aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/arpwatch
diff options
context:
space:
mode:
authorCraig Leres <leres@FreeBSD.org>2019-12-17 00:53:08 +0000
committerCraig Leres <leres@FreeBSD.org>2019-12-17 00:53:08 +0000
commitd712e09dea507cd49fcb1c84143ff21433646b74 (patch)
tree8c250c8c9faeb57e372b6e8f3b9bc3da7b4a3586 /net-mgmt/arpwatch
parent1715e7a24e9edb479b14a9809fae37c90875a1ca (diff)
downloadports-d712e09dea507cd49fcb1c84143ff21433646b74.tar.gz
ports-d712e09dea507cd49fcb1c84143ff21433646b74.zip
net-mgmt/arpwatch: Fix the rc.d script to handle interface names
with '.' in them based on a patch from Daniel Duerr. Remove obsolete port version of the rc.d script. PR: 242673 Submitted by: Daniel Duerr Approved by: ler (mentor, implicit)
Notes
Notes: svn path=/head/; revision=520290
Diffstat (limited to 'net-mgmt/arpwatch')
-rw-r--r--net-mgmt/arpwatch/Makefile2
-rw-r--r--net-mgmt/arpwatch/files/arpwatch.in80
-rw-r--r--net-mgmt/arpwatch/files/patch-arpwatch.sh.in12
3 files changed, 13 insertions, 81 deletions
diff --git a/net-mgmt/arpwatch/Makefile b/net-mgmt/arpwatch/Makefile
index 8401c182e06e..cf13de386669 100644
--- a/net-mgmt/arpwatch/Makefile
+++ b/net-mgmt/arpwatch/Makefile
@@ -3,7 +3,7 @@
PORTNAME= arpwatch
PORTVERSION= 3.0
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= net-mgmt
MASTER_SITES= https://ee.lbl.gov/downloads/arpwatch/ \
LOCAL/leres/arpwatch
diff --git a/net-mgmt/arpwatch/files/arpwatch.in b/net-mgmt/arpwatch/files/arpwatch.in
deleted file mode 100644
index c949a5016d6a..000000000000
--- a/net-mgmt/arpwatch/files/arpwatch.in
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-
-# PROVIDE: arpwatch
-# REQUIRE: NETWORKING
-
-# Add the following lines to /etc/rc.conf to enable arpwatch:
-#
-#arpwatch_enable="YES"
-#
-arpwatch_enable=${arpwatch_enable:-"NO"}
-arpwatch_dir=${arpwatch_dir:-"%%PREFIX%%/arpwatch/"}
-
-. /etc/rc.subr
-
-name=arpwatch
-rcvar=arpwatch_enable
-required_dirs=${arpwatch_dir}
-
-load_rc_config ${name}
-
-command="%%PREFIX%%/sbin/${name}"
-start_precmd=${name}_precmd
-
-arpwatch_precmd() {
- case ${arpwatch_interfaces} in
- '')
- echo prcmd
- if [ ! -e "${arpwatch_dir}/arp.dat" ]; then
- if [ -e "${arpwatch_dir}/arp.dat-" ]; then
- cp "${arpwatch_dir}/arp.dat-" "${arpwatch_dir}/arp.dat"
- else
- touch "${arpwatch_dir}/arp.dat"
- fi
- fi
- ;;
-
- *)
- for interface in ${arpwatch_interfaces}; do
- if [ ! -e "${arpwatch_dir}/arp.${interface}.dat" ]; then
- if [ -e "${arpwatch_dir}/arp.${interface}.dat-" ]; then
- cp "${arpwatch_dir}/arp.${interface}.dat-" "${arpwatch_dir}/arp.${interface}.dat"
- else
- touch "${arpwatch_dir}/arp.${interface}.dat"
- fi
- fi
- done
- ;;
- esac
-}
-
-arpwatch_stop() {
- killall arpwatch
-}
-
-case ${arpwatch_interfaces} in
- '')
- echo 'meuh'
- run_rc_command "$1"
- ;;
-
- *)
- case "$1" in
- *start)
- for interface in ${arpwatch_interfaces}; do
- rc_interface=`echo ${interface} | sed 's/\./_/g'`
- eval options=\$arpwatch_${rc_interface}_options
- command_args="-i ${interface} ${options} -f ${arpwatch_dir}/arp.${interface}.dat"
- pidfile="/var/run/arpwatch-${interface}.pid"
- run_rc_command "$1"
- done
- ;;
- *)
- run_rc_command "$1"
- ;;
- esac
- ;;
-esac
diff --git a/net-mgmt/arpwatch/files/patch-arpwatch.sh.in b/net-mgmt/arpwatch/files/patch-arpwatch.sh.in
new file mode 100644
index 000000000000..4704767d10a0
--- /dev/null
+++ b/net-mgmt/arpwatch/files/patch-arpwatch.sh.in
@@ -0,0 +1,12 @@
+--- arpwatch.sh.in.orig 2014-07-25 18:42:17 UTC
++++ arpwatch.sh.in
+@@ -47,7 +47,8 @@ arpwatch_precmd()
+ if [ $cmd == start ]; then
+ prep_datfile ${fn}
+ fi
+- eval options=\$arpwatch_${interface}_options
++ ltr ${interface} . _ _interface
++ eval options=\$arpwatch_${_interface}_options
+ command_args="-i ${interface} -f ${fn} -P ${pidfile} ${options}"
+ }
+