mirror of
https://github.com/acedanger/shell.git
synced 2025-12-06 01:10:12 -08:00
fix: Start SSH agent and add key silently if not already running
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user