fn_print_fail_nl "Checking for update: linux.mtasa.com: Still No logs with server version found"
fn_script_log_fatal "Checking for update: linux.mtasa.com: Still No logs with server version found"
core_exit.sh
fi
fi
# Gets current build info
# Checks if current build info is available. If it fails, then a server restart will be forced to generate logs.
if[ ! -f "${gamelogdir}"/server.log];then
fn_print_error "Checking for update: linux.mtasa.com"
sleep 1
fn_print_error_nl "Checking for update: linux.mtasa.com: No logs with server version found"
fn_script_log_error "Checking for update: linux.mtasa.com: No logs with server version found"
sleep 1
fn_print_info_nl "Checking for update: linux.mtasa.com: Forcing server restart"
fn_script_log_info "Checking for update: linux.mtasa.com: Forcing server restart"
sleep 1
exitbypass=1
command_stop.sh
exitbypass=1
command_start.sh
sleep 1
# Check again and exit on failure.
if[ ! -f "${gamelogdir}"/server.log];then
fn_print_fail_nl "Checking for update: linux.mtasa.com: Still No logs with server version found"
fn_script_log_fatal "Checking for update: linux.mtasa.com: Still No logs with server version found"
core_exit.sh
fi
fi
# Get current build from logs
currentbuild=$(awk -F"= Multi Theft Auto: San Andreas v"'{print $2}'"${consolelogdir}"/"${servicename}"-console.log | awk '{print $1}')
if[ -z "${currentbuild}"];then
fn_print_error_nl "Checking for update: linux.mtasa.com: Current build version not found"
fn_script_log_error "Checking for update: linux.mtasa.com: Current build version not found"
sleep 1
fn_print_info_nl "Checking for update: linux.mtasa.com: Forcing server restart"
fn_script_log_info "Checking for update: linux.mtasa.com: Forcing server restart"
exitbypass=1
command_stop.sh
exitbypass=1
command_start.sh
currentbuild=$(awk -F"= Multi Theft Auto: San Andreas v"'{print $2}'"${consolelogdir}"/"${servicename}"-console.log | awk '{print $1}')
if[ -z "${currentbuild}"];then
fn_print_fail_nl "Checking for update: linux.mtasa.com: Current build version still not found"
fn_script_log_fatal "Checking for update: linux.mtasa.com: Current build version still not found"
core_exit.sh
fi
fi
# Get current build from logs
currentbuild=$(cat "${gamelogdir}"/server.log | grep "= Multi Theft Auto: San Andreas v"| awk '{ print $7 }'| sed -r 's/^.{1}//'| tail -1)
if[ -z "${currentbuild}"];then
fn_print_error_nl "Checking for update: linux.mtasa.com: Current build version not found"
fn_script_log_error "Checking for update: linux.mtasa.com: Current build version not found"
sleep 1
fn_print_info_nl "Checking for update: linux.mtasa.com: Forcing server restart"
fn_script_log_info "Checking for update: linux.mtasa.com: Forcing server restart"
exitbypass=1
command_stop.sh
exitbypass=1
command_start.sh
currentbuild=$(cat "${gamelogdir}"/server.log | grep "= Multi Theft Auto: San Andreas v"| awk '{ print $7 }'| sed -r 's/^.{1}//'| tail -1)
if[ -z "${currentbuild}"];then
fn_print_fail_nl "Checking for update: linux.mtasa.com: Current build version still not found"
fn_script_log_fatal "Checking for update: linux.mtasa.com: Current build version still not found"
core_exit.sh
fi
fi
}
fn_mta_get_availablebuild()
{
fn_fetch_file "https://raw.githubusercontent.com/multitheftauto/mtasa-blue/master/Server/version.h""${tmpdir}""version.h"# we need to find latest stable version here
fn_fetch_file "https://raw.githubusercontent.com/multitheftauto/mtasa-blue/master/Server/version.h""${tmpdir}""version.h"# we need to find latest stable version here