Adjusted VERSION handling to allow specific versions

Fixes #79
This commit is contained in:
Geoff Bourne committed 2020-07-02 17:17:52 -05:00
1 parent b8be36016e
commit 24c7a2ca7d
2 files changed
+14 -6

No files matched your search

+13 -6
View File
@@ -14,23 +14,23 @@ fi
set -e
case ${VERSION} in
case ${VERSION^^} in
1.11)
VERSION=1.11.4.2
;;
1.12)
VERSION=1.12.0.28
;;
1.13|PREVIOUS)
1.13)
VERSION=1.13.0.34
;;
1.14)
1.14|PREVIOUS)
VERSION=1.14.60.5
;;
1.16)
VERSION=1.16.0.2
VERSION=1.16.1.02
;;
*)
LATEST)
for a in data-bi-prtid data-platform; do
DOWNLOAD_URL=$(restify --attribute=${a}=serverBedrockLinux ${downloadPage} 2> /tmp/restify.out | jq -r '.[0].href' || echo '')
if [[ ${DOWNLOAD_URL} ]]; then
@@ -45,6 +45,9 @@ case ${VERSION} in
exit 2
fi
;;
*)
# use the given version exactly
;;
esac
if [ ! -f "bedrock_server-${VERSION}" ]; then
@@ -56,7 +59,11 @@ if [ ! -f "bedrock_server-${VERSION}" ]; then
TMP_ZIP=/tmp/$(basename "${DOWNLOAD_URL}")
echo "Downloading Bedrock server version ${VERSION} ..."
curl -o ${TMP_ZIP} -fsSL ${DOWNLOAD_URL}
if ! curl -o ${TMP_ZIP} -fsSL ${DOWNLOAD_URL}; then
echo "ERROR failed to download from ${DOWNLOAD_URL}"
echo " Double check that the given VERSION is valid"
exit 2
fi
# remove only binaries and some docs, to allow for an upgrade of those
rm -rf bedrock_server *.so release-notes.txt bedrock_server_how_to.html valid_known_packs.json premium_cache 2> /dev/null