]> gitweb.fluxo.info Git - scripts.git/commitdiff
Adding lsign script
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 5 Feb 2014 01:05:08 +0000 (23:05 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 5 Feb 2014 01:05:08 +0000 (23:05 -0200)
lsign [new file with mode: 0755]

diff --git a/lsign b/lsign
new file mode 100755 (executable)
index 0000000..e1ceb3d
--- /dev/null
+++ b/lsign
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Locally sign an OpenPGP key.
+#
+
+# Parameters
+BASENAME="`basename $0`"
+NAME="$1"
+set -e
+
+# Syntax check
+if [ -z "$NAME" ]; then
+  echo "usage: $BASENAME <key>"
+  exit 1
+fi
+
+# Optional reason
+read -e -p 'Optional lsignreason notation: ' REASON 
+
+# Local signature
+if [ ! -z "$REASON" ]; then
+  gpg --lsign --ask-cert-expire "$NAME"
+else
+  gpg --lsign --cert-notation "lsigreason@notations.openpgp.fifthhorseman.net=${REASON}" --ask-cert-expire "$NAME"
+fi