summaryrefslogtreecommitdiff
blob: 0512d05857a5a96cb908431ad5fed85837a8a7aa (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
27
28
29
30
31
32
33
34
35
36
37
#!/sbin/openrc-run
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

extra_commands="reload"

FROX_CONFIG="/etc/frox.conf"
FROX_PID_FILE="/var/run/frox/frox.pid"
FROX_OPTS="-f ${FROX_CONFIG}"

checkconfig() {
	local piddir="$(dirname ${FROX_PID_FILE})"
	checkpath -q -d -o ftpproxy:ftpproxy -m 0770 "${piddir}" || return 1
	if [ ! -f "${FROX_CONFIG}" ] ; then
		eerror "missing ${FROX_CONFIG}"
		return 1
	fi
}

start() {
	checkconfig || return 1
	ebegin "Starting ${SVCNAME}"
	start-stop-daemon --start --quiet --exec /usr/sbin/frox -- ${FROX_OPTS}
	eend $?
}

stop() {
	ebegin "Stopping ${SVCNAME}"
	start-stop-daemon --stop --quiet --exec /usr/sbin/frox --pidfile "${FROX_PID_FILE}"
	eend $?
}

reload() {
	ebegin "Reloading configuration"
	start-stop-daemon --signal HUP --pidfile "${FROX_PID_FILE}"
	eend $?
}