Wrap ssh auth sock set in conditional to prevent early exits.

This commit is contained in:
2024-08-14 16:04:55 +12:00
parent 4eef245d6b
commit 1d4fc8d8aa

View File

@ -126,7 +126,9 @@ 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