diff --git a/default.prf b/default.prf index befd40d0..1431beb6 100644 --- a/default.prf +++ b/default.prf @@ -67,8 +67,8 @@ profile-name=Default Audit Template # Number of seconds to pause between every test (0 is no pause) pause-between-tests=0 -# Quick mode (no waiting for keypresses) -quick=no +# Quick mode (do not wait for keypresses) +quick=yes # Refresh software repositories to help detecting vulnerable packages refresh-repositories=yes diff --git a/developer.prf b/developer.prf index 856596a8..624e06e6 100644 --- a/developer.prf +++ b/developer.prf @@ -3,6 +3,5 @@ debug=yes developer-mode=yes -quick=yes strict=yes verbose=yes diff --git a/include/parameters b/include/parameters index 0798224e..001044a5 100644 --- a/include/parameters +++ b/include/parameters @@ -233,7 +233,7 @@ # Cronjob support --cron-job | --cronjob | --cron) CRONJOB=1 - CHECK=1; QUICKMODE=1; COLORS=0; NEVERBREAK=1 # Use some defaults (-c, -Q, no colors) + CHECK=1; COLORS=0; NEVERBREAK=1 # Use some defaults ('audit system', -Q, no colors) RemoveColors ;; @@ -345,7 +345,6 @@ # Quiet mode --quiet | -q | --silent) QUIET=1 - QUICKMODE=1 # Run non-interactive ;; # Non-interactive mode @@ -444,7 +443,6 @@ # Warnings --warnings-only | --show-warnings-only) SHOW_WARNINGS_ONLY=1 - QUICKMODE=1 QUIET=1 ;; @@ -465,5 +463,15 @@ done + # Ensure non-interactive mode when running quietly or as cronjob + if [ ${CRONJOB} -eq 1 -o ${QUIET} -eq 1 ]; then + if [ ${QUICKMODE} -eq 0 ]; then + if [ ${QUIET} -eq 0 ]; then + echo "Switched back to quick mode (cron/non-interactive/quiet)" + fi + QUICKMODE=1 + fi + fi + #================================================================================ # Lynis - Security Auditing and System Hardening for Linux and UNIX - https://cisofy.com diff --git a/include/profiles b/include/profiles index a2d36bb4..f8935ece 100644 --- a/include/profiles +++ b/include/profiles @@ -290,9 +290,9 @@ # Quick (no waiting for keypresses) quick) - # Quick mode (SKIP_PLUGINS) might already be set outside profile, so store in different variable - SETTING_QUICK_MODE=0 # default is no - FIND=$(echo "${VALUE}" | egrep "^(1|true|yes)$") && QUICKMODE=1 + # Quick mode might already be set outside profile, so store in different variable + SETTING_QUICK_MODE=1 # default is yes + FIND=$(echo "${VALUE}" | egrep "^(0|false|no)$") && QUICKMODE=0 if [ ! -z "${FIND}" ]; then SETTING_QUICK_MODE=1; fi Debug "Quickmode set to ${SETTING_QUICK_MODE}" AddSetting "quick" "${SETTING_QUICK_MODE}" "Quick mode (non-interactive)"