Add an SSH agent

This commit is contained in:
Rodolphe Bréard 2024-11-15 23:09:32 +01:00
parent 0d5afb169a
commit d1800d918a
No known key found for this signature in database

View file

@ -32,6 +32,14 @@ if [ -f "/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.
. "/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
fi
# SSH agent
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
ssh-agent -t 1h > "$XDG_RUNTIME_DIR/ssh-agent.env"
fi
if [[ ! -f "$SSH_AUTH_SOCK" ]]; then
source "$XDG_RUNTIME_DIR/ssh-agent.env" >/dev/null
fi
# Aliases
[ -f "$MY_CONFIG/.aliases" ] && . "$MY_CONFIG/.aliases"