#!/bin/bash
#
# to setup startup map and gametype please check Server-TacticalOps.ini
# [URL]
# .
# .
# LocalMap=....
#

#
# GENERAL CONFIG
#
UTBINARY="$PWD/ucc-bin"
SLEEPTIME="10"
#
# if you use ucc to start set "server"
# else ""
#
UCCOPTIONS="server"

#
# dont use ~/.unrealtournament/
#
OPTIONS="-nohomedir"

#
# INI FILES
#
SERVERINI="Server-TacticalOps.ini"
USERINI="Server-User.ini"

#
# LOG OPTIONS
#
LOGPREFIX="TacticalOpsServer"
LOGDIR="../Logs"
SYSTEMLOGS="$LOGDIR/system"

while true; do
    SD=$(date +'%Y-%m-%dT%H-%M');
    CMDLINE="$UTBINARY $UCCOPTIONS -INI=$SERVERINI -USERINI=$USERINI -LOG=$SYSTEMLOGS/$LOGPREFIX-$SD.log $OPTIONS";

    echo $CMDLINE;
    nice $CMDLINE;

    echo -e "\n\nyou have 10s to kill this script\n\n";
    sleep $SLEEPTIME;
done
