-
-
Save jonathonbyrdziak/2942151 to your computer and use it in GitHub Desktop.
APE Daemon File
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/sh | |
# /etc/init.d/aped | |
# | |
# chkconfig: 2345 85 15 | |
# description: APE Daemon | |
# processname: APE Daemon | |
# | |
# Tutorial for installing this file can be found at | |
# @see http://redrokk.com/2012/06/16/installing-ape-streaming-server-tutorial | |
# Install the service with chkconfig --add aped | |
# | |
# Define where ape is installed. | |
# The trailing slash is required ( Example : /my/path/bin/ ) | |
APE_DIRECTORY=/etc/ape/bin/ | |
# Define the PID File | |
PIDFILE=/var/run/aped.pid | |
# Source function library. | |
. /etc/init.d/functions | |
DAEMON="${APE_DIRECTORY}aped --cfg ${APE_DIRECTORY}ape.conf > /dev/null" | |
start() { | |
echo -n "Starting APE... " | |
cd $APE_DIRECTORY; | |
daemon $DAEMON | |
RETVAL=$? | |
echo | |
[ $RETVAL = 0 ] && touch /var/lock/subsys/aped | |
return $RETVAL | |
} | |
stop() { | |
echo "Stopping APE..." | |
kill `cat /var/run/aped.pid` | |
RETVAL=$? | |
echo | |
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/aped | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
stop | |
start | |
;; | |
*) | |
echo "Usage: {start|stop|restart}" | |
exit 1 | |
;; | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment