Re: [dev] ssh-agent stanza in POSIX shell

From: Patrick Haller <201009-suckless_AT_haller.ws>
Date: Mon, 31 Oct 2011 08:27:17 +0800

On 2011-10-30 20:04, Sime Ramov wrote:
> I've found the following clever ssh-agent stanza in Richard Crowley's
> `.profile`[https://raw.github.com/rcrowley/home/master/.profile]:
...
> It works partially, i.e. it spawns a new agent on every shell
> invocation.

It should probably test for functionality, something like:

ssh_agent_check ()
{
        for sock in {$TMPDIR,/tmp}/ssh-*/agent*
        do
                export SSH_AUTH_SOCK=$sock
                ssh-add -l && return
        done
        eval `ssh-agent`
}


Patrick
Received on Mon Oct 31 2011 - 01:27:17 CET

This archive was generated by hypermail 2.3.0 : Mon Oct 31 2011 - 01:36:03 CET