summaryrefslogtreecommitdiff
path: root/localserver/updatedb.sh
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-09-05 20:47:10 +0300
committerAndrei Karas <akaras@inbox.ru>2015-09-05 20:47:10 +0300
commitf3a3fd199083b5a11a71c9c159534e395bfef048 (patch)
treece6b9f26709ed1a8107fd55334b41ec7d6b256a9 /localserver/updatedb.sh
parent454ad75aaae91c0dac1d26b013c9e65c6734dda3 (diff)
downloadtools-f3a3fd199083b5a11a71c9c159534e395bfef048.tar.gz
tools-f3a3fd199083b5a11a71c9c159534e395bfef048.tar.bz2
tools-f3a3fd199083b5a11a71c9c159534e395bfef048.tar.xz
tools-f3a3fd199083b5a11a71c9c159534e395bfef048.zip
localserver: Add updatedb script
Diffstat (limited to 'localserver/updatedb.sh')
-rwxr-xr-xlocalserver/updatedb.sh24
1 files changed, 24 insertions, 0 deletions
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