Skip to content

Instantly share code, notes, and snippets.

@git-hulk
Last active July 15, 2022 15:05
Show Gist options
  • Save git-hulk/6341917a40d3fca453ab7593109ea666 to your computer and use it in GitHub Desktop.
Save git-hulk/6341917a40d3fca453ab7593109ea666 to your computer and use it in GitHub Desktop.
#!/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
@git-hulk
Copy link
Author

git-hulk commented Jul 14, 2022

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment