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

SET=$1

echo SET${SET} | colorize yellow black

cd $HOME/servers${SET}/Log/
echo $(pwd)

for date in $(ls -hld 2021* | awk -F" " '{print $NF}'); do 
	echo ${date};
	cd $HOME/servers${SET}/Log/${date}; rsync -avz MissionServer${SET} GAMEDB${SET}:$HOME/servers${SET}/Log/${date}/.
done

cd $HOME/servers${SET}/; mv MS${SET} MissionServer${SET}
cd $HOME/servers${SET}/; rsync -avz MissionServer${SET} GAMEDB${SET}:$HOME/servers${SET}/.
cd $HOME/servers${SET}/MissionServer${SET}/; mv auto_start z_a_s
cd $HOME/servers${SET}/; mv MissionServer${SET} MS${SET}
