From 45230791ff44951210103db9ac7d36c028fb53b8 Mon Sep 17 00:00:00 2001 From: Christian Nicolai Date: Fri, 27 Dec 2019 17:50:00 +0100 Subject: [PATCH] Fix hiding pcsensor exit code of head --- pcsensor | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pcsensor b/pcsensor index 61f021e..6215577 100755 --- a/pcsensor +++ b/pcsensor @@ -18,14 +18,14 @@ if [ "${1}" = "config" ]; then echo "temp.label temperatue" echo "temp.type GAUGE" else - TEMP=`${PCSENSOR} -cm | head -n 1` + TEMP=$(${PCSENSOR} -cm) if [[ $? != 0 ]]; then sleep 2 - TEMP=`${PCSENSOR} -cm | head -n 1` + TEMP=$(${PCSENSOR} -cm) if [[ $? != 0 ]]; then sleep 6 - TEMP=`${PCSENSOR} -cm | head -n 1` + TEMP=$(${PCSENSOR} -cm) fi fi - echo "temp.value $TEMP" + echo "temp.value $(echo -n "$TEMP" | head -n 1)" fi