Successful spigot/bukkit update check caused grep to fail (#2726)

This commit is contained in:
Geoff Bourne
2024-03-17 22:07:34 -05:00
committed by GitHub
parent 35daf1441a
commit 938b562d21
2 changed files with 4 additions and 8 deletions

View File

@@ -89,7 +89,7 @@ function downloadSpigot {
tempFile="$SERVER.$$"
# HTTP error or download site responded with an HTML error page
if ! curl -fsSL -o "$tempFile" "${curlArgs[@]}" "$downloadUrl" || grep -iq "doctype html" "$tempFile"; then
if ! curl -fsSL -o "$tempFile" "${curlArgs[@]}" "$downloadUrl" || ( [ -f "$tempFile" ] && grep -iq "doctype html" "$tempFile" ); then
cat <<EOF
@@ -113,7 +113,9 @@ EOF
fi
else
mv "$tempFile" "$SERVER"
if [ -f "$tempFile" ]; then
mv "$tempFile" "$SERVER"
fi
fi