]> git.plutz.net Git - serve0/commitdiff
helper script to synchronize index storages
authorPaul Hänsch <paul@plutz.net>
Mon, 13 Sep 2021 00:02:41 +0000 (02:02 +0200)
committerPaul Hänsch <paul@plutz.net>
Mon, 13 Sep 2021 00:02:41 +0000 (02:02 +0200)
index2post.sh [new file with mode: 0755]

diff --git a/index2post.sh b/index2post.sh
new file mode 100755 (executable)
index 0000000..5fdf9ca
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+REQUEST_METHOD=manual
+. "${_EXEC:-${0%/*}}/cgilite/cgilite.sh"
+. "${_EXEC}/cgilite/storage.sh"
+
+find "${_DATA}" -path '*/.index/meta' -exec cat '{}' + \
+| while read l w h t c n; do
+  printf '?op=add&select=%s' "/$(URL "$(UNSTRING "${n%$CR}")"*)"
+  printf "&tag=%s" $(printf %s "${t#tags=}" |tr , \  )
+  printf \\n
+done