diff --git a/.bashrc b/.bashrc index 307591c..27dec15 100644 --- a/.bashrc +++ b/.bashrc @@ -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