[cod] cod4 auto server restart script

Bong-Master bong-master at 22ndsas.org.uk
Thu Dec 13 08:07:58 EST 2007


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
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Cod4.sh
URL: <http://icculus.org/pipermail/cod/attachments/20071213/1b1d2d11/attachment.diff>


More information about the Cod mailing list