change $_gpg_env
to default & replace running check
This commit is contained in:
parent
6531df12c0
commit
0cdc244c13
1 changed files with 5 additions and 4 deletions
|
@ -14,7 +14,7 @@ if (( ! $+commands[gpg-agent] )); then
|
|||
fi
|
||||
|
||||
# Make sure to use the $GNUPGHOME first.
|
||||
_gpg_env="${GNUPGHOME:-$HOME/.gnupg}/gpg-agent.env"
|
||||
_gpg_env="${GNUPGHOME:-$HOME/.gnupg}/gpg-agent.info"
|
||||
|
||||
function _gpg-agent-start {
|
||||
local ssh_support
|
||||
|
@ -34,9 +34,10 @@ 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) | grep -q gpg-agent ||
|
||||
_gpg-agent-start
|
||||
}
|
||||
ps -U "$USER" -o 'command,pid' \
|
||||
| grep "${${(@s.:.)GPG_AGENT_INFO}[2]}" \
|
||||
| grep -q '^gpg-agent' \
|
||||
|| _gpg-agent-start
|
||||
else
|
||||
_gpg-agent-start
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue