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