what could possibly go wrong

This commit is contained in:
Shihaam Abdul Rahman 2022-04-09 02:01:58 +05:00
parent 480754a82f
commit 5ea3bf6231
Signed by: shihaam
GPG Key ID: 16ADCF6871CB2A56

View File

@ -14,19 +14,21 @@ source .env
else else
TEXT="🔴BML Down" TEXT="🔴BML Down"
STATUS=DOWN STATUS=DOWN
if [ "$JCODE" = "69" ]
then
curl -s $TG_BOTAPI$TG_BOT_TOKEN/sendMessage?chat_id=$PROXY_ALERT_CHATID'&'text=$JCODE
STATUS_OLD=$STATUS
fi
fi fi
if [ "$STATUS" != "$STATUS_OLD" ] if [ "$STATUS" != "$STATUS_OLD" ]
then then
STATUS_OLD=$STATUS STATUS_OLD=$STATUS
if [ "$COUNT" != "1" ] if [ "$COUNT" != "1" ]
then then
TGTEXT=$(echo Status: $TEXT | sed "s/ /%20/g"); echo Telegram Text $TGTEXT if [ "$JCODE" = "69" ]
curl -s $TG_BOTAPI$TG_BOT_TOKEN/sendMessage?chat_id=$TG_CHATID'&'text=${TGTEXT} then
JMSG=$(cat .cache | tail -n1 | jq .msg); echo Json Message: $JMSG
TGTEXT=$(echo Json Code: $JCODE%0AJson Message: $JMSG | sed "s/ /%20/g"); echo Telegram Text $TGTEXT
curl -s $TG_BOTAPI$TG_BOT_TOKEN/sendMessage?chat_id=$PROXY_ALERT_CHATID'&'text=${TGTEXT}
else
TGTEXT=$(echo Status: $TEXT | sed "s/ /%20/g"); echo Telegram Text $TGTEXT
curl -s $TG_BOTAPI$TG_BOT_TOKEN/sendMessage?chat_id=$TG_CHATID'&'text=${TGTEXT}
fi
fi fi
fi fi
sleep $DELAY sleep $DELAY