mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
more variable fixes
This commit is contained in:
parent
9933470d1a
commit
7341973eff
14
inxi
14
inxi
|
@ -3036,7 +3036,7 @@ get_network_advanced_data()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local a_network_adv_working='' card_if='' working_path=''
|
local a_network_adv_working='' card_if='' working_path=''
|
||||||
local eth_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++ ))
|
||||||
do
|
do
|
||||||
|
@ -3045,12 +3045,12 @@ get_network_advanced_data()
|
||||||
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 )
|
card_if=$( ls $working_path/net 2>/dev/null )
|
||||||
eth_id=$card_if
|
if_id=$card_if
|
||||||
working_path=$working_path/net/$card_if
|
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_if=$( 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_if" )
|
if_id=$( cut -d ':' -f 2 <<< "$card_if" )
|
||||||
working_path=$working_path/$card_if
|
working_path=$working_path/$card_if
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -3069,7 +3069,7 @@ get_network_advanced_data()
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
A_NETWORK_DATA[i]=${a_network_adv_working[0]}","${a_network_adv_working[1]}","${a_network_adv_working[2]}","${a_network_adv_working[3]}","${a_network_adv_working[4]}","$eth_id","$oper_state","$speed","$duplex","$mac_id
|
A_NETWORK_DATA[i]=${a_network_adv_working[0]}","${a_network_adv_working[1]}","${a_network_adv_working[2]}","${a_network_adv_working[3]}","${a_network_adv_working[4]}","$if_id","$oper_state","$speed","$duplex","$mac_id
|
||||||
IFS="$ORIGINAL_IFS"
|
IFS="$ORIGINAL_IFS"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -4908,11 +4908,11 @@ print_networking_data()
|
||||||
print_network_advanced_data()
|
print_network_advanced_data()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local network_data='' eth_id='N/A' duplex='N/A' mac_id='N/A' speed='N/A' oper_state='N/A'
|
local network_data='' if_id='N/A' duplex='N/A' mac_id='N/A' speed='N/A' oper_state='N/A'
|
||||||
|
|
||||||
if [[ $B_SHOW_ADVANCED_NETWORK == 'true' ]];then
|
if [[ $B_SHOW_ADVANCED_NETWORK == 'true' ]];then
|
||||||
if [[ -n ${a_network_working[5]} ]];then
|
if [[ -n ${a_network_working[5]} ]];then
|
||||||
eth_id=${a_network_working[5]}
|
if_id=${a_network_working[5]}
|
||||||
fi
|
fi
|
||||||
if [[ -n ${a_network_working[6]} ]];then
|
if [[ -n ${a_network_working[6]} ]];then
|
||||||
oper_state=${a_network_working[6]}
|
oper_state=${a_network_working[6]}
|
||||||
|
@ -4926,7 +4926,7 @@ print_network_advanced_data()
|
||||||
if [[ -n ${a_network_working[9]} ]];then
|
if [[ -n ${a_network_working[9]} ]];then
|
||||||
mac_id=${a_network_working[9]}
|
mac_id=${a_network_working[9]}
|
||||||
fi
|
fi
|
||||||
network_data="${C1}IF:${C2} $eth_id ${C1}State:${C2} $oper_state ${C1}Speed:${C2} $speed"
|
network_data="${C1}IF:${C2} $if_id ${C1}State:${C2} $oper_state ${C1}Speed:${C2} $speed"
|
||||||
network_data="$network_data ${C1}Duplex:${C2} $duplex ${C1}Mac:${C2} $mac_id"
|
network_data="$network_data ${C1}Duplex:${C2} $duplex ${C1}Mac:${C2} $mac_id"
|
||||||
network_data=$( create_print_line " " "$network_data" )
|
network_data=$( create_print_line " " "$network_data" )
|
||||||
print_screen_output "$network_data"
|
print_screen_output "$network_data"
|
||||||
|
|
Loading…
Reference in a new issue