]> git.ipfire.org Git - thirdparty/cups.git/blob - init/cups.osx
Load cups into easysw/current.
[thirdparty/cups.git] / init / 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:=-AUTOMATIC-}" = "-AUTOMATIC-" ]; then
12 ConsoleMessage "Starting printing services"
13 /usr/sbin/cupsd
14 elif [ "${CUPS:=-AUTOMATIC-}" = "-YES-" ]; then
15 ConsoleMessage "Starting printing services"
16 /usr/sbin/cupsd
17 fi
18 }
19
20 StopService ()
21 {
22 # Until cupsd has a pid file...
23 pid=`ps ax | awk '{if (match($5, ".*/cupsd$") || $5 == "cupsd") print $1}'`
24 if test "$pid" != ""; then
25 ConsoleMessage "Stopping printing services"
26 kill "${pid}"
27 fi
28 }
29
30 RestartService ()
31 {
32 # Until cupsd has a pid file...
33 pid=`ps ax | awk '{if (match($5, ".*/cupsd$") || $5 == "cupsd") print $1}'`
34 if test "x$pid" != x; then
35 ConsoleMessage "Restarting printing services"
36 kill -HUP "${pid}"
37 else
38 if [ "${CUPS:=-AUTOMATIC-}" = "-AUTOMATIC-" -o "${CUPS:=-AUTOMATIC-}" = "-YES-" ]; then
39 ConsoleMessage "Starting printing services"
40 /usr/sbin/cupsd
41 fi
42 fi
43 }
44
45 RunService "$1"