summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--localserver/README1
-rwxr-xr-xlocalserver/updatedb.sh24
2 files changed, 25 insertions, 0 deletions
diff --git a/localserver/README b/localserver/README
index 4b00c4e..04ea81d 100644
--- a/localserver/README
+++ b/localserver/README
@@ -5,6 +5,7 @@ build.sh - build server from sources.
givegm.sh - give gm rights to first account created on server.
initdb.sh - initialize mariadb database.
installconfigs.sh - install configurations into server data directory.
+updatedb.sh - update if need sql database
See also http://wiki.evolonline.org/guidelines/installmariadb
http://wiki.evolonline.org/guidelines/localserver
diff --git a/localserver/updatedb.sh b/localserver/updatedb.sh
new file mode 100755
index 0000000..1d641c2
--- /dev/null
+++ b/localserver/updatedb.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+export VER=$(cat versions/sqlver 2>/dev/null)
+export SQLDIR="../../server-data/sql-files/"
+export CMD="mysql -u evol -pevol evol"
+
+function run {
+ echo "Running $1"
+# $CMD <$1
+}
+
+if [[ -z "${VER}" ]]; then
+ export VER="1"
+fi
+
+if [ "${VER}" -lt "2" ]; then
+ run "2015-07-02--18-14.sql"
+ run "2015-07-08--13-08.sql"
+ run "2015-08-27--20-42.sql"
+fi
+
+if [ "${VER}" -lt "2" ]; then
+ echo "2" >versions/sqlver
+fi