[cod] monitoring the server?
Dave Whitney
whitney321 at yahoo.com
Mon May 29 19:35:41 EDT 2006
egads, I'm starting to understand that gibberish... woot!
Thanks much!
Dave
Walker <walkertje at gmail.com> wrote: Hi there,
check out the tool kkrcon (http://kkrcon.sourceforge.net/) and this script.
I'm not using it, just found it once and thought it might come in handy some time...
Hope it helps.
#!/bin/sh
tf1="temp1"
kkrcon.pl -a instertserverip -p insertserverport -t old insertrconpassword status > $tf1
# total number of lines in output
tnl=`wc $tf1 | awk '{print $1}' `
# tnl=1 - server doesnt respond. crash/wrong ip/port
# tnl=2 - bad password
# tnl=5 - server empty
if [ "$tnl" -le 1 ]; then
sleep 30
# lets try again, in case server was restarting map
kkrcon.pl -a insertserverip -p insertserverport -t old insertrconpassword status > $tf1
tnl=`wc $tf1 | awk '{print $1}' `
if [ "$tnl" -le 1 ]; then
# no. server is really down
serverpid=`ps auxw | grep serverstartfilenamehere | grep -v grep | awk '{print $2}'`
if [ -z "$serverpid" ]; then
cd /serverstartupfolderhere
./serverstartcommandlinehere
else
kill $serverpid
sleep 10
cd /serverstartupfolderhere
./serverstartcommandlinehere
fi
fi
fi
#EOF
---------------------------------
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail Beta.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/cod/attachments/20060529/eeeef6e8/attachment.htm>
More information about the Cod
mailing list