Test-Script um Dateisystem-Check existiert.
This commit is contained in:
parent
782a54efff
commit
09876ec680
1 changed files with 53 additions and 54 deletions
107
test.uefi
107
test.uefi
|
@ -10,22 +10,24 @@ ESP_LABEL="EFI"
|
|||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
|
||||
CHECK_EXISTENCE_OUTPUT=$(lsblk -o NAME | grep -c "^${DRIVE//\/dev\/}")
|
||||
# Prüfen, ob Drive existiert
|
||||
|
||||
if [[ ${CHECK_EXISTENCE_OUTPUT} -lt 1 ]]; then
|
||||
CHECK_PARTITION_EXISTENCE_OUTPUT=$(lsblk -pldo NAME | grep -ic "${DRIVE}")
|
||||
|
||||
if [[ ${CHECK_PARTITION_EXISTENCE_OUTPUT} -eq 1 ]]; then
|
||||
echo "Platte existiert nicht, Abbruch!"
|
||||
exit 1
|
||||
else
|
||||
echo "Platte existiert , Weitermachen."
|
||||
fi
|
||||
|
||||
|
||||
#----------------------------#
|
||||
|
||||
RECREATE_PARTITIONS="1"
|
||||
# Prüfen, ob Partitionen existieren ung ggf. erstellen
|
||||
|
||||
declare -A PARTITIONS_PRESENT=()
|
||||
|
||||
CHECK_PARTITIONS_OUTPUT=$(lsblk -po NAME,PARTTYPE | grep "${DRIVE}[0-9]")
|
||||
CHECK_PARTITIONS_OUTPUT=$(lsblk -pldo NAME,PARTTYPE "${DRIVE}[0-9]")
|
||||
|
||||
CHECK_ESP=$(echo "${CHECK_PARTITIONS_OUTPUT}" | grep -c "c12a7328-f81f-11d2-ba4b-00a0c93ec93b")
|
||||
PARTITIONS_PRESENT+=([ESP]="${CHECK_ESP}")
|
||||
|
@ -106,58 +108,55 @@ else
|
|||
fi
|
||||
fi
|
||||
|
||||
# if [[ ${PARTITIONS_PRESENT[ROOT]} -eq 1 ]]; then
|
||||
# echo "Root-Partition vorhanden."
|
||||
# read -r -p "Partition trotzdem neuerstellen? (j/N): " confirm_root
|
||||
# if [[ ${confirm_root} == [jJ] ]]; then
|
||||
# echo "Root-Partition wird neu erstellt"
|
||||
# echo sgdisk -n 0:
|
||||
# else
|
||||
# echo "Root-Partition wird nicht neu erstellt"
|
||||
# fi
|
||||
# else
|
||||
# echo "Root-Partition nicht vorhanden."
|
||||
# fi
|
||||
|
||||
# if [[ ${PARTITIONS_PRESENT[USR]} -eq 1 ]]; then
|
||||
# echo "/usr-Partition vorhanden."
|
||||
# read -r -p "Partition trotzdem neuerstellen? (j/N): " confirm_usr
|
||||
# if [[ ${confirm_usr} == [jJ] ]]; then
|
||||
# echo "/usr-Partition wird neu erstellt"
|
||||
# else
|
||||
# echo "/usr-Partition wird nicht neu erstellt"
|
||||
# fi
|
||||
# else
|
||||
# echo "/usr-Partition nicht vorhanden."
|
||||
# fi
|
||||
|
||||
# if [[ ${PARTITIONS_PRESENT[USRHASH]} -eq 1 ]]; then
|
||||
# echo "/usr-Verity-Partition vorhanden."
|
||||
# read -r -p "Partition trotzdem neuerstellen? (j/N): " confirm_usrhash
|
||||
# if [[ ${confirm_usrhash} == [jJ] ]]; then
|
||||
# echo "/usr-Verity-Partition wird neu erstellt"
|
||||
# else
|
||||
# echo "/usr-Verity-Partition wird nicht neu erstellt"
|
||||
# fi
|
||||
# else
|
||||
# echo "/usr-Verity-Partition nicht vorhanden."
|
||||
# fi
|
||||
|
||||
# if [[ ${PARTITIONS_PRESENT[ESP]} -eq 1 ]]; then
|
||||
# echo "ESP-Partition vorhanden."
|
||||
# read -r -p "Partition trotzdem neuerstellen? (j/N): " confirm_esp
|
||||
# if [[ ${confirm_esp} == [jJ] ]]; then
|
||||
# echo "ESP-Partition wird neu erstellt"
|
||||
# else
|
||||
# echo "ESP-Partition wird nicht neu erstellt"
|
||||
# fi
|
||||
# else
|
||||
# echo "ESP-Partition nicht vorhanden."
|
||||
# fi
|
||||
# _______ _ _ ___________ _ _ ___ _ ______
|
||||
# /\ / ______ \| | | |___ _____| | | | \ | |/ ___ \
|
||||
# / \ | | \/| |_____| | | | | | | | |\ \ | | / \_|
|
||||
# / /\ \ | | | | | | | | | | | \ \ | | | ___
|
||||
# / /__\ \ | | | _____ | | | | | | | | \ \ | | | |_ |
|
||||
# / ______ \| |_____/\| | | | | | \ \____/ | | \ \| | \___| |
|
||||
#/_/ \_\________/|_| |_| |_| \________/|_| \___|\_______|
|
||||
#/_/ \_\________/|_| |_| |_| \________/|_| \___|\_______|
|
||||
|
||||
|
||||
#----------------------------#
|
||||
|
||||
|
||||
|
||||
#----------------------------#
|
||||
|
||||
CHECK_FS_EXISTENCE_OUTPUT=$(lsblk -pldo NAME,PARTUUID,PARTTYPE,FSTYPE,FSVER "${DRIVE}[0-9]")
|
||||
declare -A INFO_ESP=""
|
||||
declare -A INFO_USR=""
|
||||
declare -A INFO_USRHASH=""
|
||||
declare -A INFO_ROOT=""
|
||||
|
||||
CHECK_FS_ESP=$(echo "${CHECK_FS_EXISTENCE_OUTPUT}" | grep -i "c12a7328-f81f-11d2-ba4b-00a0c93ec93b" | grep -i "vfat" | grep -ic "fast32")
|
||||
|
||||
CHECK_FS_USR=$(echo "${CHECK_FS_EXISTENCE_OUTPUT}" | grep -i "8484680c-9521-48c6-9c11-b0720656f69e" | grep -ic "ext4")
|
||||
|
||||
CHECK_FS_USRHASH=$(echo "${CHECK_FS_EXISTENCE_OUTPUT}" | grep -i "77ff5f63-e7b6-4633-acf4-1565b864c0e6" | grep -ic "dm_verity_hash")
|
||||
|
||||
CHECK_FS_ROOT=$(echo "${CHECK_FS_EXISTENCE_OUTPUT}" | grep -i "4f68bce3-e8cd-4db1-96e7-fbcaf984b709" | grep -i "ext4")
|
||||
|
||||
if [[ ${CHECK_ESP} -eq 0 ]]; then
|
||||
echo "ESP-Dateisystem existiert nicht."
|
||||
else
|
||||
echo "ESP-Dateisystem existiert."
|
||||
fi
|
||||
|
||||
if [[ ${CHECK_FS_USR} -eq 0 ]]; then
|
||||
echo "/usr-Dateisystem existiert nicht."
|
||||
else
|
||||
echo "/usr-Dateisystem existiert."
|
||||
fi
|
||||
|
||||
if [[ ${CHECK_FS_USRHASH} -eq 0 ]]; then
|
||||
echo "Dateisystem existiert nicht."
|
||||
else
|
||||
echo "Dateisystem existiert."
|
||||
fi
|
||||
|
||||
if [[ ${CHECK_FS_ROOT} -eq 0 ]]; then
|
||||
echo "Root-Dateisystem existiert nicht."
|
||||
else
|
||||
echo "Root-Dateisystem existiert."
|
||||
fi
|
Loading…
Reference in a new issue