summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/reevotech/GenerateSubCategories.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/bin/reevotech/GenerateSubCategories.sh b/bin/reevotech/GenerateSubCategories.sh
new file mode 100755
index 00000000..204b7b2c
--- /dev/null
+++ b/bin/reevotech/GenerateSubCategories.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+# ----
+# Copyright (C) 2013-2020 - Reevo Project (http://reevo.org)
+# License: Affero GPL version 3 - http://www.gnu.org/licenses/agpl.html
+# ES: Este archivos es parte de: reevo-web (http://git.reevo.org/reevo/reevo-web)
+# EN: This file is part of: reevo-web (http://git.reevo.org/reevo/reevo-web)
+# ----
+# Use:GenerteSubCategories.sh deployment listado_de_subcategorias categoria_padre
+
+if [ -z $1 ];
+then
+ echo "Use: ./GenerteSubCategories.sh deployment listado_de_subcategorias.txt categoria_padre"
+ exit
+fi
+
+
+DEPLOY=$1
+FILE=$2
+PARENT=$3
+TEMP="/tmp/cats"
+
+sed 's/ /_/g' $FILE > $TEMP
+sed -i 's/^/Category:/g' $TEMP
+sed -i 's/$/.mw/g' $TEMP
+
+cd /srv/reevotech
+
+for i in `cat $TEMP`; do
+ echo "[[Category:$PARENT]]" > "www/wiki/deployments/$DEPLOY/pages/Category/$i"
+done