Skip directory if it has already been found, or its symlink

This commit is contained in:
mboelen 2014-10-13 20:07:19 +02:00
parent 8454ac7baf
commit 5ac6812ba5

View File

@ -52,10 +52,6 @@
logtext "Result: found the path behind this symlink (${SCANDIR} --> ${sFILE})" logtext "Result: found the path behind this symlink (${SCANDIR} --> ${sFILE})"
ORGPATH="${SCANDIR}" ORGPATH="${SCANDIR}"
SCANDIR="${sFILE}" SCANDIR="${sFILE}"
FIND=`echo ${SCANNEDPATHS} | grep ", ${SCANDIR}"`
if [ ! "${FIND}" = "" ]; then
SKIPDIR=1; logtext "Result: Skipping this directory as it is a symlink and was already scanned"
fi
else else
SKIPDIR=1; logtext "Result: Symlink variable empty, or directory to symlink is non-existing" SKIPDIR=1; logtext "Result: Symlink variable empty, or directory to symlink is non-existing"
fi fi
@ -63,6 +59,12 @@
SKIPDIR=1; logtext "Result: Could not find the location of this symlink, or is not a directory" SKIPDIR=1; logtext "Result: Could not find the location of this symlink, or is not a directory"
fi fi
fi fi
FIND=`echo ${SCANNEDPATHS} | grep ", ${SCANDIR}"`
if [ ! "${FIND}" = "" ]; then
SKIPDIR=1; logtext "Result: Skipping this directory as it was already scanned"
fi
if [ ${SKIPDIR} -eq 0 ]; then if [ ${SKIPDIR} -eq 0 ]; then
logtext "Test: Checking binaries in directory ${SCANDIR}" logtext "Test: Checking binaries in directory ${SCANDIR}"
Display --indent 4 --text "- ${SCANDIR}" --result FOUND --color GREEN Display --indent 4 --text "- ${SCANDIR}" --result FOUND --color GREEN
@ -174,7 +176,7 @@
done done
else else
logtext "Result: Directory ${SCANDIR} skipped" logtext "Result: Directory ${SCANDIR} skipped"
Display --indent 4 --text "- ${SCANDIR} (symlinked from ${ORGPATH})" --result SKIPPED --color YELLOW Display --indent 4 --text "- ${SCANDIR}" --result SKIPPED --color YELLOW
fi fi
else else
Display --indent 4 --text "- ${SCANDIR}" --result "NOT FOUND" --color WHITE Display --indent 4 --text "- ${SCANDIR}" --result "NOT FOUND" --color WHITE