From 2b6b9ae04e60160eb18e4779da156737573bb930 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Mon, 28 Apr 2014 19:38:51 +0000 Subject: [PATCH] branch one, sensors --- inxi | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/inxi b/inxi index 957f932..6383b6c 100755 --- a/inxi +++ b/inxi @@ -3,7 +3,7 @@ #### Script Name: inxi #### Version: 2.1.23 #### Date: 2014-04-28 -#### Patch Number: 04-b1 +#### Patch Number: 05-b1 ######################################################################## #### SPECIAL THANKS ######################################################################## @@ -8266,7 +8266,7 @@ get_sensors_data() # for temp1/2 only use temp1/2 if they are null or greater than the last ones $1 ~ /^temp1$/ && $2 ~ /^[ \t]*\+([0-9]+)/ { tempWorking=gensub( /[ \t]+\+([0-9\.]+)(.*)/, "\\1", 1, $2 ) - if ( temp1 == "" || ( tempWorking > 0 && tempWorking > temp1 ) ) { + if ( temp1 == "" || tempWorking > 0 ) { temp1=tempWorking } tempWorkingUnit=gensub( /[ \t]+\+([0-9\.]+)[ \t°]+([CF])(.*)/, "\\2", 1, $2 ) @@ -8276,7 +8276,7 @@ get_sensors_data() } $1 ~ /^temp2$/ && $2 ~ /^[ \t]*\+([0-9]+)/ { tempWorking=gensub( /[ \t]+\+([0-9\.]+)(.*)/, "\\1", 1, $2 ) - if ( temp2 == "" || ( tempWorking > 0 && tempWorking > temp2 ) ) { + if ( temp2 == "" || tempWorking > 0 ) { temp2=tempWorking } tempWorkingUnit=gensub( /[ \t]+\+([0-9\.]+)[ \t°]+([CF])(.*)/, "\\2", 1, $2 ) @@ -8406,11 +8406,22 @@ get_sensors_data() } else { if ( tempFanType != "" ){ + # there are some weird scenarios if ( tempFanType == 1 ){ - cpuTempReal=temp1 + if ( temp1 != "" && temp2 != "" && temp2 > temp1 ) { + cpuTempReal=temp2 + } + else { + cpuTempReal=temp2 + } } else { - cpuTempReal=temp2 + if ( temp1 != "" && temp2 != "" && temp1 > temp2 ) { + cpuTempReal=temp1 + } + else { + cpuTempReal=temp2 + } } } else { @@ -8439,10 +8450,20 @@ get_sensors_data() } else if ( tempFanType != "" ){ if ( tempFanType == 1 ) { - moboTempReal=temp2 + if ( temp1 != "" && temp2 != "" && temp2 > temp1 ) { + moboTempReal=temp1 + } + else { + moboTempReal=temp2 + } } else { - moboTempReal=temp1 + if ( temp1 != "" && temp2 != "" && temp1 > temp2 ) { + moboTempReal=temp2 + } + else { + moboTempReal=temp1 + } } } else {