Update offsite-power-check.sh

This commit is contained in:
2024-01-22 23:28:56 -06:00
parent 10aed96247
commit 3994b2c7c0

View File

@@ -66,7 +66,7 @@ $(date)"
SENDNOTICE "OFFSITE POWER" "Batteries are fully recharged"
rm -f ${PW_TMPFOLDER}/power.offsite.charging
# elif [ ${OFFSITE_BATT_CAP%.*} -lt 100 ] && [ ! -f ${PW_TMPFOLDER}/power.offsite.charging ]; then
elif [ ${OFFSITE_BATT_CAP%.*} -lt 100 ]; then
elif [ ${OFFSITE_BATT_CAP%.*} -lt 100 ] && ([ ! -f ${PW_TMPFOLDER}/power.offsite.charging ] || [ $(expr `date +%s` - $(stat -f %m ${PW_TMPFOLDER}/power.offsite.charging)) -gt 60 ]); then
# touch ${PW_TMPFOLDER}/power.offsite.charging
echo "${OFFSITE_BATT_CAP%.*}%" >| ${PW_TMPFOLDER}/power.offsite.charging
fi