Fix bash SSH check

This commit is contained in:
Anthony Rose 2021-03-18 10:02:00 +00:00
parent 72837fb596
commit ef43f66137

View file

@ -262,7 +262,10 @@ case "$-" in
;; ;;
esac 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 then
ssh-add "$HOME/.ssh/id_ed25519" ssh-add "$HOME/.ssh/id_ed25519"
fi fi