about summary refs log tree commit diff
path: root/contrib/msign
diff options
context:
space:
mode:
authorJames Rowe <jnrowe@gmail.com>2020-11-08 20:26:19 +0000
committerLeah Neukirchen <leah@vuxu.org>2020-11-24 14:15:29 +0100
commitbc021c53b6d49032efab050a8f1f6b44804916ac (patch)
tree36083dce74a32f8001e1d390920e715732ffae98 /contrib/msign
parent6a8543e3215f73cffe08230fe64b45a86fc15681 (diff)
downloadmblaze-bc021c53b6d49032efab050a8f1f6b44804916ac.tar.gz
mblaze-bc021c53b6d49032efab050a8f1f6b44804916ac.tar.xz
mblaze-bc021c53b6d49032efab050a8f1f6b44804916ac.zip
Allow gpg and gpg2 executables for gnupg interaction
Closes: #193 [via git-merge-pr]
Diffstat (limited to 'contrib/msign')
-rwxr-xr-xcontrib/msign8
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/msign b/contrib/msign
index 7f23ab4..c21e2fc 100755
--- a/contrib/msign
+++ b/contrib/msign
@@ -3,6 +3,12 @@
 
 [ -f "$1" ] || exit 1
 
+if command -v gpg2 >/dev/null; then
+	GPG=gpg2
+else
+	GPG=gpg
+fi
+
 IFS='
 '
 
@@ -13,7 +19,7 @@ FROM=$(maddr -a -h from "$1" | sed 1q)
 [ "$FROM" ] && key="--default-key=$FROM"
 
 awk '/^$/,0' "$1" | mmime | sed 's/$/
/' >"$TMPD"/content
-gpg2 $key --armor --detach-sign -o "$TMPD"/signature.asc "$TMPD"/content ||
+$GPG $key --armor --detach-sign -o "$TMPD"/signature.asc "$TMPD"/content ||
 	exit $?
 
 {