cvsdist afac77e
#!/bin/sh
cvsdist afac77e
#
cvsdist afac77e
# "$Id: cups.sh,v 1.10 2000/03/30 05:19:16 mike Exp $"
cvsdist afac77e
#
cvsdist afac77e
#   Startup/shutdown script for the Common UNIX Printing System (CUPS).
cvsdist afac77e
#
cvsdist afac77e
#   Linux chkconfig stuff:
cvsdist afac77e
#
cvsdist 79dcdc0
#   chkconfig: 2345 55 10
cvsdist afac77e
#   description: Startup/shutdown script for the Common UNIX \
cvsdist afac77e
#                Printing System (CUPS).
cvsdist afac77e
#
cvsdist afac77e
#   Copyright 1997-2000 by Easy Software Products, all rights reserved.
cvsdist afac77e
#
cvsdist afac77e
#   These coded instructions, statements, and computer programs are the
cvsdist afac77e
#   property of Easy Software Products and are protected by Federal
cvsdist afac77e
#   copyright law.  Distribution and use rights are outlined in the file
cvsdist afac77e
#   "LICENSE.txt" which should have been included with this file.  If this
cvsdist afac77e
#   file is missing or damaged please contact Easy Software Products
cvsdist afac77e
#   at:
cvsdist afac77e
#
cvsdist afac77e
#       Attn: CUPS Licensing Information
cvsdist afac77e
#       Easy Software Products
cvsdist afac77e
#       44141 Airport View Drive, Suite 204
cvsdist afac77e
#       Hollywood, Maryland 20636-3111 USA
cvsdist afac77e
#
cvsdist afac77e
#       Voice: (301) 373-9603
cvsdist afac77e
#       EMail: cups-info@cups.org
cvsdist afac77e
#         WWW: http://www.cups.org
cvsdist afac77e
#
cvsdist afac77e
# heavily edited so that it's more like other scripts in init.d on Red Hat
cvsdist afac77e
# Linux
cvsdist afac77e
cvsdist afac77e
# Source function library.
8a53eed
. /etc/init.d/functions
cvsdist afac77e
cvsdist afac77e
DAEMON=cupsd
cvsdist afac77e
cvsdist 0519732
prog=cups
cvsdist 0519732
cvsdist afac77e
start () {
cvsdist 0519732
	echo -n $"Starting $prog: "
cvsdist 0519732
cvsdist afac77e
	# start daemon
cvsdist afac77e
	daemon $DAEMON
cvsdist afac77e
        RETVAL=$?
cvsdist afac77e
	echo
cvsdist afac77e
	[ $RETVAL = 0 ] && touch /var/lock/subsys/cups
cvsdist afac77e
	return $RETVAL
cvsdist afac77e
}
cvsdist afac77e
cvsdist afac77e
stop () {
cvsdist afac77e
	# stop daemon
cvsdist 79dcdc0
	echo -n $"Stopping $prog: "
cvsdist afac77e
	killproc $DAEMON
cvsdist afac77e
	RETVAL=$?
cvsdist afac77e
	echo
cvsdist afac77e
	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/cups
cvsdist afac77e
}
cvsdist afac77e
cvsdist afac77e
restart() {
cvsdist afac77e
	stop
cvsdist afac77e
	start
cvsdist afac77e
}
cvsdist afac77e
cvsdist afac77e
case $1 in
cvsdist afac77e
	start)
cvsdist afac77e
		start
cvsdist afac77e
	;;
cvsdist afac77e
	stop)
cvsdist afac77e
		stop
cvsdist afac77e
	;;
cvsdist afac77e
	restart)
cvsdist afac77e
		restart
cvsdist afac77e
	;;
cvsdist afac77e
	condrestart)
cvsdist fcbc17b
		[ -f /var/lock/subsys/cups ] && restart || :
cvsdist afac77e
	;;	
cvsdist 0519732
	reload)
cvsdist 0519732
		echo -n $"Reloading $prog: "
cvsdist 0519732
		killproc $DAEMON -HUP
cvsdist 0519732
		RETVAL=$?
cvsdist 0519732
		echo
cvsdist 0519732
	;;
cvsdist afac77e
	status)
cvsdist afac77e
		status $DAEMON
8a53eed
		RETVAL=$?
cvsdist afac77e
	;;
d2bfd04
	restartlog)
d2bfd04
		stop
d2bfd04
		cat /dev/null >/var/log/cups/error_log
d2bfd04
		start
d2bfd04
	;;
cvsdist afac77e
	*)
cvsdist afac77e
cvsdist 79dcdc0
	echo $"Usage: $prog {start|stop|restart|condrestart|reload|status}"
8a53eed
	exit 3
cvsdist afac77e
esac
cvsdist afac77e
cvsdist afac77e
exit $RETVAL