#!/bin/bash # ============================================ # Security Notifier — DAARION # Version: 1.0.0 # Purpose: Send security alerts and reports to Telegram/Email # ============================================ # Configuration (Fill these or set via ENV) TOKEN="${TELEGRAM_BOT_TOKEN:-8112062582:AAGI7tPFo4gvZ6bfbkFu9miq5GdAH2_LvcM}" CHAT_ID="${TELEGRAM_CHAT_ID:-}" # YOUR CHAT ID HERE send_telegram_msg() { local message="$1" if [ -n "$CHAT_ID" ]; then curl -s -X POST "https://api.telegram.org/bot$TOKEN/sendMessage" \ -d "chat_id=$CHAT_ID" \ -d "text=$message" \ -d "parse_mode=Markdown" > /dev/null fi } send_telegram_doc() { local doc_path="$1" local caption="$2" if [ -n "$CHAT_ID" ] && [ -f "$doc_path" ]; then curl -s -X POST "https://api.telegram.org/bot$TOKEN/sendDocument" \ -F "chat_id=$CHAT_ID" \ -F "document=@$doc_path" \ -F "caption=$caption" > /dev/null fi } # Usage examples: # ./notify.sh --msg "🚨 *Alert:* Potential miner detected on NODE1" # ./notify.sh --doc "/path/to/report.md" "🛡️ Security Audit Report" case "$1" in --msg) send_telegram_msg "$2" ;; --doc) send_telegram_doc "$2" "$3" ;; *) echo "Usage: $0 [--msg 'message'] [--doc '/path/to/file' 'caption']" ;; esac