docker-minecraft-server/minecraft-server/start-finalSetup03Modconfig
Michael Reichenbach a316bd8f95 fix(minecraft-server): filter env replacement file
Environment variable replacement now only affects matching file types.

Closes #299
2019-03-29 12:11:42 +01:00

26 lines
715 B
Bash

#!/bin/bash
# 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
exec /start-finalSetup04ServerProperties $@