From: Samir Benmendil Date: Sun, 24 Nov 2019 14:14:22 +0000 (+0000) Subject: bin: fix whatsmyip script X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/1ec67e3b3cbd2e71be69a6bf5488a6bf1c4696d3?ds=inline bin: fix whatsmyip script --- diff --git a/bin/whatsmyip b/bin/whatsmyip index 5f0479f..288e3b3 100755 --- a/bin/whatsmyip +++ b/bin/whatsmyip @@ -1,8 +1,8 @@ #!/bin/bash if hash drill 2>/dev/null; then - drill +short myip.opendns.com @resolver1.opendns.com -if hash dig 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