Created
January 17, 2013 21:41
-
-
Save apg/4560056 to your computer and use it in GitHub Desktop.
Best way to start an ssh-agent that I know of. Stick it in your .bash_profile for ultimateness.
This file contains hidden or 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
export SSH_AUTH_SOCK=$HOME/.ssh/agent.sock | |
if ! ([ -S "$SSH_AUTH_SOCK" ] && { ssh-add -l >& /dev/null || [ $? -ne 2 ]; }) ; then | |
echo "Starting agent..." | |
eval "$(ssh-agent -s -a $SSH_AUTH_SOCK)" > /dev/null | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment