#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Could be cleaned up a bit to be more efficient, but it works! You can add this to your
.bash_profile
or.zshrc
to autoload all your SSH keys.