wok-next annotate boxbackup-server/stuff/bbstored @ rev 13252
Up rapidsvn (0.12.1)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Aug 15 09:11:12 2012 +0200 (2012-08-15) |
parents | 67b0b4fc1484 |
children | 7f188676b59c |
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) |
pascal@11691 | 19 if active_pidfile $PIDFILE bbstored ; 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) |
pascal@11691 | 28 if ! active_pidfile $PIDFILE bbstored ; 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@2340 | 34 rm -f $PIDFILE |
domcox@1357 | 35 status |
domcox@1357 | 36 ;; |
domcox@1357 | 37 restart) |
pascal@11691 | 38 if ! active_pidfile $PIDFILE bbstored ; then |
domcox@1357 | 39 echo "$NAME is not running." |
domcox@1357 | 40 exit 1 |
domcox@1357 | 41 fi |
domcox@1357 | 42 echo -n "Restarting $DESC: $NAME... " |
domcox@1357 | 43 kill `cat $PIDFILE` |
domcox@2340 | 44 rm -f $PIDFILE |
domcox@1357 | 45 sleep 2 |
domcox@1357 | 46 $DAEMON $OPTIONS > /dev/null |
domcox@1357 | 47 status |
domcox@1357 | 48 ;; |
domcox@1357 | 49 *) |
domcox@1357 | 50 echo "" |
domcox@1357 | 51 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" |
domcox@1357 | 52 echo "" |
domcox@1357 | 53 exit 1 |
domcox@1357 | 54 ;; |
domcox@1357 | 55 esac |
domcox@1357 | 56 |
domcox@1357 | 57 exit 0 |