diff options
-rwxr-xr-x | gpg-safe-import | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gpg-safe-import b/gpg-safe-import new file mode 100755 index 0000000..eca63c2 --- /dev/null +++ b/gpg-safe-import @@ -0,0 +1,10 @@ +#!/bin/bash + +tmp_dir=$(mktemp -d) +trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT + +if ! gpg --homedir "${tmp_dir}" "$@"; then + >&2 echo 'gpg exited non-zero' + exit 1 +fi +gpg --homedir "${tmp_dir}" -a --export | gpg --import |