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"
39 daemon /usr/sbin/unbound \
40 -c /etc/unbound/unbound.conf $UNBOUND_OPT </dev/null
42 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/unbound
44 msg_already_running "Unbound"
49 if [ -f /var/lock/subsys/unbound ]; then
50 msg_stopping "Unbound"
52 rm -f /var/lock/subsys/unbound >/dev/null 2>&1
54 msg_not_running "Unbound"
59 # See how we were called.
70 if [ -f /etc/rndc.conf ]; then
73 if [ $RET -ne 0 ]; then
79 if [ -f /var/lock/subsys/unbound ]; then
80 if [ -f /etc/rndc.conf ]; then
81 run_cmd "$(nls 'Reloading %s service' 'Unbound')" /usr/sbin/rndc reload
83 msg_reloading "Unbound"
88 msg_not_running "Unbound"
98 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"