Skip to content

Instantly share code, notes, and snippets.

Created February 3, 2015 17:39
Show Gist options
  • Save anonymous/d08771328f90272110ed to your computer and use it in GitHub Desktop.
Save anonymous/d08771328f90272110ed to your computer and use it in GitHub Desktop.
Setting up a GPG Agent
# Inser this snippet into your ~/.bash_profile
# Set up the GPG Agent
# http://fvue.nl/wiki/Debian_4.0:_Installing_gpg-agent
if [ -f ${HOME}/.gpg-agent-info ] && \
kill -0 $(cut -d: -f 2 ${HOME}/.gpg-agent-info)
then
# Yes, '.gpg-agent-info' points to valid gpg-agent process;
# Indicate gpg-agent process
GPG_AGENT_INFO=$(cat ${HOME}/.gpg-agent-info | cut -c 16-)
else
# No, no valid gpg-agent process available;
# Start gpg-agent
eval $(gpg-agent --daemon --no-grab --write-env-file ${HOME}/.gpg-agent-info)
fi
export GPG_TTY=$(tty)
export GPG_AGENT_INFO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment