summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer/2ping/files/2pingd')
-rw-r--r--net-analyzer/2ping/files/2pingd36
1 files changed, 36 insertions, 0 deletions
diff --git a/net-analyzer/2ping/files/2pingd b/net-analyzer/2ping/files/2pingd
new file mode 100644
index 000000000000..a1cf292ac5fe
--- /dev/null
+++ b/net-analyzer/2ping/files/2pingd
@@ -0,0 +1,36 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DAEMON="/usr/bin/2ping"
+PIDFILE="/var/run/2ping"
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting 2ping server"
+ start-stop-daemon --start \
+ --background --make-pidfile \
+ --pidfile "${PIDFILE}" \
+ --exec "${DAEMON}" -- \
+ --listen -q ${OPTS} \
+ >/dev/null
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping 2ping server"
+ start-stop-daemon --stop --pidfile "${PIDFILE}"
+ eend $?
+}
+
+restart() {
+ ebegin "Restarting 2ping server"
+ start-stop-daemon --stop --pidfile "${PIDFILE}"
+ sleep 1
+ start-stop-daemon --start --exec "${DAEMON}" --pidfile "${PIDFILE}"
+ eend $?
+}