diff options
author | Kepi <kepi@igloonet.cz> | 2020-07-02 23:47:13 +0300 |
---|---|---|
committer | Kepi <kepi@igloonet.cz> | 2020-07-03 00:42:28 +0300 |
commit | f94817f66f4344e9fee676480bf4e04167ebc52c (patch) | |
tree | c44d2f1c7e6f0ba9d8dcf17326278d30bef3ca18 /include/parameters | |
parent | 1da058d6defcbfa4729b99526fdafcd1ae5295ce (diff) |
Command line option for slow test threshold
IMHO it should be OK to run long tests if we count with it.
Example:
lynis audit system --slow-warning 300
Will warn when test takes longer than 300 seconds, instead of default 10.
Diffstat (limited to 'include/parameters')
-rw-r--r-- | include/parameters | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/parameters b/include/parameters index 8668b683..242899e6 100644 --- a/include/parameters +++ b/include/parameters @@ -423,6 +423,23 @@ QUIET=1 ;; + # Warning when test is slow + --slow-warning) + if [ $# -gt 1 ]; then + shift + + if [ "$1" -gt 0 ] 2>/dev/null; then + SLOW_TEST_THRESHOLD="$1" + else + echo "Argument has to be number." + exit 1 + fi + else + echo "Specify threshold as number of seconds above which should Lynis warn about long test." + exit 1 + fi + ;; + --tests-category | --tests-categories | --view-categories | --list-categories | --show-categories) echo "Error: Deprecated option ($1)" exit 1 |