#!/bin/sh
#
# Start probing the network for hw addresses, and if new ones
# are found, update /tftpboot/$IP, and /etc/bootpdtab
#
# Part of debian nfsroot package.
#
set -e

#If you want the network to be probed for hw-addresses, so that
#bootpd automatically knows all hw numbers, and the /tftpboot directory
#automatically gets filled up, set this to "1".
#(you may want to make /tftpboot point to something off your root parttion;
#/tftpboot uses about 1326k + 30k/klient (=3M for my 60 clients).
probenet=0


if test "$probenet" != "0"; then
  
  EXEC=/usr/sbin/nrprobenet
  test -f $EXEC || exit 0
  
  case "$1" in
    start)
  	 echo "Start probe for hw addresses"
  	 source /etc/nfsroot/def
  	 $EXEC -u 200 -i 2 -r "$IPRANGE" &
  	 echo $!>/var/run/nrprobenet.pid
      ;;
    stop)	
  	 echo "stop probe for hw addresses"        
  	 killall  $EXEC
  	  ;;
    *)
  	  echo "Usage: /etc/init.d/probenet {start|stop}"
  	  exit 1
  esac
fi
  
exit 0
