diff options
-rw-r--r-- | zshrc | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -37,8 +37,10 @@ export PAGER="less -FXR" # load any SSH keys into the agent export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent/agent.sock" -keys_loaded="$( ssh-add -l | grep 'has no ident' | wc -l )" -if [ "$keys_loaded" -eq "1" ]; then - ssh-add +if [ -f "${SSH_AUTH_SOCK}" ]; then + keys_loaded="$( ssh-add -l | grep 'has no ident' | wc -l )" + if [ "$keys_loaded" -eq "1" ]; then + ssh-add + fi + ssh-add -l fi -ssh-add -l |