better warnings
This commit is contained in:
+11
-5
@@ -124,16 +124,22 @@ dialogue() {
|
|||||||
echo "Chose disk $disk_name"
|
echo "Chose disk $disk_name"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo -e "${RED}WARNING: ALL DATA ON ${disk_name} WILL BE DESTROYED${RESET}"
|
if [[ $NO_WRITE == false ]]; then
|
||||||
lsblk $disk_name 2>/dev/null || true
|
echo -e "${RED}WARNING: ALL DATA ON ${disk_name} WILL BE DESTROYED${RESET}"
|
||||||
|
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user