From 87fdd64328ce3e2c77f8b0014f8312782fa53946 Mon Sep 17 00:00:00 2001 From: Shihaam Abdul Rahman Date: Wed, 28 Apr 2021 07:15:26 +0500 Subject: [PATCH] password saving --- readpass.sh | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/readpass.sh b/readpass.sh index 1354fa6..ee40614 100644 --- a/readpass.sh +++ b/readpass.sh @@ -1,23 +1,19 @@ - if [ -f $CREDENTIALS ] then source $CREDENTIALS -elif [ "$LOGIN" = "2" ] -then - if [ -f $CREDENTIALS ] + if [ "$LOGIN" = "2" ] then - echo "${red}Saved Credentials has been changed${reset}" - rm $CREDENTIALS + echo "${red}Password update required${reset}" + rm $CREDENTIALS 2> /dev/null + read -p 'Username: ' BML_USERNAME + read -s -p 'Password: ' BML_PASSWORD + echo "" else - echo "${red}Username or Password incorrect${reset}" + : fi - read -p 'Username: ' BML_USERNAME - read -s -p 'Password: ' BML_PASSWORD - echo "" - elif [ ! -f $CREDENTIALS ] then - echo "${red}Password file not found in $CREDENTIALS${reset}" + echo "${red}Username or Password in correct${reset}" read -p 'Username: ' BML_USERNAME read -s -p 'Password: ' BML_PASSWORD echo "" @@ -25,5 +21,4 @@ else : fi - source login.sh