:	Shutdown command
:
if test "$1" -gt 0 -a "$1" -lt 31; then
	DELAY=$1; shift
else
	DELAY=5
fi
MESS="$*"
set `who am i`
if test $1 != root; then
	echo 'shutdown: Sorry, you must login as SUPERUSER to kill system.'
	exit 1
fi
while test "$DELAY" -gt 0; do
HACKERS=`who | grep -v console`
if test "$HACKERS"; then
	echo 'shutdown: Waiting for following users to log off:'
	who | grep -v console 
	echo "
	******************************************
	  $MESS
	  System SHUTDOWN in $DELAY minutes...       
	  Please clean up and log off.          
	******************************************" | /etc/wall
else
	break
fi
for j in 15 15 15 15
do
	sleep $j
	HACKERS=`who | grep -v console`
	if test -z "$HACKERS"; then
		break 2 
	fi
done
DELAY="`expr $DELAY - 1`"
done
echo 'shutdown: **** All users logged off, system will now terminate ****'
/etc/log System shutdown
sync
sleep 5
/etc/haltsys
sleep 100
