Created
March 15, 2017 21:41
-
-
Save EntropyWorks/b3676a507c176b51f31170511546ff4b to your computer and use it in GitHub Desktop.
Using gpg-agent instead of ssh-agent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GPG_TTY=$(tty) | |
export GPG_TTY | |
if test -f "$HOME/.gpg-agent-info" && \ | |
kill -0 "$(grep GPG_AGENT_INFO "$HOME/.gpg-agent-info" | cut -d: -f 2)" 2>/dev/null; then | |
. "${HOME}/.gpg-agent-info" | |
echo "first . ${HOME}/.gpg-agent-info" | |
export GPG_AGENT_INFO | |
export SSH_AUTH_SOCK | |
export SSH_AGENT_PID | |
else | |
eval "$(gpg-agent --daemon --verbose --enable-ssh-support --log-file "${HOME}/.gpg-agent.log" --write-env-file "${HOME}/.gpg-agent-info")" | |
. "${HOME}/.gpg-agent-info" | |
echo "second . ${HOME}/.gpg-agent-info" | |
export GPG_AGENT_INFO | |
export SSH_AUTH_SOCK | |
export SSH_AGENT_PID | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment