Skip to content

Commit

Permalink
gpg: potential fix for sorin-ionescu#1252
Browse files Browse the repository at this point in the history
  • Loading branch information
belak committed Nov 10, 2017
1 parent 105e965 commit f02dc1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/gpg/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ fi
_gpg_agent_conf="${GNUPGHOME:-$HOME/.gnupg}/gpg-agent.conf"
_gpg_agent_env="${TMPDIR:-/tmp}/gpg-agent.env.$UID"

# Load environment variables from previous run
source "$_gpg_agent_env" 2> /dev/null

# Start gpg-agent if not started.
if [[ -z "$GPG_AGENT_INFO" && ! -S "${GNUPGHOME:-$HOME/.gnupg}/S.gpg-agent" ]]; then
# Export environment variables.
source "$_gpg_agent_env" 2> /dev/null

# Start gpg-agent if not started.
if ! ps -U "$LOGNAME" -o pid,ucomm | grep -q -- "${${${(s.:.)GPG_AGENT_INFO}[2]}:--1} gpg-agent"; then
eval "$(gpg-agent --daemon | tee "$_gpg_agent_env")"
Expand Down

0 comments on commit f02dc1a

Please sign in to comment.