Last active
July 15, 2022 15:05
-
-
Save git-hulk/6341917a40d3fca453ab7593109ea666 to your computer and use it in GitHub Desktop.
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/sh | |
YELLOW="\033[37;1m" | |
GREEN="\033[32;1m" | |
ENDCOLOR="\033[0m" | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 {YOUR RELEASE TAR FILE}" >&2 | |
exit 1 | |
fi | |
PKG=$1 | |
if [ ! -f "$PKG" ]; then | |
echo "File '$PKG' does not exist." | |
exit 1 | |
fi | |
gpg --armor --output "$PKG.asc" --detach-sig $PKG | |
gpg --verify "$PKG.asc" $PKG | |
if [ $? -eq 0 ] | |
then | |
printf $GREEN"Success to verify the gpg sign"$ENDCOLOR"\n" | |
else | |
printf $YELLOW"Failed to verify the gpg sign"$ENDCOLOR"\n" | |
fi | |
shasum -a 512 $PKG > "$PKG.sha512" | |
shasum -a 512 -c "$PKG.sha512" | |
if [ $? -eq 0 ] | |
then | |
printf $GREEN"Success to verify the checksum"$ENDCOLOR"\n" | |
else | |
printf $YELLOW"Failed to verify the checksum"$ENDCOLOR"\n" | |
fi |
Author
git-hulk
commented
Jul 14, 2022
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment