Last active
August 29, 2015 14:26
-
-
Save trueheart78/efcb8d2beea794f8d538 to your computer and use it in GitHub Desktop.
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
| #!/bin/bash | |
| for f in `find ~/.ssh -perm 600 -type f` | |
| do | |
| add_key=true | |
| for k in `ssh-add -l` | |
| do | |
| if [[ "$k" = "$f" ]] | |
| then | |
| add_key=false | |
| fi | |
| done | |
| if [ $add_key = true ] | |
| then | |
| `ssh-add $f` | |
| fi | |
| done |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could be cleaned up a bit to be more efficient, but it works! You can add this to your
.bash_profileor.zshrcto autoload all your SSH keys.