Skip to content

Instantly share code, notes, and snippets.

@oppai
Created February 15, 2017 09:59
Show Gist options
  • Save oppai/abf9d8f7cee6684dcd4c20ece4af667f to your computer and use it in GitHub Desktop.
Save oppai/abf9d8f7cee6684dcd4c20ece4af667f to your computer and use it in GitHub Desktop.
#!/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