Created
February 6, 2013 17:52
-
-
Save NetworksAreMadeOfString/4724430 to your computer and use it in GitHub Desktop.
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 | |
# chkconfig: 2345 95 20 | |
# description: UniFi system | |
# processname: UniFi | |
ctrl_start() | |
{ | |
#nohup java -jar JarFile.jar </dev/null >>myLogFile 2>>myErrorFile& | |
java -jar /usr/UniFi/lib/ace.jar start & | |
} | |
ctrl_stop() | |
{ | |
java -jar /usr/UniFi/lib/ace.jar stop & | |
} | |
ctrl_restart() | |
{ | |
ctrl_stop | |
sleep 1 | |
ctrl_start | |
} | |
case "$1" in | |
start) | |
echo -n "starting UniFi system" | |
ctrl_start | |
echo " service started" | |
;; | |
stop) | |
echo -n "stopping UniFi system" | |
ctrl_stop | |
echo " service stopped" | |
;; | |
restart) | |
echo -n "restarting UniFi system" | |
ctrl_restart | |
echo "service restarted" | |
;; | |
*) | |
echo "usage: service UniFi {start|stop|restart}" | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment