From: Don Armstrong Date: Wed, 17 Apr 2019 00:17:47 +0000 (-0700) Subject: use gpg-connect-agent X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=000e1664375362657465800f5c943c4e91f97c37;p=zsh.git use gpg-connect-agent --- diff --git a/.zsh/zshrc/64_ssh b/.zsh/zshrc/64_ssh index 449d11b..3e5d6f8 100644 --- a/.zsh/zshrc/64_ssh +++ b/.zsh/zshrc/64_ssh @@ -1,8 +1,11 @@ # -*- mode: sh -*- -# -*- mode: sh -*- # set up ssh-agent -if which ssh-agent >/dev/null && [ -d ~/.ssh ] && \ +if which gpg-connect-agent >/dev/null && [ -n "$GPG_AGENT_INFO" ]; then + SSH_AUTH_SOCK=$(gpg-connect-agent -q 'getinfo ssh_socket_name' '/bye'| + awk -F'D ' '/.ssh$/{print $2}') + export SSH_AUTH_SOCK; +elif which ssh-agent >/dev/null && [ -d ~/.ssh ] && \ [ -z "$SSH_CONNECTION" ] && [ -z "$SSH_CLIENT" ]; then if [ -e ~/.ssh/ssh_agent_info ] && \ [ -n "$(awk -F '[=;]' '/^SSH_AGENT_PID/{print $2}' ~/.ssh/ssh_agent_info)" ] && \