|
@@ -11,13 +11,17 @@ fn_update_dl() {
|
|
|
# Download and extract files to tmpdir.
|
|
# Download and extract files to tmpdir.
|
|
|
fn_fetch_file "http://linux.mtasa.com/dl/multitheftauto_linux_x64.tar.gz" "" "" "" "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "nochmodx" "norun" "force" "nohash"
|
|
fn_fetch_file "http://linux.mtasa.com/dl/multitheftauto_linux_x64.tar.gz" "" "" "" "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "nochmodx" "norun" "force" "nohash"
|
|
|
fn_dl_extract "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "${serverfiles}" "multitheftauto_linux_x64"
|
|
fn_dl_extract "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "${serverfiles}" "multitheftauto_linux_x64"
|
|
|
|
|
+ fn_clear_tmp
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
fn_update_localbuild() {
|
|
fn_update_localbuild() {
|
|
|
# Gets local build info.
|
|
# Gets local build info.
|
|
|
fn_print_dots "Checking local build: ${remotelocation}"
|
|
fn_print_dots "Checking local build: ${remotelocation}"
|
|
|
- # Uses log file to get local build.
|
|
|
|
|
- localbuild=$(grep "= Multi Theft Auto: San Andreas v" "${serverfiles}/mods/deathmatch/logs/server.log" | awk '{ print $7 }' | sed -r 's/^.{1}//' | tail -1)
|
|
|
|
|
|
|
+ # Uses executable to get local build.
|
|
|
|
|
+ if [ -d "${executabledir}" ]; then
|
|
|
|
|
+ cd "${executabledir}" || exit
|
|
|
|
|
+ localbuild=$(${executable} -v 2> /dev/null)
|
|
|
|
|
+ fi
|
|
|
if [ -z "${localbuild}" ]; then
|
|
if [ -z "${localbuild}" ]; then
|
|
|
fn_print_error "Checking local build: ${remotelocation}: missing local build info"
|
|
fn_print_error "Checking local build: ${remotelocation}: missing local build info"
|
|
|
fn_script_log_error "Missing local build info"
|
|
fn_script_log_error "Missing local build info"
|
|
@@ -31,11 +35,11 @@ fn_update_localbuild() {
|
|
|
|
|
|
|
|
fn_update_remotebuild() {
|
|
fn_update_remotebuild() {
|
|
|
# Get remote build info.
|
|
# Get remote build info.
|
|
|
- apiurl="https://api.github.com/repos/multitheftauto/mtasa-blue/releases/latest"
|
|
|
|
|
|
|
+ apiurl="https://linux.multitheftauto.com/revision/latest.txt"
|
|
|
remotebuildresponse=$(curl -s "${apiurl}")
|
|
remotebuildresponse=$(curl -s "${apiurl}")
|
|
|
- remotebuildfilename=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("Linux-amd64")) | .name')
|
|
|
|
|
- remotebuildurl=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("Linux-amd64")) | .browser_download_url')
|
|
|
|
|
- remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '.tag_name')
|
|
|
|
|
|
|
+ remotebuildfilename="multitheftauto_linux_x64.tar.gz"
|
|
|
|
|
+ remotebuildurl="http://linux.mtasa.com/dl/multitheftauto_linux_x64.tar.gz"
|
|
|
|
|
+ remotebuildversion=$(echo "${remotebuildresponse}")
|
|
|
if [ "${firstcommandname}" != "INSTALL" ]; then
|
|
if [ "${firstcommandname}" != "INSTALL" ]; then
|
|
|
fn_print_dots "Checking remote build: ${remotelocation}"
|
|
fn_print_dots "Checking remote build: ${remotelocation}"
|
|
|
# Checks if remotebuildversion variable has been set.
|
|
# Checks if remotebuildversion variable has been set.
|