Created
April 7, 2014 23:39
-
-
Save vromero/10073890 to your computer and use it in GitHub Desktop.
Validate Local Maven Repository
This file contains hidden or 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
COLOR_RED=$'\e[0;31m'; COLOR_GREEN=$'\e[0;32m'; COLOR_END=$'\e[0m'; for FILE in $(find ~/.m2/repository -name "*.sha1") ; do CALCULATED_DIGEST=$(openssl dgst -sha1 -binary ${FILE%.*}| xxd -p); DIGEST=$(for i in $(for i in $(cat ${FILE});do if [[ $i =~ ^.{40}$ ]] ; then echo $i; fi ; done);do echo $i; done ); ISVALID=$([ $CALCULATED_DIGEST == $DIGEST ] && echo ${COLOR_GREEN}VALID${COLOR_END} || echo ${COLOR_RED}INVALID${COLOR_END}); echo ${ISVALID} ${FILE%.*} ${DIGEST} ${CALCULATED_DIGEST}; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment