From ba4578f451f19c51e0c503aa3d91ef27be9fe1f6 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 18 Aug 2018 18:51:45 -0500 Subject: [PATCH] mc: check validity of downloaded bukkit/spigot jar Fixes #242 --- minecraft-server/start-deployBukkitSpigot | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/minecraft-server/start-deployBukkitSpigot b/minecraft-server/start-deployBukkitSpigot index 6f6da56a..c30d2852 100755 --- a/minecraft-server/start-deployBukkitSpigot +++ b/minecraft-server/start-deployBukkitSpigot @@ -17,7 +17,7 @@ function downloadSpigot { local match case "$TYPE" in *BUKKIT|*bukkit) - match="Craftbukkit" + match="CraftBukkit" downloadUrl=${BUKKIT_DOWNLOAD_URL} getbukkitFlavor=craftbukkit ;; @@ -40,12 +40,13 @@ function downloadSpigot { fi echo "Downloading $match from $downloadUrl ..." - if ! curl -fsSL -o $SERVER "$downloadUrl"; then + curl -fsSL -o $SERVER "$downloadUrl" + if [[ $? != 0 || $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then cat <