From 1d937e93a6593a615152adbfcbf1b55034499853 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Tue, 22 Jul 2014 19:36:48 +0000 Subject: [PATCH] branch one, advanced networking, small changes and cleanups --- inxi | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/inxi b/inxi index 2fd0d3f..5f59ab3 100755 --- a/inxi +++ b/inxi @@ -6413,7 +6413,7 @@ get_networking_data() get_network_advanced_data() { eval $LOGFS - local a_network_adv_working='' if_path='' 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 usb_data='' usb_vendor='' usb_product='' product_path='' driver_test='' array_counter=0 @@ -6507,23 +6507,23 @@ get_network_advanced_data() if [[ -e $working_path/net ]];then # in cases like infiniband dual port devices, there can be two ids, like ib0 ib1, # with line break in output - if_path=$( ls $working_path/net 2>/dev/null ) + if_data=$( ls $working_path/net 2>/dev/null ) b_path_made='false' # this is the normal usb detection if the first one didn't work elif [[ -n $usb_data && -e $working_uevent_path/net ]];then - if_path=$( ls $working_uevent_path/net 2>/dev/null ) - if_id=$if_path - working_path=$working_uevent_path/net/$if_path + if_data=$( ls $working_uevent_path/net 2>/dev/null ) + if_id=$if_data + working_path=$working_uevent_path/net/$if_data # 2.6.32 debian lenny kernel shows not: /net/eth0 but /net:eth0 else - if_path=$( ls $working_path 2>/dev/null | grep 'net:' ) - if_id=$( cut -d ':' -f 2 <<< "$if_path" ) - working_path=$working_path/$if_path + if_data=$( ls $working_path 2>/dev/null | grep 'net:' ) + if_id=$( cut -d ':' -f 2 <<< "$if_data" ) + working_path=$working_path/$if_data fi - log_function_data "POST: working_path: $working_path\nif_path: $if_path - 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 - if [[ -n $if_path ]];then - for if_item in $if_path + if [[ -n $if_data ]];then + for if_item in $if_data do # strip out trailing spaces if_item=${if_item%% } @@ -6531,6 +6531,10 @@ get_network_advanced_data() 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