[brlug-general] md5sum and diff?
William Anderson
whanders at lasthonorableman.net
Thu Nov 5 10:23:16 CST 2009
You should be able to just copy the md5sum from a website into a text
file and just let md5sum do a check:
$ md5sum testfile
68b329da9893e34099c7d8ad5cb9c940 testfile
$ md5sum testfile > testfile.md5
$ md5sum -c testfile.md5
testfile: OK
The format for the check file is the md5sum, two spaces, and the file
name. You can also specify multiple files, one per line, and check
several files at once (e.g. if your installing a piece of software and
serveral dependencies, you can just download all the tar balls, copy the
md5sum for each into a single file and let md5sum check them all).
Bill
On Thu, Nov 05, 2009 at 09:53:51AM -0600, Brad Bendily wrote:
> 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
>
> _______________________________________________
> General mailing list
> General at brlug.net
> http://mail.brlug.net/mailman/listinfo/general_brlug.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://brlug.net/pipermail/general_brlug.net/attachments/20091105/e69f6dc5/attachment.bin>
More information about the General
mailing list