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
15name="unbound"
16rcvar=`set_rcvar`
17
18load_rc_config $name
19
20command="/usr/local/sbin/unbound"
21pidfile=${unbound_pidfile:-"/usr/local/etc/unbound/unbound.pid"}
22command_args=${unbound_flags:-"-c /usr/local/etc/unbound/unbound.conf"}
23extra_commands="reload"
24
25if 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
32fi
33
34run_rc_command "$1"
35