mirror of
https://github.com/acedanger/shell.git
synced 2025-12-06 03:20: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
|
fi
|
||||||
|
|
||||||
if [ -z "$SSH_AUTH_SOCK" ]; then
|
if [ -z "$SSH_AUTH_SOCK" ]; then
|
||||||
eval "$(ssh-agent -s)"
|
# Start the SSH agent if not already running
|
||||||
ssh-add ~/.ssh/id_rsa
|
# 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
|
fi
|
||||||
Reference in New Issue
Block a user