mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
Merge from bittboy/buildroot@db180c0
This commit is contained in:
38
package/bind/S81named
Normal file
38
package/bind/S81named
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
|
||||
CONFIG=/etc/bind/named.conf
|
||||
DAEMON=/usr/sbin/named
|
||||
|
||||
[ -f $CONFIG ] || exit 0
|
||||
|
||||
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"
|
||||
fi
|
||||
printf "Starting domain name daemon: "
|
||||
start-stop-daemon -S -x $DAEMON -- -c $CONFIG -u named
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping domain name daemon: "
|
||||
rndc stop || start-stop-daemon -K -x $DAEMON
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
restart)
|
||||
$0 stop || true
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
reload|force-reload)
|
||||
rndc reload || $0 restart
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload|force-reload}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user