#!/sbin/sh
#
# NOTE:    This script is not configurable!  Any changes made to this
#          scipt will be overwritten when you upgrade to the next
#          release of HP-UX.
#
# WARNING: Changing this script in any way may lead to a system that
#          is unbootable.  Do not modify this script.
#

#
# Clean uucp spool directories
#

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

rval=0
set_return() {
	x=$?
	if [ $x -ne 0 ]; then
		echo "ERROR CODE $x"
		rval=1
	fi
}


case $1 in
start_msg)
	echo "Clean UUCP"
	;;

'start')
	if [ -f /etc/rc.config.d/clean_uucp ] ; then
		. /etc/rc.config.d/clean_uucp
	else
		echo "ERROR: /etc/rc.config.d/clean_uucp file MISSING"
	fi
	if [ "$CLEAN_UUCP" -eq 1 -a -x /usr/lbin/uucp/uuclean ]; then
		echo "cleaning up uucp"
		/usr/lbin/uucp/uuclean -pSTST -pLCK -n0
		set_return
	else
		rval=2
	fi

	;;

*)
	echo "usage: $0 {start}"
	;;
esac

exit $rval
