summaryrefslogtreecommitdiffstats
path: root/net-wireless/unifi/files/unifi.init
blob: fc2e40dced576a1031097610c045db6db5b90d42 (plain) (blame)
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
27
28
#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

PID_FILE="/var/run/unifi.pid"
DAEMON="${JAVA_HOME-/usr}"/bin/java
UNIFI_PATH="/usr/lib/unifi"

depend() {
    need net
}

start() {
	ebegin "Starting unifi"
	cd "${UNIFI_PATH}"
	start-stop-daemon --start --quiet -b \
	--pidfile "${PID_FILE}" -m \
	--exec ${DAEMON} -- -jar lib/ace.jar start
	eend $?
	#--user nobody --group nobody \
}

stop() {
	ebegin "Stopping unifi"
	start-stop-daemon --quiet --stop -R 20 --pidfile "${PID_FILE}"
	eend $?
}