From 0fe7e5aa90fe2925999c1bd368b979e01a85d66d Mon Sep 17 00:00:00 2001 From: Elyrith Date: Fri, 7 Dec 2012 17:38:10 -0500 Subject: [PATCH] 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) --- README | 0 THANKS | 0 check_temp.sh | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 README mode change 100644 => 100755 THANKS diff --git a/README b/README old mode 100644 new mode 100755 diff --git a/THANKS b/THANKS old mode 100644 new mode 100755 diff --git a/check_temp.sh b/check_temp.sh index 542565e..cd0772f 100755 --- a/check_temp.sh +++ b/check_temp.sh @@ -190,9 +190,9 @@ fi #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 -#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