wok-6.x annotate boxbackup-client/stuff/bbackupd @ rev 1357
Add: BoxBackup automatic on-line backup system
author | Dominique Corbex <domcox@users.sourceforge.net> |
---|---|
date | Tue Sep 09 22:18:22 2008 +0200 (2008-09-09) |
parents | |
children | bf612580d156 |
rev | line source |
---|---|
domcox@1357 | 1 #!/bin/sh |
domcox@1357 | 2 # /etc/init.d/bbackupd: Start, stop and restart bbackupd deamon on SliTaz, at boot |
domcox@1357 | 3 # time or with the command line. |
domcox@1357 | 4 # |
domcox@1357 | 5 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS |
domcox@1357 | 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf. |
domcox@1357 | 7 # |
domcox@1357 | 8 . /etc/init.d/rc.functions |
domcox@1357 | 9 . /etc/daemons.conf |
domcox@1357 | 10 |
domcox@1357 | 11 NAME=BBackupd |
domcox@1357 | 12 DESC="BoxBackup deamon" |
domcox@1357 | 13 DAEMON=/usr/bin/bbackupd |
domcox@1357 | 14 OPTIONS=$BBSTORED_OPTIONS |
domcox@1357 | 15 PIDFILE=/var/run/bbackupd.pid |
domcox@1357 | 16 |
domcox@1357 | 17 case "$1" in |
domcox@1357 | 18 start) |
domcox@1357 | 19 if [ -f $PIDFILE ] ; then |
domcox@1357 | 20 echo "$NAME already running." |
domcox@1357 | 21 exit 1 |
domcox@1357 | 22 fi |
domcox@1357 | 23 echo -n "Starting $DESC: $NAME... " |
domcox@1357 | 24 $DAEMON $OPTIONS > /dev/null |
domcox@1357 | 25 status |
domcox@1357 | 26 ;; |
domcox@1357 | 27 stop) |
domcox@1357 | 28 if [ ! -f $PIDFILE ] ; then |
domcox@1357 | 29 echo "$NAME is not running." |
domcox@1357 | 30 exit 1 |
domcox@1357 | 31 fi |
domcox@1357 | 32 echo -n "Stopping $DESC: $NAME... " |
domcox@1357 | 33 kill `cat $PIDFILE` |
domcox@1357 | 34 status |
domcox@1357 | 35 ;; |
domcox@1357 | 36 restart) |
domcox@1357 | 37 if [ ! -f $PIDFILE ] ; then |
domcox@1357 | 38 echo "$NAME is not running." |
domcox@1357 | 39 exit 1 |
domcox@1357 | 40 fi |
domcox@1357 | 41 echo -n "Restarting $DESC: $NAME... " |
domcox@1357 | 42 kill `cat $PIDFILE` |
domcox@1357 | 43 sleep 2 |
domcox@1357 | 44 $DAEMON $OPTIONS > /dev/null |
domcox@1357 | 45 status |
domcox@1357 | 46 ;; |
domcox@1357 | 47 *) |
domcox@1357 | 48 echo "" |
domcox@1357 | 49 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" |
domcox@1357 | 50 echo "" |
domcox@1357 | 51 exit 1 |
domcox@1357 | 52 ;; |
domcox@1357 | 53 esac |
domcox@1357 | 54 |
domcox@1357 | 55 exit 0 |