dotfiles/gnupg/gnupg_agent

14 lines
262 B
Plaintext
Raw Normal View History

#!/bin/bash
if [ $(pgrep gpg-agent) != 0 ]; then
export GPG_AGENT_INFO
export SSH_AUTH_SOCK
export SSH_AGENT_PID
else
eval $(gpg-agent --daemon ~/.gpg-agent-info)
fi
gpg-connect-agent /bye
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)