From faa2f7026f99f1bee58bd592e5544f60c5b859ad Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 30 Dec 2023 14:52:53 -0600 Subject: [PATCH] update --- defaults.inc | 2 +- inc/power.inc.sh | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/defaults.inc b/defaults.inc index 098afcd6..ad99a9f5 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,5 +1,5 @@ -VERS='2.5.89-12302023' +VERS='2.5.90-12302023' noheader=' update service dailytemp confsync ' diff --git a/inc/power.inc.sh b/inc/power.inc.sh index 66bf669d..489cec0c 100644 --- a/inc/power.inc.sh +++ b/inc/power.inc.sh @@ -382,7 +382,7 @@ VOLTAGE: ${INPUTACV}'volts" else [ $(expr `date +%s` - $(stat -c %Y ${PW_LOGPOWER})) -ge $(echo "scale=0; ${PW_LOG_INTERVAL_NORMAL}*60" | bc) ] && echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${INPUTACV}'volts - Normal Voltage" >> ${PW_LOGPOWER} if [ -f ${PW_TMPFOLDER}/power.ac.start ]; then - SENDNOTICE "Power Nominal" "Service Startup + SENDNOTICE "POWER Startup - Nominal" "Service Startup Normal voltage detected VOLTAGE: ${INPUTACV}'volts BATT VOLTAGE: ${BATTVOLT}'volts" @@ -413,7 +413,18 @@ BATT VOLTAGE: ${BATTVOLT}'volts" else [ $(expr `date +%s` - $(stat -c %Y ${PW_LOGPOWER})) -ge 300 ] && echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${INPUTACV}'volts / ${BATTVOLT}'volts - Power OFF or LOW" >> ${PW_LOGPOWER} - if [ -f ${PW_TMPFOLDER}/power.ac.good ]; then + if [ -f ${PW_TMPFOLDER}/power.ac.start ]; then + SENDNOTICE "POWER Startup - POWER OFF/LOW!!" "Service Startup +Power off or low voltage detected +VOLTAGE: ${INPUTACV}'volts +BATT VOLTAGE: ${BATTVOLT}'volts" 1 + echo "($(date +'%Y-%m-%d %H:%M:%S')) - Input: ${INPUTACV}'volts - 'Check Power' Service Startup - Normal voltage detected" >> ${PW_LOGFILE} + echo "($(date +'%Y-%m-%d %H:%M:%S')) - Input: ${INPUTACV}'volts - 'Check Power' Service Startup - Normal voltage detected" >> ${PW_LOGPOWER} + rm -f ${PW_TMPFOLDER}/power.ac.start + rm -f ${PW_TMPFOLDER}/power.ac.good + touch ${PW_TMPFOLDER}/power.ac.low + + elif [ -f ${PW_TMPFOLDER}/power.ac.good ]; then echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${INPUTACV}'volts / ${BATTVOLT}'volts - Power OFF or LOW voltage detected" >> ${PW_LOGPOWER} SENDNOTICE "POWER ALERT - POWER OFF/LOW!!" "Power off or low voltage detected VOLTAGE: ${INPUTACV}'volts