summaryrefslogtreecommitdiffstats
path: root/net/arpwatch-devel/files/arpwatch.sh
blob: 1f4ad205b3fe6ac775ff7f0f0618f9fbbc61daea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/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 "$PREFIX"/sbin/arpwatch -a -d "$PREFIX"/arpwatch ]; then
		"$PREFIX"/sbin/arpwatch && echo -n ' arpwatch'
	fi
	;;
stop)
	killall arpwatch && echo -n ' arpwatch'
	;;
*)
	echo "Usage: `basename $0` {start|stop}" >&2
	exit 64
	;;
esac

exit 0
OpenPOWER on IntegriCloud