Skip to content

Instantly share code, notes, and snippets.

@da-n
Created August 24, 2013 04:10
Show Gist options
  • Save da-n/6326007 to your computer and use it in GitHub Desktop.
Save da-n/6326007 to your computer and use it in GitHub Desktop.
# 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