rwx/sh/gpg.sh
2024-11-19 09:22:24 +01:00

12 lines
241 B
Bash

sh_gpg_ssh() {
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
}
sh_gpg_ssh