#!/sbin/sh
#------------------------------------------------------------------#
#
# HPUX_ID: @(#) $Revision: 17.3 $ generated on Fri Mar  9 17:07:50 MST 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_23262

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.
#
#----------------------------------------------------------------------------
#-------------------------- Begin ESSD extended script ----------------------
#----------------------------------------------------------------------------
#
###############################################################################
# Try to kill any daemons - arraymond and ARMServer

    if [[ $SW_ROOT_DIRECTORY != "/" ]]
    then
      echo "WARNING: Software Root Directory, ${SW_ROOT_DIRECTORY}, is not \"/\",  "
      echo "         cannot kill monitor daemons.                                  " 
      exitval=$WARNING
      exit $exitval
    fi

    #
    # kill monitor daemon
    #

    kill_named_procs arraymond SIGKILL
    retval=$?
    if [[ $retval -ne 0 ]]
    then
      echo "ERROR:   Could not kill the \"arraymond\" daemon.  The new arraymond    "
      echo "         file cannot be installed while the daemon is running.          " 
      echo "         Please manually kill the arraymond daemon and reinstall the    " 
      echo "         \"$PRODUCT\" product.                                          "
      exit $FAILURE
    fi

    #
    # kill ARMServer daemon
    #
    
    kill_named_procs ARMServer SIGKILL
    retval=$?
    if [[ $retval -ne 0 ]]
    then
      echo "ERROR:   Could not kill the \"ARMServer\" daemon.  The new ARMServer    "
      echo "         file cannot be installed while the daemon is running.  Please  " 
      echo "         manually kill the ARMServer daemon and reinstall the           " 
      echo "         \"$PRODUCT\" product.                                          "
      exit $FAILURE
    fi
 

###############################################################################
#
#----------------------------------------------------------------------------
#------------------------ End ESSD extended script --------------------------
#----------------------------------------------------------------------------
#
#####
##### START_CUSTOMIZATION_HERE

exit $exitval
