fix to avoid other's ssh-agent

pull/85/head
Changwoo Park 2011-10-28 19:51:44 +09:00
parent 6cccf6e575
commit 8f8a1686b8
1 changed files with 1 additions and 1 deletions

View File

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