cookie dir to env

This commit is contained in:
Shihaam Abdul Rahman 2021-05-14 02:44:12 +05:00
parent 3f85e76b36
commit 6024a9ca0a
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,5 @@
#!/bin/bash
source .env # import credentials
mkdir -p ~/.cache/bml-cli/ # make cookie dir
source .env # import credentials, tg api, cookie path, bml api
if [ ! -f delay ] # if delay file missing
then
@ -9,7 +8,7 @@ fi
while true; do
LOGIN=$(curl -s -c $COOKIE $BML_URL/login --data-raw username=$BML_USERNAME --data-raw password=${BML_PASSWORD} | jq -r .code) ## attempt to login
LOGIN=$(curl -s -c $COOKIE $BML_URL/login --data-raw username=$BML_USERNAME --data-raw password=${BML_PASSWORD} | jq -r .code) # attempt to login and generate cookie
if [ "$LOGIN" = "0" ] # if Login success
then

View File

@ -9,4 +9,5 @@ TG_CHATID='' #Your Telegram chat ID, This could be your user, group, supergroup
# DO NOT EDIT THESE UNLESS YOU KNOW WHAT YOURE DOING
TG_BOTAPI='https://api.telegram.org/bot'
BML_URL='https://www.bankofmaldives.com.mv/internetbanking/api'
mkdir -p ~/.cache/bml-cli/ # make cookie dir
COOKIE=~/.cache/bml-cli/cookie # set cookie dir