:
# @(#)cron 5.3b of Jan 6, 1988
:
#	cron control
case $1 in
'start')
	set `who -r`
	# don't start if last run state was 2 (multiuser) or 3 (multiuser with RFS)
	if [ $9 != 2 -a $9 != 3 ]
	then
		echo "Starting cron."
# terminate any running cron in case they want singleuser via
# 'init s', instead of 'singleuser'
		pid=`ps -e | sed -n '/ cron$/s/^ *\([0-9][0-9]*\).*/\1/p'`
		if [ "$pid" != "" ]
		then
			kill $pid
		fi
		rm -f /usr/lib/cron/FIFO
		if [ -x /usr/bin/cron ]
		then
			/usr/bin/cron
		elif [ -x /etc/cron ]
		then
			/etc/cron
		fi
	fi
	;;
'stop')
	pid=`ps -e | sed -n '/ cron$/s/^ *\([0-9][0-9]*\).*/\1/p'`
	if [ "$pid" != "" ]
	then
		echo "Stopping cron."
		kill $pid
	fi
	;;
*)
	echo "usage: $0 {start|stop}"
	;;
esac
