]> git.nbdom.net Git - nb.git/commitdiff
Merge branch 'testing'
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 14 May 2018 15:17:22 +0000 (16:17 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 14 May 2018 15:17:22 +0000 (16:17 +0100)
1  2 
etc/profile.d/functions

index 3bb8c0546c202f5f52f0f87a662be9ed6525d000,36b73824544f3ef2ded9d912bb7bd81735266138..ca658bea151cd63bf0f187564b25f087a70c8213
@@@ -772,12 -725,11 +725,12 @@@ 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
 +              #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" | perl -ne 'print "$1\n" and exit 64 if /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/';
 +              http_get "$url" | sed -n '/\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}/p; q' | awk '{print $1; exit 64}'
 +
                [ "$?" == "64" ] && return 0;
        done;
        return 1