#!/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