From 33aa30c60f239bcc226d95c505c05dc64b9c4e1c Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Thu, 22 Jan 2015 09:23:27 +0100 Subject: [PATCH] 20120510: update --- bin/cron/temperature_log | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/cron/temperature_log b/bin/cron/temperature_log index 2f85b2d..f533e63 100755 --- a/bin/cron/temperature_log +++ b/bin/cron/temperature_log @@ -1,7 +1,13 @@ #!/bin/bash #temperature: 23 C -TEMPERATURE=`awk '{print $2}' /proc/acpi/thermal_zone/THRM/temperature` +SENSORDATA=$(sensors 2>&1) + +TEMPERATURE="$(grep -i 'temp1' <<< "${SENSORDATA}" | \ + grep -Eo '[0-9\.]+[[:punct:]]?[ ]?[CF]+' | head -n 1 | \ + sed 's/.\([CF]\)/\1/' | sed 's/C//' )" + +#TEMPERATURE=`awk '{print $2}' /proc/acpi/thermal_zone/THRM/temperature` MONTH=`date +%Y-%m` DATE=`date +%Y-%m-%d` #TOTAL=`awk '{a+=$8}END{print a}' /var/log/custom_logs/temperature.log`