mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 16:21:39 +00:00
branch one, cleanup
This commit is contained in:
parent
5ae57ca4cc
commit
fcb9adf33a
19
inxi
19
inxi
|
@ -6333,7 +6333,7 @@ get_networking_data()
|
||||||
A_NETWORK_DATA=( $(
|
A_NETWORK_DATA=( $(
|
||||||
echo "$Lspci_v_Data" | gawk '
|
echo "$Lspci_v_Data" | gawk '
|
||||||
# NOTE: see version 2.1.28 or earlier for old logic if for some reason it is needed again
|
# NOTE: see version 2.1.28 or earlier for old logic if for some reason it is needed again
|
||||||
# that used a modified string made from nic name, why, I have no idea, makes no sense and leads
|
# that used a modified string made from nic name for index, why, I have no idea, makes no sense and leads
|
||||||
# to wrong ordered output as well.
|
# to wrong ordered output as well.
|
||||||
BEGIN {
|
BEGIN {
|
||||||
IGNORECASE=1
|
IGNORECASE=1
|
||||||
|
@ -6348,12 +6348,7 @@ get_networking_data()
|
||||||
gsub(/,/, " ", aNic[counter])
|
gsub(/,/, " ", aNic[counter])
|
||||||
gsub(/^ +| +$/, "", aNic[counter])
|
gsub(/^ +| +$/, "", aNic[counter])
|
||||||
gsub(/ [ \t]+/, " ", aNic[counter])
|
gsub(/ [ \t]+/, " ", aNic[counter])
|
||||||
# NOT USED: construct a unique string ending for each device type detected, this allows for
|
|
||||||
# multiple instances of the same exact devices, ie, dual gigabit, virtual devices, etc
|
|
||||||
# nic = counter "*" nic "~~" counter++
|
|
||||||
aPciBusId[counter] = gensub(/(^[0-9a-f:\.]+) [^:]+: .+$/,"\\1","g",$0)
|
aPciBusId[counter] = gensub(/(^[0-9a-f:\.]+) [^:]+: .+$/,"\\1","g",$0)
|
||||||
# NOT USED: I do not understand why incrementing a string index makes sense?
|
|
||||||
# eth[nic]++
|
|
||||||
while ( getline && !/^$/ ) {
|
while ( getline && !/^$/ ) {
|
||||||
gsub(/,/, "", $0)
|
gsub(/,/, "", $0)
|
||||||
if ( /^[[:space:]]*I\/O/ ) {
|
if ( /^[[:space:]]*I\/O/ ) {
|
||||||
|
@ -6370,20 +6365,13 @@ get_networking_data()
|
||||||
}
|
}
|
||||||
|
|
||||||
END {
|
END {
|
||||||
j=0
|
|
||||||
for (i=0;i<counter;i++) {
|
for (i=0;i<counter;i++) {
|
||||||
useDrivers=""
|
useDrivers=""
|
||||||
usePorts=""
|
usePorts=""
|
||||||
useModules=""
|
useModules=""
|
||||||
useNic=""
|
useNic=""
|
||||||
usePciBusId=""
|
usePciBusId=""
|
||||||
# NOT USED: first condition should almost never/never happen
|
|
||||||
# if ( eth[i] > 1 ) {
|
|
||||||
# a[j] = eth[i] "x " i
|
|
||||||
# }
|
|
||||||
# else {
|
|
||||||
# a[j] = i
|
|
||||||
# }
|
|
||||||
## note: this loses the plural ports case, is it needed anyway?
|
## note: this loses the plural ports case, is it needed anyway?
|
||||||
if ( aPorts[i] != "" ) {
|
if ( aPorts[i] != "" ) {
|
||||||
usePorts = aPorts[i]
|
usePorts = aPorts[i]
|
||||||
|
@ -6401,11 +6389,8 @@ get_networking_data()
|
||||||
usePciBusId = aPciBusId[i]
|
usePciBusId = aPciBusId[i]
|
||||||
}
|
}
|
||||||
# create array primary item for master array
|
# create array primary item for master array
|
||||||
# NOT USED: and strip out the counter again, this handled dual cards with same chipset
|
|
||||||
# sub( /~~[0-9]+$/, "", a[j] )
|
|
||||||
sub( / $/, "", usePorts ) # clean off trailing whitespace
|
sub( / $/, "", usePorts ) # clean off trailing whitespace
|
||||||
print useNic "," useDrivers "," usePorts "," useModules, "," usePciBusId
|
print useNic "," useDrivers "," usePorts "," useModules, "," usePciBusId
|
||||||
# j++
|
|
||||||
}
|
}
|
||||||
}' ) )
|
}' ) )
|
||||||
IFS="$ORIGINAL_IFS"
|
IFS="$ORIGINAL_IFS"
|
||||||
|
|
Loading…
Reference in a new issue