diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 51f691d5c..e5e6d1e5d 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v25.1.5" +modulesversion="v25.1.6" # Core diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh index dad98a1e2..bf9790132 100644 --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -164,7 +164,7 @@ fn_update_steamcmd_localbuild() { } fn_update_steamcmd_remotebuild() { - # Get remote build info. + # Gets remote build info. if [ -d "${steamcmddir}" ]; then cd "${steamcmddir}" || exit fi diff --git a/lgsm/modules/update_fctr.sh b/lgsm/modules/update_fctr.sh index b49386654..3418c7424 100644 --- a/lgsm/modules/update_fctr.sh +++ b/lgsm/modules/update_fctr.sh @@ -34,7 +34,7 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://factorio.com/get-download/${branch}/headless/${factorioarch}" remotebuildresponse=$(curl -s "${apiurl}") remotebuildversion=$(echo "${remotebuildresponse}" | grep -o '[0-9]\.[0-9]\{1,\}\.[0-9]\{1,\}' | head -1) diff --git a/lgsm/modules/update_jk2.sh b/lgsm/modules/update_jk2.sh index 098154499..5fdd54c65 100644 --- a/lgsm/modules/update_jk2.sh +++ b/lgsm/modules/update_jk2.sh @@ -31,7 +31,7 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://api.github.com/repos/mvdevs/jk2mv/releases/latest" remotebuildresponse=$(curl -s "${apiurl}") remotebuildfilename=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("dedicated.zip")) | .name') diff --git a/lgsm/modules/update_mc.sh b/lgsm/modules/update_mc.sh index 0ce4e2e39..a9be77576 100644 --- a/lgsm/modules/update_mc.sh +++ b/lgsm/modules/update_mc.sh @@ -34,7 +34,7 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://launchermeta.mojang.com/mc/game/version_manifest.json" remotebuildresponse=$(curl -s "${apiurl}") # Latest release. diff --git a/lgsm/modules/update_mcb.sh b/lgsm/modules/update_mcb.sh index 8154b813e..a8616c3b8 100644 --- a/lgsm/modules/update_mcb.sh +++ b/lgsm/modules/update_mcb.sh @@ -38,7 +38,7 @@ fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" # Uses log file to get local build. - localbuild=$(grep Version "${consolelogdir}"/* 2> /dev/null | tail -1 | sed 's/.*Version: //' | tr -d '\000-\011\013-\037') + localbuild=$(grep -hoP 'Version:\s*\K[\d.]+' "${consolelogdir}"/* 2> /dev/null | sort -V -r | head -n1) if [ -z "${localbuild}" ]; then fn_print_error "Checking local build: ${remotelocation}: missing local build info" fn_script_log_error "Missing local build info" @@ -51,15 +51,18 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Random number for userAgent - randomint=$(tr -dc 0-9 < /dev/urandom 2> /dev/null | head -c 4 | xargs) - # Get remote build info. - if [ "${mcversion}" == "latest" ]; then - remotebuildversion=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -Ls -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.${randomint}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://www.minecraft.net/bedrockdedicatedserver/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]") + # Gets remote build info. + apiurl="https://net-secondary.web.minecraft-services.net/api/v1.0/download/links" + remotebuildresponse=$(curl -s "${apiurl}" | jq '.result.links[]') + # Latest preview. + if [ "${mcversion}" == "preview" ]; then + remotebuildurl=$(echo "${remotebuildresponse}" | jq -r 'select(.downloadType == "serverBedrockPreviewLinux") | .downloadUrl') + # Latest release. else - remotebuildversion="${mcversion}" + remotebuildurl=$(echo "${remotebuildresponse}" | jq -r 'select(.downloadType == "serverBedrockLinux") | .downloadUrl') fi - remotebuildurl="https://www.minecraft.net/bedrockdedicatedserver/bin-linux/bedrock-server-${remotebuildversion}.zip" + remotebuildversion=$(echo "${remotebuildurl}" | grep -Eo "[.0-9]+[0-9]") + remotebuildfilename="bedrock-server-${remotebuildversion}.zip" if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" diff --git a/lgsm/modules/update_mta.sh b/lgsm/modules/update_mta.sh index c7214665d..50a3fb895 100644 --- a/lgsm/modules/update_mta.sh +++ b/lgsm/modules/update_mta.sh @@ -34,7 +34,7 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://linux.multitheftauto.com/revision/latest.txt" remotebuildresponse=$(curl -s "${apiurl}") remotebuildfilename="multitheftauto_linux_x64.tar.gz" diff --git a/lgsm/modules/update_pmc.sh b/lgsm/modules/update_pmc.sh index 9c288827e..c38911d4e 100644 --- a/lgsm/modules/update_pmc.sh +++ b/lgsm/modules/update_pmc.sh @@ -32,7 +32,7 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://api.papermc.io/v2/projects" # Get list of projects. remotebuildresponse=$(curl -s "${apiurl}") diff --git a/lgsm/modules/update_ts3.sh b/lgsm/modules/update_ts3.sh index 92f9d3489..e1917e5e1 100644 --- a/lgsm/modules/update_ts3.sh +++ b/lgsm/modules/update_ts3.sh @@ -31,7 +31,7 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://www.teamspeak.com/versions/server.json" remotebuildresponse=$(curl -s "${apiurl}") diff --git a/lgsm/modules/update_ut99.sh b/lgsm/modules/update_ut99.sh index 5f30bdc23..bdfb96f0b 100644 --- a/lgsm/modules/update_ut99.sh +++ b/lgsm/modules/update_ut99.sh @@ -32,7 +32,7 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://api.github.com/repos/OldUnreal/UnrealTournamentPatches/releases/latest" remotebuildresponse=$(curl -s "${apiurl}") remotebuildfilename=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("Linux-amd64")) | .name') diff --git a/lgsm/modules/update_vints.sh b/lgsm/modules/update_vints.sh index d468d58d4..4021af11a 100644 --- a/lgsm/modules/update_vints.sh +++ b/lgsm/modules/update_vints.sh @@ -34,7 +34,7 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="http://api.vintagestory.at/stable-unstable.json" remotebuildresponse=$(curl -s "${apiurl}") if [ "${branch}" == "stable" ]; then diff --git a/lgsm/modules/update_xnt.sh b/lgsm/modules/update_xnt.sh index 7014ab1a9..f043a4227 100644 --- a/lgsm/modules/update_xnt.sh +++ b/lgsm/modules/update_xnt.sh @@ -36,7 +36,7 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://api.github.com/repos/xonotic/xonotic/tags" remotebuildresponse=$(curl -s "${apiurl}") remotebuildtag=$(echo "${remotebuildresponse}" | jq -r '.[0].name') diff --git a/linuxgsm.sh b/linuxgsm.sh index af7c182dd..6d6f7251f 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -24,7 +24,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v25.1.5" +version="v25.1.6" shortname="core" gameservername="core" commandname="CORE"