summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmutt-gpg-config-namespaced.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/mutt-gpg-config-namespaced.sh b/mutt-gpg-config-namespaced.sh
new file mode 100755
index 0000000..5921436
--- /dev/null
+++ b/mutt-gpg-config-namespaced.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Add a --trustdb-name namespace to the gpg config options for mutt.
+# Use like this in muttrc:
+# source "mutt-gpg-config-namespaced /etc/Muttrc.gpg.dist foo"|
+
+set -eu
+
+sourcefile=$1
+dbname=$2
+
+grep -E -v "^\s*(#|$)" "$sourcefile" \
+ | grep 'command=' \
+ | sed "s#gpg #gpg --trustdb-name=$dbname #"