| 1 |
#! /usr/bin/env bash |
| 2 |
# |
| 3 |
# Signs $1 with the Bro GPG key. Signature will be written to $1.asc. |
| 4 |
# |
| 5 |
# GPG agent needs to be running. |
| 6 |
# |
| 7 |
# Needs gpg2. |
| 8 |
|
| 9 |
GPG=`which gpg2` |
| 10 |
KEY=F8CB8019 |
| 11 |
|
| 12 |
if [ "$GPG" == "" ]; then |
| 13 |
echo "Can't find gpg2." |
| 14 |
exit 1 |
| 15 |
fi |
| 16 |
|
| 17 |
if [ "$#" != 1 ]; then |
| 18 |
echo "usage: `basename $0` <file>" |
| 19 |
exit 1 |
| 20 |
fi |
| 21 |
|
| 22 |
if ! gpg-agent -q; then |
| 23 |
echo "GPG agent not running." |
| 24 |
exit 1 |
| 25 |
fi |
| 26 |
|
| 27 |
FILE=$1 |
| 28 |
|
| 29 |
$GPG --detach-sign -a -u $KEY --openpgp -o $FILE.asc $FILE |
| 30 |
|
| 31 |
|