diff options
Diffstat (limited to 'print/cups/files/cupsd.sh')
-rw-r--r-- | print/cups/files/cupsd.sh | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/print/cups/files/cupsd.sh b/print/cups/files/cupsd.sh new file mode 100644 index 00000000000..d48a29208d9 --- /dev/null +++ b/print/cups/files/cupsd.sh @@ -0,0 +1,49 @@ +#!/bin/sh +# +# $NetBSD: cupsd.sh,v 1.1 2000/12/07 20:33:05 jlam Exp $ +# +# PROVIDE: cupsd +# REQUIRE: DAEMON + +name="cupsd" +command=@PREFIX@/sbin/${name} + +pid=`ps -ax | awk '{print $1,$5}' | grep ${name} | awk '{print $1}'` + +cmd=${1:-start} + +case ${cmd} in +start|restart) + if [ "$pid" != "" ] + then + echo "Restarting ${name}." + kill -HUP $pid + else + echo "Starting ${name}." + ${command} + fi + ;; + +stop) + if [ "$pid" != "" ] + then + echo "Stopping ${name}." + kill $pid + fi + ;; + +status) + if [ "$pid" != "" ] + then + echo "${name} is running as pid ${pid}." + else + echo "${name} is not running." + fi + ;; + +*) + echo 1>&2 "Usage: ${name} [restart|start|stop|status]" + exit 1 + ;; +esac +exit 0 |