From 8add60292e9b62a2dd89b5a0a6e640153c980fb1 Mon Sep 17 00:00:00 2001 From: tombdf Date: Thu, 19 Dec 2024 16:53:46 +0100 Subject: [PATCH] Update .zshrc --- dot_zshrc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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"