#!/bin/bash

source ~/.gamerc

CURRENT_DIRECTORY=$(pwd)
SERVER_NAME=$(basename ${CURRENT_DIRECTORY})
ERROR_LOG_NAME=$(ls -hltra Error* -hltra | awk -F" " '{print $9}' | tail -n 1)
TEST_SERVER_IP=${TEST_SERVER_GLOBAL_IP}
TEST_SERVER_DEBUG_ERROR_LOG_DIRECTORY='core/live_debug_log'

scp ${ERROR_LOG_NAME} ${TEST_SERVER_IP}:${WORKING_DIRECTORY}/www/${TEST_SERVER_DEBUG_ERROR_LOG_DIRECTORY}/${SERVER_NAME}_${ERROR_LOG_NAME}

echo http://${TEST_SERVER_GLOBAL_IP}/${TEST_SERVER_DEBUG_ERROR_LOG_DIRECTORY}/${SERVER_NAME}_${ERROR_LOG_NAME}
