#!/sbin/sh
#------------------------------------------------------------------#
#
# HPUX_ID: @(#) $Revision: 5.1 $ generated on Mon Mar  9 14:16:59 EST 1998
#
# (c)Copyright 1983-2001 Hewlett-Packard Co.,  All Rights Reserved.
#
#------------------------------------------------------------------#
# SD preremove script template for 11.X patches.                   #
#------------------------------------------------------------------#
# This file is optional for all 11.X patches.  The purpose of this #
# script is to prepare the system for installation of the patch.   #
#------------------------------------------------------------------#

_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 the SW-GETTOOLS.SD-CMDS fileset is installed then the binaries
# are replaced with sym-links.  These need to be cleaned up before
# this fileset can be installed.  This is the same behavior that is in
# the SW-GETTOOLS.SD-CMDS preremove script.



    if [[ -r /usr/sbin/swinstall# ]] && [[ -h /usr/sbin/swinstall ]]
	then
	rm /usr/sbin/swinstall
	mv /usr/sbin/swinstall#  /usr/sbin/swinstall

	rm /usr/sbin/swacl
	ln /usr/sbin/swinstall  /usr/sbin/swacl

	rm /usr/sbin/swconfig
	ln /usr/sbin/swinstall  /usr/sbin/swconfig
	
        rm /usr/sbin/swlist
	ln /usr/sbin/swinstall  /usr/sbin/swlist

	rm /usr/sbin/swreg
	ln /usr/sbin/swinstall  /usr/sbin/swreg

	rm /usr/sbin/swremove
	ln /usr/sbin/swinstall  /usr/sbin/swremove

	rm /usr/sbin/swverify
	ln /usr/sbin/swinstall  /usr/sbin/swverify

	rm /usr/sbin/swjob
	ln /usr/sbin/swinstall  /usr/sbin/swjob

	rm /usr/sbin/swcopy
	ln /usr/sbin/swinstall  /usr/sbin/swcopy

	rm /usr/sbin/sd
	ln /usr/sbin/swinstall  /usr/sbin/sd


    fi


    if [[ -r /usr/sbin/swpackage# ]] && [[ -h /usr/sbin/swpackage ]]
	then
	rm /usr/sbin/swpackage
	mv /usr/sbin/swpackage#  /usr/sbin/swpackage

	rm /usr/sbin/swmodify
	ln /usr/sbin/swpackage  /usr/sbin/swmodify

    fi

exit $exitval
