manage symlink
This commit is contained in:
+4
-3
@@ -37,13 +37,14 @@ function _cacheStale {
|
|||||||
function _getRandomFile {
|
function _getRandomFile {
|
||||||
f=$(_getRandomBurpFolders )
|
f=$(_getRandomBurpFolders )
|
||||||
#f=/home/tom/Documents/Opendoor/Developpement/Scripts/Backups/BurpCheck/Test
|
#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 ; }
|
test -d "${f}" || { echo "error opening $f" ; exit 1 ; }
|
||||||
cacheFile=/tmp/burp_cache_$(echo $f | md5sum | cut -f1 -d ' ')
|
cacheFile=/tmp/burp_cache_$(echo $f | md5sum | cut -f1 -d ' ')
|
||||||
if ( $(_cacheStale "$cacheFile" )) ; then
|
if ( $(_cacheStale "$cacheFile" )) ; then
|
||||||
readarray -d '' files < <(shuf -z $cacheFile)
|
readarray -d '' files < <(shuf -z $cacheFile)
|
||||||
else
|
else
|
||||||
readarray -d '' files < <(find $f -type f -print0 | shuf -z | tee $cacheFile)
|
readarray -d '' files < <(find ${f} -type f -print0 | shuf -z | tee $cacheFile)
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user