19 lines
372 B
1
# bind gpg agent to current tty
2
rwx_gpg_agent_update() {
3
gpg-connect-agent \
4
updatestartuptty \
5
/bye
6
}
7
8
rwx_gpg_ssh_auth_sock() {
9
local user_id
10
user_id=$(id --user)
11
if [ "${user_id}" -ne 0 ]; then
12
if [ -f "${HOME}/.gnupg/gpg-agent.conf" ]; then
13
SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
14
export SSH_AUTH_SOCK
15
fi
16
fi
17
}
18
19
rwx_gpg_ssh_auth_sock
20