From 312a53e3b9854927d95ce470494c2c72ce70c310 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Fri, 31 Oct 2008 07:13:26 +0000 Subject: [PATCH] Added (x) numbering for each hard drive listed in > 1 verbosity levels, this is a nice improvement in readability --- inxi | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/inxi b/inxi index a61d999..fc5e7c7 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.2.14 +#### version: 0.2.15 #### Date: October 30 2008 ######################################################################## #### inxi is a fork of infobash, the original bash sys info script by locsmif @@ -46,7 +46,7 @@ CPU_MODEL='' CPU_CLOCK='' CPU_FLAGS='' HDD_CAPACITY='' -#HDD_MODEL='' ## note, can't declare this or it adds a comma in list of disks in get_hdd_data +HDD_MODEL='' ## note, can't declare this or it adds a comma in list of disks in get_hdd_data HDD_USED='' IRC_CLIENT='' IRC_CLIENT_VERSION='' @@ -1066,6 +1066,7 @@ get_hard_drive_data() { local disk='' i='' hdd_cap2='' hdd_cap1='' disk_capacity='' a_total_hdd='' + i=1 for disk in /proc/ide/ide*/hd* do if [[ -e $disk/media && $( remove_erroneous_chars $disk/media ) = disk ]];then @@ -1075,7 +1076,8 @@ get_hard_drive_data() break fi (( disk_capacity+=$( remove_erroneous_chars $disk/capacity ) )) - HDD_MODEL="${HDD_MODEL}${HDD_MODEL+,}$( remove_erroneous_chars $disk/model )" + HDD_MODEL="${HDD_MODEL}${HDD_MODEL+ ${C1}($i)${C2}}$( remove_erroneous_chars $disk/model )" + ((i++)) fi done @@ -1105,7 +1107,7 @@ get_hard_drive_data() for (( i=0; i < ${#a_total_hdd[@]}; i++ )) do - HDD_MODEL="${HDD_MODEL}${HDD_MODEL+,}${a_total_hdd[i]}" + HDD_MODEL="${HDD_MODEL}${HDD_MODEL+ ${C1}($(($i+1)))${C2}}${a_total_hdd[i]}" done if [ -z "$HDD_MODEL" ];then HDD_MODEL='Non Detected' @@ -1331,7 +1333,7 @@ print_hard_disk_data() root_home_data=$( echo $root_home_data ) # get rid of linebreaks if [ "$VERBOSITY_LEVEL" -ge 2 ];then - hdd_data=$( create_print_line "Disks:" "${C1}HDD${C2} ${HDD_MODEL} ${C1}Size${C2} ${HDD_CAPACITY} (${HDD_USED})${CN}" ) + hdd_data=$( create_print_line "Disks:" "${C1}HDD${C2}${HDD_MODEL} ${C1}Size${C2} ${HDD_CAPACITY} (${HDD_USED})${CN}" ) else hdd_data=$( create_print_line "Disks:" "${C1}HDD Size${C2} ${HDD_CAPACITY} (${HDD_USED})${CN}" ) fi