Last active
February 23, 2021 08:02
-
-
Save theminer3746/32d06315e1c2a9a83afbf6e11f41916a to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
if [[ ! -f sample.txt ]]; then | |
echo "Error : Sample.txt does not exist."; | |
exit; | |
fi | |
ORIGINAL_HASH=$(cat hash.txt); | |
NEW_HASH=$(openssl sha1 sample.txt); | |
if [ "$ORIGINAL_HASH" = "$NEW_HASH" ]; | |
then | |
echo "Test PASSED : Hash matched"; | |
else | |
echo "Test FAILED : Hash does not match"; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment