aboutsummarylogtreecommitdiffstats
path: root/dom4-server
blob: e8537794cc11bae9ddb3e6bbb89e7b029ac054d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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