mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
56 lines
1.2 KiB
Bash
Executable File
56 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# shellcheck source=start-utils
|
|
. "${SCRIPTS:-/}start-utils"
|
|
set -o pipefail
|
|
handleDebugMode
|
|
|
|
: "${PAPER_PROJECT:=paper}"
|
|
: "${PAPERBUILD:=}"
|
|
: "${PAPER_DOWNLOAD_URL:=}"
|
|
: "${PAPER_CUSTOM_JAR:=}"
|
|
|
|
resultsFile=/data/.paper.env
|
|
if [[ $PAPER_CUSTOM_JAR ]]; then
|
|
export SERVER="$PAPER_CUSTOM_JAR"
|
|
elif [[ $PAPER_DOWNLOAD_URL ]]; then
|
|
if ! mc-image-helper install-paper \
|
|
--output-directory=/data \
|
|
--results-file="$resultsFile" \
|
|
--url="$PAPER_DOWNLOAD_URL"; then
|
|
log "ERROR: failed to download from custom PaperMC URL"
|
|
exit 1
|
|
fi
|
|
# grab SERVER and export it
|
|
set -a
|
|
# shellcheck disable=SC1090
|
|
source "${resultsFile}"
|
|
set +a
|
|
|
|
else
|
|
args=(
|
|
--output-directory=/data
|
|
--results-file="$resultsFile"
|
|
--project="$PAPER_PROJECT"
|
|
--version="$VERSION"
|
|
)
|
|
if [[ $PAPERBUILD ]]; then
|
|
args+=(--build="$PAPERBUILD")
|
|
fi
|
|
if ! mc-image-helper install-paper "${args[@]}"; then
|
|
log "ERROR: failed to download $PAPER_PROJECT"
|
|
exit 1
|
|
fi
|
|
# grab SERVER and export it
|
|
set -a
|
|
# shellcheck disable=SC1090
|
|
source "${resultsFile}"
|
|
set +a
|
|
|
|
fi
|
|
|
|
# Normalize on Spigot for downstream operations
|
|
export FAMILY=SPIGOT
|
|
|
|
exec "${SCRIPTS:-/}start-spiget" "$@"
|