From a0160061730c400dbb27bf597faabb536f163fe3 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Wed, 8 Jun 2011 09:22:40 +0000 Subject: [PATCH] tweaks, clean up chassis output --- inxi | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/inxi b/inxi index 860c001..0840a6b 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.6.1 +#### version: 1.6.2 #### Date: June 8 2011 ######################################################################## #### SPECIAL THANKS @@ -5991,7 +5991,10 @@ print_machine_data() b_skip_chassis='true' fi if [[ -n ${A_MACHINE_DATA[12]} && $b_skip_chassis != 'true' ]];then - chassis_vendor="${C1}Chassis${C2} ${A_MACHINE_DATA[12]}" + # no need to print the vendor string again if it's the same + if [[ ${A_MACHINE_DATA[12]} != ${A_MACHINE_DATA[0]} ]];then + chassis_vendor=" ${A_MACHINE_DATA[12]}" + fi if [[ -n ${A_MACHINE_DATA[13]} ]];then chassis_type=" ${C1}type${C2} ${A_MACHINE_DATA[13]}" fi @@ -6001,7 +6004,9 @@ print_machine_data() if [[ -n ${A_MACHINE_DATA[15]} && $B_OUTPUT_FILTER != 'true' ]];then chassis_serial=" ${C1}serial${C2} ${A_MACHINE_DATA[15]}" fi - chassis_line="$chassis_vendor$chassis_type$chassis_version$chassis_serial" + if [[ -n "$chassis_vendor$chassis_type$chassis_version$chassis_serial" ]];then + chassis_line="${C1}Chassis${C2}$chassis_vendor$chassis_type$chassis_version$chassis_serial" + fi fi fi if [[ -n ${A_MACHINE_DATA[5]} ]];then