# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
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
}

CheckZones

if [ "${GLOBAL_ZONE}" != "true" ]; then
    exit 1
fi

echo "This patch should not be removed. "
echo "It was used to install Sun Update connection."
echo "If you still want to remove it, please remove:"
echo "     /var/sadm/patch/119107-03/prebackout"

# Are there local zones?
for i in `/usr/sbin/zoneadm list -cv | grep -v ID | grep -v global | awk '{print $4}'`; do 
     echo "    $i/root/var/sadm/patch/119107-03/prebackout"
done
exit 1
