better warnings

This commit is contained in:
2026-07-13 14:04:42 -05:00
parent 5d8c3fd3b0
commit d0fa3f2e47
+10 -4
View File
@@ -124,16 +124,22 @@ dialogue() {
echo "Chose disk $disk_name" echo "Chose disk $disk_name"
echo echo
if [[ $NO_WRITE == false ]]; then
echo -e "${RED}WARNING: ALL DATA ON ${disk_name} WILL BE DESTROYED${RESET}" echo -e "${RED}WARNING: ALL DATA ON ${disk_name} WILL BE DESTROYED${RESET}"
lsblk $disk_name 2>/dev/null || true elif [[ $NO_RETABLE == false ]]; then
echo -e "${YELLOW}INFO: Running in NO WRITE mode. No data will be written to disk${RESET}"
elif
echo -e "${YELLOW}WARNING: Existing partitions will be used but filesystems and file data may be modified${RESET}"
fi
lsblk $disk_name
echo echo
read -rp "Are you sure you want to continue? (yes/no): " confirm read -rp "Are you sure you want to continue? (yes/no): " confirm
if [[ "$confirm" != "yes" ]]; then if [[ "$confirm" != "yes" ]]; then
echo "Aborted." echo "Aborted."
exit 0 exit 0
fi fi
echo "Chose disk $disk_name"
echo
} }
rewrite_gpt_table() { rewrite_gpt_table() {
@@ -149,7 +155,7 @@ rewrite_gpt_table() {
sgdisk -n 2:0:+1G -t 2:8300 -c 2:"boot" $disk_name sgdisk -n 2:0:+1G -t 2:8300 -c 2:"boot" $disk_name
sgdisk -n 3:0:0 -t 3:8e00 -c 3:"Linux LVM" $disk_name sgdisk -n 3:0:0 -t 3:8e00 -c 3:"Linux LVM" $disk_name
partprobe || true partprobe 2>/dev/null ||
lsblk $disk_name lsblk $disk_name