diff options
author | mboelen <michael@cisofy.com> | 2016-04-25 11:18:09 +0300 |
---|---|---|
committer | mboelen <michael@cisofy.com> | 2016-04-25 11:18:09 +0300 |
commit | eae8ef99a46da9b9fdfed3b23d6f82a283178e27 (patch) | |
tree | 1b551a95d9d9c03a348d1e437bf0e27067198dc0 | |
parent | a3075d2e8fb00c205ad7a11e0d7005f973683b2d (diff) |
Exit with exit code 0 by default, unless error-on-warnings is being used
-rw-r--r-- | include/consts | 1 | ||||
-rw-r--r-- | include/profiles | 7 | ||||
-rwxr-xr-x | lynis | 7 |
3 files changed, 14 insertions, 1 deletions
diff --git a/include/consts b/include/consts index d771f08c..47245bb1 100644 --- a/include/consts +++ b/include/consts @@ -76,6 +76,7 @@ unset LANG DB2_RUNNING=0 DISCOVERED_BINARIES="" DOCKER_DAEMON_RUNNING=0 + ERROR_ON_WARNINGS=0 FILEVALUE="" FIND="" FIREWALL_ACTIVE=0 diff --git a/include/profiles b/include/profiles index 787d561a..7d076d9c 100644 --- a/include/profiles +++ b/include/profiles @@ -99,6 +99,13 @@ fi ;; + # Show non-zero exit code when errors are found + error-on-warnings) + if [ "${VALUE}" = "yes" -o "${VALUE}" = "true" -o ${VALUE} = "1" ]; then + ERROR_ON_WARNINGS=1 + fi + ;; + # Skip FreeBSD port audit freebsd_skip_portaudit) LogText "Option set: Skip FreeBSD portaudit" @@ -986,7 +986,12 @@ ${NORMAL} # Clean exit (Delete PID file) if [ ${TOTAL_WARNINGS} -gt 0 ]; then - ExitCustom 78 + # Use exit code 78 if we found any warnings (and enabled) + if [ ${ERROR_ON_WARNINGS} -eq 1 ]; then + ExitCustom 78 + else + ExitClean + fi else ExitClean fi |