diff --git a/src/freedombone-utils-gpg b/src/freedombone-utils-gpg index 19528b65..57765697 100755 --- a/src/freedombone-utils-gpg +++ b/src/freedombone-utils-gpg @@ -252,7 +252,7 @@ function gpg_agent_setup { 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 - if [[ "$USER" == 'root' ]]; then + if [[ "$gpg_username" != "$USER" ]]; then su -c "echo RELOADAGENT | gpg-connect-agent" - $gpg_username else echo RELOADAGENT | gpg-connect-agent