]> git.ipfire.org Git - thirdparty/cups.git/blob - cups.osx
Load cups into easysw/current.
[thirdparty/cups.git] / cups.osx
1 #!/bin/sh
2
3 ##
4 # PrintingServices - a.k.a. CUPS
5 ##
6
7 . /etc/rc.common
8
9 StartService ()
10 {
11 if [ "${CUPS:=-YES-}" = "-YES-" ]; then
12 ConsoleMessage "Starting printing services"
13 /usr/sbin/cupsd
14 fi
15 }
16
17 StopService ()
18 {
19 # Until cupsd has a pid file...
20 pid=`ps ax | awk '{if (match($5, ".*/cupsd$") || $5 == "cupsd") print $1}'`
21 if test "$pid" != ""; then
22 ConsoleMessage "Stopping printing services"
23 kill "${pid}"
24 fi
25 }
26
27 RestartService ()
28 {
29 # Until cupsd has a pid file...
30 pid=`ps ax | awk '{if (match($5, ".*/cupsd$") || $5 == "cupsd") print $1}'`
31 if test "x$pid" != x; then
32 ConsoleMessage "Restarting printing services"
33 kill -HUP "${pid}"
34 else
35 StartService
36 fi
37 }
38
39 RunService "$1"