Skip to content

Instantly share code, notes, and snippets.

@jcooklin
Last active December 3, 2015 00:28
Show Gist options
  • Save jcooklin/697141b689e7cbdf085d to your computer and use it in GitHub Desktop.
Save jcooklin/697141b689e7cbdf085d to your computer and use it in GitHub Desktop.
Signs snap plugin
#!/bin/bash
die() {
echo >&2 "$@"
exit 1
}
if [ "$#" -lt 3 ] || [ "$#" -gt 3 ]
then
die "Error: expected the secret-keyring public-keyring and plugin to sign"
fi
priv_ring=$1
pub_ring=$2
plugin=$3
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
echo "${green}signing the plugin ${plugin} ${reset}"
echo "${red}gpg --no-default-keyring --armor --secret-keyring $priv_ring --keyring $pub_ring --output $plugin.asc --detach-sig $plugin ${reset}"
echo ""
echo "[Enter] to continue"
read x
gpg --no-default-keyring --armor --secret-keyring $priv_ring --keyring $pub_ring --output $plugin.asc --detach-sig $plugin
echo ""
echo "${green}verify the image${reset}"
echo "${red}gpg --no-default-keyring --secret-keyring $priv_ring --keyring $pub_ring --verify $plugin.asc $plugin ${reset}"
echo ""
echo "[Enter] to continue"
read x
gpg --no-default-keyring --secret-keyring $priv_ring --keyring $pub_ring --verify $plugin.asc $plugin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment