From fd19e7d78b67c7a6a271a66342f6ea6788ae431c Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Thu, 5 Jan 2023 02:04:26 +0000 Subject: [PATCH] Update file run_onchange_before_91-configure-gpg.tmpl --- .../universal/run_onchange_before_91-configure-gpg.tmpl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 2cea23b9..07c8493e 100644 --- a/home/.chezmoiscripts/universal/run_onchange_before_91-configure-gpg.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_before_91-configure-gpg.tmpl @@ -26,8 +26,13 @@ if [ -n "$KEYID" ] && command -v gpg > /dev/null; then logg info 'Retrying after turning on debug mode and using the standard DNS resolver' sudo pkill dirmngr dirmngr --debug-all --daemon --standard-resolver - gpg --keyserver hkps://pgp.mit.edu --recv "$KEYID" - gpgconf --kill dirmngr + gpg --keyserver hkps://pgp.mit.edu --recv "$KEYID" || EXIT_CODE=$? + if [ -n "$EXIT_CODE" ]; then + logg error 'Failed to retrieve public user GPG key on hkps://pgp.mit.edu' + gpgconf --kill dirmngr + else + logg success 'Successfully imported configured public user GPG key' + fi fi else logg info 'Key is already in keyring'