]> git.rmz.io Git - dotfiles.git/blobdiff - bin/whatsmyip
mutt: fix F macro to not write message to home
[dotfiles.git] / bin / whatsmyip
index 8f6cbc77ce7b657c4c1d22268ca05cccc94841a0..288e3b3f7b30f90516c611a120effa760644b390 100755 (executable)
@@ -1,4 +1,9 @@
 #!/bin/bash
 #!/bin/bash
-# only works behind DD-WRT router
-#ssh root@192.168.1.3 -p 2222 -q "nvram get wan_ipaddr"
-curl -s 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