X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/09496b6ff99a67b874af21c1d5a937240912639b..c6a94b49c00ea320c67909cbe0d2df2f95d4fbb9:/bin/whatsmyip?ds=inline diff --git a/bin/whatsmyip b/bin/whatsmyip index 4b6d080..288e3b3 100755 --- a/bin/whatsmyip +++ b/bin/whatsmyip @@ -1,4 +1,9 @@ #!/bin/bash -# only works behind DD-WRT router -#ssh root@192.168.1.3 -p 2222 -q "nvram get wan_ipaddr" -curl ifconfig.me/ip + +if hash drill 2>/dev/null; then + drill myip.opendns.com @resolver1.opendns.com | grep "^myip." | cut -f5 +elif hash dig 2>/dev/null; then + dig +short myip.opendns.com @resolver1.opendns.com +elif hash curl 2>/dev/null; then + curl -s ifconfig.me/ip +fi