diff --git a/script.uefi b/script.uefi index b06ced9..35a0d73 100755 --- a/script.uefi +++ b/script.uefi @@ -98,9 +98,13 @@ create () { # existing_partitions [] existing_partitions () { + local DEVICE="$1" + local TYPE="$2" + echo "1: $1,2: $2" >> temp.log if [[ $# -eq 1 ]] # Genereller test auf Partitionen then - ANZAHL_PARTITIONEN_VORHANDEN=$(lsblk -pl "${DEVICE}" | grep -ic "${1}") + echo "Path 1" >> temp.log + ANZAHL_PARTITIONEN_VORHANDEN=$(lsblk -pl "${DEVICE}" | grep -ic "${DEVICE}[0-9]") if [[ ${ANZAHL_PARTITIONEN_VORHANDEN} != 0 ]] then echo "yes" # Partitionen vorhanden @@ -109,7 +113,8 @@ existing_partitions () { fi elif [[ $# -eq 2 ]] # Test auf eine bestimmte Partition then - case $2 in + echo "Path 2" >> temp.log + case ${TYPE} in "ESP") PARTUUID="${GUIDS[ESP]}" ;; @@ -129,7 +134,8 @@ existing_partitions () { die 1 "Unbekannter Partitionstype" ;; esac - SPEZIFISCHE_PARTITION_VORHANDEN=$(lsblk -o PARTTYPE "${DEVICE}" | grep "${PARTUUID}") + echo "UUID: ${PARTUUID}" >> temp.log + SPEZIFISCHE_PARTITION_VORHANDEN=$(lsblk -o PARTTYPE "${DEVICE}" | grep -ic "${PARTUUID}") if [[ "${SPEZIFISCHE_PARTITION_VORHANDEN}" == 1 ]] then echo "yes" # bestimmte Partition vorhanden