Browse Source

#428 count under-voltage reports

v1.1
Christian Rotzoll 6 years ago
parent
commit
215deda60d
  1. 6
      home.admin/00infoBlitz.sh
  2. 19
      home.admin/_background.sh

6
home.admin/00infoBlitz.sh

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

19
home.admin/_background.sh

@ -60,6 +60,25 @@ do
fi 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 # RECHECK PUBLIC IP
# when public IP changes, restart LND with new IP # when public IP changes, restart LND with new IP

Loading…
Cancel
Save