#! /bin/csh -f
# Written by Furey.
# With additions from Tony.

# Set the port number.
set port = 2000
set logfile = ../log/output.log
if ( "$1" != "" ) set port="$1"

# Change to area directory.
# autokill 60 >> ../area/autokill.txt &
cd ../area

# Set limits.
nohup
nice
ulimit -c unlimited
#limit stack 1024k

while ( 1 )

    # Run merc.
    ../bin/AoH $port >&! $logfile

    if ( -e ../txt/shutdown.txt ) then
        rm -f ../txt/shutdown.txt
        exit 0
    endif
    sleep 5
end
