system/scripts/fish/functions/__ssh_agent_is_key_added.fish
Georg 209f09dc5c fish greeting with ssh-agent magic
Signed-off-by: Georg <georg@lysergic.dev>
2021-12-02 22:29:26 +01:00

10 lines
308 B
Fish

# custom
function __ssh_agent_is_key_added -d "checks if fingerprint is already present"
set SSH_FP (ssh-keygen -lf ~/.ssh/id_lysergic-cert.pub | awk '{print $2}')
if ! test -z "$SSH_FP"
and ssh-add -l | grep -q "$SSH_FP"
else
return 1
end
end