#!/bin/sh
#
# @(#)preinstall	1.1 05/14/96 SMI
#
# Copyright 05/14/96 Sun Microsystems, Inc. All Rights Reserved
#
#  Preinstall script for package: SUNWomgtb
#  

# Exit codes for installation scripts 
e_ok=0      
e_fatal=1      # stop installation on this exit
e_warning=2    # Installation will go on. 
e_int=3        # Interrupted. Stop installation
e_reboot=10    # User must reboot after installation of all selected packages
e_rebootnow=20 # User must reboot right after installation of current package
               # To be added to one of the single-digit exit code above

# Trap interrupt
trap `exit $e_int` 15

#   ------------ TO BE CUSTOMIZED  ---------------

AWK=/usr/bin/awk
ECHO=/bin/echo
GREP=/bin/grep
PS=/usr/bin/ps

DAEMON=osimcsd
#
# Kill possible running osimcsd(s)
#

pid=`$PS -fu root | $GREP $DAEMON | $GREP -v grep | $AWK '{ print $2 }'`
for p in $pid
do
	$ECHO "Stopping running osimcsd: \c"
	kill -15 $p >/dev/null 2>&1
	$ECHO "osimcsd PID=$p killed."
done

# Happy End
exit $e_ok
