Fixes for variable handling around ssh-agent
This commit is contained in:
parent
86cbdbbab9
commit
9fc65724ef
@ -46,9 +46,9 @@ if [ -f ~/.ssh/config ]; then
|
||||
done
|
||||
fi
|
||||
# Tell shell about ssh-agent -- enable with 'systemctl enable ssh-agent@$USER.service'
|
||||
SSH_AGENT_PID="$(ps -feu "$USER" | grep -v grep | grep -m 1 ssh-agent | awk '{ print $2; }')"
|
||||
export SSH_AGENT_PID="$(ps -fu "$USER" | grep -v grep | grep -m 1 ssh-agent | awk '{ print $2; }')"
|
||||
if [ -n "$SSH_AGENT_PID" ]; then
|
||||
SSH_AUTH_SOCK="$(ls -1 /tmp/ssh-*/agent.$(( $SSH_AGENT_PID - 1 )))"
|
||||
export SSH_AUTH_SOCK="$(ls -1 /tmp/ssh-*/agent.$(( $SSH_AGENT_PID - 1 )))"
|
||||
echo ssh-agent PID is $SSH_AGENT_PID
|
||||
fi
|
||||
# Set up screen/tmux safety nest by default for remote sessions
|
||||
|
Loading…
Reference in New Issue
Block a user