#!/bin/tcsh -f

#
# read arguments
#
set SRV=$1
set IPADDR=$2

#
# exe path and options
#

#
# check conectivity by running timestamp test first 
#

tbit -m 100 -t Timestamp $IPADDR > tmp
set tbitstat=$status
#
# if okay, check ECN
#
if ($tbitstat == 0) then
	/bin/rm -f datalog
	set TS = `date`
	tbit -m 100 -t ECN $IPADDR > datalog
	set tbitstat=$status
	if ($tbitstat == 0) then
		set RES = `tail datalog`
		echo $TS - $SRV $IPADDR $RES >> MASTERLOG
		echo $TS - $SRV $IPADDR $RES 
	endif
endif
