diff --git a/dot_config/bash/ssh-agent.sh.tmpl b/dot_config/bash/ssh-agent.sh.tmpl index e74b1e3..8f526ae 100644 --- a/dot_config/bash/ssh-agent.sh.tmpl +++ b/dot_config/bash/ssh-agent.sh.tmpl @@ -1,4 +1,14 @@ {{- 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 +{{- else -}} SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" export SSH_AUTH_SOCK +{{ end }} {{- end -}} diff --git a/dot_config/bash/wsl-ssh-agent.sh.tmpl b/dot_config/bash/wsl-ssh-agent.sh.tmpl deleted file mode 100644 index 16e29fe..0000000 --- a/dot_config/bash/wsl-ssh-agent.sh.tmpl +++ /dev/null @@ -1,11 +0,0 @@ -{{- 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 -}}