Skip to content

Commit

Permalink
Make Telegram message match inotify message
Browse files Browse the repository at this point in the history
  • Loading branch information
pedropombeiro committed Sep 22, 2024
1 parent ea5467b commit e702cfa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions script/trigger_telegram.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Check if TELEGRAM_TOKEN and TELEGRAM_CHATID are both set
if [ -z "${TELEGRAM_TOKEN}" ] || [ -z "${TELEGRAM_CHATID}" ]; then
echo "TELEGRAM_TOKEN or TELEGRAM_CHATID is not set"
echo "TELEGRAM_TOKEN or TELEGRAM_CHATID environment variables not set, skipping Telegram trigger."
exit 1
fi

Expand All @@ -17,4 +17,4 @@ MESSAGE="Scanner: $1"
ENCODED_MESSAGE=$(echo "$MESSAGE" | jq -sRr @uri)

# Send the message using wget
wget -qO- --post-data="chat_id=$CHAT_ID&text=$ENCODED_MESSAGE" "https://api.telegram.org/$TOKEN/sendMessage" > /dev/null
wget -qO- --post-data="chat_id=$CHAT_ID&text=$ENCODED_MESSAGE" "https://api.telegram.org/$TOKEN/sendMessage" >/dev/null

0 comments on commit e702cfa

Please sign in to comment.