Skip to content

Instantly share code, notes, and snippets.

@VTimofeenko
Created January 2, 2020 22:33
Show Gist options
  • Save VTimofeenko/bb2725beb6f321c4c065055deca8bacd to your computer and use it in GitHub Desktop.
Save VTimofeenko/bb2725beb6f321c4c065055deca8bacd to your computer and use it in GitHub Desktop.
#!/bin/sh
# A _very_ primitive telegram notification mechanism
# If you want something more sophisticated - check https://github.com/vysheng/tg
if [ -z "${1}" ]
then
message_text="Job's done!"
else
message_text=${1}
fi
curl -X POST \
-H 'Content-Type: application/json' \
-d "{\"chat_id\": \"${CHAT_ID}\", \"text\": \"${message_text}\", \"disable_notification\": true}" \
https://api.telegram.org/bot${BOT_ID}:${BOT_KEY}/sendMessage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment