Skip to content

Instantly share code, notes, and snippets.

@popmonkey
Last active October 16, 2018 17:13
Show Gist options
  • Save popmonkey/1ffa576eae1d53ad73b912e15f83cebb to your computer and use it in GitHub Desktop.
Save popmonkey/1ffa576eae1d53ad73b912e15f83cebb to your computer and use it in GitHub Desktop.
load ssh keys into ssh key agent
# keys
for key in # list or glob of identities
do
KEY_SIG=$(cat ~/.ssh/$key.pub)
if [ `ssh-add -L | grep "$KEY_SIG" | wc -l` -ne 1 ] ; then ssh-add ~/.ssh/$key ; fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment