Skip to content

Instantly share code, notes, and snippets.

@micmro
Last active January 12, 2017 22:50
Show Gist options
  • Save micmro/4e0df2fe712cea0ca29af3f9e4a3b02c to your computer and use it in GitHub Desktop.
Save micmro/4e0df2fe712cea0ca29af3f9e4a3b02c to your computer and use it in GitHub Desktop.
Automatically add ssh key to ssh-agent in shell if it had not been added yet
# add ssh key to ssh-agent if it had not been added yet
ssh-add -l | grep -q "$HOME/.ssh/id_rsa" || ssh-add $HOME/.ssh/id_rsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment