fix check whether setting is present

This commit is contained in:
Robert Habermann 2020-01-08 19:56:39 +00:00
parent 4a457b8565
commit c330da29e1

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}