diff --git a/utils/define.sh b/utils/define.sh index 9f95bd9..b1bce85 100755 --- a/utils/define.sh +++ b/utils/define.sh @@ -4,4 +4,18 @@ function define() { VARS+=("$1") value="${*:2}" eval "$1"='$value' -} \ No newline at end of file +} + +if [[ $(pwd) == *"SigScript" ]]; then + source utils/search.sh + + #Check for hashes + FILES=$(ls -d */) + for f in $FILES + do + search $f + check $f + done +else + echo "Dev build, no checks required." +fi \ No newline at end of file diff --git a/utils/md5 b/utils/md5 index 4427839..a6e2766 100644 --- a/utils/md5 +++ b/utils/md5 @@ -1,3 +1,3 @@ -44298d14789ec0b1e8bc67bab63cbf14 - +a137a2465efff1c5c1ac2e59ccddb20b - 548480c89fb8d6668a83ee9e534eb2dd - -918a57ceddd604250f2f47216f3323ff - +3d3c053e6902e501283ca7e1d2b99ea1 - diff --git a/utils/search.sh b/utils/search.sh index ab0569d..522c4bf 100644 --- a/utils/search.sh +++ b/utils/search.sh @@ -1,14 +1,31 @@ function search() { - FILES=$(ls $1) - for f in $FILES + FILES2=$(ls $1) + for g in $FILES2 do - if [ -d $1$f ]; + if [ -d $1$g ]; then - echo "$1$f is a directory" - search $1$f/ + echo "$1$g is a directory" + search $1$g/ else - echo "$1$f is a file" - md5sum < $1$f >> $1md5 + echo "$1$g is a file" + md5sum < $1$g >> $1md5 + fi + done +} + +function check() { + echo "Check $1" + FILES2=$(ls $1) + if [ -f "$1/md5" ]; + then + echo " md5 exists" + fi + for g in $FILES2 + do + if [ -d $1$g ]; + then + echo "$1$g is a directory" + check $1$g/ fi done } \ No newline at end of file