Created
February 15, 2017 09:59
-
-
Save oppai/abf9d8f7cee6684dcd4c20ece4af667f to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env sh | |
all_keys=$(ssh-add -l | cut -f 3 -d ' ') | |
remove_key=$(ssh-add -l | peco | cut -f 3 -d' ') | |
new_keys=$(echo "$all_keys" | grep -v $remove_key) | |
ssh-add -D | |
for path in $new_keys; do | |
ssh-add -K $path | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment