Answer the question
In order to leave comments, you need to log in
Request to api.telegram.org?
Tell me how to fix the code for passing the request through a proxy for a request to the telegram bot, as you know, Roskomnadzor blocks these attempts.
#!/bin/sh
API_TOKEN=''
CHAT_ID=''
if [ -z "$CHAT_ID" ]; then
echo 'Please, define CHAT_ID first! See "chat":{"id":xxxxxxx string below:'
/usr/bin/wget -qO - https://api.telegram.org/bot$API_TOKEN/getUpdates
exit 1
fi
MSG="<b>$(nvram get computer_name)</b>: [email protected]"
/usr/bin/wget -qs "https://api.telegram.org/bot$API_TOKEN/sendMessage?chat_id=$CHAT_ID&parse_mode=html&text=$MSG" 2>&1
if [ $? -eq 0 ]; then
echo 'Message sent successfully.'
else
echo 'Error while sending message!'
exit 1
fi
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question