#!/bin/bash

server_list="\n
arkhamhorror.lab.ece.cmu.local 172.19.132.110\n
boggle.lab.ece.cmu.local 172.19.132.112\n
chess.lab.ece.cmu.local 172.19.132.113\n
clue.lab.ece.cmu.local 172.19.132.114\n
devilbunny.lab.ece.cmu.local 172.19.132.115\n
diplomacy.lab.ece.cmu.local 172.19.132.116\n
drlucky.lab.ece.cmu.local 172.19.132.117\n
girltalk.lab.ece.cmu.local 172.19.132.118\n
go.lab.ece.cmu.local 172.19.132.119\n
mahjongg.lab.ece.cmu.local 172.19.132.120\n
othello.lab.ece.cmu.local 172.19.132.121\n
risk.lab.ece.cmu.local 172.19.132.122\n
roborally.lab.ece.cmu.local 172.19.132.123\n
settlers.lab.ece.cmu.local 172.19.132.124\n
stratego.lab.ece.cmu.local 172.19.132.125
"

domain=`echo -e $server_list | awk '$2 ~ /\<'"$1"'\>/ {print $1}'`
echo "Found the domain: $domain at $1"

user=`whoami`
program="/afs/ece/usr/hcheong/blackjack_client_rep/rm_server_start"
#ssh $user@$1 screen -S $lable -d -m $program
screen -d -m ssh $user@$domain $program
#ssh $user@$1 $program
