소스 검색

improve `ssh-add.zsh` check

Was actually returning `true` all the time. Thanks David!
Weiyi Lou 12 년 전
부모
커밋
8f23911289
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      zsh/omz-custom/ssh-add.zsh

+ 1 - 1
zsh/omz-custom/ssh-add.zsh

@@ -3,6 +3,6 @@
 #
 # We silence error output for when we're sshing to a machine that we don't want
 # to use ssh-agent forwarding for.
-if [[ `ssh-add -l 2> /dev/null` != *id_?sa* ]]; then
+if [[ `ssh-add -L | grep "^ssh-" | wc -l` == 0 ]]; then
   ssh-add 2> /dev/null
 fi