feat: add Telegram notification support and remove explicit ntfy/Gmail inputs
This commit is contained in:
10
notify.sh
10
notify.sh
@@ -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
|
||||
Reference in New Issue
Block a user