From 023ba2d188e0e2a846a4a88994b91b1e345aeaf7 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Tue, 22 Nov 2011 05:33:11 +0000 Subject: [PATCH] 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. --- inxi | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/inxi b/inxi index 1b514a1..8b083e1 100755 --- a/inxi +++ b/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