Created
September 4, 2019 19:36
-
-
Save ghostsquad/3d9bdcc559eb132b365412d9a11df09e to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env bash | |
envfile="$HOME/.gnupg/gpg-agent.env" | |
if [[ -e "$envfile" ]] && kill -0 $(grep GPG_AGENT_INFO "$envfile" | cut -d: -f 2) 2>/dev/null; then | |
eval "$(cat "$envfile")" | |
else | |
eval "$(gpg-agent --daemon --enable-ssh-support)" | |
fi | |
export GPG_AGENT_INFO # the env file does not contain the export statement | |
export SSH_AUTH_SOCK # enable gpg-agent for ssh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment