wok view dnsmasq/stuff/etc/init.d/dnsmasq @ rev 25473

created recipe for get-java8-jre
author Hans-G?nter Theisgen
date Wed Oct 12 10:36:11 2022 +0100 (18 months ago)
parents ff5fd8788cd9
children
line source
1 #!/bin/sh
2 # /etc/init.d/dnsmasq: Start, stop and restart DNSmasq daemon on SliTaz
3 # at boot time or with command.
4 #
5 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS
6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
7 #
8 . /etc/init.d/rc.functions
9 . /etc/daemons.conf
11 NAME=DNSmasq
12 DESC="$(_ '%s daemon' dnsmasq)"
13 DAEMON=/usr/sbin/dnsmasq
14 OPTIONS=$DNSMASQ_OPTIONS
15 PIDFILE=/var/run/dnsmasq.pid
17 case "$1" in
18 (start)
19 if active_pidfile $PIDFILE dnsmasq
20 then
21 _ '%s is already running.' $NAME
22 exit 1
23 fi
24 action 'Starting %s: %s...' "$DESC" $NAME
25 $DAEMON $OPTIONS
26 status
27 ;;
28 (stop)
29 if ! active_pidfile $PIDFILE dnsmasq
30 then
31 _ '%s is not running.' $NAME
32 exit 1
33 fi
34 action 'Stopping %s: %s...' "$DESC" $NAME
35 kill $(cat $PIDFILE)
36 status
37 ;;
38 (restart)
39 if ! active_pidfile $PIDFILE dnsmasq
40 then
41 _ '%s is not running.' $NAME
42 exit 1
43 fi
44 action 'Restarting %s: %s...' "$DESC" $NAME
45 kill $(cat $PIDFILE)
46 sleep 2
47 $DAEMON $OPTIONS
48 status
49 ;;
50 (*)
51 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
52 newline
53 exit 1
54 ;;
55 esac
57 exit 0