summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xget-signers33
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)