summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Blas Izquierdo Riera (klondike) <klondike@xiscosoft.es>2013-02-26 04:54:34 +0100
committerFrancisco Blas Izquierdo Riera (klondike) <klondike@xiscosoft.es>2013-02-26 04:56:39 +0100
commit8075aa1f699f1146a192fcd8ff450863b3cd0b9c (patch)
tree217df4119e262abeb07940e19403e3b6ba9c55f1 /net-p2p/nmdcredir/files/nmdcredir.init.d
parentAdding support for using the system boost libraries (diff)
downloadklondike-8075aa1f699f1146a192fcd8ff450863b3cd0b9c.tar.gz
klondike-8075aa1f699f1146a192fcd8ff450863b3cd0b9c.tar.bz2
klondike-8075aa1f699f1146a192fcd8ff450863b3cd0b9c.zip
Adding nmdcredir
Package-Manager: portage-2.1.11.50
Diffstat (limited to 'net-p2p/nmdcredir/files/nmdcredir.init.d')
-rw-r--r--net-p2p/nmdcredir/files/nmdcredir.init.d41
1 files changed, 41 insertions, 0 deletions
diff --git a/net-p2p/nmdcredir/files/nmdcredir.init.d b/net-p2p/nmdcredir/files/nmdcredir.init.d
new file mode 100644
index 0000000..00efdf3
--- /dev/null
+++ b/net-p2p/nmdcredir/files/nmdcredir.init.d
@@ -0,0 +1,41 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+depend() {
+ use dns
+ need net
+}
+
+PIDFILE=/var/run/${RC_SVCNAME}.pid
+
+# port redirection_address [hub_name redirect_message]
+# Port to listen to
+NMDCREDIR_PORT="411"
+# Adress to redirect to
+NMDCREDIR_ADDR="adcs://localhost:2780/"
+
+#If a message should be sent set this to the hubname
+NMDCREDIR_HUBN="TheHub"
+
+#Message to send if NMDCREDIR_HUBN is set
+NMDCREDIR_MESS="You are being redirected to our new hub at adcs://localhost:2780/"
+
+
+start() {
+ ebegin "Starting nmdcredir ${RC_SVCNAME}"
+ if [ -z ${NMDCREDIR_HUBN} ]; then
+ start-stop-daemon --start --pidfile "${PIDFILE}" -u ${NMDCREDIR_USER}:${NMDCREDIR_GROUP} -m -b /usr/bin/nmdcredir -- "${NMDCREDIR_PORT}" "${NMDCREDIR_ADDR}"
+ else
+ start-stop-daemon --start --pidfile "${PIDFILE}" -u ${NMDCREDIR_USER}:${NMDCREDIR_GROUP} -m -b /usr/bin/nmdcredir -- "${NMDCREDIR_PORT}" "${NMDCREDIR_ADDR}" \
+ "${NMDCREDIR_HUBN}" "${NMDCREDIR_MESS}"
+ fi
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping nmdcredir ${RC_SVCNAME}"
+ start-stop-daemon --stop --pidfile "${PIDFILE}"
+ eend $?
+}