59 lines
1.2 KiB
Bash
Executable File
59 lines
1.2 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
meta_dir="docker_meta"
|
|
|
|
if test ! -f "$meta_dir/config_done"; then
|
|
# TODO: Use config/paper-global.yml with new config keys for 1.19+ Paper
|
|
config_path="paper.yml"
|
|
|
|
config=""
|
|
|
|
if test "$VELOCITY_ENABLE" = "true"; then
|
|
echo "online-mode=false" > server.properties
|
|
|
|
velocity=$(cat << EOF
|
|
settings:
|
|
velocity-support:
|
|
enabled: true
|
|
online-mode: true
|
|
secret: '$VELOCITY_SECRET'
|
|
EOF
|
|
)
|
|
|
|
config="${config}${velocity}"
|
|
fi
|
|
|
|
if test ! -z "$config"; then
|
|
echo "Writing config"
|
|
echo "$config" > $config_path
|
|
fi
|
|
|
|
echo "eula=true" > eula.txt
|
|
|
|
mkdir -p "$meta_dir" && touch "$meta_dir/setup_done"
|
|
else
|
|
echo "Configuration is done"
|
|
fi
|
|
|
|
if test "$PAPER_DONT_DOWNLOAD_ON_START" != "true"; then
|
|
echo $MC_VERSION
|
|
version=$MC_VERSION
|
|
echo "Downloading version $version"
|
|
|
|
apiURL=https://api.papermc.io/v2/projects/paper
|
|
|
|
build=$(curl -X GET $apiURL/versions/$version/builds | jq -r ".builds[-1].build")
|
|
echo "Build is $build"
|
|
|
|
url=$apiURL/versions/$version/builds/$build/downloads/paper-$version-$build.jar
|
|
echo "Full URL is: $url"
|
|
|
|
echo "Downloading to $PWD"
|
|
wget -O paper.jar $url
|
|
else
|
|
echo "Skipping Paper download"
|
|
fi
|
|
|
|
echo "> $@"
|
|
exec "$@"
|