+
+ # set up ssh-agent
+ if which ssh-agent >/dev/null && [ -d ~/.ssh ]; then
+ if [ -e ~/.ssh/ssh_agent_info ] && \
+ kill -0 "$(awk -F '[=;]' '/^SSH_AGENT_PID/{print $2}' ~/.ssh/ssh_agent_info)"; then
+ . ~/.ssh/ssh_agent_info > /dev/null
+ elif [ -e ~/.ssh/ssh_agent_info_$(hostname) ] && \
+ kill -0 "$(awk -F '[=;]' '/^SSH_AGENT_PID/{print $2}' ~/.ssh/ssh_agent_info_$(hostname))"; then
+ . ~/.ssh/ssh_agent_info_$(hostname) > /dev/null
+ else
+ ssh-agent -s > ~/.ssh/ssh_agent_info_$(hostname)
+ . ~/.ssh/ssh_agent_info_$(hostname) > /dev/null
+ fi;
+ fi;