# automatic check of sha256 checksums?



## tingo (Jan 14, 2012)

My mind is blank today, and I didn't find anything with Google:
has anyone made a script or shell function to automatically verify a set of files against the SHA256 checksums in the text file CHECKSUM.SHA256?
ie. script <directory> if all files match, nothing is output. If any files differ, filename amd both checksums are output.


----------



## vwe@ (Jan 15, 2012)

tingo,

not really sha256 and not reading the checksum from filename.sha256 but you may want to have a look at the file at http://people.freebsd.org/~vwe/files/pkgchkhealth.

It's a simple and very old bourne script I've written years ago and even while it's slow (compared to Tools/scripts/consistency-check) it does it's thing (and gives correct output for symlinked files).

There's a section in pkgchkhealth for checking the installed binary files of a port and all recorded files are compared for a correct md5 checksum (that was read earlier before from the +CONTENTS file from the package database).

Whatever you'll want to do, I think this is basically what you're looking for.


----------

