manage symlink
This commit is contained in:
+4
-3
@@ -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
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user