From 43ffd1486c1194f13eb74dff0a8e360e4faa503d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Fri, 20 Nov 2015 17:13:25 +0100 Subject: [PATCH] Prevent multiple ssh-agent processes. --- zsh/zprofile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zsh/zprofile b/zsh/zprofile index 2de3091..d272716 100644 --- a/zsh/zprofile +++ b/zsh/zprofile @@ -24,7 +24,9 @@ export LOGDIR="$HOME/.var/log" export RUNDIR="$HOME/.var/run" if [[ -z "$SSH_CONNECTION" ]] ; then - eval $(ssh-agent -s) + if ! pgrep ssh-agent --uid $USER >/dev/null 2>&1 ; then + eval $(ssh-agent -s) + fi [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx fi