From 6eb95966f95f15c5767a28830c8b3c478905f37c Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 12 Mar 2021 13:42:04 -0600 Subject: [PATCH] Work around download page's removal of automation friendly link --- bedrock-entry.sh | 51 ++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/bedrock-entry.sh b/bedrock-entry.sh index fa595ab..02e1c6e 100755 --- a/bedrock-entry.sh +++ b/bedrock-entry.sh @@ -35,32 +35,33 @@ case ${VERSION^^} in 1.16.1) VERSION=1.16.1.02 ;; - 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 + 1.16|LATEST) + VERSION=1.16.210.05 ;; + # 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 ;;