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 99ecd1
#   chkconfig: 2345 90 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.
cvsdist afac77
if [ -f /etc/init.d/functions ] ; then
cvsdist afac77
	. /etc/init.d/functions
cvsdist afac77
elif [ -f /etc/rc.d/init.d/functions ] ; then
cvsdist afac77
	. /etc/rc.d/init.d/functions
cvsdist afac77
else
cvsdist afac77
	exit 0
cvsdist afac77
fi
cvsdist afac77
cvsdist afac77
DAEMON=cupsd
cvsdist afac77
cvsdist afac77
start () {
cvsdist afac77
	# start daemon
cvsdist afac77
	echo -n "Starting cupsd: "
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 afac77
	echo -n "Stopping cups: "
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 afac77
	status)
cvsdist afac77
		status $DAEMON
cvsdist afac77
	;;
cvsdist afac77
	*)
cvsdist afac77
cvsdist afac77
	echo "Usage: $DAEMON {start|stop|restart|status|condrestart}"
cvsdist afac77
	exit 1
cvsdist afac77
esac
cvsdist afac77
cvsdist afac77
exit $RETVAL