From 4f0eb7e9fba08b5c2e34978eaa43519bc56dcb20 Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Thu, 5 Jan 2023 02:49:37 +0000 Subject: [PATCH] Update file run_onchange_before_91-configure-gpg.tmpl --- .../universal/run_onchange_before_91-configure-gpg.tmpl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/home/.chezmoiscripts/universal/run_onchange_before_91-configure-gpg.tmpl b/home/.chezmoiscripts/universal/run_onchange_before_91-configure-gpg.tmpl index 07c8493e..20583a40 100644 --- a/home/.chezmoiscripts/universal/run_onchange_before_91-configure-gpg.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_before_91-configure-gpg.tmpl @@ -30,6 +30,11 @@ if [ -n "$KEYID" ] && command -v gpg > /dev/null; then if [ -n "$EXIT_CODE" ]; then logg error 'Failed to retrieve public user GPG key on hkps://pgp.mit.edu' gpgconf --kill dirmngr + KEYID="${KEYID^^}" + KEYID="$(echo "$KEYID" | sed 's/^0X/0x/')" + if [ -f "$HOME/.gnupg/$KEYID.key" ]; then + gpg --import "$HOME/.gnupg/$KEYID.key" + fi else logg success 'Successfully imported configured public user GPG key' fi