Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions gpg-agent-placeholder
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#!/bin/bash
set -euo pipefail

set -eo pipefail

# prevent starting real gpg-agent locally if it's redirected via split-gpg2
# Prevent starting real gpg-agent locally if it's redirected via split-gpg2,
# which only uses the default GnuPG home directory.
if [ -e /run/qubes-service/split-gpg2-client ]; then
exit 0
case "$@" in
*"--homedir $HOME/.gnupg "*)
exit 0
;;
esac
fi
# otherwise, launch gpg-agent
gpgagent=$(gpgconf --list-components | grep ^gpg-agent: | cut -d ':' -f 3)

# Otherwise, launch gpg-agent.
gpgagent="$(gpgconf --list-components | awk -F: '/^gpg-agent:/{print $3}')"
exec "$gpgagent" "$@"