Skip to content
Browse files

agent: fix process check when there's no SSH_AGENT_PID

  • Loading branch information...
1 parent 91849aa commit 4422e6fe9e8cc712d69f80c054f8a13d34cc72c3 @meh meh committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 agent/init.zsh
View
4 agent/init.zsh
@@ -8,7 +8,7 @@ if is-callable ssh-agent; then
source "$env" &> /dev/null
if is-callable pgrep; then
- (( $(pgrep -U "$USER" ssh-agent) == SSH_AGENT_PID )) && return 0
+ (( ${$(pgrep -U "$USER" ssh-agent):-0} == SSH_AGENT_PID )) && return 0
else
ps -ef | grep -q " $SSH_AGENT_PID .* ssh-agent$" && return 0
fi
@@ -52,7 +52,7 @@ if is-callable gpg-agent; then
source "$env" &> /dev/null
if is-callable pgrep; then
- (( $(pgrep -U "$USER" gpg) == SSH_AGENT_PID )) && return 0
+ (( ${$(pgrep -U "$USER" gpg):-0} == SSH_AGENT_PID )) && return 0
else
ps -ef | grep -q " $SSH_AGENT_PID .* gpg-agent$" && return 0
fi

0 comments on commit 4422e6f

Please sign in to comment.
Something went wrong with that request. Please try again.