Skip to content

Instantly share code, notes, and snippets.

@kitzy
Created February 6, 2017 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kitzy/906abbc5c4ffabff5e68a6a1e579479c to your computer and use it in GitHub Desktop.
Save kitzy/906abbc5c4ffabff5e68a6a1e579479c to your computer and use it in GitHub Desktop.
#!/bin/bash
KNOWNHASH=""
FILEPATH=""
TESTHASH=$(md5 ${FILEPATH} | awk '{print $4}')
if [ ! -e "${FILEPATH}" ]
then
echo "<result>not found</result>"
else
if [ "${TESTHASH}" == "${KNOWNHASH}" ]
then
echo "<result>match</result>"
else
echo "<result>no match</result>"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment