Skip to content

Commit

Permalink
Add additional grep cmd.
Browse files Browse the repository at this point in the history
This is necessary to ensure that the `PID` found in `$_gpg_env`
actually belongs to `gpg-agent` and not some other process.
  • Loading branch information
nasenatmer committed Apr 27, 2013
1 parent df00850 commit 6531df1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/gpg-agent/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Florian Walch <[email protected]>
# Sorin Ionescu <[email protected]>
# neersighted <[email protected]>
# Jakob Hetzelein <[email protected]>
#

# Return if requirements are not found.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6531df1

Please sign in to comment.