summaryrefslogtreecommitdiff
path: root/get-signers
diff options
context:
space:
mode:
Diffstat (limited to 'get-signers')
-rwxr-xr-xget-signers16
1 files changed, 11 insertions, 5 deletions
diff --git a/get-signers b/get-signers
index 98d5082..d383f41 100755
--- a/get-signers
+++ b/get-signers
@@ -1,11 +1,17 @@
#!/bin/sh
if [ "$#" -eq 0 ]; then
- echo >&2 "Usage: $0 <keyid> [<keyid> ..]"
+ echo >&2 "Usage: $0 <keyid> [ <depth> ]"
exit 1
fi
-gpg --with-colons --fast-list-mode --list-sigs "$@" |
- awk -F ':' '$1 ~ /sig|rev/ {print $5}' |
- sort -u |
- xargs gpg --recv-keys
+keys="$1"
+depth="${2:-1}"
+
+while [ "$depth" -gt 0 ]; do
+
+ keys=$(gpg --with-colons --fast-list-mode --list-sigs $keys | awk -F ':' '$1 ~ /sig|rev/ {print $5}' | sort -u)
+ gpg --recv-keys $keys
+
+ depth=$((depth - 1))
+done