bash: GPG SSH agent

This commit is contained in:
Cat /dev/Nulo 2022-01-14 22:46:21 -03:00
parent df697759e2
commit 607fa9c573

10
.bashrc
View file

@ -37,3 +37,13 @@ if ! "$REMOTE"; then
PROMPT_COMMAND="osc7_cwd;$PROMPT_COMMAND"
fi
# ------------------------------------------------------------------------------
# GPG SSH agent
if ! "$REMOTE"; then
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
# Start if not started
gpg-agent --daemon 2>/dev/null
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
fi
fi