summaryrefslogtreecommitdiff
path: root/net-nntp/nzbget/files/nzbget.initd
diff options
context:
space:
mode:
Diffstat (limited to 'net-nntp/nzbget/files/nzbget.initd')
-rw-r--r--net-nntp/nzbget/files/nzbget.initd28
1 files changed, 28 insertions, 0 deletions
diff --git a/net-nntp/nzbget/files/nzbget.initd b/net-nntp/nzbget/files/nzbget.initd
new file mode 100644
index 000000000000..06f75596e438
--- /dev/null
+++ b/net-nntp/nzbget/files/nzbget.initd
@@ -0,0 +1,28 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_started_commands="reload"
+
+start() {
+ ebegin "Starting ${RC_SVCNAME}"
+ checkpath -d -m 0755 -o "${NZBGET_USER}":"${NZBGET_GROUP}" /run/nzbget
+ start-stop-daemon --quiet --start --user "${NZBGET_USER}" \
+ --group "${NZBGET_GROUP}" --exec /usr/bin/nzbget -- \
+ --configfile "${NZBGET_CONFIGFILE}" --daemon \
+ ${NZBGET_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${RC_SVCNAME}"
+ start-stop-daemon --stop --exec /usr/bin/nzbget -- \
+ --configfile "${NZBGET_CONFIGFILE}" --daemon \
+ ${NZBGET_OPTS}
+}
+
+reload() {
+ ebegin "Reloading ${RC_SVCNAME}"
+ /usr/bin/nzbget --configfile "${NZBGET_CONFIGFILE}" --reload >/dev/null
+ eend $?
+}