From 95685a6743d5c10e328a42e1c16b440e7f8a19ec Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 15 Apr 2023 16:03:51 +0200 Subject: [PATCH] kartei: add trust-gpg script --- kartei/trust-gpg.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 kartei/trust-gpg.sh diff --git a/kartei/trust-gpg.sh b/kartei/trust-gpg.sh new file mode 100755 index 000000000..006151d3a --- /dev/null +++ b/kartei/trust-gpg.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# usage: $0 +set -eu +WD=$(dirname "$(realpath "$0")") +PUBKEYS= +for key in "$WD"/kmein/kmein.gpg "$WD"/lass/pgp/* "$WD"/makefu/pgp/* "$WD"/tv/pgp/*; do + echo "$key" >&2 + keyid=$(gpg --with-colons --fingerprint --import-options show-only --import "$key" | grep fpr | cut -d : -f 10 | head -1) + gpg --import "$key" >&2 + printf '5\ny\n' | gpg --command-fd 0 --expert --edit-key "$keyid" trust >&2 + PUBKEYS="${PUBKEYS}$keyid\n" +done +echo -ne "$PUBKEYS"