summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorMichael Mason <ms13sp@gmail.com>2009-03-18 16:45:54 +0000
committerMichael Mason <ms13sp@gmail.com>2009-03-18 16:45:54 +0000
commit4faf6321585e20a6140b0fdc386b5ac418457214 (patch)
tree54517c526f3d5c35947d6dbd4832e292f513fb03 /testing
parent2502bfa7e0db886b7e312fc6f2b9b0f5de5b2922 (diff)
downloadaports-4faf6321585e20a6140b0fdc386b5ac418457214.tar.bz2
aports-4faf6321585e20a6140b0fdc386b5ac418457214.tar.xz
Adding confd and initd for arpwatch
Diffstat (limited to 'testing')
-rw-r--r--testing/arpwatch/arpwatch.confd12
-rw-r--r--testing/arpwatch/arpwatch.initd37
2 files changed, 49 insertions, 0 deletions
diff --git a/testing/arpwatch/arpwatch.confd b/testing/arpwatch/arpwatch.confd
new file mode 100644
index 000000000..f44221aa3
--- /dev/null
+++ b/testing/arpwatch/arpwatch.confd
@@ -0,0 +1,12 @@
+# Config file for /etc/init.d/arpwatch
+# see arpwatch.8 for more information
+
+#IFACES="eth0 eth1"
+IFACES="eth0"
+
+# Additional options to pass to arpwatch.
+OPTIONS="-N -p"
+
+# Comment this line if you wish arpwatch to run as root user (not recommended)
+ARPUSER="arpwatch"
+
diff --git a/testing/arpwatch/arpwatch.initd b/testing/arpwatch/arpwatch.initd
new file mode 100644
index 000000000..e039e1db8
--- /dev/null
+++ b/testing/arpwatch/arpwatch.initd
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/net-analyzer/arpwatch/files/arpwatch.initd,v 1.1 2007/06/02 22:37:16 jokey Exp $
+
+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
+}