Compare commits

..

No commits in common. "ee6600e0fc3bbfccdb7617b266d079b82524365c" and "8e2c6d1983d8979cc9f678bed473fb06a31e6735" have entirely different histories.

2 changed files with 17 additions and 6 deletions

View File

@ -2,11 +2,9 @@
## Alert BML Online/Down for maintanace on Telegram
# NOTE: DUE TO RECENT CHANGES WITH BML TO STOP BOTS, THIS BOT NOW NEEDS A PROXY SERVER!!
## Getting started.
### Requirements
`curl` `jq` `screen`
`curl` `screen`
- Install with whatever package manager you use.
- Make SURE they are installed before continuing!
### Clone repo and Configure

View File

@ -4,8 +4,21 @@ while true;
do
source .env
COUNT=$(echo $[$COUNT+1])
STATUS=$(curl -si $BML_URL/login | jq .code)
if [ "$STATUS" = "0" ]
STATUS=$(curl -si $BML_URL/login \
-H 'authority: www.bankofmaldives.com.mv' \
-H 'cache-control: max-age=0' \
-H 'upgrade-insecure-requests: 1' \
-H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.83 Safari/537.36' \
-H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' \
-H 'sec-gpc: 1' \
-H 'sec-fetch-site: none' \
-H 'sec-fetch-mode: navigate' \
-H 'sec-fetch-user: ?1' \
-H 'sec-fetch-dest: document' \
-H 'accept-language: en-US,en;q=0.9' \
-H "cookie: cf_clearance=${CF_CLEARANCE};" \
--compressed | head -n1 | awk '{print $2}')
if [ "$STATUS" = "200" ]
then
TEXT="🟢BML Online"
else
@ -16,7 +29,7 @@ source .env
STATUS_OLD=$STATUS
if [ "$COUNT" != "1" ]
then
TGTEXT=$(echo Status: $TEXT | sed "s/ /%20/g")
TGTEXT=$(echo Status: $TEXT%0ACode: HTTP $STATUS | sed "s/ /%20/g")
curl -s $TG_BOTAPI$TG_BOT_TOKEN/sendMessage?chat_id=$TG_CHATID'&'text=${TGTEXT}
fi
fi