Created
April 14, 2022 05:30
-
-
Save olex0r/55b6df23e2afbf2b01be2e69a1da03a8 to your computer and use it in GitHub Desktop.
Get WAN IP
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
#!/bin/bash | |
WANIP=$(dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'"' '{ print $2}') | |
WANGEO=$(geoiplookup $WANIP | cut -d ' ' -f 4,5) | |
echo $WANIP | |
echo $WANGEO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment