From 84feed2d45293372d19b871283b4ed56c65e8097 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Fri, 31 Oct 2008 07:21:57 +0000 Subject: [PATCH] added some hdd output tweaks --- inxi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/inxi b/inxi index fc5e7c7..ab451f6 100755 --- a/inxi +++ b/inxi @@ -46,7 +46,9 @@ 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 +#: note: if this is declared, whatever string you want inserted will be inserted first +## in this case, it's desirable to print out (x) before each driver found. +HDD_MODEL='' HDD_USED='' IRC_CLIENT='' IRC_CLIENT_VERSION='' @@ -1076,6 +1078,7 @@ get_hard_drive_data() break fi (( disk_capacity+=$( remove_erroneous_chars $disk/capacity ) )) + # this adds the (x) numbering in front of each disk found, and creates the full disk string HDD_MODEL="${HDD_MODEL}${HDD_MODEL+ ${C1}($i)${C2}}$( remove_erroneous_chars $disk/model )" ((i++)) fi @@ -1104,9 +1107,10 @@ get_hard_drive_data() } ' /proc/scsi/scsi)) IFS="$OIFS" - + for (( i=0; i < ${#a_total_hdd[@]}; i++ )) do + # this adds the (x) numbering in front of each disk found, and creates the full disk string HDD_MODEL="${HDD_MODEL}${HDD_MODEL+ ${C1}($(($i+1)))${C2}}${a_total_hdd[i]}" done if [ -z "$HDD_MODEL" ];then