branches one, more bug fixes

This commit is contained in:
inxi-svn 2014-07-25 16:25:46 +00:00
parent 593b14d8de
commit 75e4366817

29
inxi
View file

@ -6416,6 +6416,7 @@ get_network_advanced_data()
local a_network_adv_working='' if_data='' working_path='' working_uevent_path='' dir_path='' 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 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 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 # we need to change to holder since we are updating the main array
IFS=$'\n' IFS=$'\n'
local a_main_working=(${A_NETWORK_DATA[@]}) local a_main_working=(${A_NETWORK_DATA[@]})
@ -6505,6 +6506,7 @@ get_network_advanced_data()
a_network_adv_working[1]=$driver_test a_network_adv_working[1]=$driver_test
fi fi
fi fi
#echo wp: $working_path
log_function_data "PRE: working_path: $working_path\nworking_uevent_path: $working_uevent_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 # 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 # with line break in output
if_data=$( ls $working_path/net 2>/dev/null ) if_data=$( ls $working_path/net 2>/dev/null )
b_path_made='false' b_path_made='false'
#echo yes
# this is the normal usb detection if the first one didn't work # this is the normal usb detection if the first one didn't work
elif [[ -n $usb_data && -e $working_uevent_path/net ]];then elif [[ -n $usb_data && -e $working_uevent_path/net ]];then
if_data=$( ls $working_uevent_path/net 2>/dev/null ) 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" ) if_id=$( cut -d ':' -f 2 <<< "$if_data" )
working_path=$working_path/$if_data working_path=$working_path/$if_data
fi fi
#echo id: $if_data
log_function_data "POST: working_path: $working_path\nif_data: $if_data - if_id: $if_id" 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 ## note: in cases of dual ports with different ids, this loop will create extra array items
# if_data="eth0 # if_data="eth0
# ib0 # eth2
# ib1" # ib1"
# echo if_data $if_data # echo if_data $if_data
if [[ -n $if_data ]];then if [[ -n $if_data ]];then
@ -6540,26 +6544,31 @@ get_network_advanced_data()
do do
# strip out trailing spaces # strip out trailing spaces
if_item=${if_item%% } if_item=${if_item%% }
#echo wp1: $working_path
if [[ $b_path_made == 'false' ]];then if [[ $b_path_made == 'false' ]];then
working_path=$working_path/net/$if_item full_path=$working_path/net/$if_item
if_id=$if_item if_id=$if_item
else
full_path=$working_path
fi fi
#echo fp: $full_path
#echo id: $if_id
# echo "$if_data ii: $if_item $array_counter i: $i" # echo "$if_data ii: $if_item $array_counter i: $i"
speed='' speed=''
duplex='' duplex=''
mac_id='' mac_id=''
oper_state='' oper_state=''
if [[ -r $working_path/speed ]];then if [[ -r $full_path/speed ]];then
speed=$( cat $working_path/speed 2>/dev/null ) speed=$( cat $full_path/speed 2>/dev/null )
fi fi
if [[ -r $working_path/duplex ]];then if [[ -r $full_path/duplex ]];then
duplex=$( cat $working_path/duplex 2>/dev/null ) duplex=$( cat $full_path/duplex 2>/dev/null )
fi fi
if [[ -r $working_path/address ]];then if [[ -r $full_path/address ]];then
mac_id=$( cat $working_path/address 2>/dev/null ) mac_id=$( cat $full_path/address 2>/dev/null )
fi fi
if [[ -r $working_path/operstate ]];then if [[ -r $full_path/operstate ]];then
oper_state=$( cat $working_path/operstate 2>/dev/null ) oper_state=$( cat $full_path/operstate 2>/dev/null )
fi fi
if [[ -n ${a_network_adv_working[10]} ]];then if [[ -n ${a_network_adv_working[10]} ]];then
chip_id=${a_network_adv_working[10]} chip_id=${a_network_adv_working[10]}