wok-6.x annotate rsync/stuff/etc/init.d/rsyncd @ rev 8
Add : gcc-lib-base, rp-pppoe, rsync, zlib
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Thu Dec 13 15:21:06 2007 +0100 (2007-12-13) |
parents | |
children | 3ad62af80036 |
rev | line source |
---|---|
pankso@8 | 1 #!/bin/sh |
pankso@8 | 2 # /etc/init.d/rsyncd: Start, stop and restart Rsync deamon on SliTaz, at boot |
pankso@8 | 3 # time or with the command line. |
pankso@8 | 4 # |
pankso@8 | 5 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS |
pankso@8 | 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf. |
pankso@8 | 7 # |
pankso@8 | 8 . /etc/init.d/rc.functions |
pankso@8 | 9 . /etc/daemons.conf |
pankso@8 | 10 |
pankso@8 | 11 NAME=Rsyncd |
pankso@8 | 12 DESC="rsync deamon" |
pankso@8 | 13 DAEMON=/usr/bin/rsync |
pankso@8 | 14 OPTIONS=$RSYNCD_OPTIONS |
pankso@8 | 15 PIDFILE=/var/run/rsyncd.pid |
pankso@8 | 16 |
pankso@8 | 17 case "$1" in |
pankso@8 | 18 start) |
pankso@8 | 19 if [ -f $PIDFILE ] ; then |
pankso@8 | 20 echo "$NAME already running." |
pankso@8 | 21 exit 1 |
pankso@8 | 22 fi |
pankso@8 | 23 echo -n "Starting $DESC: $NAME... " |
pankso@8 | 24 $DAEMON $OPTIONS |
pankso@8 | 25 status |
pankso@8 | 26 ;; |
pankso@8 | 27 stop) |
pankso@8 | 28 if [ ! -f $PIDFILE ] ; then |
pankso@8 | 29 echo "$NAME is not running." |
pankso@8 | 30 exit 1 |
pankso@8 | 31 fi |
pankso@8 | 32 echo -n "Stopping $DESC: $NAME... " |
pankso@8 | 33 kill `cat $PIDFILE` |
pankso@8 | 34 rm $PIDFILE |
pankso@8 | 35 status |
pankso@8 | 36 ;; |
pankso@8 | 37 restart) |
pankso@8 | 38 if [ ! -f $PIDFILE ] ; then |
pankso@8 | 39 echo "$NAME is not running." |
pankso@8 | 40 exit 1 |
pankso@8 | 41 fi |
pankso@8 | 42 echo -n "Restarting $DESC: $NAME... " |
pankso@8 | 43 kill `cat $PIDFILE` |
pankso@8 | 44 rm $PIDFILE |
pankso@8 | 45 sleep 2 |
pankso@8 | 46 $DAEMON $OPTIONS |
pankso@8 | 47 status |
pankso@8 | 48 ;; |
pankso@8 | 49 *) |
pankso@8 | 50 echo "" |
pankso@8 | 51 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" |
pankso@8 | 52 echo "" |
pankso@8 | 53 exit 1 |
pankso@8 | 54 ;; |
pankso@8 | 55 esac |
pankso@8 | 56 |
pankso@8 | 57 exit 0 |