aboutsummaryrefslogtreecommitdiffstats
path: root/.profile
diff options
context:
space:
mode:
Diffstat (limited to '.profile')
-rw-r--r--.profile10
1 files changed, 9 insertions, 1 deletions
diff --git a/.profile b/.profile
index 760945f..822f6b8 100644
--- a/.profile
+++ b/.profile
@@ -29,7 +29,15 @@ fi
export PATH=$PATH:/usr/local/texlive/bin/x86_64-linux
###### gpg agent ######
-eval "$(gpg-agent --daemon)"
+gpgenv="$HOME/.gnupg/gpg-agent.env"
+if [ -e "${gpgenv}" ] && kill -0 $(grep GPG_AGENT_INFO "${gpgenv}" \
+ | cut -d: -f 2) 2>/dev/null; then
+ eval "$(cat "${gpgenv}")"
+else
+ eval "$(gpg-agent --daemon --enable-ssh-support --write-env-file "${gpgenv}")"
+fi
+export GPG_AGENT_INFO
+export SSH_AUTH_SOCK # enable gpg-agent for ssh
# This file is sourced by bash for login shells. The following line
# runs your .bashrc and is recommended by the bash info pages.