-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nordigen): add telegram requisition hook
- Loading branch information
1 parent
77c792a
commit 2be6020
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
|
||
# This script will send a message to a Telegram channel with the reauthentication link | ||
# | ||
# Configuration is done in the /data/telegram_config.env | ||
# Environment variables expected | ||
# | ||
# telegram_bot_token | ||
# telegram_chat_id | ||
# | ||
|
||
# Check if the required parameters are provided | ||
if [ "$#" -ne 2 ]; then | ||
echo "Usage: $0 <status> <link>" | ||
exit 1 | ||
fi | ||
|
||
# Load Telegram credentials from the file if available | ||
if [ -f "/data/telegram_config.env" ]; then | ||
. "/data/telegram_config.env" | ||
fi | ||
|
||
# Set the parameters | ||
status="$1" | ||
link="$2" | ||
|
||
# Send the message to the Telegram channel | ||
curl -s -X POST https://api.telegram.org/bot${telegram_bot_token}/sendMessage -d chat_id=${telegram_chat_id} -d text="YNABber needs reauthentication\n\nStatus: $status\nLink: $link" | ||
|