summaryrefslogtreecommitdiff
path: root/receive-key
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-06-06 10:57:08 +0200
committerErich Eckner <git@eckner.net>2017-06-06 10:57:08 +0200
commitf0c3b9db66fc1b2db6daf7dd8e4c6d14318c8470 (patch)
treea1a257d95f0127b5370f2e2bc2f7e8ed3453e863 /receive-key
parent3a4eff13b74213f3c175057e2da8aee595bac9aa (diff)
downloadreceive-all-keys-f0c3b9db66fc1b2db6daf7dd8e4c6d14318c8470.tar.xz
add --homedir to gpgHEADmaster
Diffstat (limited to 'receive-key')
-rwxr-xr-xreceive-key9
1 files changed, 7 insertions, 2 deletions
diff --git a/receive-key b/receive-key
index c777bb6..b20ba3d 100755
--- a/receive-key
+++ b/receive-key
@@ -1,11 +1,16 @@
#!/bin/bash
+if [ ! -d "${0%/*}/gnupg" ]; then
+ mkdir "${0%/*}/gnupg"
+ chmod 700 "${0%/*}/gnupg"
+fi
+
keyIDs="$(
- gpg --batch --with-colons --search-keys "$1" 2> /dev/null | \
+ gpg --homedir "${0%/*}/gnupg" --batch --with-colons --search-keys "<$1>" 2> /dev/null | \
grep '^pub:' | \
cut -d: -f2
)"
if [ -n "${keyIDs}" ]; then
- gpg --recv-keys ${keyIDs}
+ gpg --homedir "${0%/*}/gnupg" --recv-keys ${keyIDs}
fi