aboutsummaryrefslogtreecommitdiff
path: root/contrib/unbound/contrib/rc_d_unbound
blob: 9d98c5e059aeb06aa023ec9cb292a4a92369ecac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
#
# unbound freebsd startup rc.d script, modified from the named script.
# uses the default unbound installation path and pidfile location.
# copy this to /etc/rc.d/unbound
# and put unbound_enable="YES" into rc.conf
#

# PROVIDE: unbound
# REQUIRE: SERVERS cleanvar
# KEYWORD: shutdown

. /etc/rc.subr

name="unbound"
rcvar=`set_rcvar`

load_rc_config $name

command="/usr/local/sbin/unbound"
pidfile=${unbound_pidfile:-"/usr/local/etc/unbound/unbound.pid"}
command_args=${unbound_flags:-"-c /usr/local/etc/unbound/unbound.conf"}
extra_commands="reload"

if test "$1" = "stop" ; then
	run_rc_command "$1"
	ret=$?
	if test $ret -eq 0; then
		rm -f "$pidfile"
	fi
	exit $ret
fi

run_rc_command "$1"