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

This Month's Specials

ATF: Armored Task Force- Save $7.00
winSPMBT: Main Battle Tank- Save $5.00

   







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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old October 17th, 2006, 03:22 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

Im rather proud of this altho it will make others cringe at its ugliness. I wanted a way for people to check which games need players. Doing an "ls" of the game directory from a CGI was easy enough but I realized that instead of using "ls" of the directorys as fact that the game exists, I should use the "ps". Then starting a game will automatically cause it to show, and if a game finishes or crashes then it will automatically not appear. I also arranged for it to pull the port from the ps display and show that.
http://host.dom3minions.com/bin/blitz_chk.cgi

Code:

#!/bin/bash
echo "Content-type: text/html"
echo -e "\n\n"

echo "<H2><b>Dominions 3 Blitz games</b></H2>"
echo "These are 2-player games on tiny maps<br>"
echo '<a href="http://host.dom3minions.com/how-to.html">how to join a game</a><b
r><br>'


cd /home/dom3/dominions3/savedgames
ps ax |grep dom3|grep bl_ | \
while read n n n n n n game n port n n n n n n n n era n
do
echo "era $era game <b>$game</b> on port <b>$port</b><br>"
cd $game
for fyle in `ls -1 *.2h`
do
echo $fyle "<br>"
done
cd /home/dom3/dominions3/savedgames
echo "<br>"
done

__________________
-- 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
 

Bookmarks

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

Thread Tools
Display Modes

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 06:56 AM.


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