# $Copyright:	$
# Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
# Sequent Computer Systems, Inc.   All rights reserved.
#  
# This software is furnished under a license and may be used
# only in accordance with the terms of that license and with the
# inclusion of the above copyright notice.   This software may not
# be provided or otherwise made available to, or used by, any
# other person.  No title to or ownership of the software is
# hereby transferred.
#ident	"$Header: lp 1.4 90/04/25 $@(#)nlp:etc/lp	1.3"

##########
#
# If not invoked with at least one argument, assume we are
# running on a pre-SVR3.0 machine. We'll check our name to
# see what we do. Otherwise, the first argument tells what
# to do.
##########
if [ $# = 0 ]
then
	case $0 in
	*/lp-start )
		state=start
		;;
	*/lp-stop )
		state=stop
		;;
	esac
else
	state=$1
fi


set `who -r`
case $state in

'start')
	if [ $9 = "2" -o $9 = "3" ]
	then
		exit
	fi
	[ -x /usr/lib/lpsched ] && /usr/lib/lpsched
	;;
'stop')
	#
	# /usr might be umounted
	#
	[ -x /usr/lib/lpshut ] && /usr/lib/lpshut
	;;
esac
