#!/bin/sh
# bsd license to all the sluts. chmod u+x this file and move it to /usr/local/bin or something.
file=$1
tmpfile=$(mktemp)
hash=$(sha256sum $file | cut -d' ' -f1)
cat ${file} > ${tmpfile}
echo ${hash} >> ${tmpfile}
cat ${tmpfile} > ${file}
rm -f ${tmpfile}