]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | #!/bin/sh |
2 | ||
3 | ## | |
4 | # PrintingServices - a.k.a. CUPS | |
5 | ## | |
6 | ||
7 | . /etc/rc.common | |
8 | ||
9 | StartService () | |
10 | { | |
fa73b229 | 11 | if [ "${CUPS:=-AUTOMATIC-}" = "-AUTOMATIC-" ]; then |
ef416fc2 | 12 | ConsoleMessage "Starting printing services" |
13 | /usr/sbin/cupsd | |
fa73b229 | 14 | elif [ "${CUPS:=-AUTOMATIC-}" = "-YES-" ]; then |
15 | ConsoleMessage "Starting printing services" | |
16 | /usr/sbin/cupsd | |
17 | fi | |
ef416fc2 | 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}" | |
fa73b229 | 27 | fi |
ef416fc2 | 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 | |
fa73b229 | 38 | if [ "${CUPS:=-AUTOMATIC-}" = "-AUTOMATIC-" -o "${CUPS:=-AUTOMATIC-}" = "-YES-" ]; then |
39 | ConsoleMessage "Starting printing services" | |
40 | /usr/sbin/cupsd | |
41 | fi | |
ef416fc2 | 42 | fi |
43 | } | |
44 | ||
45 | RunService "$1" |