diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:20:04 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:20:04 +0200 |
commit | 1b8dfe266937a37a4c642f96ceb2347bf4c00a17 (patch) | |
tree | 0c6aab146bb3c82efd9c7846a9a4e70dcb0ec84f /meta-networking/recipes-support/dnsmasq/files/init | |
download | meta-openembedded-daisy-140929.tar.gz |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-networking/recipes-support/dnsmasq/files/init')
-rw-r--r-- | meta-networking/recipes-support/dnsmasq/files/init | 52 |
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 0000000000..d1aa9e517d --- /dev/null +++ b/meta-networking/recipes-support/dnsmasq/files/init | |||
@@ -0,0 +1,52 @@ | |||
1 | #!/bin/sh | ||
2 | DAEMON=/usr/bin/dnsmasq | ||
3 | NAME=dnsmasq | ||
4 | DESC="DNS forwarder and DHCP server" | ||
5 | ARGS="-7 /etc/dnsmasq.d" | ||
6 | |||
7 | test -f $DAEMON || exit 0 | ||
8 | |||
9 | set -e | ||
10 | |||
11 | case "$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 | ;; | ||
50 | esac | ||
51 | |||
52 | exit 0 | ||