mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-16 19:50:19 +01:00
0c90e265b2
Signed-off-by: Robby Workman <rworkman@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
57 lines
885 B
Bash
57 lines
885 B
Bash
#!/bin/sh
|
|
#
|
|
# Start/stop/restart yadifad
|
|
#
|
|
|
|
do_start() {
|
|
if [ -x /usr/sbin/yadifad ]; then
|
|
if [ ! -d /run/yadifa ]; then
|
|
mkdir -p /run/yadifa
|
|
chown yadifa:yadifa /run/yadifa
|
|
fi
|
|
echo -n "Starting YADIFA DNS Server: /usr/sbin/yadifad -c /etc/yadifa/yadifad.conf --daemon... "
|
|
/usr/sbin/yadifad -c /etc/yadifa/yadifad.conf --daemon 2> /dev/null
|
|
echo "done."
|
|
fi
|
|
}
|
|
|
|
do_stop() {
|
|
echo -n "Stopping YADIFA DNS Server: "
|
|
kill $(cat /var/run/yadifa/yadifad.pid) 2> /dev/null
|
|
sleep 2
|
|
echo "done."
|
|
}
|
|
|
|
do_restart() {
|
|
do_stop
|
|
sleep 1
|
|
do_start
|
|
}
|
|
|
|
do_reload() {
|
|
/usr/bin/yadifa cfgreload
|
|
}
|
|
|
|
do_logreopen() {
|
|
/usr/bin/yadifa logreopen
|
|
}
|
|
|
|
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
|