Only use the first line of output

This commit is contained in:
Christian Nicolai 2019-12-26 14:36:08 +01:00 committed by GitHub
parent e70d6b59fd
commit 632b81b9f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -18,13 +18,13 @@ if [ "${1}" = "config" ]; then
echo "temp.label temperatue" echo "temp.label temperatue"
echo "temp.type GAUGE" echo "temp.type GAUGE"
else else
TEMP=`${PCSENSOR} -cm` TEMP=`${PCSENSOR} -cm | head -n 1`
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
sleep 2 sleep 2
TEMP=`${PCSENSOR} -cm` TEMP=`${PCSENSOR} -cm | head -n 1`
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
sleep 6 sleep 6
TEMP=`${PCSENSOR} -cm` TEMP=`${PCSENSOR} -cm | head -n 1`
fi fi
fi fi
echo "temp.value $TEMP" echo "temp.value $TEMP"