summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgpg-agent.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/gpg-agent.sh b/gpg-agent.sh
index 801c40b..356af6b 100755
--- a/gpg-agent.sh
+++ b/gpg-agent.sh
@@ -12,8 +12,9 @@
initgpg(){
[[ -z $XDG_CONFIG_HOME ]] && XDG_CONFIG_HOME="$HOME/.config"
[ -f "$XDG_CONFIG_HOME/disable-gpg-agent" ] && return 0
- if [[ ! -S "$HOME/.gnupg/S.gpg-agent.ssh" ]]; then
- pkill gpg-agent
+ #if [[ ! -S "$HOME/.gnupg/S.gpg-agent.ssh" ]]; then
+ if ! pgrep -u ${SUDO_USER:-$USER} -x gpg-agent >/dev/null; then
+ #pkill gpg-agent
/usr/bin/gpg-agent --daemon --enable-ssh-support --use-standard-socket >/dev/null
fi
export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh