Get SSH_AUTH_SOCK from gpgconf

Older versions of GPG don't support the `agent-ssh-socket` option, so we
will have to work around this.
master
nirenjan 2020-04-12 16:57:52 -07:00
parent b5fc74d501
commit 9da5e26220
1 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,10 @@
gpgconf --launch gpg-agent gpgconf --launch gpg-agent
export SSH_AUTH_SOCK="$HOME/.gnupg/S.gpg-agent.ssh" export SSH_AUTH_SOCK="$HOME/.gnupg/S.gpg-agent.ssh"
TSOCK=$(gpgconf --list-dirs agent-ssh-socket || true)
if [[ -n "$TSOCK" ]]
then
export SSH_AUTH_SOCK="$TSOCK"
unset TSOCK
fi