Sync 'minimal' branch with 'master'.
This commit is contained in:
parent
4edb9ac7cc
commit
44ad23f4f0
37 changed files with 559 additions and 380 deletions
17
.bash_logout
17
.bash_logout
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash - not strictly necessary, but helps nano with syntax highlighting.
|
||||
|
||||
# Clear the screen/console on logout.
|
||||
if (( $SHLVL == 1 )); then
|
||||
if (( SHLVL == 1 )); then
|
||||
if [[ -x /usr/bin/clear_console ]]; then
|
||||
/usr/bin/clear_console -q
|
||||
elif [[ -x /usr/bin/clear ]]; then
|
||||
|
|
@ -9,6 +9,19 @@ if (( $SHLVL == 1 )); then
|
|||
elif [[ -x /usr/bin/tput ]]; then
|
||||
/usr/bin/tput clear
|
||||
else
|
||||
echo -ne "\E[2J"
|
||||
echo -ne "\e[2J"
|
||||
fi
|
||||
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
|
||||
(( $? != 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
|
||||
}
|
||||
|
||||
# Update the ~/.ssh/agents file.
|
||||
__read_ssh_agents && __write_ssh_agents
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue