password saving

This commit is contained in:
Shihaam Abdul Rahman 2021-04-28 07:15:26 +05:00
parent 5d44df595b
commit 87fdd64328

View File

@ -1,23 +1,19 @@
if [ -f $CREDENTIALS ] if [ -f $CREDENTIALS ]
then then
source $CREDENTIALS source $CREDENTIALS
elif [ "$LOGIN" = "2" ] if [ "$LOGIN" = "2" ]
then
if [ -f $CREDENTIALS ]
then then
echo "${red}Saved Credentials has been changed${reset}" echo "${red}Password update required${reset}"
rm $CREDENTIALS rm $CREDENTIALS 2> /dev/null
else
echo "${red}Username or Password incorrect${reset}"
fi
read -p 'Username: ' BML_USERNAME read -p 'Username: ' BML_USERNAME
read -s -p 'Password: ' BML_PASSWORD read -s -p 'Password: ' BML_PASSWORD
echo "" echo ""
else
:
fi
elif [ ! -f $CREDENTIALS ] elif [ ! -f $CREDENTIALS ]
then then
echo "${red}Password file not found in $CREDENTIALS${reset}" echo "${red}Username or Password in correct${reset}"
read -p 'Username: ' BML_USERNAME read -p 'Username: ' BML_USERNAME
read -s -p 'Password: ' BML_PASSWORD read -s -p 'Password: ' BML_PASSWORD
echo "" echo ""
@ -25,5 +21,4 @@ else
: :
fi fi
source login.sh source login.sh