fixed naming of variable to fit what it is better

This commit is contained in:
inxi-svn 2011-04-25 06:57:02 +00:00
parent 2c75a106b6
commit 9933470d1a

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_port='' working_path='' local a_network_adv_working='' card_if='' working_path=''
local eth_id='' speed='' duplex='' mac_id='' oper_state='' local eth_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_port=$( ls $working_path/net 2>/dev/null ) card_if=$( ls $working_path/net 2>/dev/null )
eth_id=$card_port eth_id=$card_if
working_path=$working_path/net/$card_port working_path=$working_path/net/$card_if
# 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_port=$( ls $working_path 2>/dev/null | grep 'net:' ) card_if=$( ls $working_path 2>/dev/null | grep 'net:' )
eth_id=$( cut -d ':' -f 2 <<< "$card_port" ) eth_id=$( cut -d ':' -f 2 <<< "$card_if" )
working_path=$working_path/$card_port working_path=$working_path/$card_if
fi fi
if [[ -n $card_port ]];then if [[ -n $card_if ]];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