Properly start the agent and have its config available

This commit is contained in:
Jona Reichmann 2019-03-09 14:15:07 +01:00
parent fe74ddd6ad
commit b8a3d13f1d
Signed by: transcaffeine
GPG Key ID: 03624C433676E465
2 changed files with 15 additions and 0 deletions

13
gnupg/gnupg_agent Executable file
View File

@ -0,0 +1,13 @@
#!/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)

View File

@ -21,6 +21,8 @@ mkdir -p ~/.gnupg
ln -s ./gnupg/gpg.conf ~/.gnupg/gpg.conf ln -s ./gnupg/gpg.conf ~/.gnupg/gpg.conf
ln -s ./gnupg/gpg-agent.conf ~/.gnupg/gpg-agent.conf ln -s ./gnupg/gpg-agent.conf ~/.gnupg/gpg-agent.conf
ln -s ./gnupg/sshcontrol ~/.gnupg/sshcontrol ln -s ./gnupg/sshcontrol ~/.gnupg/sshcontrol
ln -s ./gnupg/gnupg_agent ~/.gnupg/gnupg_agent
chmod u+x ~/.gnupg/gnupg_agent
git config --global gpg.program gpg2 git config --global gpg.program gpg2
git config --global user.name jreichmann git config --global user.name jreichmann