Skip to content

Instantly share code, notes, and snippets.

@Ation
Created March 10, 2020 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ation/a75603e7e9217df7e9193e37b1de456b to your computer and use it in GitHub Desktop.
Save Ation/a75603e7e9217df7e9193e37b1de456b to your computer and use it in GitHub Desktop.
ssh-agent start
ssh-add -l &>/dev/null
if [ "$?" == 2 ]; then
test -r ~/.ssh-agent && \
eval "$(<~/.ssh-agent)" >/dev/null
ssh-add -l &>/dev/null
if [ "$?" == 2 ]; then
(umask 066; ssh-agent > ~/.ssh-agent)
eval "$(<~/.ssh-agent)" >/dev/null
ssh-add
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment