Enhanced version check to use existing download if website fails

For #87 #88
This commit is contained in:
Geoff Bourne committed 2020-07-22 18:48:05 -05:00
1 parent ed929e3771
commit f6e34594df
1 file changed
+3
+3
View File
@@ -39,6 +39,9 @@ case ${VERSION^^} in
done done
if [[ ${DOWNLOAD_URL} =~ http.*/.*-(.*)\.zip ]]; then if [[ ${DOWNLOAD_URL} =~ http.*/.*-(.*)\.zip ]]; then
VERSION=${BASH_REMATCH[1]} VERSION=${BASH_REMATCH[1]}
elif [[ $(ls 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"
else else
echo "Failed to extract download URL '${DOWNLOAD_URL}' from ${downloadPage}" echo "Failed to extract download URL '${DOWNLOAD_URL}' from ${downloadPage}"
cat /tmp/restify.out cat /tmp/restify.out