diff --git a/README.md b/README.md index e059356..e048e05 100644 --- a/README.md +++ b/README.md @@ -223,12 +223,15 @@ $ pass init "Go Jira " You probably want to setup gpg-agent so that you dont have to type in your gpg passphrase all the time. You can get `gpg-agent` to automatically start by adding something like this to your `$HOME/.bashrc` ```bash -if [ ! -f $HOME/.gpg-agent-info ]; then - # set passphrase cache so I only have to type my passphrase once a day - gpg-agent --default-cache-ttl 86400 --daemon --write-env-file $HOME/.gpg-agent-info +if [ -f $HOME/.gpg-agent-info ]; then + . $HOME/.gpg-agent-info + export GPG_AGENT_INFO +fi +# verify sock file from GPG_AGENT_INFO is actually present +if [ ! -S "${GPG_AGENT_INFO%%:*}" ]; then + # set passphrase cache so I only have to type my passphrase once a day + eval $(gpg-agent --default-cache-ttl 604800 --daemon --write-env-file $HOME/.gpg-agent-info) fi -. $HOME/.gpg-agent-info -export GPG_AGENT_INFO export GPG_TTY=$(tty) ```