can print balance now
This commit is contained in:
parent
d3c9f9efc8
commit
b0f07dc028
32
get-balance.sh
Normal file → Executable file
32
get-balance.sh
Normal file → Executable file
@ -1,30 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
#Import variable
|
||||
#Import variables
|
||||
source .env
|
||||
|
||||
|
||||
get_balance(){
|
||||
#Login
|
||||
$curl -s -c $COOKIE $BML_URL/login \
|
||||
--data-raw username=$BML_USERNAME \
|
||||
--data-raw password=${BML_PASSWORD}
|
||||
echo ""
|
||||
echo "Login done"; sleep 2
|
||||
echo ""
|
||||
|
||||
--data-raw password=${BML_PASSWORD} > /dev/null
|
||||
|
||||
# Get profiles and select personal profile
|
||||
#$curl -s -b $COOKIE $BML_URL/profile | jq -r '.payload | .profile | .[] | .profile' | head -n 1
|
||||
$curl -s -b $COOKIE $BML_URL/profile
|
||||
echo ""
|
||||
echo "Get Profile done"; sleep 2
|
||||
echo ""
|
||||
PROFILE=$($curl -s -b $COOKIE $BML_URL/profile | jq -r '.payload | .profile | .[] | .profile' | head -n 1)
|
||||
$curl -s -b $COOKIE $BML_URL/profile \
|
||||
--data-raw profile=$PROFILE >> /dev/null
|
||||
|
||||
# Getting dashboard
|
||||
BALANCE=$($curl -s -b $COOKIE $BML_URL/dashboard | jq -r '.payload | .dashboard |.[] | [.availableBalance] | .[]' | head -n1)
|
||||
}
|
||||
|
||||
get_balance
|
||||
|
||||
# Print Balance
|
||||
echo MVR: $BALANCE
|
||||
|
||||
#PROFILE=$($curl -s -b $COOKIE $BML_URL/profile | jq -r '.payload | .profile | .[] | .profile' | head -n 1)
|
||||
#$curl -s -b $COOKIE $BML_URL/profile \
|
||||
# --data-raw profile=$PROFILE >> /dev/null
|
||||
#
|
||||
#$curl -s -c $COOKIE $BML_URL/api/dashboard
|
||||
|
Loading…
x
Reference in New Issue
Block a user