2022-05-11 08:14:30 -04:00
|
|
|
{{- if (eq .chezmoi.os "linux") -}}
|
2022-05-11 08:24:27 -04:00
|
|
|
{{- 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 -}}
|
2022-05-11 08:14:30 -04:00
|
|
|
SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
|
|
|
|
export SSH_AUTH_SOCK
|
2022-05-11 08:24:27 -04:00
|
|
|
{{ end }}
|
2022-05-11 08:14:30 -04:00
|
|
|
{{- end -}}
|