summaryrefslogtreecommitdiffstats
path: root/net-mgmt/arpwatch/files/arpwatch.sh
diff options
context:
space:
mode:
Diffstat (limited to 'net-mgmt/arpwatch/files/arpwatch.sh')
-rw-r--r--net-mgmt/arpwatch/files/arpwatch.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/net-mgmt/arpwatch/files/arpwatch.sh b/net-mgmt/arpwatch/files/arpwatch.sh
index f0c8a79..1f4ad20 100644
--- a/net-mgmt/arpwatch/files/arpwatch.sh
+++ b/net-mgmt/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)
OpenPOWER on IntegriCloud