Compare commits

..

3 commits

View file

@ -107,7 +107,7 @@ CHECK_ESP=$(echo "${CHECK_PARTITIONS_OUTPUT}" | grep -c "c12a7328-f81f-11d2-ba4b
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")
if [[ ${CHECK_ESP} -eq 1 && ${CHECK_USR} -eq 1 && ${CHECK_USRHASH} -eq 1 && ${CHECK_ROOT} -eq 1 ]]; then
read -r "Alle Partitionen sind vorhanden. Trotzdem neu erstellen? (j/N): " confirm
read -r -p "Alle Partitionen sind vorhanden. Trotzdem neu erstellen? (j/N): " confirm
if [[ "${confirm}" == [jJ] ]];then
echo "Partitionen werden neu erstellt"
RECREATE_PARTITIONS="1"
@ -115,6 +115,7 @@ if [[ ${CHECK_ESP} -eq 1 && ${CHECK_USR} -eq 1 && ${CHECK_USRHASH} -eq 1 && ${CH
echo "Partitionen werden nicht neu erstellt"
RECREATE_PARTITIONS="0"
fi
sleep 5
fi
if [[ ${RECREATE_PARTITIONS} -eq 1 ]]; then
@ -251,7 +252,7 @@ for i in ${PARTITION_NUMBERS}; do
done
# Prüfen,ob die Dateisysteme schon korrekt sind
FILESYSTEM_OUTPUT=$(lsblk -o NAME,FSTYPE,FSVER,PARTUUID | grep "${DRIVE//\/dev\/}[0-9]")
FILESYSTEM_OUTPUT=$(lsblk -o NAME,FSTYPE,FSVER,PARTUUIDi,LABEL | grep "${DRIVE//\/dev\/}[0-9]")
CHECK_FS_ESP=$(echo "${FILESYSTEM_OUTPUT}" | grep "${ESP_PARTITION["PARTUUID"]}" | grep -i "vfat" | grep -i "fat32" | grep -c -i "${ESP_LABEL}")
CHECK_FS_USR=$(echo "${FILESYSTEM_OUTPUT}" | grep "${USR_PARTITION["PARTUUID"]}" | grep -i "ext4" | grep -c -i "${USR_LABEL}")
CHECK_FS_USRHASH=$(echo "${FILESYSTEM_OUTPUT}" | grep "${USRHASH_PARTITION["PARTUUID"]}" | grep -c -i "dm_verity_hash")
@ -260,7 +261,7 @@ CHECK_FS_ROOT=$(echo "${FILESYSTEM_OUTPUT}" | grep "${ROOT_PARTITION["PARTUUID"]
RECREATE_FILESYSTEMS="0"
if [[ ${CHECK_FS_ESP} -eq 1 && ${CHECK_FS_USR} -eq 1 && ${CHECK_FS_USRHASH} -eq 1 && ${CHECK_FS_ROOT} -eq 1 ]]; then
echo "Alles vorhanden"
read -r "Alle Dateisysteme vorhanden. Trotzdem neu erstellen? (j/N): " confirm
read -r -p "Alle Dateisysteme vorhanden. Trotzdem neu erstellen? (j/N): " confirm
if [[ ${confirm} == [jJ] ]]; then
echo "Dateisysteme werden neuerstellt."
RECREATE_FILESYSTEMS="1"
@ -268,6 +269,7 @@ if [[ ${CHECK_FS_ESP} -eq 1 && ${CHECK_FS_USR} -eq 1 && ${CHECK_FS_USRHASH} -eq
echo "Dateisysteme werden nicht neu erstellt."
RECREATE_FILESYSTEMS="0"
fi
sleep 5
fi
if [[ (${CHECK_ESP} -eq 0 || ${RECREATE_FILESYSTEMS} -eq 1) && -n ${ESP_PARTITION["PARTUUID"]} ]]; then