]> git.rmz.io Git - dotfiles.git/blobdiff - bin/whatsmyip
Backup UH
[dotfiles.git] / bin / whatsmyip
index 4b6d0800bb0df96c898751002118816e9b2abe7a..5f0479f780c3d902700f105da322bc253a8c1344 100755 (executable)
@@ -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 +short myip.opendns.com @resolver1.opendns.com
+if 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