aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Kavanagh <rak@debian.org>2013-07-25 08:19:51 -0400
committerRyan Kavanagh <rak@debian.org>2013-07-25 08:45:10 -0400
commitcc3dd67078ef1ccb53c4fbc59e246e71051c4421 (patch)
tree6ac5964c107e0af8acacb8b596766ab0e12997a6
parentAdded my stopaudio script (diff)
Added a colouriser for gpg
-rwxr-xr-xbin/gpg-check17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/gpg-check b/bin/gpg-check
new file mode 100755
index 0000000..79948c9
--- /dev/null
+++ b/bin/gpg-check
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+MSG=$(cat)
+
+echo "${MSG}" | grep 'BEGIN PGP SIGNATURE' > /dev/null 2>&1;
+SIGNED=$?
+
+if [ ${SIGNED} = 0 ]; then
+ echo "${MSG}" | \
+ sed -e '/^-\+BEGIN PGP SIGNED MESSAGE-\+/,/^Hash:.*/d' \
+ -e '/^-\+BEGIN PGP SIGNATURE-\+/,$d' | \
+ mutt-autoalias
+ echo '\n'
+ echo "${MSG}" | gpg --verify - 2>&1;
+else
+ echo "${MSG}" | mutt-autoalias
+fi