From f0c3b9db66fc1b2db6daf7dd8e4c6d14318c8470 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 6 Jun 2017 10:57:08 +0200 Subject: add --homedir to gpg --- .gitignore | 1 + receive-key | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a8ef404 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +gnupg 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 -- cgit v1.2.3-70-g09d2