#!/bin/sh
##############
# Product: OPENAFS
# Fileset: OPENAFS.OPENAFS-CLNT
# checkinstall
# @(#) $Revision$
##############
#
#  (c) Copyright 2003
#
########

# The global variables SUCCESS, FAILURE, WARNING, EXCLUDE, PATH, ROOT,
# SW_CTL_SCRIPT_NAME, _pf, PRODUCT, and FILESET are all set by control_utils.

set -a
UTILS="/usr/lbin/sw/control_utils"
if [[ ! -f ${UTILS} ]]
then
    echo "ERROR:   Cannot find ${UTILS}"
    exit 1
fi
. ${UTILS}

exitval=$SUCCESS                # Anticipate success

############################################################################

# 
# Check for running afsd processes, exit with a WARNING if running..
# and SUCCESS if not running.
#

ps -ef | grep -v grep | grep afsd 

if [[ $? = 0 ]]; then
  print "WARNING:  afsd processes are running..."
  print "The preinstall script will attempt to shut down afsd processes"
  exitval=$WARNING
else
  print "NOTE:  No afsd processes are running."
  exitval=$SUCCESS
fi

exit $exitval
