]> git.plutz.net Git - serve0/blobdiff - index2post.sh
helper script to synchronize index storages
[serve0] / index2post.sh
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