#!/sbin/sh # $Id: initd.script,v 1.1 2003/09/07 04:57:02 elkner Exp $ # description: # start/stop the arpwatch daemon for discovering new IP/Ethernet adresses # # default: S/K09 0/K09 1/K09 2/S91 ARPWATCH=@CLIENT_BASEDIR@/sbin/arpwatch DATAFILE=/var/arpwatch/arp.dat case "$1" in 'start') if [ -x "$ARPWATCH" ]; then if [ -n "$DATAFILE" ]; then PARAM="-f $DATAFILE" else PARAM="" fi $ARPWATCH -N $PARAM && echo "Starting arpwatch ... " if [ $? -ne 0 ]; then echo "failed with error $?." else echo "done." fi fi ;; 'stop') # Determine PID of process(es) to stop pid=`pgrep -x -P 1 arpwatch` if [ -n "$pid" ]; then if kill $pid; then echo "arpwatch stopped" else echo "arpwatch is not running" fi else echo "arpwatch is not running..." fi ;; *) echo "usage: $0 {start|stop}" ;; esac exit 0