Limit parsing to only grab the first result found for the sensor. Sometimes you get more than one result for things like CPU cores (Quad core printing as: Core0,Core0,Core1,Core1 on a Toshiba laptop with sensor k8temp-pci-00c3)

This commit is contained in:
Elyrith 2012-12-07 17:38:10 -05:00
parent 6df8362ab0
commit 0fe7e5aa90
3 changed files with 2 additions and 2 deletions

0
README Normal file → Executable file
View File

0
THANKS Normal file → Executable file
View File

View File

@ -190,9 +190,9 @@ fi
#Get the temperature #Get the temperature
TEMP=`${SENSORPROG} | grep "$sensor" | cut -d+ -f2 | cut -c1-2 ` TEMP=`${SENSORPROG} | grep "$sensor" | cut -d+ -f2 | cut -c1-2 | head -n1`
#Old way - Get the temperature #Old way - Get the temperature
#TEMP=`${SENSORPROG} | grep "$sensor" | awk '{print $3}' | cut -c2-3` #TEMP=`${SENSORPROG} | grep "$sensor" | awk '{print $3}' | cut -c2-3 | head -n1`
# Check if the thresholds have been set correctly # Check if the thresholds have been set correctly