From 263206a792a48a74e4aca00d0c16e14a03ab0fc2 Mon Sep 17 00:00:00 2001 From: quamis Date: Tue, 7 Jun 2016 11:12:27 +0300 Subject: [PATCH] added support for TEMPer2, with 2 sensors --- pcsensor | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/pcsensor b/pcsensor index 9229324..a56af46 100755 --- a/pcsensor +++ b/pcsensor @@ -13,19 +13,32 @@ if [ "${1}" = "config" ]; then echo "graph_scale no" echo "graph_vlabel Celsius" echo "graph_category sensors" - echo "graph_info This graph shows the temperature reported by the first attached TEMPer USB Thermometer" + echo "graph_info This graph shows the temperature reported by the first attached TEMPer2 USB Thermometer" - echo "temp.label temperatue" - echo "temp.type GAUGE" + echo "temp1.label temperature1" + echo "temp1.type GAUGE" + echo "temp2.label temperature2" + echo "temp2.type GAUGE" else - TEMP=`${PCSENSOR} -cm` + TEMP1=`${PCSENSOR} -cm | head -n 1 | tail -n 1` if [[ $? != 0 ]]; then sleep 2 - TEMP=`${PCSENSOR} -cm` + TEMP1=`${PCSENSOR} -cm | head -n 1 | tail -n 1` if [[ $? != 0 ]]; then sleep 6 - TEMP=`${PCSENSOR} -cm` + TEMP1=`${PCSENSOR} -cm | head -n 1 | tail -n 1` fi fi - echo "temp.value $TEMP" + echo "temp1.value $TEMP1" + + TEMP2=`${PCSENSOR} -cm | head -n 2 | tail -n 1` + if [[ $? != 0 ]]; then + sleep 2 + TEMP2=`${PCSENSOR} -cm | head -n 2 | tail -n 1` + if [[ $? != 0 ]]; then + sleep 6 + TEMP2=`${PCSENSOR} -cm | head -n 2 | tail -n 1` + fi + fi + echo "temp2.value $TEMP2" fi