Fehler bei der Erkennung von existierenden Partitionen behoben. Das Gerät wurde auch als Partition gezählt.
This commit is contained in:
parent
05f4b13e8e
commit
240e181576
1 changed files with 9 additions and 3 deletions
12
script.uefi
12
script.uefi
|
@ -98,9 +98,13 @@ create () {
|
|||
|
||||
# existing_partitions <Gerät> [<Type>]
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue