#!/bin/bash

set -e           #yes, I've just read the policy manual....

source /etc/nfsroot/def

if test ! -e /tftpboot; then mkdir /tftpboot; fi

echo I assume the IP number of your server is $SERVERIP,
echo and that the range of possible nfsroot client IP numbers
echo is: $IPRANGE
echo
echo If this is incorrect, please change it in
echo /etc/nfsroot/def
echo '(or see /usr/doc/nfsroot/use.doc)'
echo
echo
echo 'Read that file anyway, as you may want to move /tftpboot'
echo "away from your root partition (that's where it is now)"

echo 'starting up the daemon to probe the network for hw adresses...'

#sleep 3       #I like to be able to read things..

#backup old /etc/bootptab, nrpobenet will overwrite it.
if test ! -f /etc/bootptab-pre-nfsroot; then
  cp /etc/bootptab /etc/bootptab-pre-nfsroot
fi

/etc/init.d/bootpd start
/etc/init.d/nrprobenet start

update-rc.d bootpd     defaults >/dev/null
update-rc.d nrprobenet defaults >/dev/null
