From fde55c7c048f6ace89492e96c284994f9ccb977f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 19 Jul 2023 22:08:40 +0200 Subject: [PATCH] gpg agent if configuration --- bash/gpg.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bash/gpg.sh b/bash/gpg.sh index 8025b64..abea396 100644 --- a/bash/gpg.sh +++ b/bash/gpg.sh @@ -1,4 +1,6 @@ if [ ${EUID} -ne 0 ] ; then - export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" - gpg-connect-agent updatestartuptty /bye > '/dev/null' + if [ -f "${HOME}/.gnupg/gpg-agent.conf" ] ; then + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" + gpg-connect-agent updatestartuptty /bye > '/dev/null' + fi fi