Last active
April 25, 2018 08:04
-
-
Save conrad784/d083c8d31d470da153011d3a3689cca0 to your computer and use it in GitHub Desktop.
query your ipv4/6 address and print the name of the network you are in
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 characters
#!/bin/sh | |
IPV4=$(curl -s -4 icanhazip.com) | |
IPV6=$(curl -s -6 icanhazip.com) | |
PTR4=$(curl -s -4 icanhazptr.com) | |
PTR6=$(curl -s -6 icanhazptr.com) | |
NETNAME=$(whois $IPV4 | grep netname | rev | cut -d ' ' -f1 | rev) | |
echo "IPV4: $IPV4" | |
echo "IPV6: $IPV6" | |
echo "PTR4: $PTR4" | |
echo "PTR6: $PTR6" | |
echo " net: $NETNAME" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment