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.
This commit is contained in:
parent
df00850ed0
commit
6531df12c0
1 changed files with 2 additions and 1 deletions
|
@ -5,6 +5,7 @@
|
|||
# Florian Walch <florian.walch@gmx.at>
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
# neersighted <neersighted@myopera.com>
|
||||
# Jakob Hetzelein <nasenatmer@posteo.de>
|
||||
#
|
||||
|
||||
# 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
|
||||
|
|
Loading…
Add table
Reference in a new issue