Skip to content

Instantly share code, notes, and snippets.

@neillfontes
Created October 28, 2020 12:50
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 neillfontes/2320614ab834a4fbaa6f372c0dd2c44c to your computer and use it in GitHub Desktop.
Save neillfontes/2320614ab834a4fbaa6f372c0dd2c44c to your computer and use it in GitHub Desktop.
Compare md5 of a file in artifactory with a local file
#!/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