dotfiles/fish/functions/test_identities.fish

10 lines
236 B
Fish

function test_identities
ssh-add -l | grep "The agent has no identities" > /dev/null
if [ $status -eq 0 ]
ssh-add "~/.ssh/id_(nice_hostname)"
if [ $status -eq 2 ]
start_agent
end
end
end