From f9e7b6916c7785f1339ee415d675d79d5c2abdbe Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Mon, 6 Jun 2011 03:54:28 +0000 Subject: [PATCH] found another path case for usb networking cards, requires special handling --- inxi | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/inxi b/inxi index df0b822..c27706c 100755 --- a/inxi +++ b/inxi @@ -1,8 +1,8 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.5.11 -#### Date: May 30 2011 +#### version: 1.5.12 +#### Date: June 5 2011 ######################################################################## #### SPECIAL THANKS ######################################################################## @@ -3902,7 +3902,7 @@ get_networking_data() get_network_advanced_data() { eval $LOGFS - local a_network_adv_working='' if_path='' working_path='' dir_path='' + local a_network_adv_working='' if_path='' working_path='' working_uevent_path='' dir_path='' local if_id='' speed='' duplex='' mac_id='' oper_state='' local usb_data='' usb_vendor='' usb_product='' product_path='' driver_test='' @@ -3947,19 +3947,25 @@ get_network_advanced_data() # now ls that directory and get the numeric starting sub directory and that should be the full path # to the /net directory part dir_path=$( ls ${working_path} 2>/dev/null | grep -sE '^[0-9]' ) - working_path="${working_path}${dir_path}" + working_uevent_path="${working_path}${dir_path}" fi fi # /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/uevent grep for DRIVER= # /sys/devices/pci0000:00/0000:00:0b.1/usb1/1-1/1-1:1.0/uevent if [[ -n $usb_data ]];then - driver_test=$( grep -si 'DRIVER=' $working_path/uevent | cut -d '=' -f 2 ) + driver_test=$( grep -si 'DRIVER=' $working_uevent_path/uevent | cut -d '=' -f 2 ) if [[ -n $driver_test ]];then a_network_adv_working[1]=$driver_test fi fi - if [[ -e $working_path/net ]];then + if [[ -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 + # this case, from debian squeeze: + # /sys/devices/pci0000:00/0000:00:0b.1/usb1/1-1/net/wlan0/address + elif [[ -e $working_path/net ]];then if_path=$( ls $working_path/net 2>/dev/null ) if_id=$if_path working_path=$working_path/net/$if_path