Hello,

I have a script to decrypt a file and send it to another program:

  gpg -q -d "$filename" | mpv -

this works fine when my gpg agent is already unlocked, ie the passphrase
is alredy cached.

But when the agent is not yet unlocked, I get some garbled passphrase
prompt which breaks my terminal, and even typing the passphrase does not
work

what do I need to do?

check first whether agent is unlocked, and if not unlock it first and
only then proceed with gpg -d?

how would I check that?

I tried this:

if echo "test" | gpg --sign --quiet >/dev/null 2>/dev/null ; then

which sort of works, but looks convoluted and also has few hundred
milliseconds delay

Also, is there a command for unlocking the agent without actually
decrypting anything ?

thank you,

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-users

Reply via email to