5 if which ssh-agent >/dev/null && [ -d ~/.ssh ] && \
6 [ -z "$SSH_CONNECTION" ] && [ -z "$SSH_CLIENT" ]; then
7 if [ -e ~/.ssh/ssh_agent_info ] && \
8 [ -n "$(awk -F '[=;]' '/^SSH_AGENT_PID/{print $2}' ~/.ssh/ssh_agent_info)" ] && \
9 kill -0 "$(awk -F '[=;]' '/^SSH_AGENT_PID/{print $2}' ~/.ssh/ssh_agent_info)" >/dev/null 2>&1; then
10 . ~/.ssh/ssh_agent_info > /dev/null
11 elif [ -e ~/.ssh/ssh_agent_info_$(hostname) ] && \
12 kill -0 "$(awk -F '[=;]' '/^SSH_AGENT_PID/{print $2}' ~/.ssh/ssh_agent_info_$(hostname))" >/dev/null 2>&1; then
13 . ~/.ssh/ssh_agent_info_$(hostname) > /dev/null
15 ssh-agent -s > ~/.ssh/ssh_agent_info_$(hostname)
16 . ~/.ssh/ssh_agent_info_$(hostname) > /dev/null