diff --git a/roles/home-cli/files/bashrc b/roles/home-cli/files/bashrc index d62dcc4..860b2dc 100644 --- a/roles/home-cli/files/bashrc +++ b/roles/home-cli/files/bashrc @@ -262,7 +262,10 @@ case "$-" in ;; esac -if [ -S "$SSH_AUTH_SOCK" ] && [ -r "$HOME/.ssh/id_ed25519" ] && [ $(ssh-add -l | egrep "acp-(home|work) \(ED25519\)" | wc -l) = 0 ] +if [ -S "$SSH_AUTH_SOCK" ] \ + && [ -r "$HOME/.ssh/id_ed25519" ] \ + && [ -r "$HOME/.ssh/id_ed25519.pub" ] \ + && [ $(ssh-add -l | grep "$(ssh-keygen -l -f "$HOME/.ssh/id_ed25519.pub")" | wc -l) = 0 ] then ssh-add "$HOME/.ssh/id_ed25519" fi