forked from herlo/ssh-gpg-smartcard-config
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgpg-agent-wrapper
More file actions
28 lines (21 loc) · 789 Bytes
/
Copy pathgpg-agent-wrapper
File metadata and controls
28 lines (21 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Copyright (c) 2010 Diego E. Pettenò <flameeyes@gmail.com>
# Available under CC-BY license (Attribution)
if ! [ -f "${HOME}/.gpg-agent-info" ] ||
! pgrep -u ${USER} gpg-agent >/dev/null; then
gpg-agent --daemon --enable-ssh-support --scdaemon-program /usr/bin/scdaemon --use-standard-socket --log-file ~/.gnupg/gpg-agent.log --write-env-file
fi
# for ssh-agent forwarding, override gnome-keyring though!
if [ -n ${SSH_AUTH_SOCK} ] && \
[ ${SSH_AUTH_SOCK#/tmp/keyring-} = ${SSH_AUTH_SOCK} ]; then
fwd_SSH_AUTH_SOCK=${SSH_AUTH_SOCK}
fi
export SSH_AUTH_SOCK
if [ "${fwd_SSH_AUTH_SOCK}" != "" ]; then
SSH_AUTH_SOCK=${fwd_SSH_AUTH_SOCK}
export SSH_AUTH_SOCK
fi
source ${HOME}/.gpg-agent-info
export GPG_AGENT_INFO
export SSH_AGENT_PID
GPG_TTY=$(tty)
export GPG_TTY