aboutsummarylogtreecommitdiffstats
path: root/dom4-server
diff options
context:
space:
mode:
Diffstat (limited to 'dom4-server')
-rwxr-xr-xdom4-server31
1 files changed, 31 insertions, 0 deletions
diff --git a/dom4-server b/dom4-server
new file mode 100755
index 000000000000..e8537794cc11
--- /dev/null
+++ b/dom4-server
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+game=`cat /usr/share/dom4/current`
+
+if [[ -z "$game" ]]; then
+ echo "No game specified. Use 'dom4 config' to load a game configuration."
+ exit 1
+fi
+
+if [[ ! -s /usr/share/dom4/config/$game.properties ]]; then
+ echo "Tried to load $game but configuration file is missing."
+ exit 1
+fi
+
+# Load config
+
+config="--tcpserver --textonly --noclientstart"
+
+while read -r line; do
+ if [[ -n $line && ! $line = \#* ]]; then
+ echo "Setting $line"
+
+ config="$config --$line"
+ fi
+done < /usr/share/dom4/config/$game.properties
+
+# Start server
+
+export DOM4_CONF=/usr/share/dom4
+
+exec sh /opt/Dominions4/dom4.sh $config $game