2018-04-21 20:26:36 +00:00
|
|
|
# Enable gpg-agent if it is not running-
|
|
|
|
# --use-standard-socket will work from version 2 upwards
|
|
|
|
|
|
|
|
AGENT_SOCK=`gpgconf --list-dirs | grep agent-socket | cut -d : -f 2`
|
|
|
|
|
|
|
|
if [ ! -S ${AGENT_SOCK} ]; then
|
|
|
|
gpg-agent --daemon --use-standard-socket >/dev/null 2>&1
|
2017-11-07 16:04:38 +00:00
|
|
|
fi
|
2018-04-21 20:26:36 +00:00
|
|
|
export GPG_TTY=$(tty)
|
2010-10-15 14:50:39 +00:00
|
|
|
|
2018-04-21 20:26:36 +00:00
|
|
|
# Set SSH to use gpg-agent if it's enabled
|
|
|
|
if [ -S "${AGENT_SOCK}.ssh" ]; then
|
|
|
|
export SSH_AUTH_SOCK="${AGENT_SOCK}.ssh"
|
2017-11-07 16:04:38 +00:00
|
|
|
unset SSH_AGENT_PID
|
2013-02-21 01:46:20 +00:00
|
|
|
fi
|
2010-10-15 14:50:39 +00:00
|
|
|
|