rwx/sh/gpg.sh
Marc Beninca 513d09f797
All checks were successful
/ job (push) Successful in 3m56s
gpg/gak,gau
2025-07-06 15:32:43 +02:00

29 lines
492 B
Bash

# functions to handle gpg
# turn gpg agent off
#= gak
rwx_gpg_agent_kill() {
gpgconf \
--kill "gpg-agent"
}
# bind gpg agent to current tty
#= gau
rwx_gpg_agent_update() {
gpg-connect-agent \
updatestartuptty \
/bye
}
rwx_gpg_ssh_auth_sock() {
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
}
rwx_gpg_ssh_auth_sock