Skip to content

Instantly share code, notes, and snippets.

@dblevins
Created April 7, 2021 22:33
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 dblevins/fd9200a4664a82a26019fe7c17a7a3d1 to your computer and use it in GitHub Desktop.
Save dblevins/fd9200a4664a82a26019fe7c17a7a3d1 to your computer and use it in GitHub Desktop.
Verify an Apache TomEE binary
#!/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