Created
September 24, 2013 15:19
-
-
Save matthewadams/6686329 to your computer and use it in GitHub Desktop.
compare sha1 on Mac OS X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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