From 5e1f00e044b56961d8fe9cd619c8e0d6c326da58 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 2 Mar 2020 15:06:53 -0600 Subject: [PATCH] Enhanced download URL logic to try both known attributes For #31 --- bedrock-entry.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bedrock-entry.sh b/bedrock-entry.sh index 704aa00..cea3b41 100755 --- a/bedrock-entry.sh +++ b/bedrock-entry.sh @@ -26,7 +26,12 @@ case ${VERSION} in VERSION=1.14.30.2 ;; *) - DOWNLOAD_URL=$(restify --attribute=data-bi-prtid=serverBedrockLinux https://www.minecraft.net/en-us/download/server/bedrock/ | jq -r '.[0].href') + for a in data-bi-prtid data-platform; do + DOWNLOAD_URL=$(restify --attribute=${a}=serverBedrockLinux https://www.minecraft.net/en-us/download/server/bedrock/ 2> /dev/null | jq -r '.[0].href' || echo '') + if [[ ${DOWNLOAD_URL} ]]; then + break + fi + done if [[ ${DOWNLOAD_URL} =~ http.*/.*-(.*)\.zip ]]; then VERSION=${BASH_REMATCH[1]} else