mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-20 13:02:21 +02:00
#428 count under-voltage reports
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user