Skip to content

Instantly share code, notes, and snippets.

@dancmeyers
Created October 21, 2015 10:03
Show Gist options
  • Save dancmeyers/8f3cc57588025fcfbf0a to your computer and use it in GitHub Desktop.
Save dancmeyers/8f3cc57588025fcfbf0a to your computer and use it in GitHub Desktop.
envfile=~/.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 --disable-scdaemon --write-env-file $envfile)"
fi
export GPG_AGENT_INFO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment