From d6392f3aa95336ae89b5232d9f1cdfd3c737ac88 Mon Sep 17 00:00:00 2001 From: Rob Weddell Date: Mon, 17 Jul 2017 11:48:23 +0100 Subject: [PATCH] Add support for a zip file of mod configs to be supplied! This was added such that Sponge servers are supported. (For Sponge: TYPE=FORGE, MODPACK=[zip including sponge plugins and jar], MODCONFIG=[sponge configuration]) --- minecraft-server/start-minecraft.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/minecraft-server/start-minecraft.sh b/minecraft-server/start-minecraft.sh index 7474993e..a1f019e1 100755 --- a/minecraft-server/start-minecraft.sh +++ b/minecraft-server/start-minecraft.sh @@ -425,6 +425,28 @@ case "X$MODPACK" in esac fi +# If supplied with a URL for a config (simple zip of configurations), download it and unpack +if [[ "$MODCONFIG" ]]; then +case "X$MODCONFIG" in + X[Hh][Tt][Tt][Pp]*[Zz][iI][pP]) + echo "Downloading mod/plugin configs via HTTP" + echo " from $MODCONFIG ..." + curl -sSL -o /tmp/modconfig.zip "$MODCONFIG" + if [ "$TYPE" = "SPIGOT" ]; then + mkdir -p /data/plugins + unzip -o -d /data/plugins /tmp/modconfig.zip + else + mkdir -p /data/config + unzip -o -d /data/config /tmp/modconfig.zip + fi + rm -f /tmp/modconfig.zip + ;; + *) + echo "Invalid URL given for modconfig: Must be HTTP or HTTPS and a ZIP file" + ;; +esac +fi + function setServerProp { local prop=$1 local var=$2