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