summaryrefslogtreecommitdiff
path: root/localserver/updateconfigs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'localserver/updateconfigs.sh')
-rwxr-xr-xlocalserver/updateconfigs.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/localserver/updateconfigs.sh b/localserver/updateconfigs.sh
new file mode 100755
index 0000000..8c2688c
--- /dev/null
+++ b/localserver/updateconfigs.sh
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+export VER=$(cat versions/confver 2>/dev/null)
+export CONFDIR="../../server-data/"
+
+if [[ -z "${VER}" ]]; then
+ export VER="0"
+ mkdir versions
+fi
+
+if [ "${VER}" -lt "1" ]; then
+ cp -f ${CONFDIR}/conf/channels.conf ${CONFDIR}/conf/channels.conf.bak
+ cp -f ${CONFDIR}/conf/channels.conf.base ${CONFDIR}/conf/channels.conf
+fi
+
+if [ "${VER}" -lt "2" ]; then
+ rm ${CONFDIR}/conf/import/*.txt
+ cp conf/* ${CONFDIR}/conf/import
+ echo "2" >versions/confver
+fi
+
+if [ "${VER}" -lt "3" ]; then
+ cp conf/constants.conf ${CONFDIR}/conf/import/
+ echo "3" >versions/confver
+fi
+
+if [ "${VER}" -lt "4" ]; then
+ cp -f npc/motd-* ${CONFDIR}/npc/commands/
+ echo "4" >versions/confver
+fi
+
+if [ "${VER}" -lt "5" ]; then
+ cp -f ${CONFDIR}/conf/channels.conf ${CONFDIR}/conf/channels.conf.bak
+ cp -f ${CONFDIR}/conf/channels.conf.base ${CONFDIR}/conf/channels.conf
+ echo "5" >versions/confver
+fi