#!/bin/sh
############################
#                          #
#  Runtime options         #
#                          #
############################
#
# Enter the path to the 
# desired ini-file here
INI_FILE=/opt/ut/ini/tacops.ini

# The Path to your ucc executable
UCC_PATH=/opt/ut/tacops

# The Mutators you want to use.
# Giva a comma separated list or
# leave the variable empty if you
# don't want to use mutators.
# Example:
# MUTATOR=Assault.BonusPack.EavyAssaultPlus
# MUTATOR=

# The Game you want to play
# Leave this empty if you want to play the
# default game.
# Possible Values are:
#  BotPack.DeathMatchPlus
#  BotPack.TeamGamePlus
#  BotPack.Assault
#  BotPack.Domination
#  BotPack.CTFGame
#  BotPack.LastManStanding
#
# Example for Tactical Ops:
#  GAME=s_SWAT.s_SWATGame
#
# Example for Assault:
#  GAME=Botpack.Assaut
# 
GAME=s_SWAT.s_SWATGame

# The Map you want to start with
# Leave this variable empty
# if you want to start the
# default map
MAP=TO-Monastery

############################
#                          #
#   Logfile options        #
#                          #
############################
#
# The Path to your logfiles
LOGFILE_PATH=/opt/ut/logs
#
# The name of the logfile of the
# currently running game
# Don't enter a path here !
CURRENT_LOGFILE=tacops.running
#
# The name of the logfiles
# when the server crashed
# Don't enter a path here !
# Date is automatically appended
CRASH_LOGFILE=tacops.crash
#
############################
#                          #
# Only play around after   #
# this point if you know   #
# what you're doing !      #
#                          #
############################
if [ -n "$MUTATOR" ]; then
 MUTATOR="?mutator=$MUTATOR"
fi

if [ -n "$GAME" ]; then
 GAME="?game=$GAME"
fi

echo $GAME
echo $MUTATOR

while true
do

cd $UCC_PATH
./ucc server $MAP$GAME$MUTATOR ini=$INI_FILE multihome=`/sbin/ifconfig eth0|grep inet|cut -b 21-34` > $LOGFILE_PATH/$CURRENT_LOGFILE
DATE=`date "+%d.%m.%Y_%H.%M.%S"`
cat $LOGFILE_PATH/$CURRENT_LOGFILE > $LOGFILE_PATH/$CRASH_LOGFILE.$DATE
sleep 10

done

