From 157ff8a451907b63a7ea66b93853092b342b3021 Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Wed, 1 Nov 2017 08:54:28 -0700 Subject: [PATCH] Don't clobber ssh-agent --- .../zsh_custom/plugins/gpg-agent/gpg-agent.plugin.zsh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dotfiles/zsh_custom/plugins/gpg-agent/gpg-agent.plugin.zsh b/dotfiles/zsh_custom/plugins/gpg-agent/gpg-agent.plugin.zsh index 214ceca..52f23e6 100644 --- a/dotfiles/zsh_custom/plugins/gpg-agent/gpg-agent.plugin.zsh +++ b/dotfiles/zsh_custom/plugins/gpg-agent/gpg-agent.plugin.zsh @@ -1,4 +1,4 @@ -# Custom agent to handle gpg-agent 2.1 +# Custom plugin to handle gpg-agent 2.1 local GPG_ENV=$HOME/.gnupg/gpg-agent.env @@ -18,11 +18,12 @@ function start_agent_withssh { if [ -z "${GPG_AGENT_INFO}" ] ; then if which gpgconf >/dev/null 2>&1 ; then - # This might clobber SSH_AUTH_SOCK anyway... GPG_AGENT_INFO=$(gpgconf --list-dirs agent-socket) - SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) export GPG_AGENT_INFO - export SSH_AUTH_SOCK + if [ -z "${SSH_AUTH_SOCK}" ] ; then + SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + export SSH_AUTH_SOCK + fi fi fi