Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2017-08-17 21:10:51 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2017-08-17 21:10:51 +0300
commitc0a6aaf855f5994605d46d8d2b5def5d194bec2b (patch)
treee438abc9095ae0b992376ca24aae23b5b9381b07 /include/tests_tooling
parent0caf42bc5163e70bba0c78758697dbba36d70dce (diff)
[TOOL-5002] performance enhancement to reduce number of dirs/files to check
Diffstat (limited to 'include/tests_tooling')
-rw-r--r--include/tests_tooling11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/tests_tooling b/include/tests_tooling
index 26eee608..64debcde 100644
--- a/include/tests_tooling
+++ b/include/tests_tooling
@@ -54,10 +54,13 @@
# Ansible
FOUND=0
- LIST="~/.ansible ~/.ansible-retry ${ROOTDIR}etc/ansible ${ROOTDIR}root/.ansible ${ROOTDIR}tmp/.ansible"
- for ITEM in ${LIST}; do if DirectoryExists ${ITEM}; then FOUND=1; fi; done
- LIST="${ROOTDIR}var/log/ansible.log"
- for ITEM in ${LIST}; do if FileExists ${ITEM}; then FOUND=1; fi; done
+ LIST="~/.ansible ${ROOTDIR}etc/ansible ${ROOTDIR}root/.ansible ${ROOTDIR}tmp/.ansible"
+ for ITEM in ${LIST}; do if DirectoryExists ${ITEM}; then FOUND=1; break; fi; done
+ # Test for files (only if no match was found)
+ if [ ${FOUND} -eq 0 ]; then
+ LIST="${ROOTDIR}var/log/ansible.log ~/.ansible-retry"
+ for ITEM in ${LIST}; do if FileExists ${ITEM}; then FOUND=1; break; fi; done
+ fi
if [ ${FOUND} -eq 1 ]; then
LogText "Result: found a possible trace of Ansible"