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

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

if [ -r /etc/opt/SUNWssm/ENV ]
then
   grep -v "^PATCH_LEVEL=" /etc/opt/SUNWssm/ENV > /tmp/ENV.$$
   cp /tmp/ENV.$$ /etc/opt/SUNWssm/ENV
   rm -f /tmp/ENV.$$
   rm /usr/dt/bin/dtlogin
   mv /usr/dt/bin/dtlogin..org /usr/dt/bin/dtlogin
else
   echo "SUNWssm environment file is missing. This indicates a errorcondition"
   echo "in SUNWssm, 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/SUNWssm_RESTART.$PPID" ]
then
   echo "Restarting SUNWssm."
   /opt/SUNWssm/sbin/Boot && sleep 20
else
   echo "Warning! You have to activate SUNWssm manually."
fi
