From 0148ee6a4db42102b2fac871f9ee8b816866b695 Mon Sep 17 00:00:00 2001 From: Mathias Fussenegger Date: Thu, 27 Nov 2014 22:19:13 +0100 Subject: [PATCH] Check for S.gpg-agent to see if gpg-agent is running From GnuPG changelog: > Removed the GPG_AGENT_INFO related code. GnuPG does now > always use a fixed socket name in its home directory. Signed-off-by: Sorin Ionescu --- modules/gpg/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gpg/init.zsh b/modules/gpg/init.zsh index 0ff42d1..1c3837d 100644 --- a/modules/gpg/init.zsh +++ b/modules/gpg/init.zsh @@ -15,7 +15,7 @@ _gpg_agent_conf="${GNUPGHOME:-$HOME/.gnupg}/gpg-agent.conf" _gpg_agent_env="${TMPDIR:-/tmp}/gpg-agent.env" # Start gpg-agent if not started. -if [[ -z "$GPG_AGENT_INFO" ]]; then +if [[ -z "$GPG_AGENT_INFO" && ! -S "${GNUPGHOME:-$HOME/.gnupg}/S.gpg-agent" ]]; then # Export environment variables. source "$_gpg_agent_env" 2> /dev/null