| 1 |
#!/bin/sh |
| 2 |
# |
| 3 |
# unbound freebsd startup rc.d script, modified from the named script. |
| 4 |
# uses the default unbound installation path and pidfile location. |
| 5 |
# copy this to /etc/rc.d/unbound |
| 6 |
# and put unbound_enable="YES" into rc.conf |
| 7 |
# |
| 8 |
|
| 9 |
# PROVIDE: unbound |
| 10 |
# REQUIRE: SERVERS cleanvar |
| 11 |
# KEYWORD: shutdown |
| 12 |
|
| 13 |
. /etc/rc.subr |
| 14 |
|
| 15 |
name="unbound" |
| 16 |
rcvar=`set_rcvar` |
| 17 |
|
| 18 |
load_rc_config $name |
| 19 |
|
| 20 |
command="/usr/local/sbin/unbound" |
| 21 |
pidfile=${unbound_pidfile:-"/usr/local/etc/unbound/unbound.pid"} |
| 22 |
command_args=${unbound_flags:-"-c /usr/local/etc/unbound/unbound.conf"} |
| 23 |
extra_commands="reload" |
| 24 |
|
| 25 |
if test "$1" = "stop" ; then |
| 26 |
run_rc_command "$1" |
| 27 |
ret=$? |
| 28 |
if test $ret -eq 0; then |
| 29 |
rm -f "$pidfile" |
| 30 |
fi |
| 31 |
exit $ret |
| 32 |
fi |
| 33 |
|
| 34 |
run_rc_command "$1" |