last bug fixes

This commit is contained in:
inxi-svn 2009-07-28 22:28:40 +00:00
parent 8449bbedf9
commit 9b532f4aba

18
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 1.0.107-b1 #### version: 1.0.108-b1
#### Date: 28 July 2009 #### Date: 28 July 2009
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
@ -3063,6 +3063,7 @@ get_sensors_data()
} }
/^temp2:/ { /^temp2:/ {
# add to array if array index does not exist OR if number is > 0 # add to array if array index does not exist OR if number is > 0
tempWorking=gensub( /\+(.+)/, "\\1", 1, $2 ) tempWorking=gensub( /\+(.+)/, "\\1", 1, $2 )
if ( temp2 == "" || tempWorking > 0 ) { if ( temp2 == "" || tempWorking > 0 ) {
temp2=tempWorking temp2=tempWorking
@ -3072,14 +3073,23 @@ get_sensors_data()
} }
} }
# final fallback if all else fails # final fallback if all else fails
/^core0:/ { /^core0:|core 0:|core0 Temp/ {
tempWorking=gensub( /\+(.+)/, "\\1", 1, $2 ) if ( $2 ~ /(.+):/ ){
tempWorking=$3
}
else {
tempWorking=$2
}
tempWorking=gensub( /\+(.+)/, "\\1", 1, tempWorking )
if ( core0Temp == "" || tempWorking > 0 ) { if ( core0Temp == "" || tempWorking > 0 ) {
core0Temp=$2 core0Temp=tempWorking
} }
if ( $3 ~ /C|F/ && tempUnit == "" ){ if ( $3 ~ /C|F/ && tempUnit == "" ){
tempUnit="°" $3 tempUnit="°" $3
} }
else if ( $4 ~ /C|F/ && tempUnit == "" ){
tempUnit="°" $4
}
} }
# note: can be cpu fan:, cpu fan speed:, etc # note: can be cpu fan:, cpu fan speed:, etc