summaryrefslogtreecommitdiff
path: root/dumps/load-dumps.sh
diff options
context:
space:
mode:
Diffstat (limited to 'dumps/load-dumps.sh')
-rwxr-xr-xdumps/load-dumps.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/dumps/load-dumps.sh b/dumps/load-dumps.sh
new file mode 100755
index 0000000..7695a40
--- /dev/null
+++ b/dumps/load-dumps.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+pushd $(dirname $0) >> /dev/null
+cat .mapping | while read DB DUMP
+do
+ grep -v 'CREATE DATABASE' $DUMP | grep -vi '^Use ' | mysql ${LIGA_MYSQL_CONNECTION_OPTS} $DB
+ if [ "$DB" != "dmp202021_e" ]
+ then
+ <logoh.sql mysql ${LIGA_MYSQL_CONNECTION_OPTS} $DB
+ else
+ <logoh.en.sql mysql ${LIGA_MYSQL_CONNECTION_OPTS} $DB
+ fi
+ cat .queries | while read -r QUERY
+ do
+ mysql ${LIGA_MYSQL_CONNECTION_OPTS} -N -e "$QUERY" $DB
+ done
+done
+popd >> /dev/null