if [ ! -z "$SSH_CLIENT" ]; then
# Set display if we aren't already forwarding X11
if [ "$DISPLAY" = "" ]; then
if [ ! -z "$SSH_CLIENT" ]; then
# Set display if we aren't already forwarding X11
if [ "$DISPLAY" = "" ]; then
if [ -z "$SSH_AGENT_PID" -o ! "$SSH_AGENT_PID" = "$RUNNING_AGENT" ]; then
export SSH_AGENT_PID="$RUNNING_AGENT"
if [ "$SSH_AGENT_PID" = "" ]; then
unset SSH_AGENT_PID
unset SSH_AUTH_SOCK
# Start ssh-agent up then.
if [ -z "$SSH_AGENT_PID" -o ! "$SSH_AGENT_PID" = "$RUNNING_AGENT" ]; then
export SSH_AGENT_PID="$RUNNING_AGENT"
if [ "$SSH_AGENT_PID" = "" ]; then
unset SSH_AGENT_PID
unset SSH_AUTH_SOCK
# Start ssh-agent up then.