#!/bin/sh
# This module contains SAINT-US code from WWDSI which is regulated in
# accordance with the distribution file LICENSE.WWDSI. 

FW_TIMEOUT=1
STD_PORTS="25 53 80 139 143"
TEST_PORT=12000
TARGETS="`/bin/echo $*`"
echo > ./fwping.$$
set *=" " $*
shift
while [ "$1" ]; do
  echo `date` $1 >> ./fwping.$$
  TMP=`bin/tcp_scan -a -f 1 $1 $STD_PORTS $TEST_PORT |  \
	grep -iv timed | grep -iv "no route" | grep -iv "unreachable"`
  if [ "$TMP" ]; then
    /bin/echo "$1 is alive"
  fi 
shift
done
exit 0
