We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba13c18 commit a97b280Copy full SHA for a97b280
1 file changed
gpg-agent-placeholder
@@ -1,11 +1,16 @@
1
#!/bin/bash
2
+set -euo pipefail
3
-set -eo pipefail
4
-
5
-# 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.
6
if [ -e /run/qubes-service/split-gpg2-client ]; then
7
- exit 0
+ case "$@" in
8
+ *"--homedir $HOME/.gnupg "*)
9
+ exit 0
10
+ ;;
11
+ esac
12
fi
-# otherwise, launch gpg-agent
-gpgagent=$(gpgconf --list-components | grep ^gpg-agent: | cut -d ':' -f 3)
13
+
14
+# Otherwise, launch gpg-agent.
15
+gpgagent="$(gpgconf --list-components | awk -F: '/^gpg-agent:/{print $3}')"
16
exec "$gpgagent" "$@"
0 commit comments