Wrap ssh auth sock set in conditional to prevent early exits.
This commit is contained in:
2
.bashrc
2
.bashrc
@ -126,8 +126,10 @@ if [ -z "$(pgrep ssh-agent)" ]; then
|
||||
else
|
||||
# Set pid + auth sock to ensure existing ssh-agent will be re-used
|
||||
export SSH_AGENT_PID=$(pgrep ssh-agent)
|
||||
if [ -d "/tmp/ssh" ]; then
|
||||
export SSH_AUTH_SOCK=$(find /tmp/ssh-* -name agent.*)
|
||||
fi
|
||||
fi
|
||||
|
||||
# If ssh-agent has no identities, add mine
|
||||
ssh-add -l &>/dev/null
|
||||
|
||||
Reference in New Issue
Block a user