diff options
author | Peter Palfrader <peter@palfrader.org> | 2014-10-29 09:48:28 +0100 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2014-10-29 09:48:28 +0100 |
commit | 6369419c959e5f85780a96752a697bb37fe894d9 (patch) | |
tree | 05f06f6c1f928b9ed5cec5d5ffa1002c5f179b45 /get-signers | |
parent | a1e0c4d6b17bcfc9029a6dd5262f3b8d346be9b7 (diff) |
Change get-signers yet again
Diffstat (limited to 'get-signers')
-rwxr-xr-x | get-signers | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/get-signers b/get-signers index d383f41..1831686 100755 --- a/get-signers +++ b/get-signers @@ -1,13 +1,38 @@ #!/bin/sh +usage() +{ +cat << EOF +Usage: $0 [-d <depth>] <keyid> [ <keyid> .. ] +EOF +} + +depth="1" +while getopts "hd:" OPTION +do + case $OPTION in + h) + usage + exit + ;; + d) + depth="$OPTARG" + ;; + *) + usage >&2 + exit 1 + ;; + esac +done +shift $(($OPTIND - 1)) + if [ "$#" -eq 0 ]; then - echo >&2 "Usage: $0 <keyid> [ <depth> ]" + usage >&2 exit 1 fi -keys="$1" -depth="${2:-1}" - +keys="$*" +gpg --recv-keys $keys while [ "$depth" -gt 0 ]; do keys=$(gpg --with-colons --fast-list-mode --list-sigs $keys | awk -F ':' '$1 ~ /sig|rev/ {print $5}' | sort -u) |