#428 count under-voltage reports

This commit is contained in:
Christian Rotzoll
2019-03-15 15:43:16 +01:00
parent 88a26f881c
commit 215deda60d
2 changed files with 22 additions and 3 deletions

View File

@@ -289,7 +289,7 @@ ${color_yellow}${ln_publicColor}${ln_external}
"-------------------------------------------" \
"load average:${load##up*, }" "${temp}" \
"${hdd}" "${sync_percentage}"
if [ "${runBehindTor}" != "on" ]; then
# one extra space line at the end if nodeaddress is not TOR
echo ""
if [ ${#undervoltageReports} -gt 0 ]; then
echo "${countReports} undervoltage reports found in syslog"
fi

View File

@@ -60,6 +60,25 @@ do
fi
####################################################
# CHECK FOR UNDERVOLTAGE REPORTS
# every 1 hour scan for undervoltage reports
####################################################
recheckUndervoltage=$(($counter % 3600))
if [ ${recheckUndervoltage} -eq 1 ]; then
echo "*** RECHECK UNDERVOLTAGE ***"
countReports=$(sudo cat /var/log/syslog | grep -c "Under-voltage detected!")
echo "${countReports} undervoltage reports found in syslog"
if [ ${#undervoltageReports} -eq 0 ]; then
# write new value to info file
undervoltageReports="${countReports}"
echo "undervoltageReports=${undervoltageReports}" >> ${infoFile}
else
# update value in info file
sed -i "s/^undervoltageReports=.*/undervoltageReports=${countReports}/g" ${infoFile}
fi
fi
####################################################
# RECHECK PUBLIC IP
# when public IP changes, restart LND with new IP