Skip to content

Instantly share code, notes, and snippets.

@johnvey
johnvey / gist:3442925
Created August 23, 2012 22:44
This is bash script that ensures that ssh-agent is always loaded when you log in. It will reuse any existing agents in your session, thus avoiding spawning one on every terminal session.
# Place this in your .bash_profile for interactive-only support,
# or in .bashrc for interactive and non-interactive support.
#
# See: https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git#SetupSSHforGit-installpublickey
SSH_ENV="$HOME/.ssh/environment"
# start the ssh-agent
function start_agent {
echo "Initializing new SSH agent..."