aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-09-19 09:07:59 +0100
committerMatthew Lemon <y@yulqen.org>2024-09-19 09:07:59 +0100
commit6dd073eac8eeca6c390b9f2a2cef7adcce85113e (patch)
treeb9d3913f90141ed73cfd91c0d95a836828788b18
parent726dde6a048a477725e877d65abae91161397fad (diff)
Fix to prevent muliple ssh-agent instances spawning
-rw-r--r--fish2024/config.fish11
1 files changed, 5 insertions, 6 deletions
diff --git a/fish2024/config.fish b/fish2024/config.fish
index 68e6ea3..7b0981d 100644
--- a/fish2024/config.fish
+++ b/fish2024/config.fish
@@ -9,12 +9,11 @@ if status is-interactive
set -gx BORG_PASSCOMMAND "pass borg-passphrase"
end
-# https://gist.github.com/josh-padnick/c90183be3d0e1feb89afd7573505cab3
-# if test -z (pgrep ssh-agent)
-eval (ssh-agent -c) > /dev/null
-set -Ux SSH_AUTH_SOCK $SSH_AUTH_SOCK
-set -Ux SSH_AGENT_PID $SSH_AGENT_PID
-# end
+if not set -Ux SSH_AUTH_SOCK && not set -Ux SSH_AGENT_PID
+ eval (ssh-agent -c) > /dev/null
+ set -Ux SSH_AUTH_SOCK $SSH_AUTH_SOCK
+ set -Ux SSH_AGENT_PID $SSH_AGENT_PID
+end
#. ~/perl5/perlbrew/etc/perlbrew.fish