usbmodeswitch: Updated to v.1.2.6 from shibby's branch.
[tomato.git] / release / src / router / dnsmasq / contrib / Suse / rc.dnsmasq-suse
blob71f4c7277cfa462be36e6a6b640e2e1855102ec2
1 #! /bin/sh
3 # init.d/dnsmasq
5 ### BEGIN INIT INFO
6 # Provides: dnsmasq
7 # Required-Start: $network $remote_fs $syslog
8 # Required-Stop:
9 # Default-Start: 3 5
10 # Default-Stop:
11 # Description: Starts internet name service masq caching server (DNS)
12 ### END INIT INFO
14 NAMED_BIN=/usr/sbin/dnsmasq
15 NAMED_PID=/var/run/dnsmasq.pid
16 NAMED_CONF=/etc/dnsmasq.conf
18 if [ ! -x $NAMED_BIN ] ; then
19 echo -n "dnsmasq not installed ! "
20 exit 5
23 . /etc/rc.status
24 rc_reset
26 case "$1" in
27 start)
28 echo -n "Starting name service masq caching server "
29 checkproc -p $NAMED_PID $NAMED_BIN
30 if [ $? -eq 0 ] ; then
31 echo -n "- Warning: dnsmasq already running ! "
32 else
33 [ -e $NAMED_PID ] && echo -n "- Warning: $NAMED_PID exists ! "
35 startproc -p $NAMED_PID $NAMED_BIN -u nobody
36 rc_status -v
38 stop)
39 echo -n "Shutting name service masq caching server "
40 checkproc -p $NAMED_PID $NAMED_BIN
41 [ $? -ne 0 ] && echo -n "- Warning: dnsmasq not running ! "
42 killproc -p $NAMED_PID -TERM $NAMED_BIN
43 rc_status -v
45 try-restart)
46 $0 stop && $0 start
47 rc_status
49 restart)
50 $0 stop
51 $0 start
52 rc_status
54 force-reload)
55 $0 reload
56 rc_status
58 reload)
59 echo -n "Reloading name service masq caching server "
60 checkproc -p $NAMED_PID $NAMED_BIN
61 [ $? -ne 0 ] && echo -n "- Warning: dnsmasq not running ! "
62 killproc -p $NAMED_PID -HUP $NAMED_BIN
63 rc_status -v
65 status)
66 echo -n "Checking for name service masq caching server "
67 checkproc -p $NAMED_PID $NAMED_BIN
68 rc_status -v
70 probe)
71 test $NAMED_CONF -nt $NAMED_PID && echo reload
74 echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
75 exit 1
77 esac
78 rc_exit