Improved file check code. Added detection for if a wad file fails to download.
This commit is contained in:
parent
7d5e132f91
commit
f50b025334
@ -204,17 +204,26 @@ download() {
|
|||||||
echo "Could not download \"$i\"..."
|
echo "Could not download \"$i\"..."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
local downloadError=1
|
||||||
case "${dest##*.}" in
|
case "${dest##*.}" in
|
||||||
"zip")
|
"pk3"|"zip")
|
||||||
if [[ "$(file -b --mime-type "${cache}/${dest}")" != "application/zip" ]]; then
|
if [[ "$(file -b --mime-type "${cache}/${dest}")" != "application/zip" ]]; then
|
||||||
|
downloadError=0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"wad")
|
||||||
|
if [[ "$(file -b --mime-type "${cache}/${dest}")" != "application/octet-stream" ]]; then
|
||||||
|
downloadError=0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if [[ $downloadError -eq 0 ]]; then
|
||||||
rm -fv "${cache}/${dest}"
|
rm -fv "${cache}/${dest}"
|
||||||
dialog --backtitle "Linux Game Manager" \
|
dialog --backtitle "Linux Game Manager" \
|
||||||
--infobox "Error downloading \"${dest}\". Installation cannot continue." -1 -1 --stdout
|
--infobox "Error downloading \"${dest}\". Installation cannot continue." -1 -1 --stdout
|
||||||
alert
|
alert
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user