summaryrefslogtreecommitdiff
path: root/source/n/dnsmasq/rc.dnsmasq
diff options
context:
space:
mode:
Diffstat (limited to 'source/n/dnsmasq/rc.dnsmasq')
-rw-r--r--source/n/dnsmasq/rc.dnsmasq36
1 files changed, 36 insertions, 0 deletions
diff --git a/source/n/dnsmasq/rc.dnsmasq b/source/n/dnsmasq/rc.dnsmasq
new file mode 100644
index 00000000..ce584cbd
--- /dev/null
+++ b/source/n/dnsmasq/rc.dnsmasq
@@ -0,0 +1,36 @@
+#!/bin/sh
+# Start/stop/restart dnsmasq (a small DNS/DHCP server):
+
+# Start dnsmasq:
+dnsmasq_start() {
+ if [ -x /usr/sbin/dnsmasq ]; then
+ echo "Starting dnsmasq: /usr/sbin/dnsmasq"
+ /usr/sbin/dnsmasq
+ fi
+}
+
+# Stop dnsmasq:
+dnsmasq_stop() {
+ killall dnsmasq
+}
+
+# Restart dnsmasq:
+dnsmasq_restart() {
+ dnsmasq_stop
+ sleep 1
+ dnsmasq_start
+}
+
+case "$1" in
+'start')
+ dnsmasq_start
+ ;;
+'stop')
+ dnsmasq_stop
+ ;;
+'restart')
+ dnsmasq_restart
+ ;;
+*)
+ echo "usage rc.dnsmasq: start|stop|restart"
+esac