prompt user if they want to continue

This commit is contained in:
everyone 2023-11-13 21:24:36 -08:00
parent 14366c7eac
commit 72054dd06b
Signed by: everyone
SSH key fingerprint: SHA256:FKcGHdUnp2OocVUUAEJV25QetYQXwbmKPSsblofJOrM

View file

@ -94,13 +94,17 @@ while :; do
done
stty echo
# user confirmation
while :; do
printf "\nThis script is descructive."
prompt confirmed "" "Are you sure you want to contiue." YES NO
[[ "${confirmed?}" == "YES" ]] && break
[[ "${confirmed?}" == "NO" ]] && {
printf "Exiting script\n"
exit 1
}
done
## Format disk(s)
mkfs.fat -F 32 "$root_dev"1
mkfs.btrfs -f "$root_dev"2
[[ "${home_fmt:-0}" -eq 1 ]] && {
mkfs.btrfs -f "$home_dev"1
}
## Configure root btrfs
mount --mkdir "$root_dev"2 /mnt