#!/bin/bash
source $HOME/.gamerc

echo "TEST" | colorize green black
cd $HOME/common-TEST/bin/;
SERVER_LISTS=$(ls GatewayServer TicketServer AccountDBServer GameAgentServer GameDBServer HTTPAServer LoginServer MissionServer SatelliteServer WorldServer ZoneServer CrossRouter SocietyServer config.ini 2>/dev/null | sort)
cd $HOME/common-TEST/bin/; md5sum ${SERVER_LISTS}

for ip in $(cat /etc/hosts | sed -n '/\# PLEASE/,/# DO/p' | egrep 'GAMEDB|WZ|ACCOUNTDB|LOGIN' | awk -F" " '{print $1}'); do
	echo ${ip} | colorize blue black
	print_servername ${ip} | colorize yellow black
	ssh ${ip} "
		for server in \$(cd ~/servers*/bin/; ls GatewayServer TicketServer AccountDBServer GameAgentServer GameDBServer HTTPAServer LoginServer MissionServer SatelliteServer WorldServer ZoneServer CrossRouter SocietyServer config.ini 2>/dev/null | sort); do 
		cd ~/servers*/bin/; md5sum \$server;
	done
	"
done
