mirror of
https://github.com/Matir/skel.git
synced 2026-05-26 13:35:42 -07:00
Don't clobber ssh-agent
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# Custom agent to handle gpg-agent 2.1
|
# Custom plugin to handle gpg-agent 2.1
|
||||||
|
|
||||||
local GPG_ENV=$HOME/.gnupg/gpg-agent.env
|
local GPG_ENV=$HOME/.gnupg/gpg-agent.env
|
||||||
|
|
||||||
@@ -18,13 +18,14 @@ function start_agent_withssh {
|
|||||||
|
|
||||||
if [ -z "${GPG_AGENT_INFO}" ] ; then
|
if [ -z "${GPG_AGENT_INFO}" ] ; then
|
||||||
if which gpgconf >/dev/null 2>&1 ; then
|
if which gpgconf >/dev/null 2>&1 ; then
|
||||||
# This might clobber SSH_AUTH_SOCK anyway...
|
|
||||||
GPG_AGENT_INFO=$(gpgconf --list-dirs agent-socket)
|
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
|
||||||
|
if [ -z "${SSH_AUTH_SOCK}" ] ; then
|
||||||
|
SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
|
||||||
export SSH_AUTH_SOCK
|
export SSH_AUTH_SOCK
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# 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
|
||||||
|
|||||||
Reference in New Issue
Block a user