Check for existing loaded SSH keys

This commit is contained in:
Anthony Rose 2020-12-27 16:27:33 +00:00
parent d57c8086d5
commit 214f200ad9

View file

@ -325,7 +325,7 @@ case $- in
;; ;;
esac esac
if test -S "$SSH_AUTH_SOCK" && test -r "$HOME/.ssh/id_ed25519" && [ $(ssh-add -l | grep "$HOME/.ssh/id_ed25519" | wc -l) = 0 ]; then if test -S "$SSH_AUTH_SOCK" && test -r "$HOME/.ssh/id_ed25519" && [ $(ssh-add -l | egrep "acp-(home|work) \(ED25519\)" | wc -l) = 0 ]; then
ssh-add "$HOME/.ssh/id_ed25519" ssh-add "$HOME/.ssh/id_ed25519"
fi fi