Skip to content

Commit 1da5423

Browse files
committed
ENH: Prompt for password twice and verify
1 parent 73fdd3a commit 1da5423

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

myba.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,11 @@ _read_vars () {
110110
_ask_pw () {
111111
if [ -z "${PASSWORD+1}" ]; then
112112
stty -echo
113-
IFS= read -p "Enter encryption password: " -r PASSWORD
113+
IFS= read -p "Enter encryption PASSWORD=: " -r PASSWORD
114114
echo
115+
IFS= read -p "Repeat: " -r PASSWORD2
116+
[ "$PASSWORD" = "$PASSWORD2" ] || { warn 'ERROR: Password mismatch!'; exit 1; }
117+
unset PASSWORD2
115118
stty echo
116119
fi
117120

0 commit comments

Comments
 (0)