[cod] cod4 auto server restart script

admin at teamhost.co.uk admin at teamhost.co.uk
Thu Dec 13 09:20:41 EST 2007


Hi,

Thanks I'll give this a go.

Dan

-----Original Message-----
From: Bong-Master [mailto:bong-master at 22ndsas.org.uk] 
Sent: 13 December 2007 13:08
To: cod at icculus.org
Subject: Re: [cod] cod4 auto server restart script

admin at teamhost.co.uk wrote:
>
> Hi Guys,
>
> I'm trying to find a script that will auto restart cod4 servers when 
> someone types rcon quit. Please advise?
>
> Kind Regards,
>
> Daniel
> TeamHost Administrator
> Website: http://www.teamhost.co.uk
>
> Support: http://support.teamhost.co.uk
>
> Forums: http://forums.teamhost.co.uk
>
> Tel: 0870 922 0545
>
i use this
#! /bin/bash

function savelog
{
echo saving log
DATE=$(date +%Y%m%d%H%M)
LOGSAVE=qconsole-$DATE.log

# ensure file does not exist
while [ -e $LOGSAVE ]; do
DATE=$DATE1
LOGSAVE=qconsole-$DATE.log
done
echo moving $LOGDIR/qconsole.log to $LOGDIR/$LOGSAVE
mv $LOGDIR/qconsole.log $LOGDIR/$LOGSAVE
}

LOGDIR=logs/main

touch loop
i
if [ -e $LOGDIR/qconsole.log ]; then
savelog;
fi

while [ -e loop ]; do

./cod4_lnxded2 +set fs_homepath /your/path/to/MW +set dedicated 2 +set 
net_ip xxxxxxxxxx +set net_port 28960 +set ttycon 0 +set sv_punkbuster 1 
+set fs_basepath /your/path/to/MW +exec cod4server.cfg +map_rotate



savelog
done

Attached is the .sh file that i use edit with vim 
http://www.vim.org/download.php

P.s Mak Sure You Edit The File With Vim ONLY anything else will mess the 
file up.

to start the .sh file use ./Cod4.sh &
to kill you will need to kill the Cod4.sh & the cod4_lnxded as well if 
you get my drift




More information about the Cod mailing list