[mc] Add Bukkit/Spigot support to MODPACK download-install

This commit is contained in:
Geoff Bourne 2016-01-03 09:37:27 -06:00
parent 9a90acab23
commit 1be18346ce
2 changed files with 14 additions and 8 deletions

View File

@ -352,16 +352,17 @@ will be deleted when the container is deleted.
you should use an IP address or a globally resolveable FQDN, or else the you should use an IP address or a globally resolveable FQDN, or else the
name of a linked container. name of a linked container.
### Downloadable mod pack ### Downloadable mod/plugin pack for Forge, Bukkit, and Spigot Servers
Like the `WORLD` option above, you can specify the URL of a "mod pack" Like the `WORLD` option above, you can specify the URL of a "mod pack"
to download and install into the `mods` directory. To use this option to download and install into `mods` for Forge or `plugins` for Bukkit/Spigot.
pass the environment variable `MODPACK`, such as To use this option pass the environment variable `MODPACK`, such as
docker run -d -e MODPACK=http://www.example.com/mods/modpack.zip ... docker run -d -e MODPACK=http://www.example.com/mods/modpack.zip ...
**NOTE:** The referenced URL must be a zip file with one or more Forge jar files at the **NOTE:** The referenced URL must be a zip file with one or more jar files at the
top level of the zip archive. top level of the zip archive. Make sure the jars are compatible with the
particular `TYPE` of server you are running.
## JVM Configuration ## JVM Configuration

View File

@ -157,11 +157,16 @@ fi
if [[ "$MODPACK" ]]; then if [[ "$MODPACK" ]]; then
case "X$MODPACK" in case "X$MODPACK" in
X[Hh][Tt][Tt][Pp]*[Zz][iI][pP]) X[Hh][Tt][Tt][Pp]*[Zz][iI][pP])
echo "Downloading mod pack via HTTP" echo "Downloading mod/plugin pack via HTTP"
echo "$MODPACK" echo "$MODPACK"
mkdir -p /data/mods
wget -q -O /tmp/modpack.zip "$MODPACK" wget -q -O /tmp/modpack.zip "$MODPACK"
unzip -d /data/mods /tmp/modpack.zip if [ "$TYPE" = "SPIGOT" ]; then
mkdir -p /data/plugins
unzip -d /data/plugins /tmp/modpack.zip
else
mkdir -p /data/mods
unzip -d /data/mods /tmp/modpack.zip
fi
rm -f /tmp/modpack.zip rm -f /tmp/modpack.zip
;; ;;
*) *)