Diff of /dist/restore/restore-standard.sh [000000] .. [19e22f] Maximize Restore

  Switch to side-by-side view

--- a
+++ b/dist/restore/restore-standard.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+# bbou@ac-toulouse;fr
+# 25/11/2013
+
+db=$1
+dbtype=standard
+modules="wn legacy vn bnc sumo xwn glf ilfwn logs"
+
+function process()
+{
+	if [ ! -e "$1" ];then
+		return
+	fi
+	echo "process $2"
+}
+
+function dbexists()
+{
+	return 0 
+}
+
+function deletedb()
+{
+	echo "delete ${db}"
+}
+
+function createdb()
+{
+	echo "create ${db}"
+}
+
+echo "restoring ${db}"
+
+#database
+if [ ! -z ${dbdelete} ]; then
+	deletedb
+fi
+if ! dbexists; then
+	createdb
+fi
+
+# module tables
+for m in ${modules}; do
+	sql=${dbtype}-${m}-schema.sql
+	process ${sql} schema ${db}
+done
+for m in ${modules}; do
+	sql=${dbtype}-${m}-data.sql
+	process ${sql} data ${db}
+done
+for m in ${modules}; do
+	sql=${dbtype}-${m}-constrain.sql
+	process ${sql} constrain ${db} --force
+done
+for m in ${modules}; do
+	sql=${dbtype}-${m}-views.sql
+	process ${sql} views ${db}
+done