|
|
|
@ -13,9 +13,11 @@ else
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
function _start_new_ssh_agent () {
|
|
|
|
function _start_new_ssh_agent () {
|
|
|
|
|
|
|
|
ssh_agent_file=$1
|
|
|
|
killall ssh-agent
|
|
|
|
killall ssh-agent
|
|
|
|
# start a new ssh-agent and write its output to the env file.
|
|
|
|
# start a new ssh-agent and write its output to the env file.
|
|
|
|
ssh-agent | grep -v echo >&"$ssh_agent_env_file"
|
|
|
|
ssh-agent | grep -v echo >& "$ssh_agent_file"
|
|
|
|
|
|
|
|
source "$ssh_agent_file"
|
|
|
|
echo "New ssh-agent started."
|
|
|
|
echo "New ssh-agent started."
|
|
|
|
ssh-add
|
|
|
|
ssh-add
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -27,9 +29,9 @@ if [[ -e "$ssh_agent_env_file" ]]; then
|
|
|
|
echo "Existing ssh-agent environment configured with pid ${SSH_AGENT_PID}."
|
|
|
|
echo "Existing ssh-agent environment configured with pid ${SSH_AGENT_PID}."
|
|
|
|
else
|
|
|
|
else
|
|
|
|
echo "Existing ssh-agent appears to be dead."
|
|
|
|
echo "Existing ssh-agent appears to be dead."
|
|
|
|
_start_new_ssh_agent
|
|
|
|
_start_new_ssh_agent "$ssh_agent_env_file"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
else
|
|
|
|
echo "No existing ssh-agent found."
|
|
|
|
echo "No existing ssh-agent found."
|
|
|
|
_start_new_ssh_agent
|
|
|
|
_start_new_ssh_agent "$ssh_agent_env_file"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|