2018-04-21 22:26:36 +02: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 17:04:38 +01:00
|
|
|
fi
|
2018-04-21 22:26:36 +02:00
|
|
|
export GPG_TTY=$(tty)
|
2010-10-15 16:50:39 +02:00
|
|
|
|
2018-04-21 22:26:36 +02: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 17:04:38 +01:00
|
|
|
unset SSH_AGENT_PID
|
2013-02-21 02:46:20 +01:00
|
|
|
fi
|
2010-10-15 16:50:39 +02:00
|
|
|
|