Fix SSH detection

This commit is contained in:
Anthony Rose 2020-02-06 11:20:47 +00:00
parent 2a73c55a40
commit 7f8f753037

View file

@ -250,8 +250,8 @@ case $- in
;;
esac
if test -S $SSH_AUTH_SOCK && test -r $HOME/.ssh/id_rsa && [ $(ssh-add -l | grep "$HOME/.ssh/id_rsa" | wc -l) = 0 ]; then
ssh-add $HOME/.ssh/id_rsa
if test -S "$SSH_AUTH_SOCK" && test -r "$HOME/.ssh/id_rsa" && [ $(ssh-add -l | grep "$HOME/.ssh/id_rsa" | wc -l) = 0 ]; then
ssh-add "$HOME/.ssh/id_rsa"
fi
if [ -r $HOME/.shrc.$(hostname -s) ]; then