Nice script coastie! Here's a couple suggestions to get your md5 checksums working:
#md5sum usalugslax.iso > usalug.txt
#read usalug.txt md5
#read md5sum.txt answer
if [[ `md5sum -c md5sum.txt` == 0 ]]
then echo "The md5sums match"; else echo "The md5sums don't
match...exiting" && exit 1
If you have the md5sum.txt file that was generated by md5sum for a set of files, you simply need to run the md5sum utility with the -c option and it'll look at the md5sum.txt file and check the file names in it against the files in the current directory and then calculate the md5 for each matching file and compare it against the value in the md5sum.txt file. *whew*
Said another way if your md5sum.txt file looks like:
when you run
md5sum -c md5sum.txt
it'll check the current directory for foo.txt and bar.txt. It will then calculate the md5 hash for each file and compare those hashes against the hashes in the md5sum.txt file associated with the corresponding file name. If a file is missing or changed, the md5sum check will fail with an exit status of 1.
That way you don't have to calculate the md5 sum of each file yourself and then parse through the md5sum.txt file to find the right hash value to compare your cacluated value against.