]> gitweb.fluxo.info Git - scripts.git/commitdiff
Adds keyringer-export-pads
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 6 Dec 2018 17:08:06 +0000 (15:08 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 6 Dec 2018 17:08:06 +0000 (15:08 -0200)
keyringer-export-pads [new file with mode: 0755]

diff --git a/keyringer-export-pads b/keyringer-export-pads
new file mode 100755 (executable)
index 0000000..34837cb
--- /dev/null
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+#
+# Export etherpad content into a keyring.
+# This is currently too specific to be added into keyringer tree.
+#
+
+# Load functions
+#LIB="`dirname $0`/../functions"
+#source "$LIB" maintenance $* || exit 1
+
+# Parameters
+KEYRING="$1"
+BASENAME="`basename $0`"
+
+# Check
+if [ -z "$KEYRING" ]; then
+  echo "usage: $BASENAME <keyring>"
+  exit 1
+fi
+
+# Dispatch
+for pad in `keyringer $KEYRING ls pads/urls`; do
+  echo "Exporting $pad..."
+  torify curl `keyringer $KEYRING decrypt pads/urls/$pad main 2> /dev/null`/export/txt | keyringer $KEYRING encrypt pads/exports/$pad
+done