summaryrefslogtreecommitdiff
path: root/package/dnsmasq/files/dnsmasq.init
diff options
context:
space:
mode:
Diffstat (limited to 'package/dnsmasq/files/dnsmasq.init')
-rw-r--r--package/dnsmasq/files/dnsmasq.init26
1 files changed, 26 insertions, 0 deletions
diff --git a/package/dnsmasq/files/dnsmasq.init b/package/dnsmasq/files/dnsmasq.init
new file mode 100644
index 000000000..e92ad3acc
--- /dev/null
+++ b/package/dnsmasq/files/dnsmasq.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 50
+. /etc/rc.conf
+
+case $1 in
+(autostop) ;;
+(autostart)
+ [[ $dns_dhcp = NO ]] && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -f /etc/dnsmasq.conf ] || exit
+ /usr/sbin/dnsmasq
+ ;;
+(stop)
+ killall dnsmasq
+ ;;
+(restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+(*)
+ echo "Usage: $0 {start | stop | restart}"
+ ;;
+esac
+exit $?