dotfiles/private_dot_bashrc.d/wsl-ssh-agent.sh.tmpl

12 lines
322 B
Cheetah
Raw Normal View History

2021-04-14 17:24:41 -04:00
{{- 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 -}}