aboutsummaryrefslogtreecommitdiffstats
path: root/net/arpwatch/files
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2001-04-07 09:51:53 +0800
committerbrian <brian@FreeBSD.org>2001-04-07 09:51:53 +0800
commitce0af04642dc19d786a215be8f0db74f5a2e9491 (patch)
tree4b696edcd900557b20deb2e85a3f743235ee79e2 /net/arpwatch/files
parent2353ecd66089721852e959beb01e7d6d2cac9430 (diff)
downloadfreebsd-ports-graphics-ce0af04642dc19d786a215be8f0db74f5a2e9491.tar.gz
freebsd-ports-graphics-ce0af04642dc19d786a215be8f0db74f5a2e9491.tar.zst
freebsd-ports-graphics-ce0af04642dc19d786a215be8f0db74f5a2e9491.zip
GNU_CONFIGURE=yes and teach arpwatch.sh to figure out $PREFIX
Suggested and reviewed by: John E. Hein <jhein@timing.com>
Diffstat (limited to 'net/arpwatch/files')
-rw-r--r--net/arpwatch/files/arpwatch.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/net/arpwatch/files/arpwatch.sh b/net/arpwatch/files/arpwatch.sh
index f0c8a797cb5..1f4ad205b3f 100644
--- a/net/arpwatch/files/arpwatch.sh
+++ b/net/arpwatch/files/arpwatch.sh
@@ -1,9 +1,19 @@
#!/bin/sh
+prog=$(realpath $0) || exit 1
+dir=${prog%/*}
+PREFIX=${dir%/etc/rc.d}
+
+if [ ."$dir" = ."$prog" -o ."$PREFIX" = ."$dir" ]
+then
+ echo "$0: Cannot determine the PREFIX" >&2
+ exit 1
+fi
+
case $1 in
start)
- if [ -x /usr/local/sbin/arpwatch -a -d /usr/local/arpwatch ]; then
- /usr/local/sbin/arpwatch && echo -n ' arpwatch'
+ if [ -x "$PREFIX"/sbin/arpwatch -a -d "$PREFIX"/arpwatch ]; then
+ "$PREFIX"/sbin/arpwatch && echo -n ' arpwatch'
fi
;;
stop)