Last active
August 29, 2015 13:59
-
-
Save guyhughes/10568797 to your computer and use it in GitHub Desktop.
Determine host's IP address with DuckDuckGo and curl
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
#!/usr/bin/env sh | |
curl -fs --include --request GET \ | |
'https://api.duckduckgo.com/?q=ip&l=1&no_redirect=1&skip_disambig=1&format=json' \ | |
| grep -E -o '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment