From fc2c83f1ea13ff4dcfb3202557d8bc8e7287431e Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Thu, 26 Jul 2018 01:10:19 +0200 Subject: [PATCH] Reliable way to select latest Minecraft release fixes #1961 --- lgsm/functions/update_minecraft.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/update_minecraft.sh b/lgsm/functions/update_minecraft.sh index c02fa932b..947de934a 100644 --- a/lgsm/functions/update_minecraft.sh +++ b/lgsm/functions/update_minecraft.sh @@ -9,7 +9,8 @@ local commandaction="Update" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl(){ - latestmcbuildurl=$(${curlpath} -s $(${curlpath} -s "https://launchermeta.mojang.com/mc/game/version_manifest.json" | jq -r '.versions[0] | .url') | jq -r '.downloads.server.url') + latestmcreleaselink=$(${curlpath} -s "https://launchermeta.mojang.com/mc/game/version_manifest.json" | jq -r '.latest.release as $latest | .versions[] | select(.id == $latest) | .url') + latestmcbuildurl=$(${curlpath} -s "${latestmcreleaselink}" | jq -r '.downloads.server.url') fn_fetch_file "${latestmcbuildurl}" "${tmpdir}" "minecraft_server.${availablebuild}.jar" echo -e "copying to ${serverfiles}...\c" fn_script_log "Copying to ${serverfiles}"