wok-stable annotate boxbackup-server/stuff/bbstored @ rev 1800
curl: update depends
author | Paul Issott <paul@slitaz.org> |
---|---|
date | Mon Dec 01 22:58:27 2008 +0000 (2008-12-01) |
parents | |
children | 67b0b4fc1484 |
rev | line source |
---|---|
domcox@1357 | 1 #!/bin/sh |
domcox@1357 | 2 # /etc/init.d/bbstored: Start, stop and restart bbstored 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=BBstored |
domcox@1357 | 12 DESC="BoxBackup server deamon" |
domcox@1357 | 13 DAEMON=/usr/bin/bbstored |
domcox@1357 | 14 OPTIONS=$BBSTORED_OPTIONS |
domcox@1357 | 15 PIDFILE=/var/run/bbstored.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 |