Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / packaging / HP-UX / scripts / openafs-clnt.preinstall
1 #!/bin/sh
2 ##############
3 # Product: OPENAFS
4 # Fileset: OPENAFS.OPENAFS-CLNT
5 # preinstall
6 # @(#) $Revision$
7 ##############
8 #
9 # (c) Copyright 2003
10 #
11 ########
12
13 # The global variables SUCCESS, FAILURE, WARNING, EXCLUDE, PATH, ROOT,
14 # SW_CTL_SCRIPT_NAME, _pf, PRODUCT, and FILESET are all set by control_utils.
15
16 set -a
17 UTILS="/usr/lbin/sw/control_utils"
18 if [[ ! -f ${UTILS} ]]
19 then
20 echo "ERROR: Cannot find ${UTILS}"
21 exit 1
22 fi
23 . ${UTILS}
24
25 exitval=$SUCCESS # Anticipate success
26
27 ############################################################################
28
29 #
30 # Shutdown the afsd process before upgrading. This is just cleaner, than
31 # having SD move the file to #afsd because it's busy and adding it to
32 # the cleanup file for removal on the next boot.
33 #
34
35 ps -ef | grep -v grep | grep afsd
36
37 if [[ $? = 0 ]]; then
38 print "afsd process is running..attempting to shut down afsd process"
39 /usr/vice/etc/afsd -shutdown
40 if [[ $? = 0 ]]; then
41 print "Successfully shutdown the afsd processes."
42 exitval=$SUCCESS
43 else
44 print "Failed to successfully shutdown the afsd process."
45 exitval=$FAILURE
46 fi
47 fi
48
49 exit $exitval