diff --git a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg index 8ccd2e658..bc64ee883 100644 --- a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg @@ -11,6 +11,9 @@ ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters startparameters="" +# Version (latest|1.18.33.02) +mcversion="latest" + #### LinuxGSM Settings #### ## LinuxGSM Stats diff --git a/lgsm/functions/update_minecraft_bedrock.sh b/lgsm/functions/update_minecraft_bedrock.sh index ad22a291d..f724679a9 100644 --- a/lgsm/functions/update_minecraft_bedrock.sh +++ b/lgsm/functions/update_minecraft_bedrock.sh @@ -11,8 +11,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" randnum=$((1 + RANDOM % 5000)) fn_update_minecraft_dl(){ - latestmcbuildurl=$(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.${randnum}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*zip') - fn_fetch_file "${latestmcbuildurl}" "" "" "" "${tmpdir}" "bedrock_server.${remotebuild}.zip" + fn_fetch_file "https://minecraft.azureedge.net/bin-linux/bedrock-server-${remotebuild}.zip" "" "" "" "${tmpdir}" "bedrock_server.${remotebuild}.zip" echo -e "Extracting to ${serverfiles}...\c" if [ "${firstcommandname}" == "INSTALL" ]; then unzip -oq "${tmpdir}/bedrock_server.${remotebuild}.zip" -x "server.properties" -d "${serverfiles}" @@ -82,7 +81,12 @@ fn_update_minecraft_localbuild(){ fn_update_minecraft_remotebuild(){ # Gets remote build info. - remotebuild=$(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.${randnum}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]") + if [ "${mcversion}" == "latest" ]; then + remotebuild=$(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.${randnum}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]") + else + remotebuild="${mcversion}" + fi + if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuild variable has been set.