fix: canary telegram-алерт через --noproxy (xray не роутит telegram)
This commit is contained in:
@@ -74,7 +74,8 @@ send_tg() { # $1=text
|
||||
if [ -z "${ALERT_TG_BOT_TOKEN:-}" ] || [ -z "${ALERT_TG_CHAT_ID:-}" ]; then
|
||||
echo "$TS ALERT-UNSENT (TG не настроен) $1" >> "$LOG"; return 0
|
||||
fi
|
||||
if curl -s --max-time 10 "https://api.telegram.org/bot${ALERT_TG_BOT_TOKEN}/sendMessage" \
|
||||
# --noproxy: xray (HTTPS_PROXY) телегу НЕ роутит (даёт 000); слать напрямую.
|
||||
if curl -s --noproxy "*" --max-time 10 "https://api.telegram.org/bot${ALERT_TG_BOT_TOKEN}/sendMessage" \
|
||||
--data-urlencode "chat_id=${ALERT_TG_CHAT_ID}" \
|
||||
--data-urlencode "text=$1" | grep -q '"ok":true'; then
|
||||
echo "$TS ALERT-SENT tg" >> "$LOG"
|
||||
|
||||
Reference in New Issue
Block a user