rwx/sh/gpg.sh

20 lines
372 B
Bash
Raw Permalink Normal View History

2024-12-01 17:04:13 +00:00
# bind gpg agent to current tty
rwx_gpg_agent_update() {
gpg-connect-agent \
updatestartuptty \
/bye
}
2024-11-29 17:57:41 +00:00
rwx_gpg_ssh_auth_sock() {
2024-11-12 05:26:59 +00:00
local user_id
user_id=$(id --user)
if [ "${user_id}" -ne 0 ]; then
if [ -f "${HOME}/.gnupg/gpg-agent.conf" ]; then
SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
export SSH_AUTH_SOCK
fi
fi
}
2024-11-29 17:57:41 +00:00
rwx_gpg_ssh_auth_sock