kumquat-buildroot/package/bind/S81named

39 lines
850 B
Plaintext
Raw Normal View History

2006-01-25 21:56:55 +01:00
#!/bin/sh
CONFIG=/etc/bind/named.conf
DAEMON=/usr/sbin/named
2006-01-25 21:56:55 +01:00
[ -f $CONFIG ] || exit 0
2006-01-25 21:56:55 +01:00
case "$1" in
start)
if [ ! -f /etc/rndc.key ]; then
printf "Initializing bind control key: "
# if rndc.key is a symlink, the target must exist
touch /etc/rndc.key
rndc-confgen -a -r /dev/urandom 2>/dev/null && echo "OK" || echo "FAIL"
2006-01-25 21:56:55 +01:00
fi
printf "Starting domain name daemon: "
start-stop-daemon -S -x $DAEMON -- -c $CONFIG -u named
[ $? = 0 ] && echo "OK" || echo "FAIL"
2006-01-25 21:56:55 +01:00
;;
stop)
printf "Stopping domain name daemon: "
2006-01-25 21:56:55 +01:00
rndc stop || start-stop-daemon -K -x $DAEMON
[ $? = 0 ] && echo "OK" || echo "FAIL"
2006-01-25 21:56:55 +01:00
;;
restart)
$0 stop || true
sleep 1
$0 start
2006-01-25 21:56:55 +01:00
;;
reload|force-reload)
rndc reload || $0 restart
2006-01-25 21:56:55 +01:00
;;
*)
echo "Usage: $0 {start|stop|restart|reload|force-reload}"
exit 1
2006-01-25 21:56:55 +01:00
esac
exit 0