Update offsite-power-check.sh

This commit is contained in:
2024-02-05 18:36:13 -06:00
parent 9231635be9
commit 973ec3097a

View File

@@ -101,6 +101,7 @@ $(date)"
fi
fi
logtime=$(expr `date +%s` - $(stat -f %m ${PW_LOGPOWER}))
echo "HERE: ${logtime} - $(echo "scale=0; ${PW_LOG_INTERVAL_NORMAL}*60" | bc)"
if [ ${logtime} -ge $(echo "scale=0; ${PW_LOG_INTERVAL_NORMAL}*60" | bc) ] || ([ ${OFFSITE_BATT_CAP%.*} -lt 100 ] && [ ${logtime} -gt ${PW_LOG_INTERVAL_CHARGING} ]); then
echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${OFFSITE_VOLTIN}'volts - ${OFFSITE_WATTS}'watts - ${OFFSITE_BATT_CAP}'% Battery - ${OFFSITE_BATT_RUNTIME}'mins - Normal" >> ${PW_LOGPOWER}
fi