Created
July 21, 2015 09:28
-
-
Save robinwo/06144c8c565409c4ed71 to your computer and use it in GitHub Desktop.
Load ssh keys on startup
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/zsh | |
| ## load ssh keys | |
| cd ~/.ssh ; | |
| echo ":::: Load SSH keys in agent ::::" ; | |
| for i in * ; | |
| do if [[ -f $i ]] && [[ $i == id_* ]] && [[ $i != *.pub ]]; | |
| then | |
| ssh-add -l |grep -q `ssh-keygen -lf $i | awk '{print $2}'` || ssh-add $i; | |
| fi | |
| done ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment