mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-26 22:06:35 +01:00
1523e52ef6
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
52 lines
704 B
Bash
52 lines
704 B
Bash
#!/bin/sh
|
|
#
|
|
# Start/stop/restart nsd
|
|
#
|
|
|
|
do_start() {
|
|
if [ -x /usr/sbin/nsd ]; then
|
|
echo "Starting Name Server Daemon: /usr/sbin/nsd"
|
|
mkdir -p /var/run/nsd
|
|
chown nsd:nsd /var/run/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
|