unifi_controller_rhel/templates/unifi.init.j2

53 lines
648 B
Plaintext
Raw Normal View History

2014-05-27 01:33:22 +00:00
#!/bin/bash
# chkconfig: 2345 95 20
# description: UniFi system
2016-06-14 23:17:13 +00:00
# processname: UniFi
2014-05-27 01:33:22 +00:00
2016-06-14 23:17:13 +00:00
ctrl_start()
{
java -jar {{ unifi_controller_rhel_unifi_prefix }}/UniFi/lib/ace.jar start &
2014-05-27 01:33:22 +00:00
}
2016-06-14 23:17:13 +00:00
ctrl_stop()
{
java -jar {{ unifi_controller_rhel_unifi_prefix }}/UniFi/lib/ace.jar stop &
2014-05-27 01:33:22 +00:00
}
2016-06-14 23:17:13 +00:00
ctrl_restart()
{
ctrl_stop
sleep 1
ctrl_start
2014-05-27 01:33:22 +00:00
}
case "$1" in
2016-06-14 23:17:13 +00:00
2014-05-27 01:33:22 +00:00
start)
2016-06-14 23:17:13 +00:00
echo -n "starting UniFi system"
ctrl_start
echo " service started"
;;
2014-05-27 01:33:22 +00:00
stop)
2016-06-14 23:17:13 +00:00
echo -n "stopping UniFi system"
ctrl_stop
echo " service stopped"
;;
2014-05-27 01:33:22 +00:00
restart)
2016-06-14 23:17:13 +00:00
echo -n "restarting UniFi system"
ctrl_restart
echo "service restarted"
;;
2014-05-27 01:33:22 +00:00
*)
2016-06-14 23:17:13 +00:00
echo "usage: service UniFi {start|stop|restart}"
;;
esac
exit 0