Simplify the SSH agent script
This commit is contained in:
parent
ea7cff080c
commit
a70041a642
|
@ -3,14 +3,7 @@
|
||||||
#--------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------
|
||||||
# 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
|
||||||
SSH_AUTH_SOCK_FILE=~/.ssh/auth_sock
|
eval $(ssh-agent)
|
||||||
if [ -S ${SSH_AUTH_SOCK_FILE} ]; then
|
ssh-add
|
||||||
export SSH_AUTH_SOCK=${SSH_AUTH_SOCK_FILE}
|
|
||||||
export SSH_AGENT_PID=$(cat ~/.ssh/agent.pid)
|
|
||||||
else
|
|
||||||
eval `ssh-agent -a ${SSH_AUTH_SOCK_FILE} -s`
|
|
||||||
echo ${SSH_AGENT_PID} > ~/.ssh/agent.pid
|
|
||||||
ssh-add
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
#--------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue