mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-04-22 21:39:26 +00:00
fix/681 (#719)
* [shellcheck] prevent globbing * fix/681 remove old PaperMC before downloading new Fixes #681 Co-authored-by: Dubhar <thorsten.jerosch@gmail.com>
This commit is contained in:
@@ -28,7 +28,7 @@ else
|
|||||||
VANILLA_VERSION=$(echo "$versions" | jq -r '.versions[-1]')
|
VANILLA_VERSION=$(echo "$versions" | jq -r '.versions[-1]')
|
||||||
log "WARN: using ${VANILLA_VERSION} since that's the latest provided by PaperMC"
|
log "WARN: using ${VANILLA_VERSION} since that's the latest provided by PaperMC"
|
||||||
# re-execute the current script with the newly computed version
|
# re-execute the current script with the newly computed version
|
||||||
exec $0 "$@"
|
exec "$0" "$@"
|
||||||
fi
|
fi
|
||||||
log "ERROR: ${VANILLA_VERSION} is not published by PaperMC"
|
log "ERROR: ${VANILLA_VERSION} is not published by PaperMC"
|
||||||
log " Set VERSION to one of the following: "
|
log " Set VERSION to one of the following: "
|
||||||
@@ -56,6 +56,10 @@ else
|
|||||||
zarg=(-z "$SERVER")
|
zarg=(-z "$SERVER")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
log "Removing old PaperMC versions ..."
|
||||||
|
paperJarSearchString=${SERVER/$build/[0-9]*}
|
||||||
|
find . -name "$paperJarSearchString" ! -name "$SERVER" -delete -print
|
||||||
|
|
||||||
log "Downloading PaperMC $VANILLA_VERSION (build $build) ..."
|
log "Downloading PaperMC $VANILLA_VERSION (build $build) ..."
|
||||||
curl -fsSL -o "$SERVER" "${zarg[@]}" \
|
curl -fsSL -o "$SERVER" "${zarg[@]}" \
|
||||||
"https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}/downloads/${SERVER}" \
|
"https://papermc.io/api/v2/projects/paper/versions/${VANILLA_VERSION}/builds/${build}/downloads/${SERVER}" \
|
||||||
@@ -71,4 +75,4 @@ export TYPE=SPIGOT
|
|||||||
export SKIP_LOG4J_CONFIG=true
|
export SKIP_LOG4J_CONFIG=true
|
||||||
|
|
||||||
# Continue to Final Setup
|
# Continue to Final Setup
|
||||||
exec ${SCRIPTS:-/}start-finalSetupWorld $@
|
exec ${SCRIPTS:-/}start-finalSetupWorld "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user