aboutsummaryrefslogtreecommitdiff
path: root/network/yadifa/rc.yadifa
diff options
context:
space:
mode:
authorSergei Fedosoff <eleksir@gmail.com>2016-09-17 07:13:38 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2016-09-17 07:21:21 +0700
commit4a3d751ad2beb89a9975640898d46f1715d79902 (patch)
tree565ce5791578e80a1df3e857b25602893b565d37 /network/yadifa/rc.yadifa
parent70623d4892e1857775c87b9de974ddd8521daa87 (diff)
network/yadifa: Added (Yet Another DNS Implementation For All).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/yadifa/rc.yadifa')
-rw-r--r--network/yadifa/rc.yadifa53
1 files changed, 53 insertions, 0 deletions
diff --git a/network/yadifa/rc.yadifa b/network/yadifa/rc.yadifa
new file mode 100644
index 0000000000000..63a35376edbde
--- /dev/null
+++ b/network/yadifa/rc.yadifa
@@ -0,0 +1,53 @@
+#!/bin/sh
+#
+# Start/stop/restart yadifad
+#
+
+do_start() {
+ if [ -x /usr/sbin/yadifad ]; then
+ 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