fix: Start SSH agent and add key silently if not already running

This commit is contained in:
Peter Wood
2025-06-11 07:11:29 -04:00
parent 82d8e63ed7
commit 02fc6391ef

View File

@@ -171,6 +171,7 @@ if command -v fabric &> /dev/null; then
fi
if [ -z "$SSH_AUTH_SOCK" ]; then
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
fi
# Start the SSH agent if not already running
# Add the SSH key to the agent
eval "$(ssh-agent -s)" >/dev/null 2>&1 && ssh-add ~/.ssh/id_ed25519 >/dev/null 2>&1
fi