From: Nicolas Boisselier Date: Wed, 18 Apr 2018 01:58:34 +0000 (+0100) Subject: etc/profile.d/functions X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=3c87d8e1bb7037ce3d45c45554a3bad159241117;p=nb.git etc/profile.d/functions --- diff --git a/etc/profile.d/functions b/etc/profile.d/functions index cc7acf6f..d91558e0 100644 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -791,7 +791,7 @@ file_user() { myip() { local url=''; - for url in http://nbdom.net/myip http://nicolas.boisselier.free.fr/myip/ http://ipinfo.io/ip http://www.ipchicken.com http://icanhazip.com http://ident.me + for url in http://nicolas.boisselier.free.fr/myip/ http://nbdom.net/myip http://ipinfo.io/ip http://www.ipchicken.com http://icanhazip.com http://ident.me do http_get "$url" 2> /dev/null | awk 'match($0, /([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})/) {print substr($0, RSTART, RLENGTH); exit 64}' #http_get "$url" | sed -n '/\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}/p; q' | awk '{print $1}' | head -1