diff options
| -rw-r--r-- | _posts/2009-09-03-working-with-key-passphrases.textile | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/_posts/2009-09-03-working-with-key-passphrases.textile b/_posts/2009-09-03-working-with-key-passphrases.textile index 978b9f2..11fd037 100644 --- a/_posts/2009-09-03-working-with-key-passphrases.textile +++ b/_posts/2009-09-03-working-with-key-passphrases.textile @@ -47,8 +47,9 @@ function start_agent { ssh-add } -# check for running ssh-agent -if [ ${SSH_AGENT_PID} ]; then +# check for running ssh-agent +ps -ef | grep ${SSH_AGENT_PID} | grep -v grep > /dev/null +if [ $? -eq 0 ]; then # test whether standard identities have been added to # the agent already ssh-add -l | grep "agent has no identities" |
