mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 16:21:39 +00:00
not showing speed/duplex for lan card when it is down. Because cards don't always have 'up', but
might show 'unknown' for state, only not showing if it is down explicitly.
This commit is contained in:
parent
94e9d050d0
commit
023ba2d188
9
inxi
9
inxi
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
########################################################################
|
||||
#### Script Name: inxi
|
||||
#### version: 1.7.25
|
||||
#### version: 1.7.26
|
||||
#### Date: November 21 2011
|
||||
#### Patch Number: 00
|
||||
########################################################################
|
||||
|
@ -51,7 +51,7 @@
|
|||
#### DEPENDENCIES
|
||||
#### * bash >=3.0 (bash); df, readlink, stty, tr, uname, wc (coreutils);
|
||||
#### gawk (gawk); grep (grep); lspci (pciutils);
|
||||
#### free, ps, uptime (procps);
|
||||
#### free, ps, uptime (procps); find (findutils)
|
||||
#### * Also the proc filesystem should be present and mounted
|
||||
#### * Some features, like -M and -d will not work, or will work incompletely,
|
||||
#### if /sys is missing
|
||||
|
@ -4483,7 +4483,6 @@ get_network_advanced_data()
|
|||
sed 's|/net.*||' )
|
||||
fi
|
||||
fi
|
||||
|
||||
# working_path=$( ls /sys/devices/pci*/*/0000:${a_network_adv_working[4]}/net/*/uevent )
|
||||
else
|
||||
# slice off the usb- part
|
||||
|
@ -7018,7 +7017,9 @@ print_network_advanced_data()
|
|||
oper_state=${a_network_working[6]}
|
||||
fi
|
||||
# no print out for wifi since it doesn't have duplex/speed data availabe
|
||||
if [[ $b_is_wifi != 'true' ]];then
|
||||
# note that some cards show 'unknown' for state, so only testing explicitly
|
||||
# for 'down' string in that to skip showing speed/duplex
|
||||
if [[ $b_is_wifi != 'true' && $oper_state != 'down' ]];then
|
||||
if [[ -n ${a_network_working[7]} ]];then
|
||||
# make sure the value is strictly numeric before appending Mbps
|
||||
if [[ -n $( grep -E '^[0-9\.,]+$' <<< "${a_network_working[7]}" ) ]];then
|
||||
|
|
Loading…
Reference in a new issue