From 463147391c19b22dc4103ef6c6e8a9bf7db2f410 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 10 Sep 2024 01:24:42 -0400 Subject: [PATCH] Initial file download verification code. I'm not sure if it will work, but hopefully. Please watch for bugs, especially when downloading zip files. If it works, I will extend it. --- linux-game-manager.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/linux-game-manager.sh b/linux-game-manager.sh index 57926ad..3660702 100755 --- a/linux-game-manager.sh +++ b/linux-game-manager.sh @@ -204,6 +204,16 @@ download() { echo "Could not download \"$i\"..." exit 1 fi + case "${dest##*.}" in + "zip") + if [[ "$(file -b --mime-type "${cache}/${dest}")" != "application/zip" ]]; then + rm -fv "${cache}/${dest}" + dialog --backtitle "Linux Game Manager" \ + --infobox "Error downloading \"${dest}\". Installation cannot continue." -1 -1 --stdout + alert + fi + ;; + esac done }