Created
July 15, 2013 13:13
-
-
Save akesterson/5999828 to your computer and use it in GitHub Desktop.
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
if [ -f ~/.ssh-agent ]; then | |
. ~/.ssh-agent | |
if [ ! -e $SSH_AUTH_SOCK ] || [ "$(pgrep ssh-agent | grep $SSH_AGENT_PID)" == "" ]; then | |
echo "Stale ~/.ssh-agent file, ssh agent appears to be dead" | |
ssh-agent > ~/.ssh-agent | |
. ~/.ssh-agent | |
ssh-add | |
fi | |
else | |
ssh-agent > ~/.ssh-agent | |
. ~/.ssh-agent | |
ssh-add | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment