aboutsummaryrefslogtreecommitdiffstats
path: root/testing/fprobe/fprobe.initd
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2009-03-27 11:30:51 +0000
committerCarlo Landmeter <clandmeter@gmail.com>2009-03-27 11:30:51 +0000
commitbb04cb9d59e738310e3ec233fad42be31a6224ac (patch)
tree766d929a0f9aba7249e656579631928f67e9b54f /testing/fprobe/fprobe.initd
parent5a9af1f3e07c6549b2ad3e757c7214389297e09f (diff)
downloadaports-bb04cb9d59e738310e3ec233fad42be31a6224ac.tar.gz
aports-bb04cb9d59e738310e3ec233fad42be31a6224ac.tar.bz2
aports-bb04cb9d59e738310e3ec233fad42be31a6224ac.tar.xz
testing/fprobe: new aport
Diffstat (limited to 'testing/fprobe/fprobe.initd')
-rw-r--r--testing/fprobe/fprobe.initd39
1 files changed, 39 insertions, 0 deletions
diff --git a/testing/fprobe/fprobe.initd b/testing/fprobe/fprobe.initd
new file mode 100644
index 0000000000..b2ee6ded84
--- /dev/null
+++ b/testing/fprobe/fprobe.initd
@@ -0,0 +1,39 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net
+}
+
+BIN=/usr/sbin/fprobe
+PIDFILE_EXTRA=""
+[ -n "$PIDFILE_ID" ] && PIDFILE_EXTRA="[$PIDFILE_ID]"
+PIDFILE="/var/run/fprobe$PIDFILE_EXTRA.pid"
+
+start() {
+ ebegin "Starting fprobe"
+ local OPTS=""
+ [ "${PROMISC}" == "yes" ] || OPTS="${OPTS} -p"
+ [ -n "${FILTER}" ] && OPTS="${OPTS} -f '${FILTER}'"
+ for optname in i:IFACE s:TIMER_EXPIRED g:TIME_FRAGMENTED d:TIMER_IDLE \
+ e:TIMER_ACTIVE n:FLOW_VER a:LOCALIP x:SNMP_IFACE b:MEMBULK \
+ m:MEMLIMIT q:PENDING B:KERNBUF r:RTPRIO t:DELAY S:SNAPLEN \
+ c:CHROOT u:USER v:LOGLEVEL ; do
+ opt="${optname/:*}" optvar="${optname/*:}"
+ eval optvalue="\$$optvar"
+ [ -n "$optvalue" ] && OPTS="${OPTS} -${opt} ${optvalue}"
+ done
+ OPTS="${OPTS} -l 1:${PIDFILE_ID} ${COLLECTORS}"
+ start-stop-daemon --start --exec $BIN \
+ --pidfile ${PIDFILE} \
+ -- ${OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping fprobe"
+ start-stop-daemon --stop --quiet --exec $BIN \
+ --pidfile ${PIDFILE}
+ eend $?
+}