mirror of
https://github.com/guezoloic/serverconfig.git
synced 2026-01-25 10:34:23 +00:00
fix: add few functions
- create send_notification function - auto scripts/*.sh scripts searcher
This commit is contained in:
11
scripts/notifications.sh
Normal file
11
scripts/notifications.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
source /etc/serverconfig/.env
|
||||
|
||||
send_notification() {
|
||||
local message="$1"
|
||||
curl -X POST "https://api.telegram.org/bot$TELEGRAM_TOKEN/sendMessage" \
|
||||
-d "chat_id=$TELEGRAM_CHAT_ID" \
|
||||
-d "text=$message" \
|
||||
-d "parse_mode=HTML"
|
||||
}
|
||||
Reference in New Issue
Block a user