Add password confirmation
This commit is contained in:
parent
8e32635993
commit
d8574da0b9
|
@ -98,9 +98,14 @@ function __account_already_exists() {
|
||||||
|
|
||||||
# Also used by addsaslpassword
|
# Also used by addsaslpassword
|
||||||
function _password_request_if_missing() {
|
function _password_request_if_missing() {
|
||||||
|
local CONFIRM
|
||||||
if [[ -z ${PASSWD} ]]; then
|
if [[ -z ${PASSWD} ]]; then
|
||||||
read -r -s -p 'Enter Password: ' PASSWD
|
read -r -s -p 'Enter Password: ' PASSWD
|
||||||
echo
|
echo
|
||||||
[[ -z ${PASSWD} ]] && _exit_with_error 'Password must not be empty'
|
[[ -z ${PASSWD} ]] && _exit_with_error 'Password must not be empty'
|
||||||
|
|
||||||
|
read -r -s -p 'Confirm Password: ' CONFIRM
|
||||||
|
echo
|
||||||
|
[[ ${PASSWD} != "${CONFIRM}" ]] && _exit_with_error 'Passwords do not match!'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue