From 754c1e075104b9269e292df744e2e7916cbd77d3 Mon Sep 17 00:00:00 2001 From: Shihaam Abdul Rahman Date: Sun, 6 Feb 2022 20:27:21 +0500 Subject: [PATCH] remove having to press enter in menus and OTP input --- bml-cli | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bml-cli b/bml-cli index 1e59872..eb86be7 100755 --- a/bml-cli +++ b/bml-cli @@ -527,7 +527,7 @@ echo "5 - Services" echo "6 - Settings" echo "" printf 'Please Input: ' -read -r MENU +read -n 1 -r MENU if [ "$MENU" = "1" ] then @@ -585,7 +585,7 @@ contacts_menu(){ echo "x - Go back" echo "" printf 'Please Input: ' -read -r CONTACTS +read -n 1 -r CONTACTS if [ "$CONTACTS" = "1" ] || ["$CONTACTS" = "transfer" ] then @@ -629,7 +629,7 @@ change_password(){ echo "1 - Mobile" echo "2 - Email" echo "" - read -p "Please input: " OTPCHANNEL + read -n 1 -p "Please input: " OTPCHANNEL if [ "$OTPCHANNEL" = "1" ] || [ "$OTPCHANNEL" = "mobile" ] then @@ -678,7 +678,7 @@ change_password(){ --data-raw channel=$OTPCHANNEL > /dev/null echo ${lightgreen}OTP sent to ${yellow}${ECHOOTPCHANNEL}${reset} - read -p 'Enter OTP: ' OTP + read -n 6 -p 'Enter OTP: ' OTP CHANGEPASSWORD=$(curl -s -b $COOKIE $BML_URL/user/changepassword \ --data-raw currentPassword=$OLD_PASSWORD \ --data-raw newPassword=$NEW_PASSWORD \ @@ -726,7 +726,7 @@ settings(){ echo "3 - Change Password" echo "" printf 'Please Input: ' - read -r SETTINGS + read -n 1 -r SETTINGS if [ "$SETTINGS" = "1" ] then @@ -769,7 +769,7 @@ init_login(){ display_banner && check_connection #& animate "Checking Internet Connection" source $CONFIG source $CREDENTIALS -display_banner && os_detect #& animate "Detecting Operating System" +display_banner && os_detect #& animate "Detecting Operating System" display_banner && init_login userinfo display_banner && display_welcome && display_userinfo && main_menu