diff --git a/bml-bash/bml.sh b/bml-bash/bml.sh index 2a79208..1147216 100755 --- a/bml-bash/bml.sh +++ b/bml-bash/bml.sh @@ -51,17 +51,17 @@ elif [ "$MENU" = "2" ] echo "2 - Add Contact" echo "3 - Delete Conact" echo "" - printf 'Please Input:' + printf 'Please Input: ' read -r CONTACS if [ "$CONTACS" = "1" ] then - curl -s -b $COOKIE $BML_URL/contacts | jq + curl -s -b $COOKIE $BML_URL/contacts | jq -r '["Alias","Name","Account Number"], (.["payload"] | .[] | [.alias, .name, .account]) | @tsv' elif [ "$CONTACS" = "2" ] then - printf 'Account Number:' + printf 'Account Number: ' read -r ACCOUNT_NAME - printf 'Name:' + printf 'Name: ' read -r ACCOUNT_NAME curl -s -b $COOKIE $BML_URL | jq elif [ "$CONTACS" = "3" ] diff --git a/bml-bash/pasrjsontest.sh b/bml-bash/pasrjsontest.sh new file mode 100755 index 0000000..cf10c38 --- /dev/null +++ b/bml-bash/pasrjsontest.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +source .env + +BML_URL='https://www.bankofmaldives.com.mv/internetbanking/api' +COOKIE=/tmp/bmlcookie +curl -s -c $COOKIE $BML_URL/login \ + --data-raw username=$BML_USERNAME \ + --data-raw password=$BML_PASSWORD \ + --compressed > /dev/null +curl -s -b $COOKIE $BML_URL/profile > /dev/null +curl -s -b $COOKIE $BML_URL/contacts