#!/bin/ksh

remove_link() {

	link=$1
	pkg=$2

	if [ -h $ROOTDIR/$link ] ; then
		## if the link exists, remove it.
		removef -R $ROOTDIR $pkg $ROOTDIR/$link
		/bin/rm -f $ROOTDIR/$link
		removef -R $ROOTDIR -f $pkg
	fi
}


CheckZones()
{
	if [ "$ROOTDIR" = "/" -a -x /usr/bin/zonename ]; then
		ZONENAME=`/usr/bin/zonename`
		if [ ${ZONENAME} = "global" ]; then
			GLOBAL_ZONE=true
		else
			GLOBAL_ZONE=false
		fi
	else
		# Unable to determine zone
		GLOBAL_ZONE=true
	fi
}


GlobalZones()
{


	if [ -z "${ROOTDIR}" ]; then
		echo "\n$0 Failed: ROOTDIR is not set.\n" >&2
		exit 1
	fi

	remove_link usr/platform/FJSV,GPUU/lib FJSVvplu

}

NonGlobalZones()
{
	return 0
}

# Main

CheckZones

if [ "${GLOBAL_ZONE}" = "true" ]; then
	GlobalZones
else
	NonGlobalZones
fi

exit 0
