diff --git a/install.uefi b/install.uefi index 30a9f22..7d82897 100644 --- a/install.uefi +++ b/install.uefi @@ -103,21 +103,21 @@ if [[ $NOCASEMATCH_UNSET ]]; then shopt -s nocasematch fi -for i in {1..9} ; do +for i in {1..9}; do OUTPUT=$(sgdisk -i "${i}" "${DRIVE}") - PARTITION_EXISTS=$(echo "${OUTPUT}" | grep -c 'Partition size') - if [[ $PARTITION_EXISTS ]]; then - GUID_CODE=$(echo "${OUTPUT}" | cut -d ' ' -f 4) - UUID=$(echo "${OUTPUT}" | sed 's/.*GUID: \s//' | cut -d ' ' -f 1) + PARTITION_EXISTS=$(echo "${OUTPUT}" | grep -c "GUID") + if [[ "${PARTITION_EXISTS}" != "0" ]]; then + GUID_CODE=$(echo "${OUTPUT}" | grep "GUID code:" | cut -d ' ' -f 4) + UUID=$(echo "${OUTPUT}" | grep "unique GUID:" | cut -d ' ' -f 4) case $GUID_CODE in - '8484680c-9521-48c6-9c11-b0720656f69e' ) echo "USR-Partition" ;; + "8484680c-9521-48c6-9c11-b0720656f69e" ) echo "USR-Partition, UUID: ${UUID} " ;; 'USR_HASH' ) echo "USRHASH-Partition" ;; - 'c12a7328-f81f-11d2-ba4b-00a0c93ec93b' ) echo "ESP-Partition" ;; - '4f68bce3-e8cd-4db1-96e7-fbcaf984b709' ) echo "Root-Partition" ;; + "c12a7328-f81f-11d2-ba4b-00a0c93ec93b" ) echo "ESP-Partition, UUID: ${UUID}" ;; + "4f68bce3-e8cd-4db1-96e7-fbcaf984b709" ) echo "Root-Partition, UUID: ${UUID}" ;; * ) echo "Unbekannte Partition";; esac else - break; + echo "no partition found" fi done