mirror of https://github.com/CISOfy/lynis.git
Run non-interactive by default, use --wait to enforce waiting after finishing a group of tests
This commit is contained in:
parent
c31c6a5a9e
commit
76e84f4b56
|
@ -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
|
||||
|
|
|
@ -3,6 +3,5 @@
|
|||
|
||||
debug=yes
|
||||
developer-mode=yes
|
||||
quick=yes
|
||||
strict=yes
|
||||
verbose=yes
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)"
|
||||
|
|
Loading…
Reference in New Issue