Last active
August 29, 2015 14:23
-
-
Save beevelop/a11a5562e4b4ac300f6a 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
# SSH Login Notification for Pushover | |
# Add to end of /etc/profile | |
if [ -n "$SSH_CLIENT" ]; then | |
TITLE="${USER}@$(hostname -f)" | |
TEXT="$(date): SSH login to ${USER}@$(hostname -f)" | |
TEXT="$TEXT from $(echo $SSH_CLIENT|awk '{print $1}')" | |
curl -s \ | |
-F "token=API-TOKEN" \ | |
-F "user=API-USER" \ | |
-F "title=$TITLE" \ | |
-F "message=$TEXT" \ | |
-F "priority=2" \ | |
-F "retry=342" \ | |
-F "expire=7042" \ | |
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