From eb603be4aec4e0294b9d553625005c2196c155e8 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Thu, 6 Aug 2009 23:40:21 +0000 Subject: [PATCH] made fully dynamic, prints out every other hard disk, with modulus. --- inxi | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/inxi b/inxi index 46523b4..5010df1 100755 --- a/inxi +++ b/inxi @@ -3931,8 +3931,8 @@ print_gfx_data() print_hard_disk_data() { eval $LOGFS - local hdd_data='' hdd_data_2='' a_hdd_working='' hdd_temp_data='' hdd_counter=0 - local dev_data='' size_data='' hdd_model='' hdd_model_2='' hdd_model_3='' usb_data='' + local hdd_data='' hdd_data_2='' a_hdd_working='' hdd_temp_data='' + local dev_data='' size_data='' hdd_model='' usb_data='' # load A_HDD_DATA get_hdd_data_basic @@ -3987,11 +3987,14 @@ print_hard_disk_data() hdd_data='' hdd_model='' ;; - 2|4|6|8|10|12|14) - hdd_data=$( create_print_line " " "${hdd_model}${CN}" ) - print_screen_output "$hdd_data" - hdd_data='' - hdd_model='' + *) + # using modulus here, if divisible by 2, print line, otherwise skip + if [[ $(( $i % 2 )) -eq 0 ]];then + hdd_data=$( create_print_line " " "${hdd_model}${CN}" ) + print_screen_output "$hdd_data" + hdd_data='' + hdd_model='' + fi ;; esac fi