#!/bin/bash function buildSpigotFromSource { echo "Building Spigot $VANILLA_VERSION from source, might take a while, get some coffee" mkdir /data/temp cd /data/temp wget -q -P /data/temp https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar && \ java -jar /data/temp/BuildTools.jar --rev $VANILLA_VERSION 2>&1 |tee /data/spigot_build.log| while read l; do echo -n .; done; echo "done" mv spigot-*.jar /data/spigot_server.jar mv craftbukkit-*.jar /data/craftbukkit_server.jar echo "Cleaning up" rm -rf /data/temp cd /data } function downloadSpigot { local match case "$TYPE" in *BUKKIT|*bukkit) match="Craftbukkit" downloadUrl=${BUKKIT_DOWNLOAD_URL} getbukkitFlavor=craftbukkit ;; *) match="Spigot" downloadUrl=${SPIGOT_DOWNLOAD_URL} getbukkitFlavor=spigot ;; esac if [[ -z $downloadUrl ]]; then downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VERSION}.jar" fi echo "Downloading $match ..." if ! curl -fsSL -o $SERVER "$downloadUrl"; then cat <