#! /bin/sh ### BEGIN INIT INFO # Provides: flower-power # Required-Start: $all # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Manages the Things System, Inc., Flower Power TSRP transcoder # Description: Manages the Things System, Inc., Flower Power TSRP transcoder ### END INIT INFO # Author: Marshall Rose # # Please remove the "Author" lines above and replace them # with your own name if you copy and modify this script. # Do NOT "set -e" # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin NODE=/usr/local/bin/node TSRP_PID=/var/run/flower-power.pid TSRP_ARGS="/home/debian/node-flower-power/TSRP/flower-power-tsrp.js" TSRP_FILE="/var/log/flower-power.log" PID= case "$1" in start) echo -n "Starting Flower Power/TSRP transcoder..." $NODE $TSRP_ARGS >> $TSRP_FILE 2>&1 & PID=$! echo "pid is $PID" echo $PID >> $TSRP_PID ;; stop) echo -n "Stop Flower Power/TSRP transcoder..." echo -n "killing " echo `cat $TSRP_PID` kill `cat $TSRP_PID` rm $TSRP_PID ;; restart) $0 stop $0 start ;; *) echo "Usage: $0 (start|stop|restart)" exit 1 ;; esac exit 0