Created
July 23, 2018 01:01
-
-
Save dbrownidau/098dde4edb15343b440410cfe0fa64a8 to your computer and use it in GitHub Desktop.
Windows Subsystem for Linux ssh-agent bootstrap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##- WSL ssh-agent boostrap | |
if [ -d "$HOME/bin" ] ; then | |
PATH="$HOME/bin:$PATH" | |
fi | |
# ssh-agent configuration | |
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 | |
if [ "$(ssh-add -l)" == "The agent has no identities." ]; then | |
ssh-add | |
fi | |
##- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment