From 5eb33e13b9ba8ee806d114431be2d5ba216dc5ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Combes?= Date: Mon, 15 Dec 2014 14:06:08 +0100 Subject: [PATCH] fix(module/ssh): Fix error when enable module USER is replace by 'id -un' to avoid error due to the USER no set --- modules/ssh/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ssh/init.zsh b/modules/ssh/init.zsh index d8b59377..404c7ef3 100644 --- a/modules/ssh/init.zsh +++ b/modules/ssh/init.zsh @@ -25,7 +25,7 @@ if [[ ! -S "$SSH_AUTH_SOCK" ]]; then source "$_ssh_agent_env" 2> /dev/null # Start ssh-agent if not started. - if ! ps -U "$USER" -o pid,ucomm | grep -q -- "${SSH_AGENT_PID:--1} ssh-agent"; then + if ! ps -U "$(id -un)" -o pid,ucomm | grep -q -- "${SSH_AGENT_PID:--1} ssh-agent"; then eval "$(ssh-agent | sed '/^echo /d' | tee "$_ssh_agent_env")" fi fi