#!/bin/tcsh
#
#  Just loops running the server.
#  You can use the STOP.tfc file to stop the server at certain times.. e.g.
#  to stop it:  crontab the creation of STOP.tfc and a server quit.
#  to start it: crontab the deletion of STOP.tfc
#
set g = tfc	

set p = ""
set i = ""
#set p = "-port 27016"		# edit and uncomment if desired
#set i = "+ip 127.0.0.1"	# edit and uncomment if desired

setenv LD_LIBRARY_PATH .
while (1)
    if ( -e STOP.$g ) then
	sleep 60
    else
	./hlds_l -game $g $i $p +map well | ./hllog.pl $g/log $g/map.cfg
	sleep 10
    endif
end
