Add simple tool to sign all keys in a keyring
[gnupg.git] / tools / signmany
1 #!/bin/sh
2
3 if [ ! -f ./$1 ]; then
4    echo "usage: signmany keyring" >&2
5    exit 1
6 fi
7
8
9 ro="--trustdb-name=./tdb.tmp --no-default-keyring --secret-keyring /floppy/secring.gpg --keyring ./$1"
10
11 kis=`gpg $ro --fast-list-mode --list-keys --with-colons \
12      | awk -F: '$1=="pub" { print $5 }'`
13
14 for k in $kis; do
15     echo "Keyid: $k"
16     answer=A
17     while [ "$answer" = "A" ]; do
18         gpg $ro --lock-never --sign-key $k
19         answer=""
20         while [ "$answer" = "" ]; do
21            read -p 'Okay, Again or Quit? (O/A/Q) '
22            case "$REPLY" in
23               o|O) answer=O ;;
24               a|A) answer=A ;;
25               q|Q) answer=Q ;;
26               *) ;;
27            esac
28         done
29     done
30     [ "$answer" = "Q" ] && break
31 done
32
33