From 9fead3d966b09e8df40d1f9af79b300be467211c Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 13 Mar 2021 08:52:45 -0600 Subject: [PATCH] Reverting 6eb95966f95f15c5767a28830c8b3c478905f37c --- bedrock-entry.sh | 51 ++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/bedrock-entry.sh b/bedrock-entry.sh index 02e1c6e..fa595ab 100755 --- a/bedrock-entry.sh +++ b/bedrock-entry.sh @@ -35,33 +35,32 @@ case ${VERSION^^} in 1.16.1) VERSION=1.16.1.02 ;; - 1.16|LATEST) - VERSION=1.16.210.05 + 1.16) + VERSION=1.16.20.03 + ;; + LATEST) + for a in data-bi-prtid data-platform; do + for i in {1..3}; do + DOWNLOAD_URL=$(restify --attribute=${a}=serverBedrockLinux ${downloadPage} 2> restify.err | jq -r '.[0].href' || echo '') + if [[ ${DOWNLOAD_URL} ]]; then + break 2 + fi + done + done + if [[ ${DOWNLOAD_URL} =~ http.*/.*-(.*)\.zip ]]; then + VERSION=${BASH_REMATCH[1]} + elif [[ $(ls -rv bedrock_server-* 2> /dev/null|head -1) =~ bedrock_server-(.*) ]]; then + VERSION=${BASH_REMATCH[1]} + echo "WARN Minecraft download page failed, so using existing download of $VERSION" + cat restify.err + else + echo "Failed to extract download URL '${DOWNLOAD_URL}' from ${downloadPage}" + cat restify.err + rm restify.err + exit 2 + fi + rm restify.err ;; - # TODO find a new way to lookup latest version since download page now requires EULA ack -# LATEST) -# for a in data-bi-prtid data-platform; do -# for i in {1..3}; do -# DOWNLOAD_URL=$(restify --attribute=${a}=serverBedrockLinux ${downloadPage} 2> restify.err | jq -r '.[0].href' || echo '') -# if [[ ${DOWNLOAD_URL} ]]; then -# break 2 -# fi -# done -# done -# if [[ ${DOWNLOAD_URL} =~ http.*/.*-(.*)\.zip ]]; then -# VERSION=${BASH_REMATCH[1]} -# elif [[ $(ls -rv bedrock_server-* 2> /dev/null|head -1) =~ bedrock_server-(.*) ]]; then -# VERSION=${BASH_REMATCH[1]} -# echo "WARN Minecraft download page failed, so using existing download of $VERSION" -# cat restify.err -# else -# echo "Failed to extract download URL '${DOWNLOAD_URL}' from ${downloadPage}" -# cat restify.err -# rm restify.err -# exit 2 -# fi -# rm restify.err -# ;; *) # use the given version exactly ;;