Detect md5 hash files

main
sigonasr2, Sig, Sigo 3 years ago
parent 8b2cbd078a
commit 47ae1ff62a
  1. 16
      utils/define.sh
  2. 4
      utils/md5
  3. 31
      utils/search.sh

@ -4,4 +4,18 @@ function define() {
VARS+=("$1") VARS+=("$1")
value="${*:2}" value="${*:2}"
eval "$1"='$value' eval "$1"='$value'
} }
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

@ -1,3 +1,3 @@
44298d14789ec0b1e8bc67bab63cbf14 - a137a2465efff1c5c1ac2e59ccddb20b -
548480c89fb8d6668a83ee9e534eb2dd - 548480c89fb8d6668a83ee9e534eb2dd -
918a57ceddd604250f2f47216f3323ff - 3d3c053e6902e501283ca7e1d2b99ea1 -

@ -1,14 +1,31 @@
function search() { function search() {
FILES=$(ls $1) FILES2=$(ls $1)
for f in $FILES for g in $FILES2
do do
if [ -d $1$f ]; if [ -d $1$g ];
then then
echo "$1$f is a directory" echo "$1$g is a directory"
search $1$f/ search $1$g/
else else
echo "$1$f is a file" echo "$1$g is a file"
md5sum < $1$f >> $1md5 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 fi
done done
} }
Loading…
Cancel
Save