diff --git a/powerwall.sh b/powerwall.sh index 160b4a8d..940a85aa 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -155,16 +155,16 @@ Previous Temp: ${last_temp[${SENSOR}]}'F" echo -e "($datetime) - ${SENSOR} - ${temp_f}'F - Back to NORMAL TEMP - Previous Temp: ${last_temp[${SENSOR}]}'F" >> ${logtemp} echo "($datetime) - ${SENSOR} - ${temp_f}F - alert sent" >> ${logtemp} echo -e "($datetime) - ${SENSOR} - Back to NORMAL TEMP: ${temp_f}'F" >> ${logfile} + [ "$(compgen -G "${FOLDER}/shutdown.*")" != "" ] && rm -f ${FOLDER}/shutdown.* elif [ ${last_temp[${SENSOR}]} -eq 0 ]; then SENDNOTICE "${SENSOR} TEMP NORMAL" "($datetime) Service Startup NORMAL TEMP: ${temp_f}'F" echo -e "($datetime) - ${SENSOR} - ${temp_f}'F - Service Startup - NORMAL TEMP" >> ${logtemp} echo -e "($datetime) - ${SENSOR} - Service Startup: ${temp_f}'F" >> ${logfile} - + [ "$(compgen -G "${FOLDER}/shutdown.*")" != "" ] && rm -f ${FOLDER}/shutdown.* fi last_temp[${SENSOR}]=1 [ $relog -eq 1 ] && echo "($datetime) - ${SENSOR} - ${temp_f}F - Normal Temp" >> ${logtemp} - [ "$(compgen -G "${FOLDER}/shutdown.*")" != "" ] && rm -f ${FOLDER}/shutdown.* fi if [ "${temp_h}" != "" ]; then QRY="USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`temp\`, \`hum\`) VALUES ('${SENSOR_ID[${SENSOR}]}','${datetime}','${temp_f}','${temp_h}')"