Skip to content

Instantly share code, notes, and snippets.

@kristianlm
Last active November 3, 2015 21:31
Show Gist options
  • Save kristianlm/0841d0b0290f06f826be to your computer and use it in GitHub Desktop.
Save kristianlm/0841d0b0290f06f826be to your computer and use it in GitHub Desktop.
expected="c109d23ad00e8a50cf33ae1c3d811b2cd7a0bafe"
fn=index.html
curl -s google.com/$fn > /$fn.part
cs=`sha1sum /$fn.part | cut -d " " 1`
if [ "$cs" == "$expected"] ; then
echo "checksum ok $cs"
mv /$fn.part /$fn:$cs
else
echo "checksum fail $cs"
exit -12
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment