Last active
August 29, 2015 14:23
-
-
Save beevelop/a11a5562e4b4ac300f6a to your computer and use it in GitHub Desktop.
Revisions
-
beevelop revised this gist
Jun 27, 2015 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,18 @@ # 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 -
JT renamed this gist
Aug 4, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
JT created this gist
Mar 27, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ # SSH Login Notification for Pushover # Add to end of /etc/profile # Change priority to -1 to always send as a quiet notification # 1 to display as high-priority and bypass the user's quiet hours # 2 to also require confirmation from the user if [ -n "$SSH_CLIENT" ]; then 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 "message=$TEXT" \ -F "priority=1" \ https://api.pushover.net/1/messages.json >/dev/null 2>&1 fi