Last active
January 12, 2017 22:50
-
-
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
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
# 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