From f8355505182b9bf68181138c95ce7fd038e28731 Mon Sep 17 00:00:00 2001 From: Harald Hope Date: Tue, 31 Oct 2023 15:37:38 -0700 Subject: [PATCH] synced pinxi to inxi --- pinxi | 24 +++++++++++++----------- pinxi.1 | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/pinxi b/pinxi index d674925..ae04c10 100755 --- a/pinxi +++ b/pinxi @@ -49,9 +49,9 @@ use POSIX qw(ceil uname strftime ttyname); ## INXI INFO ## my $self_name='pinxi'; -my $self_version='3.3.30'; -my $self_date='2023-10-23'; -my $self_patch='09'; +my $self_version='3.3.31'; +my $self_date='2023-10-31'; +my $self_patch='01'; ## END INXI INFO ## my ($b_pledge,@pledges); @@ -20803,15 +20803,16 @@ sub wan_ip { my ($b_dig,$b_html,$ip,$ua); my $num = 0; # time: 0.06 - 0.07 seconds - # cisco opendns.com may be terminating supporting this one, sometimes works, sometimes not: - # use -4/6 to force ipv 4 or 6, but generally we want the 'natural' native - # ip returned. - # dig +short +time=1 +tries=1 myip.opendns.com @resolver1.opendns.com - # dig +short @ns1-1.akamaitech.net ANY whoami.akamai.net - # this one can take forever, and sometimes requires explicit -4 or -6 - # dig -4 TXT +short o-o.myaddr.l.google.com @ns1.google.com + # Cisco opendns.com may be terminating supporting this one, sometimes works, sometimes not: + # use -4/6 to force ipv 4 or 6, but generally we want the 'natural' native ip returned. + # dig +short +time=1 +tries=1 myip.opendns.com @resolver1.opendns.com :: 0.021s + # Works but is slow: + # dig +short @ns1-1.akamaitech.net ANY whoami.akamai.net :: 0.156s + # This one can take forever, and sometimes requires explicit -4 or -6 + # dig -4 TXT +short o-o.myaddr.l.google.com @ns1.google.com :: 0.026s; 1.087ss if (!$force{'no-dig'} && (my $program = main::check_program('dig'))){ $ip = (main::grabber("$program +short +time=1 +tries=1 \@ns1-1.akamaitech.net ANY whoami.akamai.net 2>/dev/null"))[0]; + $ip =~ s/"//g if $ip; # some return IP in quotes, when using TXT $b_dig = 1; } if (!$ip && !$force{'no-html-wan'}){ @@ -20827,8 +20828,9 @@ sub wan_ip { # 0.020s: http://whatismyip.akamai.com/ # 0.136s: https://get.geojs.io/v1/ip # 0.024s: http://icanhazip.com/ + # 0.027s: ifconfig.io # 0.230s: https://smxi.org/opt/ip.php - # http://whatismyip.akamai.com/ http://icanhazip.com/ + # 0.023s: https://api.ipify.org :: NOTE: hangs, widely variable times, don't use my @urls = (!$wan_url) ? qw(http://whatismyip.akamai.com/ http://icanhazip.com/ https://smxi.org/opt/ip.php) : ($wan_url); foreach (@urls){ diff --git a/pinxi.1 b/pinxi.1 index 8739392..fbaac8e 100644 --- a/pinxi.1 +++ b/pinxi.1 @@ -15,7 +15,7 @@ .\" with this program; if not, write to the Free Software Foundation, Inc., .\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. .\" -.TH INXI 1 "2023\-09\-25" "inxi" "inxi manual" +.TH INXI 1 "2023\-10\-31" "inxi" "inxi manual" .SH NAME inxi \- Command line system information script for console and IRC