slackbuilds_ponce/network/nsd/rc.nsd
Sergei Fedosoff 11ec04b39d network/nsd: Added (Name Server Daemon).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2016-11-04 20:01:39 +07:00

50 lines
647 B
Bash

#!/bin/sh
#
# Start/stop/restart nsd
#
do_start() {
if [ -x /usr/sbin/nsd ]; then
echo "Starting Name Server Daemon: /usr/sbin/nsd"
/usr/sbin/nsd -c /etc/nsd/nsd.conf 2> /dev/null
fi
}
do_stop() {
echo "Stopping Name Server Daemon"
kill $(cat /var/run/nsd/nsd.pid) 2> /dev/null
}
do_restart() {
do_stop
sleep 1
do_start
}
do_reload() {
kill -HUP $(cat /var/run/nsd/nsd.pid)
}
do_logreopen() {
do_reload
}
case "$1" in
'start')
do_start
;;
'stop')
do_stop
;;
'restart')
do_restart
;;
'reload')
do_reload
;;
'logreopen')
do_logreopen
;;
*)
echo "usage $0 start|stop|restart|reload|logreopen"
esac