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.

Revisions

  1. jcooklin renamed this gist Dec 3, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. jcooklin created this gist Dec 2, 2015.
    33 changes: 33 additions & 0 deletions -
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    #!/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