#!/bin/ksh
#
# Copyright (c) 2001 by Sun Microsystems, Inc.
# All rights reserved.
#
#
#
# Original Author: Michael Koller
# Modified by:     Andrew McCarthy (am91519@ireland)
#

# variables
hctsdir=SUNWhcts				# base directory
hname=$1				# test system
tdir=tests				# test directory
testcmd=$tdir/net/nettest.stf		# network test
dls=					# data list
prgdir=prgs				# program directory
inst=1					# number of instances

# functions

# do function
go_fun()
{
	$prgdir/funcs "$*" 2>&1
}	

### MAIN ###

# change to base directory
cd `dirname $0`
while [ `basename $PWD` != $hctsdir ]
do
	cd ..
done

# set local/remote
if [ `hostname` = $hname ]
then
	dls=`ls /etc/hostname.*`
else
	dls=`rsh -n $hname "ls /etc/hostname.*" 2>/dev/null`
fi

# network
if [ -z "$dls" ] 
then
	echo "No Network found."
	exit 1
else
	echo "h:<HR><B><U>System certification test - Nettest</U></B>:"		
        echo "X:4:$testcmd"     

	echo "T:Enter remote host:moon"
	echo "x:5:"

	go_fun runt 1 0 1 $inst
fi
