Merge pull request #965 from frennkie/fix-duplicate-undervol

fix duplicate undervoltage line in info file
This commit is contained in:
Christian Rotzoll
2020-01-09 14:51:48 +01:00
committed by GitHub

View File

@@ -69,7 +69,7 @@ do
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
if ! grep -Eq "^undervoltageReports=" ${infoFile}; then
# write new value to info file
undervoltageReports="${countReports}"
echo "undervoltageReports=${undervoltageReports}" >> ${infoFile}