From 9ce0294d14f04c5776edd1240533da722ff06751 Mon Sep 17 00:00:00 2001 From: Phillip Date: Sat, 7 Sep 2024 22:33:17 +0100 Subject: [PATCH] Blind test --- scripts/0-install.sh | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/scripts/0-install.sh b/scripts/0-install.sh index 80ac0b0..9f1e704 100644 --- a/scripts/0-install.sh +++ b/scripts/0-install.sh @@ -25,25 +25,23 @@ read -p "Do you wish to set a home partition? " yesno case $yesno in [yesYesYy]* ) read -p 'Please enter the drive value for the home partition: ' homepar + # Ask if a home partition should be wiped + read -p 'Do you wish to wipe the home partition? ' wipeyesno + case $wipeyesno in + [yesYesYy]* ) + mkfs.ext4 /dev/$homepar + ;; + [noNoNn]* ) + echo "The home partition will not be wiped" + ;; + * ) echo "Please answer yes (Yes, y, Y) or no (No, n, N)";; + esac ;; [noNoNn]* ) echo "A home partition will not be used in this installation" ;; * ) echo "Please answer yes (Yes, y, Y) or no (No, n, N)";; esac -# Ask if a home partition should be wiped -if test -z "$homepar"; then - read -p 'Do you wish to wipe the home partition? ' wipeyesno - case $wipeyesno in - [yesYesYy]* ) - mkfs.ext4 /dev/$homepar - ;; - [noNoNn]* ) - echo "The home partition will not be wiped" - ;; - * ) echo "Please answer yes (Yes, y, Y) or no (No, n, N)";; - esac -fi # Get user credentials read -p "Please enter a username " username read -rsp "Please enter a password " password