From 62aeec73c281114324ab6c55f49684f32532c83f Mon Sep 17 00:00:00 2001 From: vas-dav Date: Sun, 17 Mar 2024 13:17:02 +0200 Subject: [PATCH] add send_telegram script --- services/send_telegram | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 services/send_telegram diff --git a/services/send_telegram b/services/send_telegram new file mode 100755 index 0000000..11ba446 --- /dev/null +++ b/services/send_telegram @@ -0,0 +1,19 @@ +#! /bin/sh + +# Check if both monitor names are provided as arguments +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + 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 + +