From c4a035dfad7f158f6f949cada28f5e7a8d9c8469 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Thu, 24 Jul 2014 00:37:48 +0000 Subject: [PATCH] branches one, bug fixes, may work now --- inxi | 64 ++++++++++-------------------------------------------------- 1 file changed, 10 insertions(+), 54 deletions(-) diff --git a/inxi b/inxi index 7885526..a9dc81a 100755 --- a/inxi +++ b/inxi @@ -3,7 +3,7 @@ #### Script Name: inxi #### Version: 2.1.28 #### Date: 2014-07-22 -#### Patch Number: 03-b1 +#### Patch Number: 04-b1 ######################################################################## #### SPECIAL THANKS ######################################################################## @@ -6416,11 +6416,13 @@ 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 + # we need to change to holder since we are updating the main array + local a_main_working=${A_NETWORK_DATA[@]} - for (( i=0; i < ${#A_NETWORK_DATA[@]}; i++ )) + for (( i=0; i < ${#a_main_working[@]}; i++ )) do IFS="," - a_network_adv_working=( ${A_NETWORK_DATA[i]} ) + a_network_adv_working=( ${a_main_working[i]} ) IFS="$ORIGINAL_IFS" # reset these every go round driver_test='' @@ -6441,6 +6443,7 @@ get_network_advanced_data() # but broadcom shows this sometimes, and older kernels maybe: # /sys/devices/pci0000:00/0000:00:01.0/0000:05:00.0/net/eth0/ # /sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/ssb0:0/uevent:['DRIVER=b43', 'MODALIAS=ssb:v4243id0812rev0D']: + # echo a ${a_network_adv_working[4]} if [[ -d /sys/bus/pci/devices/ ]];then working_path="/sys/bus/pci/devices/0000:${a_network_adv_working[4]}" elif [[ -d /sys/devices/pci0000:00/ ]];then @@ -6527,8 +6530,9 @@ get_network_advanced_data() # if_data="eth0 # ib0 # ib1" - # if_data=$(tr '\n' ' ' <<< $if_data) + # echo if_data $if_data if [[ -n $if_data ]];then + # if_data=$(tr '\n' ' ' <<< $if_data) #if_data=$(echo $if_data) for if_item in $if_data do @@ -6538,7 +6542,7 @@ get_network_advanced_data() working_path=$working_path/net/$if_item if_id=$if_item fi - echo "$if_data ii: $if_item $array_counter" + # echo "$if_data ii: $if_item $array_counter i: $i" speed='' duplex='' mac_id='' @@ -6558,15 +6562,10 @@ get_network_advanced_data() if [[ -n ${a_network_adv_working[10]} ]];then chip_id=${a_network_adv_working[10]} fi - # echo $if_item $array_counter # now we create one array index per id found, note that one pcibusid device can have > 1 id - A_NETWORK_DATA[array_counter]=${a_network_adv_working[0]}","${a_network_adv_working[1]}","${a_network_adv_working[2]}","${a_network_adv_working[3]}","${a_network_adv_working[4]}","$if_id","$oper_state","$speed","$duplex","$mac_id","$chip_id + A_NETWORK_DATA[$array_counter]=${a_network_adv_working[0]}","${a_network_adv_working[1]}","${a_network_adv_working[2]}","${a_network_adv_working[3]}","${a_network_adv_working[4]}","$if_id","$oper_state","$speed","$duplex","$mac_id","$chip_id ((array_counter++)) - if [[ $array_counter -gt 3 ]];then - echo 'endless loop bug hit, exiting' - #exit - fi done fi done @@ -6575,49 +6574,6 @@ get_network_advanced_data() eval $LOGFE } -# array_counter=0 -# if_data="eth0 -# ib1" -# # if_data=$(tr '\n' ' ' <<< $if_data) -# if [[ -n $if_data ]];then -# #if_data=$(echo $if_data) -# for if_item in $if_data -# do -# # strip out trailing spaces -# if_item=${if_item%% } -# if [[ $b_path_made == 'false' ]];then -# working_path=$working_path/net/$if_item -# if_id=$if_item -# fi -# speed='' -# duplex='' -# mac_id='' -# oper_state='' -# if [[ -r $working_path/speed ]];then -# speed=$( cat $working_path/speed 2>/dev/null ) -# fi -# if [[ -r $working_path/duplex ]];then -# duplex=$( cat $working_path/duplex 2>/dev/null ) -# fi -# if [[ -r $working_path/address ]];then -# mac_id=$( cat $working_path/address 2>/dev/null ) -# fi -# if [[ -r $working_path/operstate ]];then -# oper_state=$( cat $working_path/operstate 2>/dev/null ) -# fi -# if [[ -n ${a_network_adv_working[10]} ]];then -# chip_id=${a_network_adv_working[10]} -# fi -# # echo $if_item $array_counter -# # now we create one array index per id found, note that one pcibusid device can have > 1 id -# A_NETWORK_DATA[array_counter]=${a_network_adv_working[0]}","${a_network_adv_working[1]}","${a_network_adv_working[2]}","${a_network_adv_working[3]}","${a_network_adv_working[4]}","$if_id","$oper_state","$speed","$duplex","$mac_id","$chip_id -# a_temp=${A_NETWORK_DATA[@]} -# echo ${a_temp[@]} -# ((array_counter++)) -# echo "$if_data" ii: $if_item $array_counter -# done -# fi -# exit get_networking_usb_data() {