#!/sbin/sh
#------------------------------------------------------------------#
#
# HPUX_ID: @(#) $Revision: 15.2 $ generated on Mon Aug 21 22:16:21 EDT 2000
#
# (c)Copyright 1983-2000 Hewlett-Packard Co.,  All Rights Reserved.
#
#------------------------------------------------------------------#
# SD preinstall 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=PHNE_22244

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

######################################################################
# Obsolete 10.20 CORE100-KRN/RUN/INIT/FMT filesets                   #
######################################################################

# Swmodify the B.10.20 Networking2 filesets out of the IPD

SW_LIST=""
found=false

for sw in   \
        Networking2.CORE100-KRN \
        Networking2.CORE100-RUN \
        Networking2.CORE100-INIT \
        Networking2.CORE100-FMT
do
        if [[ `get_install_state $sw` != 'not found' ]]
        then
                [[ $found = "true" ]] && SW_LIST=${SW_LIST}" "
                SW_LIST=${SW_LIST}" "${sw}
                found=true
        fi
done

if [[ $found = "true" ]]
then
        SW_LIST=${SW_LIST}" Networking2"
        swmodify -u $SW_LIST
fi

exitval=0

##########################################################################
# Prepare the delivery areas for files to be loaded into /usr/newconfig. #
##########################################################################

newconfig_prep /etc/rc.config.d/hpbase100conf
retval=$?

if [[ $retval -ne 0 ]]
then
        exit  $retval
fi

##########################################################################
# Install /opt/networkdocs directory                                     #
##########################################################################
r_mkdir 444 bin bin /opt/networkdocs
retval=$?

if [[ $retval -ne 0 ]]
then
        exitval=$retval
fi


exit $exitval
