blob: 87c798b5ecd38439eb565e3b65dc9ad1bdf6f786 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
ACE_LIB="lib/ace.jar"
DAEMON="${JAVA_HOME-/etc/java-config-2/current-system-vm}"/bin/java
JAVA_OPTS="-Djava.library.path= -Dorg.xerial.snappy.tempdir=/usr/lib/unifi/tmp"
UNIFI_GROUP="unifi"
UNIFI_PATH="/usr/lib/unifi"
UNIFI_USER="unifi"
depend() {
need net
}
start() {
ebegin "Starting UniFi Controller"
cd "${UNIFI_PATH}" && start-stop-daemon --start --quiet --background --user ${UNIFI_USER} --group ${UNIFI_GROUP} --chdir ${UNIFI_PATH} --exec ${DAEMON} -- ${JAVA_OPTS} -jar ${ACE_LIB} start
eend $?
}
stop() {
ebegin "Stopping UniFi Controller"
start-stop-daemon --start --quiet --background --user ${UNIFI_USER} --group ${UNIFI_GROUP} --chdir ${UNIFI_PATH} --exec ${DAEMON} -- ${JAVA_OPTS} -jar ${ACE_LIB} stop
eend $?
}
|