Created
May 25, 2015 19:12
-
-
Save anonymous/8bc44d8ba5b4eb069322 to your computer and use it in GitHub Desktop.
This file contains 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
ipaddress="$(sudo cat /var/log/messages |tail|grep -Po '(peer from calling number\s)\K[^\s]*')" | |
iplookup="ipinfo.io/$ipaddress" | |
echo "New PPTP Connection Alert" > /tmp/ppp.log | |
echo "Source IP:" $(cat /var/log/messages |tail|grep -Po '(peer from calling number\s)\K[^\s]*') >> /tmp/ppp.log | |
echo "Client IP: $5" >> /tmp/ppp.log | |
echo "IP lookup info:\n $(curl $iplookup)" >> /tmp/ppp.log | |
echo "$(date)" >> /tmp/ppp.log | |
cat /tmp/ppp.log | mail -s "New PPTP VPN Connection" email@address.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment