3 # unbound This shell script takes care of starting and stopping
4 # unbound (DNS server).
8 # description: unbound (BIND) is a Domain Name Server (DNS) \
9 # that is used to resolve host names to IP addresses.
11 # Source function library
12 . /etc/rc.d/init.d/functions
14 # Source networking configuration
15 . /etc/sysconfig/network
20 [ -f /etc/sysconfig/unbound ] && . /etc/sysconfig/unbound
22 # Check that networking is up.
23 if is_yes "${NETWORKING}"; then
24 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
25 msg_network_down "Unbound"
33 [ -e /etc/unbound/unbound.conf ] || exit 0
36 # Check if the service is already running?
37 if [ ! -f /var/lock/subsys/unbound ]; then
38 msg_starting "Unbound"
40 # prepare the root key file
41 /usr/sbin/unbound-anchor -v -a /var/lib/unbound/root.key > /dev/null
43 daemon /usr/sbin/unbound \
44 -c /etc/unbound/unbound.conf $UNBOUND_OPT </dev/null
46 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/unbound
48 msg_already_running "Unbound"
53 if [ -f /var/lock/subsys/unbound ]; then
54 msg_stopping "Unbound"
56 rm -f /var/lock/subsys/unbound >/dev/null 2>&1
58 msg_not_running "Unbound"
63 # See how we were called.
74 if [ -f /etc/rndc.conf ]; then
77 if [ $RET -ne 0 ]; then
83 if [ -f /var/lock/subsys/unbound ]; then
84 if [ -f /etc/rndc.conf ]; then
85 run_cmd "$(nls 'Reloading %s service' 'Unbound')" /usr/sbin/rndc reload
87 msg_reloading "Unbound"
92 msg_not_running "Unbound"
102 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"