add send_telegram script
This commit is contained in:
parent
0e349dbccc
commit
62aeec73c2
19
services/send_telegram
Executable file
19
services/send_telegram
Executable file
@ -0,0 +1,19 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Check if both monitor names are provided as arguments
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Usage: $0 <message_to_send>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set the API token and chat ID
|
||||
API_TOKEN="7074090911:AAEoazbp1LcqRE7qq9Jf71sXpQaQOz-D0fc"
|
||||
CHAT_ID="1622364607"
|
||||
|
||||
MESSAGE="$1"
|
||||
|
||||
# Use the curl command to send the message
|
||||
curl -s -X POST https://api.telegram.org/bot$API_TOKEN/sendMessage -d chat_id=$CHAT_ID -d text="$MESSAGE" \
|
||||
> /dev/null
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user