diff options
| -rwxr-xr-x | capu.init | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/capu.init b/capu.init new file mode 100755 index 0000000..3bbf491 --- /dev/null +++ b/capu.init @@ -0,0 +1,42 @@ +#!/bin/sh +# +# Starts CAPU +# + +BIN=/usr/bin/capu +PIDFILE=/var/run/capu.pid + +export DISPLAY=:0 + +start() { + printf "Starting CAPU: " + start-stop-daemon -S -q -b -m -p $PIDFILE --exec $BIN + [ $? = 0 ] && sleep 3 && echo "OK" || echo "FAIL" +} + +stop() { + printf "Stopping CAPU: " + start-stop-daemon -K -q -p $PIDFILE + [ $? = 0 ] && echo "OK" || echo "FAIL" +} + +restart() { + stop + sleep 2 + start +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + restart + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac |
