Skip to content

Instantly share code, notes, and snippets.

@beevelop
Last active August 29, 2015 14:23
Show Gist options
  • Save beevelop/a11a5562e4b4ac300f6a to your computer and use it in GitHub Desktop.
Save beevelop/a11a5562e4b4ac300f6a to your computer and use it in GitHub Desktop.
# 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