#!/bin/ksh
# set -x
#
# This is the post-backoutpatch section
#

echo "========================================================================="
echo

PKGNAME="SUNWssmi"

if [ -r /etc/opt/$PKGNAME/ENV ]
then
   grep -v "^PATCH_LEVEL=" /etc/opt/$PKGNAME/ENV > /tmp/ENV.$$
   cp /tmp/ENV.$$ /etc/opt/$PKGNAME/ENV
   rm -f /tmp/ENV.$$
else
   echo "$PKGNAME environment file is missing. This indicates a errorcondition"
   echo "in $PKGNAME, but it won't affect the installation of this patch but"
   echo "not being able to update this file by removing the entry:"
   echo ""
   echo "PATCH_LEVEL=<some patch no.>"
   echo ""
   echo "If you have moved this file to another location, please remove"
   echo "the line above, for proper functionality."
fi

if [ -f "/tmp/$PKGNAME_RESTART.$PPID" ]
then
   echo "Restarting $PKGNAME."
   /opt/$PKGNAME/sbin/Boot && sleep 20
else
   echo "Warning! You have to activate $PKGNAME manually."
fi
