opt/unbound/unbound

37 lines
645 B
Plaintext
Raw Normal View History

2010-06-19 17:13:17 +02:00
#!/bin/sh
#
# /etc/rc.d/crond: start/stop unbound daemon
#
SSD=/sbin/start-stop-daemon
PROG=/usr/sbin/unbound
PID=/var/run/unbound.pid
2010-06-19 17:13:17 +02:00
case $1 in
start)
/usr/sbin/unbound-anchor
$SSD --start --pidfile $PID --exec $PROG
2010-06-19 17:13:17 +02:00
;;
stop)
$SSD --stop --retry 10 --pidfile $PID
2010-06-19 17:13:17 +02:00
;;
restart)
$0 stop
$0 start
;;
status)
$SSD --status --pidfile $PID
case $? in
2015-07-09 15:32:22 +02:00
0) echo "$PROG is running with pid $(cat $PID)" ;;
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
;;
2010-06-19 17:13:17 +02:00
*)
echo "usage: $0 [start|stop|restart|status]"
2010-06-19 17:13:17 +02:00
;;
esac
# End of file