profile: Do not restart SSH if already running

master
Pierre Neidhardt 2016-05-31 10:42:33 +02:00
parent 3e49ac47b5
commit b43a773526
1 changed files with 5 additions and 3 deletions

View File

@ -97,9 +97,11 @@ export EDITOR
export GIT_EDITOR
## SSH-Agent
command -v ssh-agent >/dev/null 2>&1 && eval "$(ssh-agent)"
## Kill ssh-agent on session end. Console login only.
command -v sessionclean >/dev/null 2>&1 && trap 'sessionclean' 0
if command -v ssh-agent >/dev/null 2>&1 && [ -z "$SSH_AGENT_PID" ]; then
eval "$(ssh-agent)"
## Kill ssh-agent on session end. Console login only.
command -v sessionclean >/dev/null 2>&1 && trap 'sessionclean' 0
fi
## Set TEMP dir if you want to override /tmp for some applications that check
## for this variable. Usually not a good idea since some applications will write