su only needed for root
This commit is contained in:
parent
66b8734b0c
commit
0da7162f90
|
@ -252,7 +252,11 @@ function gpg_agent_setup {
|
||||||
if ! grep -q 'allow-loopback-pinentry' /home/$gpg_username/.gnupg/gpg-agent.conf; then
|
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
|
echo 'allow-loopback-pinentry' >> /home/$gpg_username/.gnupg/gpg-agent.conf
|
||||||
fi
|
fi
|
||||||
|
if [[ "$USER" == 'root' ]]; then
|
||||||
su -c "echo RELOADAGENT | gpg-connect-agent" - $gpg_username
|
su -c "echo RELOADAGENT | gpg-connect-agent" - $gpg_username
|
||||||
|
else
|
||||||
|
echo RELOADAGENT | gpg-connect-agent
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue