#! /bin/csh -f
# intermediate program between Vstart and mvaxbootserver
# since Vstart always puts the network name as the last argument
# Also specifies "-n", so mvaxbootserver will boot even machines that
# dont have a config file.  May be a nuisance if some machine on the
# network wants to use MOP to talk to some other boot server.
if ( $#argv < 1 ) then
    echo "Missing network device name"
    exit (1)
endif
/etc/V/mvaxbootserver -n -c /usr/V/config -e $1 -T 30000 \
	/usr/V/boot/Vload.vax &
exit 0

#
# ---- Things below this line were used to chase mysterious bugs in the
# ---- mvaxbootserver.  They're preserved here, pickled in aspic and canned,
# ---- for the next time that funny bugs strike.
#
@ i = 10
while ( $i >= 0 )
	date > ~ds/logfiles/mvaxbootserver.$$.$i
	/etc/V/mvaxbootserver -v -n -c /usr/V/config -e $1        -T 30000 /usr/V/boot/Vload.vax >>& ~ds/logfiles/mvaxbootserver.$$.$i
	mail -s 'mvaxbootserver died or was killed' mvaxbootserver-watch@pescadero <<EOF2
Exit status : $status
Time        : `date`
Parent PID  : $$
Host        : `hostname`
Argv        : $argv
Log file    : ~ds/logfiles/mvaxbootserver.$$.$i
Retries left: $i
EOF2
	mv core ~ds/logfiles/mvbs.core.$$.$i
	@ i--
end
