Code: Select all
#!/bin/sh
tron="/path/to/bin/armagetronad-dedicated"
var="/path/to/var/"
log="${var}console_log.txt"
userconfigdir="/path/to/config/"
parser="/path/to/parser.php"
ladderlog="${var}ladderlog.txt"
tail -n0 -f -s 0.01 $ladderlog | $parser | $tron --userconfigdir $userconfigdir --vardir $var | tee -a $log
Code: Select all
#!/bin/bash
loc="/home/armagetronad"
mkdir $loc/logs/$1
screen -S $1 -X logtstamp on # print timestamps in log file
screen -S $1 -X logfile $loc/logs/$1/$1_%m-%d-%Y-%c.log # create a logfile in the logs subf
screen -S $1 -X log on # Turn on logging for the server window
while true; do # start a loop to allow server restart if it crashes
# runs the actual server. By default, the binary is called armagetronad-dedicated and is located in the prefix/bin directory. In this example, it is
# in /home/armagetronad/bin directory.
$loc/bin/armagetronad-dedicated --vardir $loc/servers/$1/var
# Shows the errors and indicates that the server has crashed, and then, waits 5 seconds before restarting the server, allowing you to quit with CTRL-C
echo "Server has crashed. It will restart immediately..., press CTRL-C to cancel"
sleep 5
done # end the loop