From 0da7162f9071d7eacaf61536a1e49b2525ff2aa0 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 5 Feb 2018 12:59:28 +0000 Subject: [PATCH] su only needed for root --- src/freedombone-utils-gpg | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/freedombone-utils-gpg b/src/freedombone-utils-gpg index 0553c036..19528b65 100755 --- a/src/freedombone-utils-gpg +++ b/src/freedombone-utils-gpg @@ -252,7 +252,11 @@ 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 - su -c "echo RELOADAGENT | gpg-connect-agent" - $gpg_username + if [[ "$USER" == 'root' ]]; then + su -c "echo RELOADAGENT | gpg-connect-agent" - $gpg_username + else + echo RELOADAGENT | gpg-connect-agent + fi fi }