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