A simpler way of comparing md5 checksum?
md5sum
has a -c
option to check an existing set of sums, and its exit status indicates success/failure.
Example:
$ echo "ff9f75d4e7bda792fca1f30fc03a5303 package.deb" | md5sum -c -
package.deb: OK
Find a nice resource here
The usual bash way would be:
shopt -s nocasematch
if [[ $(md5sum "$file") = 5d40f31729c992b5a0e67490689fe8ff* ]]