diff --git a/bml-tg-notify/bml-tg-notify.sh b/bml-tg-notify/bml-tg-notify.sh index 296b91c..c410975 100755 --- a/bml-tg-notify/bml-tg-notify.sh +++ b/bml-tg-notify/bml-tg-notify.sh @@ -5,6 +5,7 @@ TG_BOTAPI='https://api.telegram.org/bot' BML_URL='https://www.bankofmaldives.com.mv/internetbanking/api' COOKIE=~/.cache/bml-cli/cookie +while true; do LOGIN=$(curl -s -c $COOKIE $BML_URL/login --data-raw username=$BML_USERNAME --data-raw password=${BML_PASSWORD} | jq -r .code) if [ "$LOGIN" = "0" ] then @@ -15,8 +16,6 @@ else exit fi -while true; do - CHECKDIFF1=$(echo $HISTORY | wc -c) HISTORY=$(curl -s -b $COOKIE $BML_URL/account/$BML_ACCOUNTID/history/today | jq -r '.payload | .history | .[]') CHECKDIFF2=$(echo $HISTORY | wc -c)