Created
September 5, 2012 17:23
-
-
Save unRob/3640460 to your computer and use it in GitHub Desktop.
Codem-transcoder init.d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: codem-transcode | |
# Required-Start: $remote_fs $network | |
# Required-Stop: $remote_fs $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts codem-transcode | |
# Description: Starts Codem Transcode Daemon | |
### END INIT INFO | |
# Author: Roberto Hidalgo <rob@surrealista.mx> | |
FOREVER_BIN=/usr/local/bin/forever | |
CODEM_BIN=/usr/bin/codem-transcode | |
CONFIG=/impacto/app/codem/config.json | |
do_start() { | |
$FOREVER_BIN start $CODEM_BIN -c $CONFIG | |
} | |
do_stop() { | |
$FOREVER_BIN stop $CODEM_BIN | |
} | |
case "$1" in | |
start) | |
echo "Starting Codem Transcode..." | |
$FOREVER_BIN start $CODEM_BIN -c $CONFIG | |
;; | |
stop) | |
echo "Stopping Codem Transcode..." | |
$FOREVER_BIN stop $CODEM_BIN | |
;; | |
restart) | |
echo "Restarting Codem Transcode..." | |
$FOREVER_BIN restart $CODEM_BIN | |
;; | |
*) | |
echo "Usage: /etc/init.d/codem {start|stop|restart}" | |
exit 1 | |
;; | |
esac | |
: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment