Keeps SSH forwarded agent

This commit is contained in:
nemunaire 2014-04-17 10:12:23 +02:00
parent 3a3ee80f7e
commit 2b0a123acf

View File

@ -64,12 +64,14 @@ PS1=$PS1'\[\e[$HOST_COLOR;01m\]\h\[\e[00m\]:\[\e[01;34m\]\W\[\e[00m\]'
PS1=$PS1'\[`if [ $? -eq 0 ]; then echo -ne "\033[0;32m"; else echo -ne "\033[0;31m"; fi`\]'
PS1=$PS1'\$\[\033[0m\] '
#Agent SSH
if [ ! -f /tmp/ssh-agent.$USER ]; then
#SSH agent
if [ -z "$SSH_AUTH_SOCK" ]; then # Keeps SSH forwarded agent
if [ ! -f /tmp/ssh-agent.$USER ]; then
ssh-agent > /tmp/ssh-agent.$USER
chmod 400 /tmp/ssh-agent.$USER
fi
source /tmp/ssh-agent.$USER > /dev/null
fi
source /tmp/ssh-agent.$USER > /dev/null
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases