Xonotic Forums
automatically including current (update) date in server name? - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Support (https://forums.xonotic.org/forumdisplay.php?fid=3)
+--- Forum: Xonotic - Server Administration (https://forums.xonotic.org/forumdisplay.php?fid=16)
+--- Thread: automatically including current (update) date in server name? (/showthread.php?tid=1534)



automatically including current (update) date in server name? - JayWalker - 01-29-2011

I want to run an automatically updated xonotic git server in Ubuntu Server 10.04. Having it update and compile should be easy enough in a startup script, ie:

Code:
./all update
./all compile
./all run dedicated

Two things I don't know how to do however:
1. Automatically update the server.cfg with the current date when the script is run (so it says something like "Xonotic git - updated <todays_date>".
2. Automatically reboot the server or kill/update/restart the git server at a specified time of day.

If anyone could help me with this it'd be much appreciated Smile


RE: automatically including current (update) date in server name? - Akari - 01-30-2011

1. Not tested, but something like this should work
Code:
echo "set builddate \"`date`\"" > ~/.xonotic/data/builddate.cfg
In config:
Code:
exec builddate.cfg
hostname "Awesome server (Updated at $builddate)"

2. You might use RCON (with rcon_secure 0):
Code:
rconpw=hackme
srvaddr=nexuiz.example.com
srvport=26000
printf "\377\377\377\377rcon %s quit" $rconpw | netcat -uc $srvaddr $srvport



RE: automatically including current (update) date in server name? - JayWalker - 02-03-2011

Example #1 did what I wanted, thanks for the help! Now I've got my git server is all set up Smile