From 061cce7b7daa7564ddff4fd8691c41d02b1c5477 Mon Sep 17 00:00:00 2001 From: Andrew Coleman Date: Wed, 14 Apr 2021 17:24:41 -0400 Subject: [PATCH] add wsl ssh agent setup --- dot_bashrc.d/wsl-ssh-agent.sh.tmpl | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 dot_bashrc.d/wsl-ssh-agent.sh.tmpl diff --git a/dot_bashrc.d/wsl-ssh-agent.sh.tmpl b/dot_bashrc.d/wsl-ssh-agent.sh.tmpl new file mode 100644 index 0000000..16e29fe --- /dev/null +++ b/dot_bashrc.d/wsl-ssh-agent.sh.tmpl @@ -0,0 +1,11 @@ +{{- if (eq .chezmoi.os "linux") -}} +{{- if (contains "microsoft" .chezmoi.kernel.osrelease) -}} +if [ -z "$(pgrep ssh-agent)" ]; then + rm -rf /tmp/ssh-* + eval $(ssh-agent -s) > /dev/null +else + export SSH_AGENT_PID=$(pgrep ssh-agent) + export SSH_AUTH_SOCK=$(find /tmp/ssh-* -name agent.*) +fi +{{- end -}} +{{- end -}}