From 8c6e9d3d7b4b23e79f67fa812fb3d23c9ae7ee43 Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 16 Feb 2024 14:51:50 +0100 Subject: [PATCH] fix: Match files case insensitive (#29) --- src/install.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/install.sh b/src/install.sh index 35bf0a5..f5109e9 100644 --- a/src/install.sh +++ b/src/install.sh @@ -8,14 +8,8 @@ else PROGRESS="--progress=dot:giga" fi -BASE="boot.img" -[ ! -f "$STORAGE/$BASE" ] && BASE="boot.iso" -[ ! -f "$STORAGE/$BASE" ] && BASE="Boot.img" -[ ! -f "$STORAGE/$BASE" ] && BASE="Boot.iso" -[ ! -f "$STORAGE/$BASE" ] && BASE="boot.IMG" -[ ! -f "$STORAGE/$BASE" ] && BASE="boot.ISO" -[ ! -f "$STORAGE/$BASE" ] && BASE="BOOT.IMG" -[ ! -f "$STORAGE/$BASE" ] && BASE="BOOT.ISO" +BASE=$(find "$STORAGE" -maxdepth 1 -type f -iname boot.iso -printf "%f\n" | head -n 1) +[ -z "$BASE" ] && BASE=$(find "$STORAGE" -maxdepth 1 -type f -iname boot.img -printf "%f\n" | head -n 1) [ -f "$STORAGE/$BASE" ] && return 0