Improved handling

This commit is contained in:
Phillip 2024-09-07 22:26:37 +01:00
parent dc6af1b41d
commit 8a5143b79d

View File

@ -24,9 +24,16 @@ esac
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, this partition will be wiped: ' homepar
read -p 'Do you wish to wipe the home partition? ' wipeyesno
case $wipeyesno in
read -p 'Please enter the drive value for the home partition: ' homepar
[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
;;
@ -34,12 +41,8 @@ case $yesno in
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
fi
# Get user credentials
read -p "Please enter a username " username
read -rsp "Please enter a password " password