#!/bin/bash
#
# The old script was very complicated. So I whipped this up
# to keep it simple. You can put any map you want the server
# to start on in the MAP variable. I recommend starting screen,
# running this, then disconnecting from screen.
#
# The script will keep logs in the ~/.loku/ut/System directory
# and name them according to when the server last was killed/crashed.
#
# The Linux UT Dedicated server uses the ini files in ~/.loki/ut/System
# An NE server only uses two ini files. The NightsEdgeServer.ini, which
# contains the server settings and playmode settings, and the User.ini,
# which is used for bot names basically. You can use the web interface for
# most things (such as map list and server info), but you'll need to edit
# the NightsEdgeServer.ini to change the preptimes, starting money, etc.
# You only need to change the info under [NightsEdge.Playmode<XXX>] where
# <XXX> is a playmode type. And you need to have as many spectator slots
# as players you plan to allow. People who join the server join as a
# spectator first.
#
# I recommend uping the starting cash and preptime for new players since
# they are going to want to pull out the big guns early and will need some
# time to get used to the menu system.
#
# Be sure to check out the NE home page http://www.rps.net/NE for more
# information and feel free to contact Bad Mojo (mojo@rps.net) via e-mail
# or on the NE forums for questions about running a server.
#
# -Bad Mojo
#


MAP=NE-WW-Canyon
LUTD=~/.loki/ut/System

while (true);
 do
  SD=`date +'%Y%m%d%H%M'`
  /usr/local/games/ut/ucc server $MAP?game=NightsEdge.NEGame \
  PORT=7777 INI=NightsEdgeServer.ini LOG=NE-$SD.log
  ED=`date +'%Y%m%d%H%M'`
  mv $LUTD/NE-$SD.log $LUTD/NE-$SD-$ED.log
 done

