Created
April 7, 2021 22:33
-
-
Save dblevins/fd9200a4664a82a26019fe7c17a7a3d1 to your computer and use it in GitHub Desktop.
Verify an Apache TomEE binary
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 | |
FILE="${1?Specify a TomEE zip, war or tar.gz to verify}" | |
SHA="$FILE.sha512" | |
[ -f "$SHA" ] || { | |
echo "Downloading sha512 for $FILE" | |
BIN="$(basename "$FILE")" | |
VER="$(echo "$BIN" | perl -pe 's,apache-(tomee-.*?)-[a-z]+\.(zip|tar.gz|war),$1,')" | |
curl -s "https://downloads.apache.org/tomee/$VER/$BIN.sha512" > "$SHA" | |
} | |
echo "$(cat $SHA) $FILE" | sha512sum -c - || { | |
echo "SHA-512 check failed: $FILE" | |
exit 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment