nice accounts, bug fixes
This commit is contained in:
parent
74b62ae824
commit
0ebc8362f0
51
bml-cli.sh
51
bml-cli.sh
@ -46,6 +46,7 @@ animate(){
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
initialize(){
|
initialize(){
|
||||||
|
echo initalizing..
|
||||||
mkdir -p ~/.config/bml-cli/
|
mkdir -p ~/.config/bml-cli/
|
||||||
mkdir -p ~/.cache/bml-cli/
|
mkdir -p ~/.cache/bml-cli/
|
||||||
echo "# DO NOT EDIT THIS MANUALLY!!" > $CREDENTIALS
|
echo "# DO NOT EDIT THIS MANUALLY!!" > $CREDENTIALS
|
||||||
@ -132,16 +133,31 @@ display_userinfo(){
|
|||||||
####################################################################
|
####################################################################
|
||||||
cexit(){
|
cexit(){
|
||||||
echo "Cleaning up.."
|
echo "Cleaning up.."
|
||||||
rm $COOKIE
|
rm $COOKIE 2> /dev/null
|
||||||
sleep 0.2
|
sleep 0.2
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reset_config(){
|
||||||
|
read -p 'Are you sure: [y/N]' SURE
|
||||||
|
if [ "$SURE" = "y" ] || [ "$SURE" = "Y" ]
|
||||||
|
then
|
||||||
|
display_banner
|
||||||
|
sleep 0.5
|
||||||
|
echo Deleting Configration.... & rm -rf ~/.config/bml-cli
|
||||||
|
sleep 0.5
|
||||||
|
echo Deleting Credentials.... & rm -rf ~/.cache/bml-cli
|
||||||
|
cexit
|
||||||
|
else
|
||||||
|
display_banner && display_name && display_userinfo
|
||||||
|
settings
|
||||||
|
fi
|
||||||
|
}
|
||||||
readpin(){
|
readpin(){
|
||||||
read -s -p 'Enter Pin: ' PIN
|
read -s -p 'Enter Pin: ' PIN
|
||||||
echo ""
|
echo ""
|
||||||
CHECK_PIN=$(echo ${BML_USERNAME} | openssl enc -d -des3 -base64 -pass pass:${PIN} -pbkdf2 2>&1 | grep -oE bad)
|
CHECK_PIN=$(echo ${BML_USERNAME} | openssl enc -d -des3 -base64 -pass pass:${PIN} -pbkdf2 2>&1 | grep -oE bad)
|
||||||
if [ "$CHECK_PIN" = "bad bad" ]
|
if [ "$CHECK_PIN" = "bad bad" ]
|
||||||
then
|
then
|
||||||
echo ${R}Incorrect Pin${N}
|
echo ${R}Incorrect Pin${N}
|
||||||
readpin
|
readpin
|
||||||
@ -299,7 +315,9 @@ userinfo(){
|
|||||||
|
|
||||||
################################################################################################
|
################################################################################################
|
||||||
accounts(){
|
accounts(){
|
||||||
echo $DASHBOARD | jq -r '.payload | .dashboard |.[] | (.alias, .account, .currency, .availableBalance)'
|
echo $DASHBOARD \
|
||||||
|
| jq -r '["Account Name"," Account Number","Type", "Currency", "Balance"], ["===================","==============","==================","=========","========="], (.payload | .dashboard |.[] | [.alias, .account, .product, .currency, .availableBalance]) | @tsv' \
|
||||||
|
| perl -pe 's/((?<=\t)|(?<=^))\t/ \t/g;' "$@" | column -t -s $'\t' | exec less -F -S -X -K
|
||||||
}
|
}
|
||||||
################################################################################################
|
################################################################################################
|
||||||
api_dashboard(){
|
api_dashboard(){
|
||||||
@ -481,6 +499,13 @@ activities(){
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
services(){
|
||||||
|
echo ""
|
||||||
|
echo "Work In Progress"
|
||||||
|
read -p "Press enter to return to main menu" BRUH
|
||||||
|
display_banner && display_name && display_userinfo
|
||||||
|
main_menu
|
||||||
|
}
|
||||||
################################################################################################
|
################################################################################################
|
||||||
main_menu(){
|
main_menu(){
|
||||||
echo "Main Menu"
|
echo "Main Menu"
|
||||||
@ -497,9 +522,8 @@ read -r MENU
|
|||||||
|
|
||||||
if [ "$MENU" = "1" ]
|
if [ "$MENU" = "1" ]
|
||||||
then
|
then
|
||||||
display_banner
|
|
||||||
api_dashboard # & animate "Fetching account details"
|
api_dashboard # & animate "Fetching account details"
|
||||||
display_banner
|
display_banner && display_name && display_userinfo
|
||||||
accounts
|
accounts
|
||||||
accounts_menu
|
accounts_menu
|
||||||
elif [ "$MENU" = "2" ]
|
elif [ "$MENU" = "2" ]
|
||||||
@ -519,14 +543,13 @@ read -r MENU
|
|||||||
activities
|
activities
|
||||||
elif [ "$MENU" = "5" ]
|
elif [ "$MENU" = "5" ]
|
||||||
then
|
then
|
||||||
echo "WIP"
|
display_banner && display_name && display_userinfo
|
||||||
sleep 2
|
services
|
||||||
cexit
|
|
||||||
elif [ "$MENU" = "6" ]
|
elif [ "$MENU" = "6" ]
|
||||||
then
|
then
|
||||||
display_banner && display_name && display_userinfo
|
display_banner && display_name && display_userinfo
|
||||||
settings
|
settings
|
||||||
elif [ "$MENU" = "exit" ]
|
elif [ "$MENU" = "exit" ] || [ "$MENU" = "x" ]
|
||||||
then
|
then
|
||||||
cexit
|
cexit
|
||||||
else
|
else
|
||||||
@ -537,8 +560,9 @@ fi
|
|||||||
}
|
}
|
||||||
##############################################################################################
|
##############################################################################################
|
||||||
accounts_menu(){
|
accounts_menu(){
|
||||||
|
echo ""
|
||||||
echo "Work In Progress"
|
echo "Work In Progress"
|
||||||
read -p "Press Anykey to go main menu" BRUH
|
read -p "Press enter to return main menu" BRUH
|
||||||
display_banner && display_name && display_userinfo
|
display_banner && display_name && display_userinfo
|
||||||
main_menu
|
main_menu
|
||||||
}
|
}
|
||||||
@ -585,7 +609,7 @@ fi
|
|||||||
}
|
}
|
||||||
transfer_menu(){
|
transfer_menu(){
|
||||||
echo "Work In Progress"
|
echo "Work In Progress"
|
||||||
read -p "Press Anykey to go main menu" BRUH
|
read -p "Press enter to return to main menu" BRUH
|
||||||
display_banner && display_name && display_userinfo
|
display_banner && display_name && display_userinfo
|
||||||
main_menu
|
main_menu
|
||||||
}
|
}
|
||||||
@ -608,9 +632,14 @@ change_password(){
|
|||||||
OTPCHANNEL=email
|
OTPCHANNEL=email
|
||||||
ECHOOTPCHANNEL=$EMAIL
|
ECHOOTPCHANNEL=$EMAIL
|
||||||
break
|
break
|
||||||
|
elif [ "$OTPCHANNEL" = "back" ] || [ "$OTPCHANNEL" = "x" ]
|
||||||
|
then
|
||||||
|
display_banner && display_name && display_userinfo
|
||||||
|
settings
|
||||||
else
|
else
|
||||||
display_banner && display_name && display_userinfo
|
display_banner && display_name && display_userinfo
|
||||||
echo ${red}Invalid Input${reset}
|
echo ${red}Invalid Input${reset}
|
||||||
|
echo Enter x to back
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user