:
#	@(#) haltsys.sh 1.4 89/07/08 
#
#	Copyright (C) The Santa Cruz Operation, 1988.
#	This Module contains Proprietary Information of
#	The Santa Cruz Operation, and should be treated as Confidential.
#

# Begin SCO_BASE

# shell script front end to uadmin to stop the system
PATH=/bin:/usr/bin:/etc

# parse command line : /etc/haltsys(reboot) or haltsys(reboot)
arg=$0
cmd=`expr "$arg" : ".*/\(.*\)"`
[ $cmd ] || cmd=$arg

cd /
sync
sync
umountall 2> /dev/null

case $cmd in
haltsys*)
	case $1 in
	-d)	# stay down with no reboot option
		uadmin 2 3 ;;
	"")	# stay down until a key is stroke
		uadmin 2 0 ;;
	*)	
		echo "Usage : /etc/haltsys [-d]\n        /etc/reboot" ;;
	esac
	;;
reboot*)	# shutdown and reboot
	uadmin 2 2
	;;
*)
	echo "Usage : /etc/haltsys [-d]\n        /etc/reboot"
	;;
esac

# End SCO_BASE
