From 9bba645d557917b6b22f36427668668fd77c18ad Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Fri, 21 Nov 2008 21:14:23 +0000 Subject: [PATCH] debugging --- inxi | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/inxi b/inxi index 468a67d..ddb6a6e 100755 --- a/inxi +++ b/inxi @@ -1826,10 +1826,10 @@ get_networking_local_ip_data() IFS=$'\n' A_INTERFACES_DATA=( $( ifconfig | gawk ' BEGIN { IGNORECASE=1 } - $1 !~ /^lo|^[ \t]/ { + $0 !~ /^lo/ { # not clear on why inet is coming through, but this gets rid of it # as first line item. - if ( $1 != "inet" ) { +# if ( $1 !~ /^inet/ ) { interface = $1 gsub(/,/, " ", interface) gsub(/^ +| +$/, "", interface) @@ -1842,19 +1842,23 @@ get_networking_local_ip_data() ipAddresses[interface] = gensub( /addr:([0-9\.]+)/, "\\1", "g", $2 ) } } - } +# } +# print ":" $0 ":" } END { j=0 for (i in aInterfaces) { useInterfaceIp = "" - a[j]=i + a[j] = i if (ipAddresses[i] != "") { useInterfaceIp = ipAddresses[i] } # create array primary item for master array - print a[j] "," useInterfaceIp + # tested needed to avoid bad data from above + if ( useInterfaceIp != "" ) { + print a[j] "," useInterfaceIp + } j++ } }') ) @@ -1862,6 +1866,7 @@ get_networking_local_ip_data() else A_INTERFACES_DATA=( "Interfaces requires ifconfig. App missing." ) fi + echo ${A_INTERFACES_DATA[@]} } get_partition_data()