mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
found another path case for usb networking cards, requires special handling
This commit is contained in:
parent
1e3003f2a3
commit
f9e7b6916c
18
inxi
18
inxi
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 1.5.11
|
#### version: 1.5.12
|
||||||
#### Date: May 30 2011
|
#### Date: June 5 2011
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### SPECIAL THANKS
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -3902,7 +3902,7 @@ get_networking_data()
|
||||||
get_network_advanced_data()
|
get_network_advanced_data()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
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 if_id='' speed='' duplex='' mac_id='' oper_state=''
|
||||||
local usb_data='' usb_vendor='' usb_product='' product_path='' driver_test=''
|
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
|
# now ls that directory and get the numeric starting sub directory and that should be the full path
|
||||||
# to the /net directory part
|
# to the /net directory part
|
||||||
dir_path=$( ls ${working_path} 2>/dev/null | grep -sE '^[0-9]' )
|
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
|
||||||
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: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
|
# /sys/devices/pci0000:00/0000:00:0b.1/usb1/1-1/1-1:1.0/uevent
|
||||||
if [[ -n $usb_data ]];then
|
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
|
if [[ -n $driver_test ]];then
|
||||||
a_network_adv_working[1]=$driver_test
|
a_network_adv_working[1]=$driver_test
|
||||||
fi
|
fi
|
||||||
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_path=$( ls $working_path/net 2>/dev/null )
|
||||||
if_id=$if_path
|
if_id=$if_path
|
||||||
working_path=$working_path/net/$if_path
|
working_path=$working_path/net/$if_path
|
||||||
|
|
Loading…
Reference in a new issue