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