@ -10,7 +10,7 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Fixes: ./dontstarve_dedicated_server_nullrenderer: ./lib32/libcurl-gnutls.so.4: no version information available (required by ./dontstarve_dedicated_server_nullrenderer)
# Issue only occures on CentOS as libcurl-gnutls.so.4 is called libcurl.so.4 on CentOS.
fn_print_info "Checking for update: ${remotelocation}: checking local build: waiting for log file: ${totalseconds}"
if[ -v "${loopignore}"];then
loopignore=1
fn_script_log_info "Waiting for log file to generate"
fi
if["${totalseconds}" -gt "120"];then
localbuild="0"
fn_print_error "Checking for update: ${remotelocation}: waiting for log file: missing log file"
fn_script_log_error "Missing log file"
fn_script_log_error "Set localbuild to 0"
sleep 0.5
fi
totalseconds=$((totalseconds +1))
done
fi
# Get current build from logs
currentbuild=$(grep "= Multi Theft Auto: San Andreas v""${gamelogdir}/server.log"| 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 0.5
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=$(grep "= Multi Theft Auto: San Andreas v""${gamelogdir}/server.log"| 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
if[ -z "${localbuild}"];then
localbuild=$(grep "= Multi Theft Auto: San Andreas v""${serverfiles}/mods/deathmatch/logs/server.log"| awk '{ print $7 }'| sed -r 's/^.{1}//'| tail -1)
fi
if[ -z "${localbuild}"];then
# Gives time for var to generate.
end=$((SECONDS+120))
totalseconds=0
while["${SECONDS}" -lt "${end}"];do
fn_print_info "Checking for update: ${remotelocation}: checking local build: waiting for local build: ${totalseconds}"
if[ -z "${loopignore}"];then
loopignore=1
fn_script_log_info "Waiting for local build to generate"
fi
localbuild=$(grep "= Multi Theft Auto: San Andreas v""${serverfiles}/mods/deathmatch/logs/server.log"| awk '{ print $7 }'| sed -r 's/^.{1}//'| tail -1)
if["${localbuild}"];then
break
fi
sleep 1
totalseconds=$((totalseconds +1))
done
fi
if[ -z "${localbuild}"];then
localbuild="0"
fn_print_error "Checking for update: ${remotelocation}: waiting for local build: missing local build info"
fn_script_log_error "Missing local build info"
fn_script_log_error "Set localbuild to 0"
else
fn_print_ok "Checking for update: ${remotelocation}: checking local build"
fn_script_log_pass "Checking local build"
fi
sleep 0.5
}
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
localmajorversion="$(grep "#define MTASA_VERSION_MAJOR""${tmpdir}/version.h"| awk '{ print $3 }'| sed 's/\r//g')"
localminorversion="$(grep "#define MTASA_VERSION_MINOR""${tmpdir}/version.h"| awk '{ print $3 }'| sed 's/\r//g')"
localmaintenanceversion="$(grep "#define MTASA_VERSION_MAINTENANCE""${tmpdir}/version.h"| awk '{ print $3 }'| sed 's/\r//g')"