Default downloads to subdir of /data (#476)
This commit is contained in:
1 parent
ee01883eae
commit
6091176128
1 file changed
+5
-5
+5
-5
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
||||||
: "${TMP_DIR:=/tmp}"
|
: "${DOWNLOAD_DIR:=${PWD}/.downloads}"
|
||||||
: "${PREVIEW:=false}"
|
: "${PREVIEW:=false}"
|
||||||
|
|
||||||
function isTrue() {
|
function isTrue() {
|
||||||
@@ -67,7 +67,7 @@ if [[ ${DEBUG^^} == TRUE ]]; then
|
|||||||
echo " current directory is $(pwd)"
|
echo " current directory is $(pwd)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export HOME=/data
|
export HOME="${PWD}"
|
||||||
|
|
||||||
downloadPage=https://www.minecraft.net/en-us/download/server/bedrock
|
downloadPage=https://www.minecraft.net/en-us/download/server/bedrock
|
||||||
|
|
||||||
@@ -104,8 +104,8 @@ esac
|
|||||||
|
|
||||||
if [[ ! -f "bedrock_server-${VERSION}" ]]; then
|
if [[ ! -f "bedrock_server-${VERSION}" ]]; then
|
||||||
|
|
||||||
[[ $TMP_DIR != /tmp ]] && mkdir -p "$TMP_DIR"
|
[[ $DOWNLOAD_DIR != /tmp ]] && mkdir -p "$DOWNLOAD_DIR"
|
||||||
TMP_ZIP="$TMP_DIR/$(basename "${DOWNLOAD_URL}")"
|
TMP_ZIP="$DOWNLOAD_DIR/$(basename "${DOWNLOAD_URL}")"
|
||||||
|
|
||||||
echo "Downloading Bedrock server version ${VERSION} ..."
|
echo "Downloading Bedrock server version ${VERSION} ..."
|
||||||
if ! curl "${curlArgs[@]}" -o "${TMP_ZIP}" -A "itzg/minecraft-bedrock-server" -fsSL "${DOWNLOAD_URL}"; then
|
if ! curl "${curlArgs[@]}" -o "${TMP_ZIP}" -A "itzg/minecraft-bedrock-server" -fsSL "${DOWNLOAD_URL}"; then
|
||||||
@@ -146,7 +146,7 @@ if [[ ! -f "bedrock_server-${VERSION}" ]]; then
|
|||||||
# Do not overwrite existing files, which means the cleanup above needs to account for things
|
# Do not overwrite existing files, which means the cleanup above needs to account for things
|
||||||
# that MUST be replaced on upgrade
|
# that MUST be replaced on upgrade
|
||||||
unzip -q -n "${TMP_ZIP}"
|
unzip -q -n "${TMP_ZIP}"
|
||||||
[[ $TMP_DIR != /tmp ]] && rm -rf "$TMP_DIR"
|
[[ $DOWNLOAD_DIR != /tmp ]] && rm -rf "$DOWNLOAD_DIR"
|
||||||
|
|
||||||
chmod +x bedrock_server
|
chmod +x bedrock_server
|
||||||
mv bedrock_server "bedrock_server-${VERSION}"
|
mv bedrock_server "bedrock_server-${VERSION}"
|
||||||
|
|||||||
Reference in new issue
Block a user