attempt to reduce lines by using OR instead of elif
This commit is contained in:
parent
5f757b26c6
commit
2387c561e7
@ -11,10 +11,7 @@ echo ""
|
|||||||
printf 'Select contact type[1]: '
|
printf 'Select contact type[1]: '
|
||||||
read -r CONTACT_TYPE
|
read -r CONTACT_TYPE
|
||||||
|
|
||||||
if [ "$CONTACT_TYPE" = "1" ]
|
if [ "$CONTACT_TYPE" = "1" ] || [ "$CONTACT_TYPE" = "" ]
|
||||||
then
|
|
||||||
source addcontact-bml.sh
|
|
||||||
elif [ "$CONTACT_TYPE" = "" ]
|
|
||||||
then
|
then
|
||||||
source addcontact-bml.sh
|
source addcontact-bml.sh
|
||||||
elif [ "$CONTATC_TYPE" = "2" ]
|
elif [ "$CONTATC_TYPE" = "2" ]
|
||||||
|
@ -18,10 +18,7 @@ then
|
|||||||
elif [ "$CONTACTS" = "3" ]
|
elif [ "$CONTACTS" = "3" ]
|
||||||
then
|
then
|
||||||
source deletecontact.sh
|
source deletecontact.sh
|
||||||
elif [ "$CONTACTS" = "4" ]
|
elif [ "$CONTACTS" = "4" ] || [ "$CONTACTS" = "back" ]
|
||||||
then
|
|
||||||
source mainmenu.sh
|
|
||||||
elif [ "$CONTACTS" = "back" ]
|
|
||||||
then
|
then
|
||||||
sleep 0.2
|
sleep 0.2
|
||||||
source mainmenu.sh
|
source mainmenu.sh
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ "uname -r | grep -oE microsoft" = "microsoft" ]
|
if [ "uname -r | grep -oE microsoft" = "microsoft" ] || [ "uname -r | grep -oE Microsoft" = "Microsoft" ]
|
||||||
then
|
then
|
||||||
WSL=true
|
WSL=true
|
||||||
#echo "${red}WSL Not Supported!${reset}" 1>&2
|
#echo "${red}WSL Not Supported!${reset}" 1>&2
|
||||||
|
21
savepass.sh
21
savepass.sh
@ -3,7 +3,7 @@ then
|
|||||||
if [ "$LOGIN" = "0" ]
|
if [ "$LOGIN" = "0" ]
|
||||||
then
|
then
|
||||||
read -p 'Do you want to save login? [y/N] ' SAVE_LOGIN
|
read -p 'Do you want to save login? [y/N] ' SAVE_LOGIN
|
||||||
if [ "$SAVE_LOGIN" = "Y" ]
|
if [ "$SAVE_LOGIN" = "Y" ] || [ "$SAVE_LOGIN" = "y" ]
|
||||||
then
|
then
|
||||||
read -s -p 'Enter Pin: ' PIN
|
read -s -p 'Enter Pin: ' PIN
|
||||||
echo ""
|
echo ""
|
||||||
@ -22,25 +22,6 @@ then
|
|||||||
echo "${red}Pin do not match${reset}"
|
echo "${red}Pin do not match${reset}"
|
||||||
source savepass.sh
|
source savepass.sh
|
||||||
fi
|
fi
|
||||||
elif [ "$SAVE_LOGIN" = "y" ]
|
|
||||||
then
|
|
||||||
read -s -p 'Enter Pin: ' PIN
|
|
||||||
echo ""
|
|
||||||
read -s -p 'Repeat Pin: ' REPEAT_PIN
|
|
||||||
if [ "$PIN" = "$REPEAT_PIN" ]
|
|
||||||
then
|
|
||||||
echo ""
|
|
||||||
echo "Your credentials are ${lightgreen}encrypted${reset} and saved in $CREDENTIALS"
|
|
||||||
BML_USERNAME=$(echo "${BML_USERNAME}" | openssl enc -e -des3 -base64 -pass pass:${PIN} -pbkdf2)
|
|
||||||
BML_PASSWORD=$(echo "${BML_PASSWORD}" | openssl enc -e -des3 -base64 -pass pass:${PIN} -pbkdf2)
|
|
||||||
echo "BML_USERNAME='${BML_USERNAME}'" > $CREDENTIALS
|
|
||||||
echo "BML_PASSWORD='${BML_PASSWORD}'" >> $CREDENTIALS
|
|
||||||
|
|
||||||
else
|
|
||||||
echo ""
|
|
||||||
echo "${red}Pin do not match${reset}"
|
|
||||||
source savepass.sh
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
:
|
:
|
||||||
fi
|
fi
|
||||||
|
@ -14,7 +14,7 @@ then
|
|||||||
elif [ "$SETTINGS" = "2" ]
|
elif [ "$SETTINGS" = "2" ]
|
||||||
then
|
then
|
||||||
source changepassword.sh
|
source changepassword.sh
|
||||||
elif [ "$SETTINGS" = "back" ]
|
elif [ "$SETTINGS" = "2" ] || [ "$SETTINGS" = "back" ]
|
||||||
then
|
then
|
||||||
source mainmenu.sh
|
source mainmenu.sh
|
||||||
elif [ "$SETTINGS" = "clear" ]
|
elif [ "$SETTINGS" = "clear" ]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user