#!/usr/bin/perl
# must be run while logged into an ECE machine
# script that connects to the servers in the server_file and 
# runs the $command below

$command = "/afs/ece/usr/ykc/18749/project/fault_injector/start_server.pl";

$counter = @ARGV;
if($counter != 1 ){
   print "./init <servers_file>";
   print "\n";
   exit;
}

$filename = $ARGV[0];

open( FILE, "< $filename" ) or die "Can't open $filename : $!";

while(<FILE>){
      chomp($_);
      push @servers,$_;
   }

foreach $servername(@servers){
   system("ssh -f $servername $command ");
   }
