Den Code zum auslesen der UUIDs der Partitionen überarbeitet.

This commit is contained in:
eichehome 2023-07-20 21:08:58 +02:00
parent a5af73b9ec
commit e4fbdbe700

View file

@ -105,19 +105,19 @@ fi
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