This commit is contained in:
2024-12-01 17:11:31 -06:00
parent 3572d6fba7
commit b2193f81ae
2 changed files with 6 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
VERS='2.8.11-12012024'
VERS='2.8.12-12012024'
noheader=' update service dailytemp confsync -r -report test '

View File

@@ -871,7 +871,7 @@ OFFSITE_CHECKPOWER_SERVICE(){
# upsinfo=$(upsc offsite-ups)
upsinfo=$(upsc offsite-ups 2>&1)
if [ "$(echo "${upsinfo}" | grep 'input.voltage:' | sed 's/.*: //')" != "" ]; then
rm -f ${PW_TMPFOLDER}/power.ups.losscomm
rm -f ${PW_TMPFOLDER}/power.offsite.ups.losscomm
OFFSITE_VOLTIN=$(echo "${upsinfo}" | grep 'input.voltage:' | sed 's/.*: //')
OFFSITE_LOAD=$(echo "${upsinfo}" | grep 'ups.load:' | sed 's/.*: //')
OFFSITE_LOAD=`echo "scale=2; ${OFFSITE_LOAD}/100" | bc`
@@ -995,14 +995,14 @@ AMBIENT TEMP: ${OFFSITE_TEMP}'F"
fi
else
if [ ! -f ${PW_TMPFOLDER}/power.ups.losscomm ]; then
touch ${PW_TMPFOLDER}/power.ups.losscomm
if [ ! -f ${PW_TMPFOLDER}/power.offsite.ups.losscomm ]; then
touch ${PW_TMPFOLDER}/power.offsite.ups.losscomm
elif [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/power.ups.losscomm)) -ge 120 ]; then
elif [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/power.offsite.ups.losscomm)) -ge 120 ]; then
echo "($(date +'%Y-%m-%d %H:%M:%S')) - 0.0'volts - 0'% Battery - Restarting NUT service" >> ${PW_LOGFILE}
service nut-driver restart
sleep 10s
touch ${PW_TMPFOLDER}/power.ups.losscomm
touch ${PW_TMPFOLDER}/power.offsite.ups.losscomm
fi
fi