use gpgconf

This commit is contained in:
David Tomaschik
2017-10-29 20:33:18 -07:00
parent f7ae1cb9f9
commit 42f93dc9d2

View File

@@ -18,9 +18,10 @@ function start_agent_withssh {
# check if another agent is running # check if another agent is running
if ! gpg-connect-agent --agent-program /dev/null --quiet /bye > /dev/null 2> /dev/null; then if ! gpg-connect-agent --agent-program /dev/null --quiet /bye > /dev/null 2> /dev/null; then
if [ -d "${XDG_RUNTIME_DIR}/gnupg" ] ; then if which gpgconf ; then
GPG_AGENT_INFO=${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent # This might clobber SSH_AUTH_SOCK anyway...
SSH_AUTH_SOCK=${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent.ssh GPG_AGENT_INFO=$(gpgconf --list-dirs agent-socket)
SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
export GPG_AGENT_INFO export GPG_AGENT_INFO
export SSH_AUTH_SOCK export SSH_AUTH_SOCK
# source settings of old agent, if applicable # source settings of old agent, if applicable