Skip to content

Instantly share code, notes, and snippets.

@tamr
Created September 3, 2021 19:08
Show Gist options
  • Save tamr/512aa47ee7278ed1d5c07002d6d6b51a to your computer and use it in GitHub Desktop.
Save tamr/512aa47ee7278ed1d5c07002d6d6b51a to your computer and use it in GitHub Desktop.

Revisions

  1. tamer created this gist Sep 3, 2021.
    6 changes: 6 additions & 0 deletions sshrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    #!/bin/bash

    ip=`echo $SSH_CONNECTION | cut -d " " -f 1`
    server_ip=`echo $SSH_CONNECTION | cut -d " " -f 3`
    #server_ip="$(wget -qO- checkip.amazonaws.com)"
    wget -qO /dev/null --delete-after --no-check-certificate "https://push.re/message?token=AppToken" --post-data "title=SSH+Login+on+$server_ip&message=User+$USER+just+logged+in+from+https://ipapi.co/$ip&priority=5"