Improved symlink detection and reporting

This commit is contained in:
mboelen 2014-10-13 19:45:14 +02:00
parent ebdee5b0d2
commit 6f893ea3b4

View File

@ -46,14 +46,18 @@
if [ -L ${SCANDIR} ]; then if [ -L ${SCANDIR} ]; then
logtext "Result: directory exists, but is actually a symlink" logtext "Result: directory exists, but is actually a symlink"
ShowSymlinkPath ${SCANDIR} ShowSymlinkPath ${SCANDIR}
if [ ${FOUNDPATH} -eq 1 -a -d ${rFILE} ]; then if [ ${FOUNDPATH} -eq 1 ]; then
# Set path to new location if [ ! "${SYMLINK}" = "" -a -d ${SYMLINK} ]; then
logtext "Result: found the path behind this symlink (${SCANDIR} --> ${sFILE})" # Set path to new location
ORGPATH="${SCANDIR}" logtext "Result: found the path behind this symlink (${SCANDIR} --> ${sFILE})"
SCANDIR="${sFILE}" ORGPATH="${SCANDIR}"
FIND=`echo ${SCANNEDPATHS} | grep ", ${SCANDIR}"` SCANDIR="${sFILE}"
if [ ! "${FIND}" = "" ]; then FIND=`echo ${SCANNEDPATHS} | grep ", ${SCANDIR}"`
SKIPDIR=1; logtext "Result: Skipping this directory as it is a symlink and was already scanned" if [ ! "${FIND}" = "" ]; then
SKIPDIR=1; logtext "Result: Skipping this directory as it is a symlink and was already scanned"
fi
else
SKIPDIR=1; logtext "Result: Symlink variable empty, or directory to symlink is non-existing"
fi fi
else else
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"