diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index 3159ade..c84f63a 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -1,5 +1,5 @@ # SSH Agent -if [[ ! -f "$XDG_RUNTIME_DIR/ssh-agent.env" ]]; then +if ! pgrep -u "$USER" ssh-agent > /dev/null || [[ ! -f "$XDG_RUNTIME_DIR/ssh-agent.env" ]]; then pkill -u "$USER" -9 ssh-agent ssh-agent > "$XDG_RUNTIME_DIR/ssh-agent.env" fi