Explorar el Código

Remove unnecessary variable from ssh-agent.sh

Weiyi Lou hace 9 años
padre
commit
fd800ec40d
Se han modificado 1 ficheros con 2 adiciones y 3 borrados
  1. 2 3
      shell/common/ssh-agent.sh

+ 2 - 3
shell/common/ssh-agent.sh

@@ -34,10 +34,9 @@ function agent_setup() {
 
 # Create a symlink to an existing auth socket.
 function link_socket() {
-  local target="$SSH_AUTH_SOCK"
   local link="$HOME/.ssh/authsock"
-  if [[ -n $target && $target != $link ]]; then
-    ln -sf $target $link &>/dev/null
+  if [[ -n $SSH_AUTH_SOCK && $SSH_AUTH_SOCK != $link ]]; then
+    ln -sf $SSH_AUTH_SOCK $link &>/dev/null
     export SSH_AUTH_SOCK=$link
   fi
 }