diff options
Diffstat (limited to 'abs/core/cups/cups')
-rwxr-xr-x | abs/core/cups/cups | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/abs/core/cups/cups b/abs/core/cups/cups new file mode 100755 index 0000000..4afaf5a --- /dev/null +++ b/abs/core/cups/cups @@ -0,0 +1,38 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +PID=`pidof -o %PPID /usr/sbin/cupsd` +case "$1" in + start) + stat_busy "Starting CUPS Daemon" + [ -z "$PID" ] && /usr/sbin/cupsd + if [ $? -gt 0 ]; then + stat_fail + else + echo $(pidof -o %PPID -x /usr/sbin/cupsd) > /var/run/cups.pid + add_daemon cups + stat_done + fi + ;; + stop) + stat_busy "Stopping CUPS Daemon" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm /var/run/cups.pid + rm_daemon cups + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 |