Update powerwall.sh

This commit is contained in:
2023-12-11 18:15:35 -06:00
parent e02a19b72a
commit c82fc9f5af

View File

@@ -245,8 +245,6 @@ CHECKTEMP_SERVICE(){
fi
if [ "${SENSORS_CHECK}" != "" ]; then
for SENSOR in "${SENSORS_CHECK[@]}"; do
[ "${last_temp[${SENSOR//-/}]}" == "" ] && last_temp[${SENSOR//-/}]=0
echo "${SENSOR//-/} - ${last_temp[${SENSOR//-/}]}"
if [ "${PW_THRESHOLDS[${SENSORa}]}" != "" ]; then
echo ${PW_THRESHOLDS[${SENSORa}]} | cut -d',' -f 1 | read temp_warn
echo ${PW_THRESHOLDS[${SENSORa}]} | cut -d',' -f 2 | read temp_crit
@@ -292,7 +290,8 @@ CHECKTEMP_SERVICE(){
temp_h=''
fi
echo "${SENSOR//-/} - ${last_temp[${SENSOR//-/}]}"
[ "${last_temp[${SENSOR//-/}]}" == "" ] && last_temp[${SENSOR//-/}]=0
logtemp=${PW_LOGFOLDER}/log-temp-${SENSOR}
if [ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ]; then
[ "${PW_SENSOR_TYPE[${SENSORa}]}" == "cpu" ] && GAUGE="CPU-USAGE" || GAUGE="TEMP"
@@ -303,7 +302,6 @@ CHECKTEMP_SERVICE(){
rm -f ${PW_TMPFOLDER}/${SENSOR}-error.reading
fi
echo "${SENSOR//-/} - ${last_temp[${SENSOR//-/}]}"
[ "${PW_SENSOR_TYPE[${SENSOR}]}" == "cpu" ] && temp_f=$(echo "scale=2; $temp_c/1" | bc -l) || temp_f=$(echo "scale=2; ${temp_c}*1.8 + 32" | bc)
[ "${SENSOR}" == "ServerRoomTH" ] && temp_f=`echo "scale=2; ${temp_f}+${PW_ServerRoomTH_Dev}" | bc`
@@ -316,9 +314,7 @@ CHECKTEMP_SERVICE(){
echo ${PW_THRESHOLDS[${SENSOR}]} | cut -d',' -f 3 | read temp_crit_sys
fi
echo 1
if (( $(bc <<< "${temp_f} < ${temp_warn}") )); then
echo "2 - ${last_temp[${SENSOR//-/}]}"
if (( $(bc <<< "${last_temp[${SENSOR//-/}]} > 1") )); then
SENDNOTICE "${SENSOR} BACK TO NORMAL" "NORMAL TEMP: ${temp_f}${GAUGESH}
Previous Temp: ${last_temp[${SENSOR//-/}]}${GAUGESH}"
@@ -327,7 +323,6 @@ Previous Temp: ${last_temp[${SENSOR//-/}]}${GAUGESH}"
# [ "$(compgen -G "${PW_TMPFOLDER}/power.*.off")" != "" ] && rm -f ${PW_TMPFOLDER}/power.*.off
elif [ "${last_temp[${SENSOR//-/}]}" == "0" ]; then
echo 4
# SENDNOTICE "${SENSOR} TEMP NORMAL" "Service Startup
# NORMAL TEMP: ${temp_f}${GAUGESH}"
echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Service Startup - NORMAL ${GAUGE}" >> ${logtemp}