mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
(change version)
the inevitable bug with method change, updated and restored lost features using /sys/block method
This commit is contained in:
parent
7f3c89b63c
commit
fa26506a22
27
inxi
27
inxi
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 1.3.13
|
#### version: 1.3.14
|
||||||
#### Date: February 6 2010
|
#### Date: February 6 2010
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### SPECIAL THANKS
|
||||||
|
@ -2576,7 +2576,7 @@ get_hard_drive_data_advanced()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local a_temp_working='' a_temp_scsi='' temp_holder='' temp_name='' i='' j=''
|
local a_temp_working='' a_temp_scsi='' temp_holder='' temp_name='' i='' j=''
|
||||||
local sd_ls_by_id='' ls_disk_by_id=''
|
local sd_ls_by_id='' ls_disk_by_id='' usb_exists=''
|
||||||
|
|
||||||
## check for all ide type drives, non libata, only do it if hdx is in array
|
## check for all ide type drives, non libata, only do it if hdx is in array
|
||||||
## this is now being updated for new /sys type paths, this may handle that ok too
|
## this is now being updated for new /sys type paths, this may handle that ok too
|
||||||
|
@ -2654,7 +2654,8 @@ get_hard_drive_data_advanced()
|
||||||
# /sys/block/[sda,hda]/device/model
|
# /sys/block/[sda,hda]/device/model
|
||||||
# this is handles the new /sys data types first
|
# this is handles the new /sys data types first
|
||||||
if [[ -e /sys/block/${a_temp_working[0]}/device/model ]];then
|
if [[ -e /sys/block/${a_temp_working[0]}/device/model ]];then
|
||||||
a_temp_working[2]="$( remove_erroneous_chars /sys/block/${a_temp_working[0]}/device/model )"
|
temp_name="$( remove_erroneous_chars /sys/block/${a_temp_working[0]}/device/model )"
|
||||||
|
temp_name=$( tr ' ' '_' <<< $temp_name | cut -d '-' -f 1 )
|
||||||
elif [[ ${#a_temp_scsi[@]} -gt 0 ]];then
|
elif [[ ${#a_temp_scsi[@]} -gt 0 ]];then
|
||||||
for (( j=0; j < ${#a_temp_scsi[@]}; j++ ))
|
for (( j=0; j < ${#a_temp_scsi[@]}; j++ ))
|
||||||
do
|
do
|
||||||
|
@ -2665,24 +2666,26 @@ get_hard_drive_data_advanced()
|
||||||
sd_ls_by_id=$( egrep -m1 ".*$temp_name.*${a_temp_working[0]}$" <<< "$ls_disk_by_id" )
|
sd_ls_by_id=$( egrep -m1 ".*$temp_name.*${a_temp_working[0]}$" <<< "$ls_disk_by_id" )
|
||||||
|
|
||||||
if [[ -n $sd_ls_by_id ]];then
|
if [[ -n $sd_ls_by_id ]];then
|
||||||
a_temp_working[2]=${a_temp_scsi[$j]}
|
temp_name=${a_temp_scsi[$j]}
|
||||||
if [[ -n $( grep 'usb-' <<< $sd_ls_by_id ) ]];then
|
|
||||||
a_temp_working[3]='USB'
|
|
||||||
fi
|
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
# test to see if we can get a better name output when null
|
# test to see if we can get a better name output when null
|
||||||
if [[ -n $temp_name ]];then
|
if [[ -n $temp_name ]];then
|
||||||
a_temp_working[2]=$temp_name
|
temp_name=$temp_name
|
||||||
else
|
|
||||||
a_temp_working[2]="Name n/a"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
|
||||||
a_temp_working[2]="Name n/a"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -z $temp_name ]];then
|
||||||
|
temp_name="Name n/a"
|
||||||
|
else
|
||||||
|
usb_exists=$( egrep -m1 "usb-.*$temp_name.*${a_temp_working[0]}$" <<< "$ls_disk_by_id" )
|
||||||
|
if [[ -n $usb_exists ]];then
|
||||||
|
a_temp_working[3]='USB'
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
a_temp_working[2]=$temp_name
|
||||||
# these loops are to easily extend the cpu array created in the gawk script above with more fields per cpu.
|
# these loops are to easily extend the cpu array created in the gawk script above with more fields per cpu.
|
||||||
for (( j=0; j < ${#a_temp_working[@]}; j++ ))
|
for (( j=0; j < ${#a_temp_working[@]}; j++ ))
|
||||||
do
|
do
|
||||||
|
|
Loading…
Reference in a new issue