Skip to content

Instantly share code, notes, and snippets.

@r-k-b
Created June 4, 2016 05:42
Show Gist options
  • Save r-k-b/e04317694cc8412cf63b5b5b8e3c998c to your computer and use it in GitHub Desktop.
Save r-k-b/e04317694cc8412cf63b5b5b8e3c998c to your computer and use it in GitHub Desktop.
Show me my public IP address, and basic details of the ISP for same.
#!/bin/bash
WANIP="$(dig +short myip.opendns.com @resolver1.opendns.com)" &&
echo "Wan IP: ${WANIP}" &&
whois $WANIP | grep -iE -e 'netname:' -e 'e-mail:' -e 'irt:'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment