#!/bin/sh

# hpux preremove script

# if BESAgent is running, try to stop it
count=0
while [ $count -le 10 ]
do
    if ! ps -e | grep -q BESClient ; then
		exit 0
	fi

	/sbin/init.d/BESClient stop
	count=`expr $count + 1`
	sleep 3
done

if ! ps -e | grep -q BESClient ; then
	exit 0
fi

exit -1

