2013-04-05 12:13:41 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# /etc/rc.d/cups-browsed: start/stop CUPS browsing daemon
|
|
|
|
#
|
|
|
|
|
2015-02-28 12:29:14 +01:00
|
|
|
SSD=/sbin/start-stop-daemon
|
|
|
|
PROG=/usr/sbin/cups-browsed
|
2022-02-20 16:32:59 +01:00
|
|
|
PID=/run/cups-browsed.pid
|
2015-02-28 12:29:14 +01:00
|
|
|
|
2013-04-05 12:13:41 +02:00
|
|
|
case $1 in
|
|
|
|
start)
|
2015-02-28 12:29:14 +01:00
|
|
|
$SSD --start -bm --pidfile $PID --exec $PROG
|
2013-04-05 12:13:41 +02:00
|
|
|
;;
|
|
|
|
stop)
|
2015-02-28 12:29:14 +01:00
|
|
|
$SSD --stop --remove-pidfile --retry 10 --pidfile $PID
|
2013-04-05 12:13:41 +02:00
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
$0 stop
|
|
|
|
$0 start
|
|
|
|
;;
|
2015-02-28 12:29:14 +01:00
|
|
|
status)
|
|
|
|
$SSD --status --pidfile $PID
|
|
|
|
case $? in
|
2015-06-29 17:03:46 +02:00
|
|
|
0) echo "$PROG is running with pid $(cat $PID)" ;;
|
2015-02-28 12:29:14 +01:00
|
|
|
1) echo "$PROG is not running but the pid file $PID exists" ;;
|
|
|
|
3) echo "$PROG is not running" ;;
|
|
|
|
4) echo "Unable to determine the program status" ;;
|
|
|
|
esac
|
|
|
|
;;
|
2013-04-05 12:13:41 +02:00
|
|
|
*)
|
2015-02-28 12:29:14 +01:00
|
|
|
echo "usage: $0 [start|stop|restart|status]"
|
2013-04-05 12:13:41 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# End of file
|