Skip to content

Instantly share code, notes, and snippets.

@StoneMoe
Last active May 15, 2016 09:11
Show Gist options
  • Save StoneMoe/aade196c06b292952e0cc65ea0eeda0d to your computer and use it in GitHub Desktop.
Save StoneMoe/aade196c06b292952e0cc65ea0eeda0d to your computer and use it in GitHub Desktop.
Linux login telegram bot alert
echo "Welcome, "$(whoami)
login_notice_id="" # admin's telegram id
login_notice_username=$(whoami)
login_notice_token="" # telegram bot token
curl --silent --data "chat_id=${login_notice_id}&text=${login_notice_username}&parse_mode=HTML&disable_web_page_preview=true" -o /dev/null https://api.telegram.org/bot$(login_notice_token)/sendMessage
printf "\n"
@StoneMoe
Copy link
Author

Maybe you wanna put this script into /etc/profile.d/scriptname.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment