Skip to content

Instantly share code, notes, and snippets.

@NetworksAreMadeOfString
Created February 6, 2013 17:52
Show Gist options
  • Save NetworksAreMadeOfString/4724430 to your computer and use it in GitHub Desktop.
Save NetworksAreMadeOfString/4724430 to your computer and use it in GitHub Desktop.
#!/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