Skip to content

Instantly share code, notes, and snippets.

@ZoolWay
Created May 25, 2020 06:12
Show Gist options
  • Save ZoolWay/45806a93f8c991fa31dddaaca96df4b5 to your computer and use it in GitHub Desktop.
Save ZoolWay/45806a93f8c991fa31dddaaca96df4b5 to your computer and use it in GitHub Desktop.
Clean and singleton startup of ssh-agent in WSL (add to .bashrc e.g.)
if ! pgrep ssh-agent > /dev/null; then
rm -f /tmp/ssh-auth-sock
eval "$(ssh-agent -s -a /tmp/ssh-auth-sock)"
ssh-add /mnt/c/Users/Admin/.ssh/compax-gitlab
else
export SSH_AUTH_SOCK=/tmp/ssh-auth-sock
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment