Comparing checksums from a directory and checksums from a store.txt file line by line to see if changes were made

i am facing a problem with my bash script whereby I need to compare the checksums of my backup files from my /axa/backup/ directory and the store.txt file in which I have stored my checksums in to make sure that no changes have been made. I am required to use a for loop and a if-else loop but it seems to not work as I seldom use it.

This is my bash script that I have written :

#!/bin/bash

for md5sum in /sads/backup/*.tgz

do

if [ "md5sum" = cat store.txt ]
then 

     echo "no changes made in /sads/backup/*.tgz "

else

     echo "Changes made in /sads/backup/*.tgz "

   fi

done


Source: bash

Leave a Reply