aboutsummaryrefslogtreecommitdiff
path: root/network/pdnsd/rc.pdnsd
diff options
context:
space:
mode:
authorAndré Geraldo Vieira <andre.geraldo@gmail.com>2010-05-12 23:32:39 +0200
committerDavid Somero <xgizzmo@slackbuilds.org>2010-05-12 23:32:39 +0200
commitdcfc8298b253229af2f918842754ef61650698b7 (patch)
tree0decf36776499766709153945bba7dc2a9a4f30d /network/pdnsd/rc.pdnsd
parent4ecb4572b7ec201523db30d821d24da770ee73af (diff)
network/pdnsd: Added to 12.2 repository
Diffstat (limited to 'network/pdnsd/rc.pdnsd')
-rw-r--r--network/pdnsd/rc.pdnsd78
1 files changed, 78 insertions, 0 deletions
diff --git a/network/pdnsd/rc.pdnsd b/network/pdnsd/rc.pdnsd
new file mode 100644
index 0000000000000..64115e1cb54a9
--- /dev/null
+++ b/network/pdnsd/rc.pdnsd
@@ -0,0 +1,78 @@
+#!/bin/bash
+#
+# /etc/rc.d/rc.pdnsd
+#
+# Starts the Proxy DNS Daemon
+#
+# description: Proxy DNS Daemon
+# processname: pdnsd
+# config: /etc/pdnsd.conf
+# distribution: Slackware
+# author: André Geraldo Vieira <andre.geraldo@gmail.com>
+#
+# Additional info:
+# 1) put these lines in the /etc/rc.d/rc.local:
+# if [ -x /etc/rc.d/rc.pdnsd ]; then
+# /etc/rc.d/rc.pdnsd start
+# fi
+#
+# 2) put these lines in the /etc/rc.d/rc.local_shutdown:
+# if [ -x /etc/rc.d/rc.pdnsd ]; then
+# /etc/rc.d/rc.pdnsd stop
+# fi
+
+start() {
+ if ! [ -r /var/run/pdnsd.pid ]; then
+ echo -n 'Starting pdnsd...'
+ /usr/sbin/pdnsd -d -p /var/run/pdnsd.pid
+ echo 'OK'
+ else
+ echo 'The PDNSD is already running!'
+ fi
+}
+
+stop() {
+ if [ -r /var/run/pdnsd.pid ]; then
+ echo -n "Shutting down pdnsd... "
+ kill -15 `cat /var/run/pdnsd.pid` && rm -f /var/run/pdnsd.pid 2> /dev/null
+ echo ' OK'
+ else
+ echo 'The PDNSD already stopped!'
+ fi
+}
+
+restart() {
+ stop
+ sleep 3
+ start
+}
+
+status() {
+ if [ -r /var/run/pdnsd.pid ]; then
+ pid=`cat /var/run/pdnsd.pid`
+ echo "PDNSD (pid $pid) is running."
+ else
+ echo 'PDNSD is stopped.'
+ fi
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ reload|restart)
+ restart
+ ;;
+ status)
+ status
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload|status}"
+ exit 1
+ ;;
+esac
+exit 0
+#EOF