wok-current annotate chillispot/stuff/chilli @ rev 24959
updated ncdu (1.14.2 -> 1.16)
author | Hans-G?nter Theisgen |
---|---|
date | Sat Apr 23 16:59:14 2022 +0100 (2022-04-23) |
parents | 1b6281d68d9f |
children |
rev | line source |
---|---|
pascal@1325 | 1 #!/bin/sh |
al@19159 | 2 # /etc/init.d/chilli : Start, stop and restart ChilliSpot server on SliTaz, at |
pascal@1325 | 3 # boot time or with the command line. |
pascal@1325 | 4 # |
pascal@1325 | 5 # To start ChilliSpot server at boot time, just put chilli in the $RUN_DAEMONS |
pascal@1325 | 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf |
pascal@1325 | 7 # |
pascal@1325 | 8 . /etc/init.d/rc.functions |
pascal@1325 | 9 . /etc/daemons.conf |
pascal@1325 | 10 |
pascal@1325 | 11 NAME=ChilliSpot |
al@19159 | 12 DESC="$(_ '%s server' ChilliSpot)" |
pascal@1325 | 13 DAEMON=/usr/sbin/chilli |
pascal@1325 | 14 OPTIONS=$CHILLI_OPTIONS |
pascal@1325 | 15 PIDFILE=/var/run/chilli.pid |
pascal@1325 | 16 [ -n "$OPTIONS" ] || OPTIONS="--pidfile $PIDFILE --statedir /var/lib/chilli/" |
pascal@1325 | 17 |
pascal@1325 | 18 case "$1" in |
pascal@1325 | 19 start) |
pascal@6170 | 20 if active_pidfile $PIDFILE chilli ; then |
al@19159 | 21 _ '%s is already running.' $NAME |
pascal@1325 | 22 exit 1 |
pascal@1325 | 23 fi |
al@19159 | 24 action 'Starting %s: %s...' "$DESC" $NAME |
pascal@1325 | 25 $DAEMON $OPTIONS |
pascal@1325 | 26 status |
pascal@1325 | 27 ;; |
pascal@1325 | 28 stop) |
pascal@6170 | 29 if ! active_pidfile $PIDFILE chilli ; then |
al@19159 | 30 _ '%s is not running.' $NAME |
pascal@1325 | 31 exit 1 |
pascal@1325 | 32 fi |
al@19159 | 33 action 'Stopping %s: %s...' "$DESC" $NAME |
al@19159 | 34 kill $(cat $PIDFILE) |
pascal@1325 | 35 status |
pascal@1325 | 36 ;; |
pascal@1325 | 37 restart) |
pascal@6170 | 38 if ! active_pidfile $PIDFILE chilli ; then |
al@19159 | 39 _ '%s is not running.' $NAME |
pascal@1325 | 40 exit 1 |
pascal@1325 | 41 fi |
al@19159 | 42 action 'Restarting %s: %s...' "$DESC" $NAME |
al@19159 | 43 kill $(cat $PIDFILE) |
pascal@1325 | 44 sleep 2 |
pascal@1325 | 45 $DAEMON $OPTIONS |
pascal@1325 | 46 status |
pascal@1325 | 47 ;; |
pascal@1325 | 48 *) |
al@19159 | 49 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]" |
al@19159 | 50 newline |
pascal@1325 | 51 exit 1 |
pascal@1325 | 52 ;; |
pascal@1325 | 53 esac |
pascal@1325 | 54 |
pascal@1325 | 55 exit 0 |