#!/sbin/sh
#------------------------------------------------------------------#
#
# HPUX_ID: @(#) $Revision: 17.3 $ generated on Tue Apr  3 11:27:54 PDT 2001
#
# (c)Copyright 1983-2001 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=PHCO_23705

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

# Remove formatted man pages cached in the usr/share/man/cat[X].Z
# directory. Note that the following list must be updated whenever
# a new man page is added.
#
MAN_1=${SW_ROOT_DIRECTORY}usr/share/man/cat1.Z/
MAN_1_LIST="getmemwindow.1 setmemwindow.1"
typeset cached_man_page=
for cached_man_page in $MAN_1_LIST
do
    if [ -f ${MAN_1}/$cached_man_page ]; then
	rm -f ${MAN_1}/$cached_man_page
    fi
done

MAN_4=${SW_ROOT_DIRECTORY}usr/share/man/cat4.Z/
MAN_4_LIST="services.window.4"
typeset cached_man_page=
for cached_man_page in $MAN_4_LIST
do
    if [ -f ${MAN_4}/$cached_man_page ]; then
	rm -f ${MAN_4}/$cached_man_page
    fi
done

# prevent /etc/services.window from being damaged.
RESOURCE_FILE=/etc/services.window
TMP_FILE='/tmp/#_etc.services.window_#'

if [ -f $RESOURCE_FILE ]; then
    # -p option is used for cp in order retain the
    # ownership/modification times for $RESOURCE_FILE in
    # $TMP_FILE. 'postinstall' would move $TMP_FILE back to its
    # original location after the swinstall.
    cp -p $RESOURCE_FILE $TMP_FILE
fi

exit $exitval
