#!/bin/csh 

#
# start all servers on the remote hosts
#
# Usage: start_dd_servers dd_server_configuration_file 
#	dd_server_configuration_file: file with the listing of the
#				hosts where the servers
#				have to be started
#
# CW Jan 2, 1996
#

#
# check the arguments 
#----------------------------
if ( $#argv != 1 ) then
	echo "bad usage: "
	echo "use: start_dd_servers dd_server_configuration_file"
	exit(1)
endif

if ( -e $argv[1] ) then
	echo "using configuration file $argv[1] \n"
else
	echo "configuration file NOT found "
	exit(1)
endif

# $dd_bin/stop_all_dd_servers $1

set me = `whoami`

set UNIX_PLATFORM = `uname -s`

foreach i ("`cat $1`") 
	set info = `echo $i`
	if ( $info[1] == "#" ) then
		continue
	endif
	echo "starting server on $info[1]..."
	if ( $#info == 4 ) then
		rsh $info[1] $CODA_BIN/start_dd_server $info[2] $info[3] $info[4] 
	else
		rsh $info[1] $CODA_BIN/start_dd_server $info[2] $info[3]
	endif
end
