diff options
| author | Moritz Beber <m.beber@jacobs-university.de> | 2010-08-11 14:21:11 +0200 |
|---|---|---|
| committer | Moritz Beber <m.beber@jacobs-university.de> | 2010-08-11 14:21:11 +0200 |
| commit | 3aedad7490335796eb80bd549b9f526a699f374d (patch) | |
| tree | d34c65942af8f50c1731504c3f1d8eccddbcf663 | |
| parent | 121b3c67c362acf87d646631801b3c77a2e785e1 (diff) | |
fixed bug with SSH_AGENT_PID
The variable SSH_AGENT_PID might still be set, so it should not be used for
testing. Resorted to a ps test instead.
| -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" |
