.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

ATF: Armored Task Force- Save $8.00
War Plan Pacific- Save $8.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 3: The Awakening

Reply
 
Thread Tools Display Modes
  #1  
Old November 15th, 2013, 01:59 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

OK another brain fart that worked out well...

Code:
#!/bin/bash

while [ ! -f ftherlnd ]

 do
   ls -1 *.2h |sort >list.txt

   if  ! diff list.txt oldlist.txt
   then
     zip -9 GodSaves *
     mv list.txt oldlist.txt
    else
     sleep 3
   fi
 done

figlet GAME START
What it does:
This is a script I can start in a games directory as soon as I have set it up for someone. It gets around the problem that pre.sh and post.sh do not activate for initial hosting.

It sits and watches for the fatherland file to exist (meaning the game has started and created its initial hosting).

If fatherland does NOT exist yet, then it watches for new pretender files (*.2h) to show up. And when a new one does then it updates the GodSave.zip file. As soon as the fatherland file appears, it shouts GAME START and quits running.

Im thinking of adding a no-clobber to the zip command to help insure first-come-first-served. Other people overwriting uploaded gods has been a problem in some games. And the recognition of fatherland could create the games first backup which has always been missing.

In any case it has proven quite useful in restarting bad starts without forcing people to re-upload their gods.
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
Reply With Quote
Reply

Bookmarks

Tags
admin, automation, command line, hosting, linux, script, server, switches


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 09:17 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.