Created
August 24, 2013 04:10
-
-
Save da-n/6326007 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Send login notification to Pushover | |
# This goes into /etc/profile | |
if [ -n "$SSH_CLIENT" ]; then | |
TEXT="$(date): SSH login to ${USER}@$(hostname -f)" | |
TEXT="$TEXT from $(echo $SSH_CLIENT|awk '{print $1}')" | |
## Send to pushover | |
curl -s \ | |
-F "token=API_TOKEN" \ | |
-F "user=API_USER" \ | |
-F "message=$TEXT" \ | |
https://api.pushover.net/1/messages.json >/dev/null 2>&1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment