Register newly found socket in agents file.
This commit is contained in:
parent
1a403671d8
commit
68f151bc7f
2 changed files with 8 additions and 2 deletions
|
|
@ -85,7 +85,7 @@ hash ssh-add ssh-agent >/dev/null 2>&1 && {
|
|||
fi
|
||||
echo
|
||||
}
|
||||
unset _GOT_LOCK _PLATFORM
|
||||
unset _PLATFORM
|
||||
|
||||
# Screen.
|
||||
hash screen >/dev/null 2>&1 && {
|
||||
|
|
|
|||
8
.bashrc
8
.bashrc
|
|
@ -12,8 +12,14 @@ _agent_prompt_command() {
|
|||
SOCK="$(_find_agent_sock)"
|
||||
if ((${PIPESTATUS[0]} == 0)); then
|
||||
export SSH_AUTH_SOCK="$SOCK"
|
||||
_lock_agents_file && {
|
||||
if _push_agent_sock; then
|
||||
echo "Connected to alternate ssh-agent - you may need to re-add keys."
|
||||
else
|
||||
echo "Connected to, but failed to register, alternate ssh-agent - you may need to re-add keys."
|
||||
fi
|
||||
}
|
||||
_SSH_PROMPT_ERROR_ISSUED=0
|
||||
echo "Connected to alternate ssh-agent - you may need to re-add keys."
|
||||
else
|
||||
if [[ -z "$(egrep -v '^$' ~/.ssh/agents)" ]]; then
|
||||
((${_SSH_PROMPT_ERROR_ISSUED:-0} == 0)) && {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue