From 9cc9a3954adafb6c907303468cc4a96d5fbb8925 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 19 Jul 2019 11:37:43 +0200 Subject: initial commit --- gpg-safe-import | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 gpg-safe-import 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 -- cgit v1.2.3-70-g09d2