manage symlink

This commit is contained in:
thomas
2026-10-02 07:18:44 +02:00
parent 9f78b7a85f
commit 546c62b2c7
+4 -3
View File
@@ -37,13 +37,14 @@ function _cacheStale {
function _getRandomFile {
f=$(_getRandomBurpFolders )
#f=/home/tom/Documents/Opendoor/Developpement/Scripts/Backups/BurpCheck/Test
test -L "${f}" && f=$(readlink -f "${f}")
test -d "${f}" || { echo "error opening $f" ; exit 1 ; }
cacheFile=/tmp/burp_cache_$(echo $f | md5sum | cut -f1 -d ' ')
if ( $(_cacheStale "$cacheFile" )) ; then
readarray -d '' files < <(shuf -z $cacheFile)
else
readarray -d '' files < <(find $f -type f -print0 | shuf -z | tee $cacheFile)
fi
else
readarray -d '' files < <(find ${f} -type f -print0 | shuf -z | tee $cacheFile)
fi
}