feat: add Telegram notification support and remove explicit ntfy/Gmail inputs

This commit is contained in:
2025-12-29 16:07:20 +07:00
parent 982e814a0f
commit 2298c3a4b3
2 changed files with 20 additions and 30 deletions

View File

@@ -6,6 +6,8 @@ if [ "$STATUS" = "failure" ]; then
ICON="❌"
fi
TEXT="$ICON *$TITLE*%0A%0A$MESSAGE"
# ---- ntfy ----
if [ -n "$NTFY_URL" ] && [ -n "$NTFY_TOPIC" ]; then
curl -s -X POST "$NTFY_URL/$NTFY_TOPIC" \
@@ -26,4 +28,12 @@ if [ -n "$GMAIL_USER" ] && [ -n "$GMAIL_TO" ]; then
-au"$GMAIL_USER" \
-ap"$GMAIL_PASS" \
"$GMAIL_TO"
fi
# ---- Telegram ----
if [ -n "$TELEGRAM_BOT_TOKEN" ] && [ -n "$TELEGRAM_CHAT_ID" ]; then
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
-d chat_id="$TELEGRAM_CHAT_ID" \
-d parse_mode="Markdown" \
-d text="$TEXT"
fi