mirror of
https://github.com/smxi/inxi.git
synced 2025-01-18 16:37:49 +00:00
branches one, more bug fixes
This commit is contained in:
parent
593b14d8de
commit
75e4366817
29
inxi
29
inxi
|
@ -6416,6 +6416,7 @@ get_network_advanced_data()
|
|||
local a_network_adv_working='' if_data='' working_path='' working_uevent_path='' dir_path=''
|
||||
local if_id='' speed='' duplex='' mac_id='' oper_state='' chip_id='' b_path_made='true'
|
||||
local usb_data='' usb_vendor='' usb_product='' product_path='' driver_test='' array_counter=0
|
||||
local full_path=''
|
||||
# we need to change to holder since we are updating the main array
|
||||
IFS=$'\n'
|
||||
local a_main_working=(${A_NETWORK_DATA[@]})
|
||||
|
@ -6505,6 +6506,7 @@ get_network_advanced_data()
|
|||
a_network_adv_working[1]=$driver_test
|
||||
fi
|
||||
fi
|
||||
#echo wp: $working_path
|
||||
log_function_data "PRE: working_path: $working_path\nworking_uevent_path: $working_uevent_path"
|
||||
|
||||
# this applies in two different cases, one, default, standard, two, for usb, this is actually
|
||||
|
@ -6516,6 +6518,7 @@ get_network_advanced_data()
|
|||
# with line break in output
|
||||
if_data=$( ls $working_path/net 2>/dev/null )
|
||||
b_path_made='false'
|
||||
#echo yes
|
||||
# this is the normal usb detection if the first one didn't work
|
||||
elif [[ -n $usb_data && -e $working_uevent_path/net ]];then
|
||||
if_data=$( ls $working_uevent_path/net 2>/dev/null )
|
||||
|
@ -6527,10 +6530,11 @@ get_network_advanced_data()
|
|||
if_id=$( cut -d ':' -f 2 <<< "$if_data" )
|
||||
working_path=$working_path/$if_data
|
||||
fi
|
||||
#echo id: $if_data
|
||||
log_function_data "POST: working_path: $working_path\nif_data: $if_data - if_id: $if_id"
|
||||
## note: in cases of dual ports with different ids, this loop will create extra array items
|
||||
# if_data="eth0
|
||||
# ib0
|
||||
# eth2
|
||||
# ib1"
|
||||
# echo if_data $if_data
|
||||
if [[ -n $if_data ]];then
|
||||
|
@ -6540,26 +6544,31 @@ get_network_advanced_data()
|
|||
do
|
||||
# strip out trailing spaces
|
||||
if_item=${if_item%% }
|
||||
#echo wp1: $working_path
|
||||
if [[ $b_path_made == 'false' ]];then
|
||||
working_path=$working_path/net/$if_item
|
||||
full_path=$working_path/net/$if_item
|
||||
if_id=$if_item
|
||||
else
|
||||
full_path=$working_path
|
||||
fi
|
||||
#echo fp: $full_path
|
||||
#echo id: $if_id
|
||||
# echo "$if_data ii: $if_item $array_counter i: $i"
|
||||
speed=''
|
||||
duplex=''
|
||||
mac_id=''
|
||||
oper_state=''
|
||||
if [[ -r $working_path/speed ]];then
|
||||
speed=$( cat $working_path/speed 2>/dev/null )
|
||||
if [[ -r $full_path/speed ]];then
|
||||
speed=$( cat $full_path/speed 2>/dev/null )
|
||||
fi
|
||||
if [[ -r $working_path/duplex ]];then
|
||||
duplex=$( cat $working_path/duplex 2>/dev/null )
|
||||
if [[ -r $full_path/duplex ]];then
|
||||
duplex=$( cat $full_path/duplex 2>/dev/null )
|
||||
fi
|
||||
if [[ -r $working_path/address ]];then
|
||||
mac_id=$( cat $working_path/address 2>/dev/null )
|
||||
if [[ -r $full_path/address ]];then
|
||||
mac_id=$( cat $full_path/address 2>/dev/null )
|
||||
fi
|
||||
if [[ -r $working_path/operstate ]];then
|
||||
oper_state=$( cat $working_path/operstate 2>/dev/null )
|
||||
if [[ -r $full_path/operstate ]];then
|
||||
oper_state=$( cat $full_path/operstate 2>/dev/null )
|
||||
fi
|
||||
if [[ -n ${a_network_adv_working[10]} ]];then
|
||||
chip_id=${a_network_adv_working[10]}
|
||||
|
|
Loading…
Reference in a new issue