37 lines
No EOL
1,020 B
Bash
37 lines
No EOL
1,020 B
Bash
#!/bin/bash
|
|
|
|
# VARIABLEN:
|
|
DRIVE="/dev/vda"
|
|
ESP="512M"
|
|
USR="10G"
|
|
ROOT_LABEL="root"
|
|
USR_LABEL="usr"
|
|
ESP_LABEL="EFI"
|
|
|
|
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
|
|
|
CHECK_EXISTENCE_OUTPUT=$(lsblk -o NAME | grep -c "^${DRIVE//\/dev\/}")
|
|
|
|
if [[ ${CHECK_EXISTENCE_OUTPUT} -lt 1 ]]; then
|
|
echo "Platte existiert nicht, Abbruch!"
|
|
exit 1
|
|
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}" |