Last active
September 16, 2019 08:35
-
-
Save dvdvnl/fde377382aa3c0cba4cfc92e1f538794 to your computer and use it in GitHub Desktop.
Send a Pushbullet note whenever a login happens. (Gist for https://www.davole.com/2019/pushbullet-on-login)
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
#!/bin/bash | |
accessToken="<Pushbullet Access Token>" | |
recipient="<Recipient e-mail>" | |
title="Login - $HOSTNAME" | |
body="The user '$USER' just logged in to '$HOSTNAME'." | |
curl -X POST \ | |
--header "Access-Token: $accessToken" \ | |
--header "Content-Type: application/json" \ | |
-d "{\"email\":\"$recipient\", \"type\":\"note\", \"title\":\"$title\", \"body\":\"$body\"}" \ | |
--silent \ | |
--output /dev/null \ | |
https://api.pushbullet.com/v2/pushes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment