clean up
This commit is contained in:
parent
dd6307ca83
commit
a88a6b22e4
@ -1,11 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
source .env
|
source .env
|
||||||
|
mkdir -p ~/.cache/bml-cli/
|
||||||
TG_BOTAPI='https://api.telegram.org/bot'
|
TG_BOTAPI='https://api.telegram.org/bot'
|
||||||
BML_URL='https://www.bankofmaldives.com.mv/internetbanking/api'
|
BML_URL='https://www.bankofmaldives.com.mv/internetbanking/api'
|
||||||
|
|
||||||
mkdir -p ~/.cache/bml-cli/
|
|
||||||
COOKIE=~/.cache/bml-cli/cookie
|
COOKIE=~/.cache/bml-cli/cookie
|
||||||
|
|
||||||
LOGIN=$(curl -s -c $COOKIE $BML_URL/login --data-raw username=$BML_USERNAME --data-raw password=${BML_PASSWORD} | jq -r .code)
|
LOGIN=$(curl -s -c $COOKIE $BML_URL/login --data-raw username=$BML_USERNAME --data-raw password=${BML_PASSWORD} | jq -r .code)
|
||||||
@ -19,9 +16,11 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
|
|
||||||
CHECKDIFF1=$(echo $HISTORY | wc -c)
|
CHECKDIFF1=$(echo $HISTORY | wc -c)
|
||||||
HISTORY=$(curl -s -b $COOKIE $BML_URL/account/$BML_ACCOUNTID/history/today | jq -r '.payload | .history | .[]')
|
HISTORY=$(curl -s -b $COOKIE $BML_URL/account/$BML_ACCOUNTID/history/today | jq -r '.payload | .history | .[]')
|
||||||
CHECKDIFF2=$(echo $HISTORY | wc -c)
|
CHECKDIFF2=$(echo $HISTORY | wc -c)
|
||||||
|
|
||||||
if [ "$CHECKDIFF1" = "$CHECKDIFF2" ]
|
if [ "$CHECKDIFF1" = "$CHECKDIFF2" ]
|
||||||
then
|
then
|
||||||
echo nothing new..checking again
|
echo nothing new..checking again
|
||||||
|
Loading…
x
Reference in New Issue
Block a user