Update offsite-power-check.sh

This commit is contained in:
2023-11-05 18:32:27 -06:00
parent 7bd7b42d39
commit d46663efae

View File

@@ -4,6 +4,7 @@ PW_FOLDER='/opt/idssys/powerwall'
PW_LOGFOLDER=${PW_FOLDER}/logs
PW_LOGFILE=${PW_LOGFOLDER}/logfile
PW_LOGPOWER=${PW_LOGFOLDER}/log-power
PW_TMPFOLDER=${PW_FOLDER}/.tmp
[ ! -f ${PW_LOGFILE} ] && touch ${PW_LOGFILE}
[ ! -f ${PW_LOGPOWER} ] && touch ${PW_LOGPOWER}
@@ -68,7 +69,7 @@ BATT RUNTIME: ${OFFSITE_BATT_RUNTIME}'Mins" 1
touch ${PW_TMPFOLDER}/power.offsite.ac.low
fi
if [ ${OFFSITE_BATT_CAP%.*} -lt 95 ] && [ ! -f ${PW_TMPFOLDER}/power.offsite.off ]; then
if [ ${OFFSITE_BATT_CAP%.*} -lt 99 ] && [ ! -f ${PW_TMPFOLDER}/power.offsite.off ]; then
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${OFFSITE_BATT_CAP}% Battery - Powering Down Hosts!" >> ${PW_LOGFILE}
SENDNOTICE2 "OFFSITE HOST POWER" "Powering DOWN offsite host(s) due to power outage" 1
touch ${PW_TMPFOLDER}/power.offsite.off