Update power.inc.sh

This commit is contained in:
2025-06-03 17:45:03 -05:00
parent 44aac506fc
commit f0802d1885

View File

@@ -1008,8 +1008,8 @@ OFFSITE_CHECKPOWER_SERVICE(){
TESTMSG=""
fi
# upsinfo=$(upsc offsite-ups)
upsinfo=$(upsc offsite-ups 2>&1)
upsinfo=$(upsc offsite-ups)
# upsinfo=$(upsc offsite-ups 2>&1)
if [ "$(echo "${upsinfo}" | grep 'input.voltage:' | sed 's/.*: //')" != "" ]; then
rm -f ${PW_TMPFOLDER}/power.offsite.ups.losscomm
OFFSITE_VOLTIN=$(echo "${upsinfo}" | grep 'input.voltage:' | sed 's/.*: //')
@@ -1140,7 +1140,7 @@ AMBIENT TEMP: ${OFFSITE_TEMP}'F"
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'V - 0'% Battery - Restarting NUT service" >> ${PW_LOGFILE}
systemctl restart nut-driver
systemctl restart /usr/lib/systemd/system/nut-driver.service
sleep 10s
touch ${PW_TMPFOLDER}/power.offsite.ups.losscomm
fi