diff --git a/burpcheck.sh b/burpcheck.sh index a269caf..31fd290 100644 --- a/burpcheck.sh +++ b/burpcheck.sh @@ -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 }