Sync .bash* with master.

This commit is contained in:
Darren 'Tadgy' Austin 2023-05-21 01:12:44 +01:00
commit 9f90dadbd4
2 changed files with 3 additions and 2 deletions

View file

@ -16,7 +16,7 @@ fi
hash ssh-add ssh-agent >/dev/null 2>&1 && {
# Stop any started ssh-agent as long as the shell level is 1 and we're not on a tty.
(( SHLVL == 1 )) && [[ "$(tty)" == /dev/pts/* ]] && [[ -n "$SSH_AGENT_PID" ]] && {
ssh-agent -k
eval "$(ssh-agent -k)"
(( $? != 0 )) && printf "\\033[1;31;40m%s\\033[0;39m\\n" "Failed to stop ssh-agent." >&2
sleep 5
unset SSH_AGENT_PID SSH_AUTH_SOCK

View file

@ -248,7 +248,7 @@ hash nc >/dev/null 2>&1 && alias pastebin='nc termbin.com 9999'
hash screen >/dev/null 2>&1 && alias screen='screen -Ua'
hash shellcheck >/dev/null 2>&1 && alias shellcheck='shellcheck -x'
hash scp ssh ssh-add >/dev/null 2>&1 && alias scp='_EXEC=scp ssh'
hash sftp ssh ssh-add >/dev/null 2>&1 && alias sftp='_EXEC=scp ssh'
hash sftp ssh ssh-add >/dev/null 2>&1 && alias sftp='_EXEC=sftp ssh'
hash ssh ssh-add >/dev/null 2>&1 && ssh() {
local ERR
@ -261,6 +261,7 @@ hash ssh ssh-add >/dev/null 2>&1 && ssh() {
(( ERR == 2 )) && __ssh_agent_prompt_command && ssh-add
(( ERR == 1 )) && ssh-add
command "${_EXEC:-${FUNCNAME[0]}}" "$@"
unset _EXEC
}
# Determine the platform being logged into.