wok annotate dnsmasq/stuff/etc/init.d/dnsmasq @ rev 19009

busybox/fbvnc: wheelmouse support (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Mar 28 18:28:53 2016 +0200 (2016-03-28)
parents
children 7f188676b59c
rev   line source
pascal@3885 1 #!/bin/sh
pascal@3885 2 # /etc/init.d/dnsmasq: Start, stop and restart Rsync deamon on SliTaz, at boot
pascal@3885 3 # time or with the command line.
pascal@3885 4 #
pascal@3885 5 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS
pascal@3885 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
pascal@3885 7 #
pascal@3885 8 . /etc/init.d/rc.functions
pascal@3885 9 . /etc/daemons.conf
pascal@3885 10
pascal@3885 11 NAME=DNSmasq
pascal@3885 12 DESC="dnsmasq deamon"
pascal@3885 13 DAEMON=/usr/sbin/dnsmasq
pascal@3885 14 OPTIONS=$DNSMASQ_OPTIONS
pascal@3885 15 PIDFILE=/var/run/dnsmasq.pid
pascal@3885 16
pascal@3885 17 case "$1" in
pascal@3885 18 start)
pascal@3885 19 if active_pidfile $PIDFILE dnsmasq ; then
pascal@3885 20 echo "$NAME already running."
pascal@3885 21 exit 1
pascal@3885 22 fi
pascal@3885 23 echo -n "Starting $DESC: $NAME... "
pascal@3885 24 $DAEMON $OPTIONS
pascal@3885 25 status
pascal@3885 26 ;;
pascal@3885 27 stop)
pascal@3885 28 if ! active_pidfile $PIDFILE dnsmasq ; then
pascal@3885 29 echo "$NAME is not running."
pascal@3885 30 exit 1
pascal@3885 31 fi
pascal@3885 32 echo -n "Stopping $DESC: $NAME... "
pascal@3885 33 kill `cat $PIDFILE`
pascal@3885 34 rm $PIDFILE
pascal@3885 35 status
pascal@3885 36 ;;
pascal@3885 37 restart)
pascal@3885 38 if ! active_pidfile $PIDFILE dnsmasq ; then
pascal@3885 39 echo "$NAME is not running."
pascal@3885 40 exit 1
pascal@3885 41 fi
pascal@3885 42 echo -n "Restarting $DESC: $NAME... "
pascal@3885 43 kill `cat $PIDFILE`
pascal@3885 44 rm $PIDFILE
pascal@3885 45 sleep 2
pascal@3885 46 $DAEMON $OPTIONS
pascal@3885 47 status
pascal@3885 48 ;;
pascal@3885 49 *)
pascal@3885 50 echo ""
pascal@3885 51 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
pascal@3885 52 echo ""
pascal@3885 53 exit 1
pascal@3885 54 ;;
pascal@3885 55 esac
pascal@3885 56
pascal@3885 57 exit 0