1
0
Fork 0

change `$_gpg_env` to default & replace running check

pull/423/head
nasenatmer 12 years ago
parent 6531df12c0
commit 0cdc244c13

@ -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…
Cancel
Save