summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer/arpwatch/files/arpwatch.initd')
-rw-r--r--net-analyzer/arpwatch/files/arpwatch.initd37
1 files changed, 37 insertions, 0 deletions
diff --git a/net-analyzer/arpwatch/files/arpwatch.initd b/net-analyzer/arpwatch/files/arpwatch.initd
new file mode 100644
index 000000000000..0a517e00c665
--- /dev/null
+++ b/net-analyzer/arpwatch/files/arpwatch.initd
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+start() {
+ for IFACE in ${IFACES}
+ do
+ ebegin "Starting arpwatch on ${IFACE}"
+ DATAFILE=/var/lib/arpwatch/${IFACE}.dat
+ [ ! -f ${DATAFILE} ] && touch ${DATAFILE}
+
+ if [ -z ${ARPUSER} ]; then
+ start-stop-daemon --start --quiet --pidfile=/var/run/arpwatch.${IFACE}.pid --exec \
+ /usr/sbin/arpwatch -- -i ${IFACE} -f ${DATAFILE} -P /var/run/arpwatch.${IFACE}.pid ${OPTIONS}
+ else
+ chown ${ARPUSER} ${DATAFILE}
+ start-stop-daemon --start --quiet --pidfile=/var/run/arpwatch.${IFACE}.pid --exec \
+ /usr/sbin/arpwatch -- -i $IFACE -u ${ARPUSER} -f ${DATAFILE} -P /var/run/arpwatch.${IFACE}.pid ${OPTIONS}
+ fi
+ eend $?
+ done
+}
+
+stop() {
+ for IFACE in ${IFACES}
+ do
+ ebegin "Stopping arpwatch on ${IFACE}"
+ start-stop-daemon --stop --quiet --pidfile=/var/run/arpwatch.${IFACE}.pid --exec \
+ /usr/sbin/arpwatch
+ eend $?
+ done
+}