From 6531df12c08a1e353a50fc1799a3b69b33d26afc Mon Sep 17 00:00:00 2001 From: nasenatmer Date: Sat, 27 Apr 2013 01:00:23 +0100 Subject: [PATCH] Add additional `grep` cmd. This is necessary to ensure that the `PID` found in `$_gpg_env` actually belongs to `gpg-agent` and not some other process. --- modules/gpg-agent/init.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/gpg-agent/init.zsh b/modules/gpg-agent/init.zsh index c8521d65bc..bc636bad9b 100644 --- a/modules/gpg-agent/init.zsh +++ b/modules/gpg-agent/init.zsh @@ -5,6 +5,7 @@ # Florian Walch # Sorin Ionescu # neersighted +# Jakob Hetzelein # # Return if requirements are not found. @@ -33,7 +34,7 @@ function _gpg-agent-start { # Source GPG agent settings, if applicable. if [[ -s "${_gpg_env}" ]]; then source "${_gpg_env}" > /dev/null - ps -e | grep $(grep GPG_AGENT_INFO $_gpg_env | cut -d: -f 2) || + ps -e | grep $(grep GPG_AGENT_INFO $_gpg_env | cut -d: -f 2) | grep -q gpg-agent || _gpg-agent-start } else