Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
compare sha1 on Mac OS X
hash=(`openssl sha1 $1`)
hash=${hash[1]}
if [ "$2" != "$hash" ]; then
echo "Mismatch: given $2, calculated $hash" > /dev/stderr
exit 1
else
echo "ok"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.