gpg-connect-agent querying max-cache-ttl

Peter Lebbing peter at digitalbrains.com
Mon Jan 12 21:24:49 CET 2015


On 12/01/15 18:45, Rob Fries wrote:
> I believe the proper way to do this would be through gpg-connect-agent.

You're mistaken; it's as Patrick said through gpgconf, the program to
programmatically query the configuration.

$ gpgconf --list-options gpg-agent|grep ^max-cache-ttl: |cut -d: -f 10

But note:

> If  it is empty, then the option is not explicitly set in the current
> configuration, and the default  applies  (if  any).

The value is field 10, the default is field 8. So if the above command returns a
blank string, try:

$ gpgconf --list-options gpg-agent|grep ^max-cache-ttl: |cut -d: -f 8

Obviously you could do this in one go, doing your own parsing rather than
calling grep and cut, etcetera.

HTH,

Peter.

-- 
I use the GNU Privacy Guard (GnuPG) in combination with Enigmail.
You can send me encrypted mail if you want some privacy.
My key is available at <http://digitalbrains.com/2012/openpgp-key-peter>



More information about the Gnupg-users mailing list