Created
October 28, 2020 12:50
-
-
Save neillfontes/2320614ab834a4fbaa6f372c0dd2c44c to your computer and use it in GitHub Desktop.
Compare md5 of a file in artifactory with a local file
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/bash | |
#requires md5sum on Mac | |
#brew install md5sha1sum | |
VAR1=`curl -s -u '[USER]:[PASSWORD]' https://[artifactory-url]/artifactory/api/storage/[artifact]/[file-name] | jq -r ".checksums.md5"` | |
VAR2=`md5sum [file-path] | cut -d' ' -f1` | |
if [ "$VAR1" = "$VAR2" ]; then | |
echo "They are the same file." | |
else | |
echo "They are NOT the same file." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment