Change SSH Agent stuff to re-use existing sockets.
This commit is contained in:
parent
c22fa4760b
commit
451d745b19
9
.bashrc
9
.bashrc
|
@ -106,8 +106,13 @@ export GOPATH=${HOME}/src/go
|
||||||
#--------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------
|
||||||
# Check if we already have an agent running and sourced
|
# Check if we already have an agent running and sourced
|
||||||
if [ -z "${SSH_AUTH_SOCK}" ]; then
|
if [ -z "${SSH_AUTH_SOCK}" ]; then
|
||||||
eval `ssh-agent -s`
|
SSH_AUTH_SOCK_FILE=~/.ssh/auth_sock
|
||||||
ssh-add
|
if [ -S ${SSH_AUTH_SOCK_FILE} ]; then
|
||||||
|
SSH_AUTH_SOCK=${SSH_AUTH_SOCK_FILE}
|
||||||
|
else
|
||||||
|
eval `ssh-agent -a ${SSH_AUTH_SOCK_FILE} -s`
|
||||||
|
ssh-add
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
#--------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue