summaryrefslogtreecommitdiff
path: root/net-ftp/frox/files/frox.initd
diff options
context:
space:
mode:
Diffstat (limited to 'net-ftp/frox/files/frox.initd')
-rw-r--r--net-ftp/frox/files/frox.initd37
1 files changed, 37 insertions, 0 deletions
diff --git a/net-ftp/frox/files/frox.initd b/net-ftp/frox/files/frox.initd
new file mode 100644
index 000000000000..0512d05857a5
--- /dev/null
+++ b/net-ftp/frox/files/frox.initd
@@ -0,0 +1,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 $?
+}