[refactor] Use regex in error check for setup log

This commit is contained in:
William Wernert
2020-07-01 13:51:54 -04:00
parent db764902c7
commit 44890edc79

View File

@@ -51,7 +51,7 @@ echo "---- Starting setup at $(date -u) ----" >> $setup_log 2>&1
automated=no
function progress() {
if grep -q "ERROR" $setup_log || grep -q "Error" $setup_log || [[ -s /var/spool/mail/root ]]; then
if grep -qE "(ERROR|Error)" $setup_log || [[ -s /var/spool/mail/root ]]; then
if [[ -s /var/spool/mail/root ]]; then
echo '[ ERROR ] /var/spool/mail/root grew unexpectedly' >> $setup_log 2>&1
fi