fix to avoid other's ssh-agent
parent
6cccf6e575
commit
8f8a1686b8
|
|
@ -8,7 +8,7 @@ function get_ssh_agent_timeout(){
|
||||||
}
|
}
|
||||||
|
|
||||||
function bind_ssh_agent(){
|
function bind_ssh_agent(){
|
||||||
local agent_pid=`ps -ef | grep ssh-agent | grep -v grep | awk '{print $2}' | xargs`
|
local agent_pid=`ps -U $USER | grep ssh-agent | grep -v grep | awk '{print $1}' | xargs`
|
||||||
|
|
||||||
if [ "$agent_pid" = "" ]; then
|
if [ "$agent_pid" = "" ]; then
|
||||||
ssh-agent -t $(get_ssh_agent_timeout) > ~/.ssh/ssh_agent_rc
|
ssh-agent -t $(get_ssh_agent_timeout) > ~/.ssh/ssh_agent_rc
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue