#!/bin/bash # notify.sh — Send Telegram notification # Usage: ./notify.sh "message text" # Requires TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID env vars (or source from .env) SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" [ -f "$SCRIPT_DIR/.env" ] && source "$SCRIPT_DIR/.env" if [ -z "$TELEGRAM_BOT_TOKEN" ] || [ -z "$TELEGRAM_CHAT_ID" ]; then echo "TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID required" exit 1 fi MSG="${1:-No message}" curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \ -d chat_id="$TELEGRAM_CHAT_ID" \ -d text="$MSG" \ -d parse_mode="Markdown" > /dev/null