diff --git a/src/freedombone-utils-gpg b/src/freedombone-utils-gpg index 637986de..e5790582 100755 --- a/src/freedombone-utils-gpg +++ b/src/freedombone-utils-gpg @@ -234,15 +234,9 @@ function gpg_agent_setup { if ! grep -q 'use-agent' /root/.gnupg/gpg.conf; then echo 'use-agent' >> /root/.gnupg/gpg.conf fi - if ! grep -q 'pinentry-mode loopback' /root/.gnupg/gpg.conf; then - echo 'pinentry-mode loopback' >> /root/.gnupg/gpg.conf - fi - if [ ! -f /root/.gnupg/gpg-agent.conf ]; then - touch /root/.gnupg/gpg-agent.conf - fi - if ! grep -q 'allow-loopback-pinentry' /root/.gnupg/gpg-agent.conf; then - echo 'allow-loopback-pinentry' >> /root/.gnupg/gpg-agent.conf - fi + echo 'default-cache-ttl 300' > /root/.gnupg/gpg-agent.conf + echo 'max-cache-ttl 999999' >> /root/.gnupg/gpg-agent.conf + echo 'allow-loopback-pinentry' >> /root/.gnupg/gpg-agent.conf if [ -f /root/.gnupg/S.dirmngr ]; then rm /root/.gnupg/S.dirmngr fi @@ -263,12 +257,9 @@ function gpg_agent_setup { if ! grep -q 'pinentry-mode loopback' /home/$gpg_username/.gnupg/gpg.conf; then echo 'pinentry-mode loopback' >> /home/$gpg_username/.gnupg/gpg.conf fi - if [ ! -f /home/$gpg_username/.gnupg/gpg-agent.conf ]; then - touch /home/$gpg_username/.gnupg/gpg-agent.conf - fi - if ! grep -q 'allow-loopback-pinentry' /home/$gpg_username/.gnupg/gpg-agent.conf; then - echo 'allow-loopback-pinentry' >> /home/$gpg_username/.gnupg/gpg-agent.conf - fi + echo 'default-cache-ttl 300' > /home/$gpg_username/.gnupg/gpg-agent.conf + echo 'max-cache-ttl 999999' >> /home/$gpg_username/.gnupg/gpg-agent.conf + echo 'allow-loopback-pinentry' >> /home/$gpg_username/.gnupg/gpg-agent.conf if [ -f /home/$gpg_username/.gnupg/S.dirmngr ]; then rm /home/$gpg_username/.gnupg/S.dirmngr fi