Update offsite-power-check.sh

This commit is contained in:
2023-11-06 10:05:34 -06:00
parent 9970d2ae55
commit 042433e5aa

View File

@@ -56,6 +56,15 @@ $(date)"
fi fi
if [ ${OFFSITE_VOLTIN%.*} -gt 105 ]; then if [ ${OFFSITE_VOLTIN%.*} -gt 105 ]; then
if [ "${charging}" == "true" ] && [ ${OFFSITE_BATT_CAP%.*} -eq 100 ]; then
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${OFFSITE_VOLTIN}'volts - ${OFFSITE_BATT_CAP}% Battery - Charging Complete" >> ${PW_LOGFILE}
SENDNOTICE "OFFSITE POWER" "Batteries are fully recharged"
charging=false
elif [ ${OFFSITE_BATT_CAP%.*} -lt 100 ]; then
charging=true
else
charging=false
fi
if [ -f ${PW_TMPFOLDER}/power.offsite.ac.low ]; then if [ -f ${PW_TMPFOLDER}/power.offsite.ac.low ]; then
if [ -f ${PW_TMPFOLDER}/power.offsite.off ]; then if [ -f ${PW_TMPFOLDER}/power.offsite.off ]; then
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${OFFSITE_VOLTIN}'volts - ${OFFSITE_BATT_CAP}% Battery - Offsite Power Restored" >> ${PW_LOGFILE} echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${OFFSITE_VOLTIN}'volts - ${OFFSITE_BATT_CAP}% Battery - Offsite Power Restored" >> ${PW_LOGFILE}