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:
parent
d43bcb9720
commit
5eb33e13b9
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue