python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / package / bind / S81named
blobbc4bb0f246f893b812beca0870bea0e4530a087e
1 #!/bin/sh
3 CONFIG=/etc/bind/named.conf
4 DAEMON=/usr/sbin/named
6 [ -x $DAEMON ] || exit 0
7 [ -f $CONFIG ] || exit 0
9 case "$1" in
10 start)
11 if [ ! -f /etc/rndc.key ]; then
12 printf "Initializing bind control key: "
13 # if rndc.key is a symlink, the target must exist
14 touch /etc/rndc.key
15 rndc-confgen -a -r /dev/urandom 2>/dev/null && echo "OK" || echo "FAIL"
17 printf "Starting domain name daemon: "
18 start-stop-daemon -S -x $DAEMON -- -c $CONFIG -u named
19 [ $? = 0 ] && echo "OK" || echo "FAIL"
21 stop)
22 printf "Stopping domain name daemon: "
23 rndc stop || start-stop-daemon -K -x $DAEMON
24 [ $? = 0 ] && echo "OK" || echo "FAIL"
26 restart)
27 $0 stop || true
28 sleep 1
29 $0 start
31 reload|force-reload)
32 rndc reload || $0 restart
35 echo "Usage: $0 {start|stop|restart|reload|force-reload}"
36 exit 1
37 esac
39 exit 0