shoestrap/assets/default/fish/functions/ssh-add-all.fish

15 lines
315 B
Fish
Raw Normal View History

2019-04-11 20:23:45 +00:00
# Adds all private keys to ssh agent
# Adds a key to agent if it hasn't been added yet
function __maybe_ssh_add
for key in $argv
if grep -q 'PRIVATE KEY' $key
ssh-add -l | grep -q "$key" ;or ssh-add $key
end
end
end
function ssh-add-all
2021-10-25 16:18:38 +00:00
__maybe_ssh_add $HOME/.ssh/id_*
2019-04-11 20:23:45 +00:00
end