From d889b76b72b3282ce6b7ac2074cf008233b9f033 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 8 Jan 2024 01:53:34 +0300 Subject: [PATCH] testing... Signed-off-by: Alex A. Naanou --- .pct-helpers | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.pct-helpers b/.pct-helpers index 27f65b3..2d5a61a 100644 --- a/.pct-helpers +++ b/.pct-helpers @@ -186,17 +186,22 @@ xread(){ xreadpass(){ local PASS1 local PASS2 - read -sep "password (Enter to skip): " PASS1 - echo - if [ $PASS1 ] ; then + for attempt in 1 2 3 ; do + read -sep "password (Enter to skip): " PASS1 + echo + if [ -z $PASS1 ] ; then + return + fi read -sep "retype password: " PASS2 echo if [[ $PASS1 != $PASS2 ]] ; then echo "ERR: passwords do not match." - return 1 + continue fi eval ''$1'='${PASS1}'' - fi + return + done + return 1 } #