Removed old ssh login code. Added some feature notes.
This commit is contained in:
parent
29b1645c71
commit
8bce5d846c
1 changed files with 4 additions and 52 deletions
|
|
@ -34,6 +34,10 @@ fi
|
||||||
[[ -d "$HOME/.local/bin" ]] && export PATH="$HOME/.local/bin:$PATH"
|
[[ -d "$HOME/.local/bin" ]] && export PATH="$HOME/.local/bin:$PATH"
|
||||||
[[ -d "$HOME/bin" ]] && export PATH="$HOME/bin:$PATH"
|
[[ -d "$HOME/bin" ]] && export PATH="$HOME/bin:$PATH"
|
||||||
|
|
||||||
|
#When registration of connection fails, set a marker in .bash_profile.
|
||||||
|
#Check for that marker in .bash_logout and don't remove socket from agents file - would be removing
|
||||||
|
#another shells socket. Will need to clear the marker if subsequently (from prompt_command) find a new socket and reg it.
|
||||||
|
|
||||||
# Make ssh-agent work better.
|
# Make ssh-agent work better.
|
||||||
hash ssh-add ssh-agent >/dev/null 2>&1 && {
|
hash ssh-add ssh-agent >/dev/null 2>&1 && {
|
||||||
if [[ -e "$SSH_AUTH_SOCK" ]]; then
|
if [[ -e "$SSH_AUTH_SOCK" ]]; then
|
||||||
|
|
@ -114,58 +118,6 @@ hash ssh-add ssh-agent >/dev/null 2>&1 && {
|
||||||
}
|
}
|
||||||
unset _OUTPUT _PLATFORM
|
unset _OUTPUT _PLATFORM
|
||||||
|
|
||||||
#hash ssh-add ssh-agent >/dev/null 2>&1 && {
|
|
||||||
# if [[ -z "$SSH_AUTH_SOCK" ]]; then
|
|
||||||
# # Try to find an existing agent socket to connect to.
|
|
||||||
# SSH_AUTH_SOCK="$(_find_agent_sock)"
|
|
||||||
# if ((${PIPESTATUS[0]} == 0)); then
|
|
||||||
# # Found a socket.
|
|
||||||
# export SSH_AUTH_SOCK
|
|
||||||
# echo "Connected to ssh-agent."
|
|
||||||
# alias ssh='ssh-add -l >/dev/null 2>&1 && unalias ssh || { ssh-add && unalias ssh; }; ssh'
|
|
||||||
# else
|
|
||||||
# # No viable socket - try to start an agent.
|
|
||||||
# eval "$(ssh-agent -s | grep -v 'echo')"
|
|
||||||
# ssh-add -l >/dev/null 2>&1
|
|
||||||
# if (( $? < 2 )); then
|
|
||||||
# # Agent started - add new socket to the agent sockets file.
|
|
||||||
# _lock_agents_file && {
|
|
||||||
# if _push_agent_sock; then
|
|
||||||
# echo "Started new ssh-agent."
|
|
||||||
# else
|
|
||||||
# echo "$(tput setaf 1 || tput AF 1)Started new ssh-agent, but failed to register socket!$(tput op)"
|
|
||||||
# fi
|
|
||||||
# }
|
|
||||||
# _unlock_agents_file
|
|
||||||
# alias ssh='ssh-add -l >/dev/null 2>&1 && unalias ssh || { ssh-add && unalias ssh; }; ssh'
|
|
||||||
# else
|
|
||||||
# echo "$(tput setaf 1 || tput AF 1)Failed to start new ssh-agent!$(tput op)"
|
|
||||||
# unset SSH_AGENT_PID SSH_AUTH_SOCK
|
|
||||||
# fi
|
|
||||||
# fi
|
|
||||||
# else
|
|
||||||
# # Got a forwarded ssh-agent connection.
|
|
||||||
# export SSH_AUTH_SOCK
|
|
||||||
# ssh-add -l >/dev/null 2>&1
|
|
||||||
# if (( $? < 2 )); then
|
|
||||||
# # Agent is connected - add new socket to the agent sockets file.
|
|
||||||
# _lock_agents_file && {
|
|
||||||
# if _push_agent_sock; then
|
|
||||||
# echo "Connected to forwarded ssh-agent."
|
|
||||||
# else
|
|
||||||
# echo -e "$(tput setaf 1 || tput AF 1)Failed to register forwarded ssh-agent socket!$(tput op)"
|
|
||||||
# fi
|
|
||||||
# }
|
|
||||||
# _unlock_agents_file
|
|
||||||
# alias ssh='ssh-add -l >/dev/null 2>&1 && unalias ssh || { ssh-add && unalias ssh; }; ssh'
|
|
||||||
# else
|
|
||||||
# echo -e "$(tput setaf 1 || tput AF 1)Problem connecting to forwarded ssh-agent!$(tput op)"
|
|
||||||
# fi
|
|
||||||
# fi
|
|
||||||
# echo
|
|
||||||
#}
|
|
||||||
#unset _PLATFORM
|
|
||||||
|
|
||||||
# Screen.
|
# Screen.
|
||||||
hash screen >/dev/null 2>&1 && {
|
hash screen >/dev/null 2>&1 && {
|
||||||
if [[ ! -e ~/.hushlogin ]]; then
|
if [[ ! -e ~/.hushlogin ]]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue