From fe38f219d12bfca7a6044b67e759b28636c46cc4 Mon Sep 17 00:00:00 2001 From: Nobleman <8305511+smac89@users.noreply.github.com> Date: Sun, 17 Mar 2024 22:50:13 -0600 Subject: [PATCH] Fix bug with finding ESP in setup.sh Fixes #3 --- setup.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 4f796e4..2fa6320 100755 --- a/setup.sh +++ b/setup.sh @@ -118,10 +118,15 @@ __find_esp__() { while read -r device; do read -r parttype fstype ESP <<<"$(lsblk -o "PARTTYPE,FSTYPE,MOUNTPOINT" "$device" 2>/dev/null | awk 'NR==2')" - + [[ "${parttype,,}" != "c12a7328-f81f-11d2-ba4b-00a0c93ec93b" ]] && continue - [[ "${fstype,,}" != "vfat" ]] && continue - [[ -z $(findmnt -sn "$ESP") ]] && continue + [[ "${fstype,,}" != "vfat" ]] && continue + [[ -z $(findmnt -sn "$ESP") ]] && continue + + # before breaking check that $ESP does in fact exist to avoid false positive from findmnt (see #3) + if [ -n "$ESP" ]; then + break + fi done <<< "$(fdisk -l 2>/dev/null | grep -i efi | cut -d " " -f 1)"