build.sh (1296B)
- #!/bin/bash
- path=~/.widrop-gpg
- echo path=$path
- [[ ! -d $path ]] && (
- echo ----------------------------------------
- echo [Widrop]: Creating the dir $path
- echo ----------------------------------------
- mkdir $path
- chmod 700 $path
- )
- [[ ! -f $path/pubring.gpg || ! -f $path/secring.gpg ]] && (
- echo ----------------------------------------
- echo [Widrop]: Creating gpg keys
- echo ----------------------------------------
- gpg --homedir $path --gen-key
- key=$(gpg --homedir ~/.widrop-gpg --list-keys 2>/dev/null | grep pub | awk '{print $2}' | awk -F"/" '{print $2}')
- echo ----------------------------------------
- echo [Widrop]: key $key generated
- echo [Widrop]: Creating revocation key
- echo ----------------------------------------
- gpg --homedir $path --armor --output $path/revoke.gpg --gen-revoke $key
- echo ----------------------------------------
- echo [Widrop]: Exporting public key
- echo ----------------------------------------
- gpg --homedir $path --export -armor --output $path/pubkey.gpg
- cp $p ath/pubkey.gpg dist/
- echo ----------------------------------------
- echo [Widrop]: done
- echo [Widrop]: keyring stored in $path
- echo [Widrop]: pubkey available in dist/pubkey.gpg
- echo [Widrop]: use ./sign.sh to sign packages
- echo ----------------------------------------
- )