diff --git a/offsite-power-check.sh b/offsite-power-check.sh index 3e8e7e7d..5a969530 100755 --- a/offsite-power-check.sh +++ b/offsite-power-check.sh @@ -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