mirror of
https://github.com/Ponce/slackbuilds
synced 2024-12-01 01:00:03 +01:00
11ec04b39d
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
50 lines
647 B
Bash
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
|