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.
cvsdist afac77e
if [ -f /etc/init.d/functions ] ; then
cvsdist afac77e
	. /etc/init.d/functions
cvsdist afac77e
elif [ -f /etc/rc.d/init.d/functions ] ; then
cvsdist afac77e
	. /etc/rc.d/init.d/functions
cvsdist afac77e
else
cvsdist afac77e
	exit 0
cvsdist afac77e
fi
cvsdist afac77e
cvsdist afac77e
DAEMON=cupsd
cvsdist afac77e
cvsdist 0519732
prog=cups
cvsdist 0519732
cvsdist 0519732
config () {
cvsdist 0519732
	# Is this a printconf system?
cvsdist 0519732
	if [ -x /usr/sbin/printconf-backend ]
cvsdist 0519732
	then
cvsdist 0519732
		# run printconf-backend to set up the configuration.
cvsdist 0519732
		/usr/sbin/printconf-backend
cvsdist 0519732
	fi
cvsdist 0519732
}
cvsdist 0519732
cvsdist afac77e
start () {
cvsdist 0519732
	echo -n $"Starting $prog: "
cvsdist 0519732
cvsdist 0519732
	config
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
		config
cvsdist 0519732
		killproc $DAEMON -HUP
cvsdist 0519732
		RETVAL=$?
cvsdist 0519732
		echo
cvsdist 0519732
	;;
cvsdist afac77e
	status)
cvsdist afac77e
		status $DAEMON
cvsdist afac77e
	;;
cvsdist afac77e
	*)
cvsdist afac77e
cvsdist 79dcdc0
	echo $"Usage: $prog {start|stop|restart|condrestart|reload|status}"
cvsdist afac77e
	exit 1
cvsdist afac77e
esac
cvsdist afac77e
cvsdist afac77e
exit $RETVAL