Skip to content

Instantly share code, notes, and snippets.

@dvdvnl
Last active September 16, 2019 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dvdvnl/fde377382aa3c0cba4cfc92e1f538794 to your computer and use it in GitHub Desktop.
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)
#!/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