From d27870e890b80ebb636955edc8cfd9fa09aa05dc Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Mon, 25 Apr 2011 06:02:08 +0000 Subject: [PATCH] a few more info items, tweaked output --- inxi | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/inxi b/inxi index 740bbf4..ab45d3a 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.4.24-b2 +#### version: 1.4.24-b3 #### Date: April 20 2011 ######################################################################## #### SPECIAL THANKS @@ -3035,7 +3035,7 @@ get_network_advanced_data() { eval $LOGFS local a_network_adv_working='' card_port='' working_path='' - local eth_id='' speed='' duplex='' mac_id='' + local eth_id='' speed='' duplex='' mac_id='' oper_state='' for (( i=0; i < ${#A_NETWORK_DATA[@]}; i++ )) do @@ -3063,9 +3063,12 @@ get_network_advanced_data() if [[ -f $working_path/address ]];then mac_id=$( cat $working_path/address ) fi + if [[ -f $working_path/operstate ]];then + oper_state=$( cat $working_path/operstate ) + 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","$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]}","$eth_id","$oper_state","$speed","$duplex","$mac_id IFS="$ORIGINAL_IFS" done @@ -4904,23 +4907,26 @@ print_networking_data() print_network_advanced_data() { eval $LOGFS - local network_data='' eth_id='N/A' duplex='N/A' mac_id='N/A' speed='N/A' + local network_data='' eth_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 [[ -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]} + oper_state=${a_network_working[6]} fi if [[ -n ${a_network_working[7]} ]];then - duplex=${a_network_working[7]} + speed="${a_network_working[7]} Mbps" fi if [[ -n ${a_network_working[8]} ]];then - mac_id=${a_network_working[8]} + duplex=${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" + if [[ -n ${a_network_working[9]} ]];then + mac_id=${a_network_working[9]} + fi + network_data="${C1}Net:${C2} $eth_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=$( create_print_line " " "$network_data" ) print_screen_output "$network_data" fi