From ef43f66137107892a617919660a5f74e2f014829 Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Thu, 18 Mar 2021 10:02:00 +0000 Subject: [PATCH] Fix bash SSH check --- roles/home-cli/files/bashrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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