Thread: Utility Linux Admining
View Single Post
  #59  
Old April 18th, 2010, 10:39 PM
Gandalf Parker's Avatar

Gandalf Parker Gandalf Parker is offline
Shrapnel Fanatic
 
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
Gandalf Parker is on a distinguished road
Default Re: Linux Admining

Whenever anyone requests a game I copy a script from another game and edit it. Whenever I see some of the always open public games have been taken I run a script to create another to take its place. Many of those involved special variables unique to that game, or even randomly decided features. So restarting games was rather a pain.

Recently I had one of the head-slapping *DOH* moments. While the script creating the game is running have it record the settings. So now each script writes the long start command to the game directory into a script named restart.sh

So now, when the machine reboots, all that needs done is
Code:
#!/bin/bash
cd ~/dominions3/savedgames

for fyle in `ls */restart.sh`
do
   $fyle
   sleep 10s
done
Ive extended the gap to 10 seconds between each restart. My first effort with no gap restarted 70 games within a minute. 24 hours later about 50 of them tried to host at the same time. Not good. Then I set it too long but even a 1minute gap would mean over an hour before all the games would be restarted. So for now Im trying 10s.

Last edited by Gandalf Parker; April 18th, 2010 at 10:56 PM..
Reply With Quote