From 2fba83fd15f97c2577d12d1b15c0062a4f18e47d Mon Sep 17 00:00:00 2001 From: Salt Date: Sat, 29 May 2021 14:22:53 -0500 Subject: [PATCH] Add the ability to define a configuration repo that's also live-downloaded --- README.md | 1 + start-server.sh | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/README.md b/README.md index 73cc88c..aa4bb00 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ variable|description `JRE_XMX`|Maximum amount of heap passed to the main Minecraft process `JRE_XMS`|Minimum heap size passed to the main Minecraft process `FORGE_PACK_ZIP`|If provided, the URL to a zip or tar.gz file that contains the modpack that needs to be installed. Will be intelligently extracted into the server directory through the magic of `find`. +`CONFIG_REPO`|If provided, the URI to a git repository that contains configuration to copy over top the pack. The root of the repo will be the root of the server directory. `ARGS`|Any additional arguments to be passed to the JVM ## Useful Arguments diff --git a/start-server.sh b/start-server.sh index efdac89..1fe29c7 100755 --- a/start-server.sh +++ b/start-server.sh @@ -20,6 +20,17 @@ if [ -n "$FORGE_PACK_ZIP" ]; then popd > /dev/null 2>&1 fi +# Then also download and extract a config repo, if one exists +if [ -n "$CONFIG_REPO" ]; then + echo "Downloading config repo: $CONFIG_REPO" + tmpdir="$(mktemp -d)" + pushd "$tmpdir" > /dev/null 2>&1 + git clone "$CONFIG_REPO" . + rm -rf .git + rsync -av ./ /minecraft/ + popd > /dev/null 2>&1 +fi + # Entrypoint will be server.jar args="-jar server.jar nogui"