mirror of
https://github.com/smxi/inxi.git
synced 2025-02-23 13:32:18 +00:00
Fixed a bug with WDC, requires for the ls -l /dev/disk/by-id test replacing whitespace with _, and trimming off the last
part of the string
This commit is contained in:
parent
fbd76c10bc
commit
ac5337d56f
11
inxi
11
inxi
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
########################################################################
|
||||
#### Script Name: inxi
|
||||
#### version: 0.4.0
|
||||
#### version: 0.4.1
|
||||
#### Date: November 7 2008
|
||||
########################################################################
|
||||
#### inxi is a fork of infobash, the original bash sys info script by locsmif
|
||||
|
@ -1191,10 +1191,7 @@ get_hdd_data_basic()
|
|||
## fills out the A_HDD_DATA array with disk names
|
||||
get_hard_drive_data_advanced()
|
||||
{
|
||||
local disk='' i='' j='' hdd_cap2='' hdd_cap1='' disk_capacity='' a_total_hdd=''
|
||||
local hdd_model='' hdd_capacity='' hdd_used=''
|
||||
|
||||
local a_temp_working='' a_temp_scsi='' temp_holder=''
|
||||
local a_temp_working='' a_temp_scsi='' temp_holder='' temp_name='' i='' j=''
|
||||
|
||||
## next check for all ide type drives, non libata, only do it if hdx is in array
|
||||
if [[ -n $( egrep 'hd[a-z]' <<< ${A_HDD_DATA[@]} ) ]];then
|
||||
|
@ -1253,7 +1250,9 @@ get_hard_drive_data_advanced()
|
|||
do
|
||||
## ok, ok, it's incomprehensible, search /dev/disk/by-id for a line that contains the
|
||||
# discovered disk name AND ends with the correct identifier, sdx
|
||||
if [[ -n $( ls -l /dev/disk/by-id | egrep -m1 ".*${a_temp_scsi[$j]}.*${a_temp_working[0]}$" ) ]];then
|
||||
temp_name=$( tr ' ' '_' <<< ${a_temp_scsi[$j]} | cut -d '-' -f 1 ) # get rid of whitespace for WDC
|
||||
# echo temp_name:$temp_name
|
||||
if [[ -n $( ls -l /dev/disk/by-id | egrep -m1 ".*$temp_name.*${a_temp_working[0]}$" ) ]];then
|
||||
a_temp_working[2]=${a_temp_scsi[$j]}
|
||||
break
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue