Skip to content

Instantly share code, notes, and snippets.

Created December 20, 2012 14:08
Show Gist options
  • Save anonymous/4345493 to your computer and use it in GitHub Desktop.
Save anonymous/4345493 to your computer and use it in GitHub Desktop.
Simple md5 checking script: type "compare.sh <md5> <file>" Added some interactive text for fun!
clear
echo ""
echo " ---- CHECKING MD5 ---- "
echo ""
echo ""
SUM=$(openssl md5 "$2")
BFO="MD5($2)= "
echo "MD5 TO CHECK WITH"
echo "----------------------------------"
echo ""
echo "$BFO$1"
echo ""
echo ""
echo "FILE'S MD5"
echo "----------------------------------"
echo ""
echo "$SUM"
echo ""
echo ""
if [ "$BFO$1" == "$SUM" ]
then
echo "----------------------------------"
echo "| M D 5 MATCHES ! :) |"
echo "----------------------------------"
echo " --- HAPPPY MD5ing! --- "
else
echo "----------------------------------"
echo "| M D 5 DOES NOT MATCH ! :( |"
echo "----------------------------------"
fi
echo ""
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment