#! /bin/sh
#
#ident	"@(#)preremove	1.2	04/01/07 SMI"
#
# Copyright 1996-2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
#

###########################################################################
#
# preremove for SUNWscu
#
#	* stop cl_ccrad daemon

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

PATH=/usr/bin:/usr/sbin
export PATH

PKGNAME=SUNWscu
STARTTAG="Start of lines added by ${PKGNAME}"
  ENDTAG="End   of lines added by ${PKGNAME}"
PROG=${PKGNAME}.preremove

TMPFILES=

###########################################
#
# Cleanup any temporary files on exit/interrupt
#
###########################################
cleanup()
{
	exit_code=$1

	if [ ! -z "${TMPFILES}" ]; then
		/bin/rm -f ${TMPFILES}
	fi

	exit ${exit_code}
}


###########################################
#
# stop the cl_ccrad daemon 
#
###########################################

stop_clccrad_daemon()
{

/etc/init.d/clccrad stop

#always succeed, enough for now
return 0

}

###########################################
#
# main
#
###########################################
errs=0

# catch common signals
trap 'echo "${PROG}: caught signal";  cleanup 3' 1 2 3 15

stop_clccrad_daemon     || errs=`expr ${errs} + 1`

if [ ${errs} -ne 0 ]; then
	cleanup 1
else
	cleanup 0
fi
