[TOOL-5002] performance enhancement to reduce number of dirs/files to check

This commit is contained in:
Michael Boelen 2017-08-17 20:10:51 +02:00
parent 0caf42bc51
commit c0a6aaf855
No known key found for this signature in database
GPG Key ID: 26141F77A09D7F04
1 changed files with 7 additions and 4 deletions

View File

@ -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"