From 07993aa464d9970f9c41ba062c2ef1396bb745e9 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sat, 15 Apr 2023 18:25:05 +0200 Subject: [PATCH] Check ISO size --- install.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/install.sh b/install.sh index f1edac6..69071c0 100644 --- a/install.sh +++ b/install.sh @@ -15,6 +15,12 @@ fi [ ! -f "$TMP" ] && echo "Failed to download ${BOOT}" && exit 61 +SIZE=$(stat -c%s "$TMP") + +if ((SIZE<1000000)); then + echo "Invalid ISO file: Size is smaller than 1 MB." && exit 62 +fi + FILE="$IMG/boot.img" mv -f "$TMP" "$FILE"