debugging

This commit is contained in:
inxi-svn 2008-11-21 21:14:23 +00:00
parent f197246e5b
commit 9bba645d55

15
inxi
View file

@ -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()