Fixed GPG-Agent having wrong options and erroring out if agent is not running instead of starting it

This commit is contained in:
2019-03-10 08:51:03 +01:00
parent ef2487a9e0
commit 8d40aa6e63
2 changed files with 4 additions and 5 deletions

View File

@ -1,11 +1,12 @@
#!/bin/bash
if [ $(pgrep gpg-agent) != 0 ]; then
rc=$(pgrep gpg-agent)
if [ "$rc" != 0 ]; then
export GPG_AGENT_INFO
export SSH_AUTH_SOCK
export SSH_AGENT_PID
else
eval $(gpg-agent --daemon ~/.gpg-agent-info)
eval $(gpg-agent --daemon)
fi
gpg-connect-agent /bye