From e4fbdbe700a6dec94a2c988eaad4374b90789765 Mon Sep 17 00:00:00 2001 From: eichehome Date: Thu, 20 Jul 2023 21:08:58 +0200 Subject: [PATCH] =?UTF-8?q?Den=20Code=20zum=20auslesen=20der=20UUIDs=20der?= =?UTF-8?q?=20Partitionen=20=C3=BCberarbeitet.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.uefi | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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