mirror of https://github.com/CISOfy/lynis.git
[TOOL-5002] performance enhancement to reduce number of dirs/files to check
This commit is contained in:
parent
0caf42bc51
commit
c0a6aaf855
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue