Skip to content

Instantly share code, notes, and snippets.

@lsd
Created July 23, 2015 12:58
Show Gist options
  • Save lsd/df0f3b2ea6bba6a1c97f to your computer and use it in GitHub Desktop.
Save lsd/df0f3b2ea6bba6a1c97f to your computer and use it in GitHub Desktop.
Function to add PGP keys by looping ~/.ssh/auto and ssh-shad
# line 5 is still noisy
# this won't block if ssh-add requires password. you will be prompted to enter it after loop
function add_pgp_keys {
for pgp in $(cat "$HOME/.ssh/auto"); do
echo $pgp
ssh-add "/Users/`whoami`/.ssh/$pgp" &2>1 > /dev/null
echo "ssh-add result: $?"
done
ssh-add -l
}
@lsd
Copy link
Author

lsd commented Jul 23, 2015

Fixed and modified part of .zshrc in https://github.com/sorin-ionescu/prezto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment