wok-next diff boxbackup/stuff/bbstored @ rev 21103

emacs: depends on emacs-common
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Jan 03 11:21:15 2019 +0200 (2019-01-03)
parents ff5fd8788cd9
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/boxbackup/stuff/bbstored	Thu Jan 03 11:21:15 2019 +0200
     1.3 @@ -0,0 +1,56 @@
     1.4 +#!/bin/sh
     1.5 +# /etc/init.d/bbstored: Start, stop and restart bbstored daemon on SliTaz, at boot
     1.6 +# time or with the command line.
     1.7 +#
     1.8 +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS
     1.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
    1.10 +#
    1.11 +. /etc/init.d/rc.functions
    1.12 +. /etc/daemons.conf
    1.13 +
    1.14 +NAME=BBstored
    1.15 +DESC="$(_ 'BoxBackup server daemon')"
    1.16 +DAEMON=/usr/bin/bbstored
    1.17 +OPTIONS=$BBSTORED_OPTIONS
    1.18 +PIDFILE=/var/run/bbstored.pid
    1.19 +
    1.20 +case "$1" in
    1.21 +  start)
    1.22 +    if active_pidfile $PIDFILE bbstored ; then
    1.23 +      _ '%s is already running.' $NAME
    1.24 +      exit 1
    1.25 +    fi
    1.26 +    action 'Starting %s: %s...' "$DESC" $NAME
    1.27 +    $DAEMON $OPTIONS >/dev/null
    1.28 +    status
    1.29 +    ;;
    1.30 +  stop)
    1.31 +    if ! active_pidfile $PIDFILE bbstored ; then
    1.32 +      _ '%s is not running.' $NAME
    1.33 +      exit 1
    1.34 +    fi
    1.35 +    action 'Stopping %s: %s...' "$DESC" $NAME
    1.36 +    kill $(cat $PIDFILE)
    1.37 +    rm -f $PIDFILE
    1.38 +    status
    1.39 +    ;;
    1.40 +  restart)
    1.41 +    if ! active_pidfile $PIDFILE bbstored ; then
    1.42 +      _ '%s is not running.' $NAME
    1.43 +      exit 1
    1.44 +    fi
    1.45 +    action 'Restarting %s: %s...' "$DESC" $NAME
    1.46 +    kill $(cat $PIDFILE)
    1.47 +    rm -f $PIDFILE
    1.48 +    sleep 2
    1.49 +    $DAEMON $OPTIONS >/dev/null
    1.50 +    status
    1.51 +    ;;
    1.52 +  *)
    1.53 +    emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
    1.54 +    newline
    1.55 +    exit 1
    1.56 +    ;;
    1.57 +esac
    1.58 +
    1.59 +exit 0