From 5bc02e1afc6e13d69e3560413b0bb3c0211ff148 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 30 Nov 2020 18:24:49 -0600 Subject: [PATCH] Added DEBUG option For #113 --- bedrock-entry.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bedrock-entry.sh b/bedrock-entry.sh index 72dea07..69ce7d0 100755 --- a/bedrock-entry.sh +++ b/bedrock-entry.sh @@ -1,5 +1,12 @@ #!/bin/bash +set -eo pipefail + +if [[ ${DEBUG^^} = TRUE ]]; then + set -x + curlArgs=(-v) +fi + downloadPage=https://www.minecraft.net/en-us/download/server/bedrock/ if [[ ${EULA^^} != TRUE ]]; then @@ -12,8 +19,6 @@ if [[ ${EULA^^} != TRUE ]]; then exit 1 fi -set -e - case ${VERSION^^} in 1.11) VERSION=1.11.4.2 @@ -67,7 +72,7 @@ if [ ! -f "bedrock_server-${VERSION}" ]; then TMP_ZIP=/tmp/$(basename "${DOWNLOAD_URL}") echo "Downloading Bedrock server version ${VERSION} ..." - if ! curl -o ${TMP_ZIP} -fsSL ${DOWNLOAD_URL}; then + if ! curl "${curlArgs[@]}" -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