From 503a1810a86a347dd3c8ff4eaf38fffabd6e9acd Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 26 May 2021 11:36:07 +0200 Subject: Add mutt-gpg-config-namespaced.sh Signed-off-by: Florian Pritz --- mutt-gpg-config-namespaced.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 mutt-gpg-config-namespaced.sh (limited to 'mutt-gpg-config-namespaced.sh') 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 #" -- cgit v1.2.3-24-g4f1b