Skip to content

Instantly share code, notes, and snippets.

@reikje
Created January 10, 2013 09:33
Show Gist options
  • Save reikje/4500765 to your computer and use it in GitHub Desktop.
Save reikje/4500765 to your computer and use it in GitHub Desktop.
if [ -f ${HOME}/.ssh-agent ]; then
. ${HOME}/.ssh-agent > /dev/null
fi
if [ -z "$SSH_AGENT_PID" -o -z "`/usr/bin/ps -a|/usr/bin/egrep \"^[ ]+$SSH_AGENT_PID\"`" ]; then
/usr/bin/ssh-agent > ${HOME}/.ssh-agent
. ${HOME}/.ssh-agent > /dev/null
fi
ssh-add ~/.ssh/id_rsa
@antonywu
Copy link

Sweet! Thanks for posting. It was a PiTA to keep typing my passphrase every time I had to push changes during an exhausting hackathon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment