From 82b3c0728e9c669ca505869aa5e5dbfd28d8decb Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Mon, 25 Apr 2011 05:33:52 +0000 Subject: [PATCH] update, added print of n/a --- inxi | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/inxi b/inxi index 0b27bdf..a122d1c 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.4.24-b1 +#### version: 1.4.24-b2 #### Date: April 20 2011 ######################################################################## #### SPECIAL THANKS @@ -4904,11 +4904,23 @@ print_networking_data() print_network_advanced_data() { eval $LOGFS - local network_data='' + local network_data='' eth_id='N/A' duplex='N/A' mac_id='N/A' speed='N/A' if [[ $B_SHOW_ADVANCED_NETWORK == 'true' ]];then - network_data="${C1}Net:${C2} ${a_network_working[5]} ${C1}Speed:${C2} ${a_network_working[6]}" - network_data="$network_data ${C1}Duplex:${C2} ${a_network_working[7]} ${C1}Mac:${C2} ${a_network_working[8]}" + if [[ -n ${a_network_working[5]} ]];then + eth_id=${a_network_working[5]} + fi + if [[ -n ${a_network_working[6]} ]];then + speed=${a_network_working[6]} + fi + if [[ -n ${a_network_working[7]} ]];then + duplex=${a_network_working[7]} + fi + if [[ -n ${a_network_working[8]} ]];then + mac_id=${a_network_working[8]} + fi + network_data="${C1}Net:${C2} $eth_id ${C1}Speed:${C2} $speed" + network_data="$network_data ${C1}Duplex:${C2} $duplex ${C1}Mac:${C2} $mac_id" network_data=$( create_print_line " " "$network_data" ) print_screen_output "$network_data" fi