#!/sbin/sh
#------------------------------------------------------------------#
#
# HPUX_ID: @(#) $Revision: 5.1 $ generated on Mon Mar  9 14:16:59 EST 1998
#
# (c)Copyright 1983-1996 Hewlett-Packard Co.,  All Rights Reserved.
#
#------------------------------------------------------------------#
# SD postinstall script template for 11.X patches.                 #
#------------------------------------------------------------------#
# This file is optional for all 11.X patches.  The purpose of this #
# script is to prepare for a kernel build when required by the     #
# install conditions.  The script can also drive events that must  #
# occur before a system reboot occurs.                             #
#------------------------------------------------------------------#

_PATCHID=PHCO_23966

UTILS="/usr/lbin/sw/control_utils"

if [ ! -f $UTILS ]; then
    echo "ERROR:   Cannot find $UTILS"
    exit 1
fi

. $UTILS
exitval=$SUCCESS

#####
##### Insert any code you may require at this point in the script.
##### Pay attention to the exitval variable and set appropriately
##### in your code.  If you are unsure as to what types of operations
##### are legal in this file and what types aren't, consult the 
##### "Guidelines for SD Control Scripts" document.
#####
##### START_CUSTOMIZATION_HERE

#
#  If SW-GETTOOLS version of these bits exist on the system then restore
#  the links to this version.  They were probably removed
#  by the preinstall script for this fileset - i.e. it is a reinstall
#  of SW-DIST after SW-GETTOOLS was installed.
#

if [[ -f /usr/lbin/swagent ]] && [[ -f /var/adm/sw/lbin/swagent ]]
then
	mv /usr/lbin/swagent /usr/lbin/swagent#
	ln -s /var/adm/sw/lbin/swagent /usr/lbin/swagent
fi

if [[ -f /usr/sbin/swagentd ]] && [[ -f /var/adm/sw/sbin/swagentd ]]
then
	mv /usr/sbin/swagentd /usr/sbin/swagentd#
	ln -s /var/adm/sw/sbin/swagentd /usr/sbin/swagentd
fi

#
#  Exit.
#
exit $exitval
