Skip to content

Instantly share code, notes, and snippets.

@kingster
Created August 12, 2014 19:14
Show Gist options
  • Save kingster/7b688664776a8ce05969 to your computer and use it in GitHub Desktop.
Save kingster/7b688664776a8ce05969 to your computer and use it in GitHub Desktop.
APS Demon File
#!/bin/bash
# /etc/init.d/aps
#
# description: APE Daemon
# processname: APE Daemon
# author : me@kinshuk.in
# Define where ape is installed.
APE_DIRECTORY=/var/aps/APS-Deploy
start() {
echo -n "Starting APE... "
pushd $APE_DIRECTORY > /dev/null
$APE_DIRECTORY/start
popd > /dev/null
RETVAL=$?
}
stop() {
echo "Stopping APE..."
$APE_DIRECTORY/stop
}
debug() {
echo "Starting Debug APE..."
pushd $APE_DIRECTORY > /dev/null
$APE_DIRECTORY/debug
popd > /dev/null
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
debug)
debug
;;
*)
echo "Usage: {start|stop|restart|debug}"
exit 1
;;
esac
exit $RETVAL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment