Skip to content

Instantly share code, notes, and snippets.

@ludwig
Forked from anonymous/.bash_profile
Last active August 29, 2015 14:15
Show Gist options
  • Save ludwig/bbe88409944d6b1d4f7e to your computer and use it in GitHub Desktop.
Save ludwig/bbe88409944d6b1d4f7e to your computer and use it in GitHub Desktop.
# 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