Check auf existierende Partitionen hinzugefügt.

This commit is contained in:
eichehome 2023-07-25 20:16:29 +02:00
parent 2b65cdd2dd
commit 7e4bb4607a

View file

@ -8,7 +8,7 @@ ROOT_LABEL="root"
USR_LABEL="usr"
ESP_LABEL="EFI"
#---------------------------#
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
CHECK_EXISTENCE_OUTPUT=$(lsblk -o NAME | grep -c "^${DRIVE//\/dev\/}")
@ -18,3 +18,20 @@ if [[ ${CHECK_EXISTENCE_OUTPUT} -lt 1 ]]; then
else
echo "Platte existiert , Weitermachen."
fi
#----------------------------#
RECREATE_PARTITIONS="1"
CHECK_PARTITIONS_OUTPUT=$(lsblk -o NAME,PARTTYPE | grep "${DRIVE//\/dev\/}[0-9]")
CHECK_ESP=$(echo "${CHECK_PARTITIONS_OUTPUT}" | grep -c "c12a7328-f81f-11d2-ba4b-00a0c93ec93b")
CHECK_USR=$(echo "${CHECK_PARTITIONS_OUTPUT}" | grep -c "8484680c-9521-48c6-9c11-b0720656f69e")
CHECK_USRHASH=$(echo "${CHECK_PARTITIONS_OUTPUT}" | grep -c "77ff5f63-e7b6-4633-acf4-1565b864c0e6")
CHECK_ROOT=$(echo "${CHECK_PARTITIONS_OUTPUT}" | grep -c "c12a7328-f81f-11d2-ba4b-00a0c93ec93b")
echo "ESP: ${CHECK_ESP}, USR: ${CHECK_USR}, USRHASH: ${CHECK_USRHASH}, ROOT: ${CHECK_ROOT}"