From 8e72d1dd9acb83a4ab43f61b3e407f42f571e448 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 3 Sep 2022 11:49:38 -0500 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/powerwall.sh b/powerwall.sh index 69102208..36ba68f3 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -21,13 +21,14 @@ CHECKTEMP(){ if [ "$temp_c" != "null" ] && [ "$temp_c" != "" ]; then temp_f=`echo "scale=2; $temp_c*1.8 + 32" | bc` #echo "$temp_c -> $temp_f" - + echo ${TEMP_THRESHOLDS[${1}]} | cut -d',' -f 1 | read temp_warn echo ${TEMP_THRESHOLDS[${1}]} | cut -d',' -f 2 | read temp_crit + temp_f=$(($temp_f + 0)) - if [ "$temp_f" -ge ${temp_warn} ] && [ "$temp_f" -lt ${temp_crit} ]; then + if [ $temp_f -ge ${temp_warn} ] && [ $temp_f -lt ${temp_crit} ]; then echo "WARNING: $temp_f" - elif [ "$temp_f" -ge ${temp_crit} ]; then + elif [ $temp_f -ge ${temp_crit} ]; then echo "CRITICAL: $temp_f" else echo "normal: $temp_f"