diff --git a/.bash_profile b/.bash_profile index abc72ec..f9227cd 100644 --- a/.bash_profile +++ b/.bash_profile @@ -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 && { diff --git a/.bashrc b/.bashrc index ebf2e29..d86c0a1 100644 --- a/.bashrc +++ b/.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)) && {