diff options
Diffstat (limited to 'scripts/install-system')
-rw-r--r-- | scripts/install-system | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/scripts/install-system b/scripts/install-system index 5543fecb..d06695e0 100644 --- a/scripts/install-system +++ b/scripts/install-system @@ -840,22 +840,20 @@ change_password() { local pwd1="1" local pwd2="2" - until [ $pwd1 == $pwd2 ] + until [ "$pwd1" == "$pwd2" ] do - echo -n "Enter $user " - pwd1=$(mkpasswd -H md5) - local salt=$(echo $pwd1 | awk -F$ '{print $3}') - - echo -n "Retype $user " - pwd2=$(mkpasswd -H md5 -S $salt) + read -p "Enter $user password:" -r -s pwd1 <>/dev/tty 1>&0 + echo + read -p "Retype $user password:" -r -s pwd2 <>/dev/tty 1>&0 + echo - if [ $pwd1 != $pwd2 ] + if [ "$pwd1" != "$pwd2" ] then echo "Passwords do not match" fi done # escape any slashes in resulting password - local epwd=$(echo $pwd | sed 's:/:\\/:g') + local epwd=$(mkpasswd -H md5 "$pwd1" | sed 's:/:\\/:g') sed -i \ -e "/ user $user {/,/}/s/encrypted-password:.*\$/encrypted-password: \"$epwd\"/" \ |