summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/dnsmasq/files/init
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-support/dnsmasq/files/init')
-rw-r--r--meta-networking/recipes-support/dnsmasq/files/init52
1 files changed, 52 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/dnsmasq/files/init b/meta-networking/recipes-support/dnsmasq/files/init
new file mode 100644
index 000000000..d1aa9e517
--- /dev/null
+++ b/meta-networking/recipes-support/dnsmasq/files/init
@@ -0,0 +1,52 @@
1#!/bin/sh
2DAEMON=/usr/bin/dnsmasq
3NAME=dnsmasq
4DESC="DNS forwarder and DHCP server"
5ARGS="-7 /etc/dnsmasq.d"
6
7test -f $DAEMON || exit 0
8
9set -e
10
11case "$1" in
12 start)
13 echo -n "starting $DESC: $NAME... "
14 test -d /var/lib/misc/ || mkdir /var/lib/misc/
15 start-stop-daemon -S -x $DAEMON -- $ARGS
16 echo "done."
17 ;;
18 stop)
19 echo -n "stopping $DESC: $NAME... "
20 start-stop-daemon -K -x $DAEMON
21 echo "done."
22 ;;
23 status)
24 echo -n "dnsmasq "
25 start-stop-daemon -q -K -t -x $DAEMON
26 RET=$?
27 if [ "$RET" = "0" ]; then
28 PID=`cat /var/run/dnsmasq.pid`
29 echo "($PID) is running"
30 else
31 echo "is not running"
32 exit $RET
33 fi
34 ;;
35 restart)
36 echo "restarting $DESC: $NAME... "
37 $0 stop
38 $0 start
39 echo "done."
40 ;;
41 reload)
42 echo -n "reloading $DESC: $NAME... "
43 killall -HUP $(basename ${DAEMON})
44 echo "done."
45 ;;
46 *)
47 echo "Usage: $0 {start|stop|status|restart|reload}"
48 exit 1
49 ;;
50esac
51
52exit 0