From f7cd4cf166b5cff7cf9a464df155a54f222db05b Mon Sep 17 00:00:00 2001 From: stojshic Date: Fri, 14 Jan 2022 23:45:55 +0100 Subject: [PATCH] Check password by entering it twice and comparing --- startup.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/startup.sh b/startup.sh index 1aa56bb..1d83828 100644 --- a/startup.sh +++ b/startup.sh @@ -145,9 +145,19 @@ set_option DISK $option userinfo () { read -p "Please enter your username: " username set_option USERNAME ${username,,} # convert to lower case as in issue #109 -echo -ne "Please enter your password: \n" -read -s password # read password without echo -set_option PASSWORD $password +while true; do + echo -ne "Please enter your password: \n" + read -s password # read password without echo + set_option PASSWORD $password + + echo -ne "Please repeat your password: \n" + read -s password2 # read password without echo + set_option PASSWORD2 $password2 + + [ "$password" = "$password2" ] && break + echo "Please try again" +done + read -rep "Please enter your hostname: " nameofmachine set_option nameofmachine $nameofmachine } @@ -169,4 +179,4 @@ logo timezone clear logo -keymap \ No newline at end of file +keymap