This commit is contained in:
inxi-svn 2011-04-25 06:59:24 +00:00
parent 7341973eff
commit 2467841555

16
inxi
View file

@ -3035,7 +3035,7 @@ get_networking_data()
get_network_advanced_data() get_network_advanced_data()
{ {
eval $LOGFS eval $LOGFS
local a_network_adv_working='' card_if='' working_path='' local a_network_adv_working='' if_path='' working_path=''
local if_id='' speed='' duplex='' mac_id='' oper_state='' local if_id='' speed='' duplex='' mac_id='' oper_state=''
for (( i=0; i < ${#A_NETWORK_DATA[@]}; i++ )) for (( i=0; i < ${#A_NETWORK_DATA[@]}; i++ ))
@ -3044,17 +3044,17 @@ get_network_advanced_data()
a_network_adv_working=( ${A_NETWORK_DATA[i]} ) a_network_adv_working=( ${A_NETWORK_DATA[i]} )
working_path="/sys/bus/pci/devices/0000:${a_network_adv_working[4]}" working_path="/sys/bus/pci/devices/0000:${a_network_adv_working[4]}"
if [[ -e $working_path/net ]];then if [[ -e $working_path/net ]];then
card_if=$( ls $working_path/net 2>/dev/null ) if_path=$( ls $working_path/net 2>/dev/null )
if_id=$card_if if_id=$if_path
working_path=$working_path/net/$card_if working_path=$working_path/net/$if_path
# 2.6.32 debian lenny kernel shows not: /net/eth0 but /net:eth0 # 2.6.32 debian lenny kernel shows not: /net/eth0 but /net:eth0
else else
card_if=$( ls $working_path 2>/dev/null | grep 'net:' ) if_path=$( ls $working_path 2>/dev/null | grep 'net:' )
if_id=$( cut -d ':' -f 2 <<< "$card_if" ) if_id=$( cut -d ':' -f 2 <<< "$if_path" )
working_path=$working_path/$card_if working_path=$working_path/$if_path
fi fi
if [[ -n $card_if ]];then if [[ -n $if_path ]];then
if [[ -f $working_path/speed ]];then if [[ -f $working_path/speed ]];then
speed=$( cat $working_path/speed ) speed=$( cat $working_path/speed )
fi fi