fix(module/ssh): Fix error when enable module

USER is replace by 'id -un' to avoid error due to the USER no set
This commit is contained in:
Frédéric Combes 2014-12-15 14:06:08 +01:00
parent d43bcb9720
commit 5eb33e13b9

View file

@ -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