[brlug-general] md5sum and diff?
Brad Bendily
bendily at gmail.com
Thu Nov 5 09:53:51 CST 2009
Hi Folks,
Been quiet for a while here.
I have a question, maybe i'm missing something, but i'm curious what
you all do in this situation, or
if there's some command out there I can't seem to find.
So, i've downloaded an ISO and I want to verify the md5sum of that iso.
I have to run the md5sum cmd against the iso I downloaded and then
copy the sum from the website and manually(visually) compare the two sums.
After doing this a number of times, i thought there must be a better
way, so I googled
and I read through some man pages and I just don't see the better way.
Am I missing something here?
Well, since I couldn't find anything I made a script to help me, so here's that:
#!/bin/bash
md5sum $1 |awk '{print $1}' > /tmp/mdoutput1.tmp
echo $2 > /tmp/mdoutput2.tmp
diff -q /tmp/mdoutput1.tmp /tmp/mdoutput2.tmp
if [ "$?" != "0" ]
then
#echo "md5sums DON'T match"
printf "\033[1;37;41m***md5sums DON'T MATCH*** \033[1;37;40m\n"
else
echo "MD5SUMS Match!!!!"
printf "\033[1;37;44m***MD5SUMS MATCH*** \033[1;37;40m\n"
fi
rm /tmp/mdoutput1.tmp
rm /tmp/mdoutput2.tmp
Is there a better way?
bb
--
Have Mercy & Say Yeah
More information about the General
mailing list