From 1840e60be4419d265f9006c543f6bcc3b0165553 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 4 Dec 2023 13:44:16 -0600 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/powerwall.sh b/powerwall.sh index ffc22908..6e49caf4 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -261,6 +261,11 @@ CHECKTEMP_SERVICE(){ fi if [ "${SENSORS_CHECK}" != "" ]; then for SENSOR in "${SENSORS_CHECK[@]}"; do + if [ "${PW_TEMP_THRESHOLDS[${SENSORa}]}" != "" ]; then + echo ${PW_TEMP_THRESHOLDS[${SENSORa}]} | cut -d',' -f 1 | read temp_warn + echo ${PW_TEMP_THRESHOLDS[${SENSORa}]} | cut -d',' -f 2 | read temp_crit + [ "${PW_TEMP_THRESHOLDS[${SENSORa}]} | cut -d',' -f 3" != "" ] && echo ${PW_TEMP_THRESHOLDS[${SENSORa}]} | cut -d',' -f 3 | read temp_crit_sys || temp_crit_sys=${temp_crit} + fi if [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "mqtt" ]; then mqtt_message=`${mqtt_conn} -t tele/${SENSOR}/SENSOR -C 1` @@ -298,9 +303,6 @@ CHECKTEMP_SERVICE(){ else temp_c=$(ssh -q -o ConnectTimeout=1 -o ConnectionAttempts=1 root@${PW_REMOTE_SENSORS[${SENSORa}]} "/opt/idssys/defaults/get-data.sh cpu-usage") fi - echo ${PW_TEMP_THRESHOLDS[${SENSORa}]} | cut -d',' -f 1 | read temp_warn - echo ${PW_TEMP_THRESHOLDS[${SENSORa}]} | cut -d',' -f 2 | read temp_crit - echo ${PW_TEMP_THRESHOLDS[${SENSORa}]} | cut -d',' -f 3 | read temp_crit_sys temp_h='' fi