]> arthur.barton.de Git - ax-zsh.git/commitdiff
gnupg: Don't fiddle with gpg-agent that much
authorAlexander Barton <alex@barton.de>
Mon, 30 Oct 2017 00:11:50 +0000 (01:11 +0100)
committerAlexander Barton <alex@barton.de>
Mon, 30 Oct 2017 00:13:46 +0000 (01:13 +0100)
This isn't necessary with GnuPG 2.1.x and newer.

plugins/gnupg/README.md
plugins/gnupg/gnupg.zshrc

index 14883353d383a0c5aff79ceadcef1c0699d64085..dfee8df219ecb6cad88f811cc10109ca9830f9cd 100644 (file)
@@ -6,7 +6,6 @@ starting a new one.
 
 - `gpg2`: use the same completions than for `gpg`.
 - When `gpg` isn't installed but `gpg2` is, alias it to `gpg`, too.
-- Store "agent information" in `$HOME/.gnupg/agent.info-$HOST:$DISPLAY`.
 
 ### Command Aliases
 
index 431b16a8709f9c6a4c390a318b63062b4401d975..e4be6780b64cf0f30fed897c4836b11bd96b3ae8 100644 (file)
@@ -16,25 +16,7 @@ fi
 
 export GPG_TTY=$(tty)
 
-agent_info_file="$HOME/.gnupg/agent.info-${HOST}"
-
-# Validate agent info ...
-if [[ -n "$GPG_AGENT_INFO" ]]; then
-       gpg-agent >/dev/null 2>&1 || unset GPG_AGENT_INFO
-fi
-
-# Read environment file, when available and agent info not already set.
-if [[ -z "$GPG_AGENT_INFO" && -r "$agent_info_file" ]]; then
-       source "$agent_info_file" 2>/dev/null
-       [[ -n "$GPG_AGENT_INFO" ]] && export GPG_AGENT_INFO
+if (( $+commands[gpg-connect-agent] )); then
+       # Try to start/connect the agent ...
+       gpg-connect-agent /bye
 fi
-
-# Setup GnuPG agent when installed.
-if (( $+commands[gpg-agent] )); then
-       # Start up a new GnuPP agent, when none is running/accessible:
-       if ! gpg-agent >/dev/null 2>&1; then
-               eval $(gpg-agent --daemon --write-env-file "$agent_info_file")
-       fi
-fi
-
-unset agent_info_file