diff --git a/dot_zshrc b/dot_zshrc index 0931c92..9b164f6 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -134,6 +134,20 @@ else export EDITOR='vim' fi +# Set the ssh-agent if it is not already running +if ! pgrep -u "$USER" ssh-agent > /dev/null; then + # Démarre ssh-agent + eval "$(ssh-agent -s)" > /dev/null +fi +export SSH_AUTH_SOCK=$(ssh-agent -s | grep -oP '(?<=SSH_AUTH_SOCK=)[^;]+') +# Add the keys to the agent +if [ -f ~/.ssh/id_ed25519 ]; then + ssh-add ~/.ssh/id_ed25519 > /dev/null 2>&1 +fi +if [ -f ~/.ssh/hexasec ]; then + ssh-add ~/.ssh/hexasec > /dev/null 2>&1 +fi + # Compilation flags # export ARCHFLAGS="-arch x86_64"