From 136ba6e0533e545fdf2d7be5ee646b708f9ebfe3 Mon Sep 17 00:00:00 2001 From: Jaromil Date: Fri, 13 Nov 2020 23:16:05 +0100 Subject: [PATCH] honor custom settings for GNUPGHOME fix #371 --- tomb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tomb b/tomb index 8202de9..cdbeac1 100755 --- a/tomb +++ b/tomb @@ -1934,9 +1934,10 @@ forge_key() { _check_swap # Ensure the available memory is safe to use # Ensure GnuPG won't exit with an error before first run - [[ -r $HOME/.gnupg/pubring.gpg ]] || { - mkdir -m 0700 $HOME/.gnupg - touch $HOME/.gnupg/pubring.gpg } + local gpghome=${GNUPGHOME:-$HOME/.gnupg} + [[ -r $gpghome/pubring.gpg ]] || { + mkdir -p -m 0700 $gpghome + touch $gpghome/pubring.gpg } # Do not overwrite any files accidentally [[ -r "$destkey" ]] && {