-You can get cron to run a script that you have in the srcds directory. I
use screen and my script (stop_css) looks like this:

/usr/bin/screen -r css -X quit

-On cron, I run this script at 5 AM everyday:

0 5 * * * /etc/rc.d/css stop

-The css file looks like this:

#! /bin/sh
#
# /etc/rc.d/css
#
# run/stop CSS via screen

export SRCDS=/gamedisk/games/halflife/srcds

echo "SRCDS CS:S"
case "$1" in
    start)
        echo start
        su [username] -c 'cd /gamedisk/games/halflife/srcds ; ./start_css' >
/tmp/hlstartCSS.log
        ;;
    stop)
        echo stop
        su [username] -c 'cd /gamedisk/games/halflife/srcds ; ./stop_css'
        ;;
esac

-You must be root to enter the cron command. Notice that the script switches
to a different user. This is recommended for running a game server (don't
run as root).

These start and stop scripts in rc.d are also used to start and stop the
game servers when the system reboots or shuts down. There are links in rc3.d
and rc5.d - S19css and K02css - for this purpose.

Hope that helps.

.......Chuck
cgi...@compuserve.com
 

-----Original Message-----
From: hlds_linux-boun...@list.valvesoftware.com
[mailto:hlds_linux-boun...@list.valvesoftware.com] On Behalf Of Eric Riemers
Sent: Sunday, July 04, 2010 5:52 PM
To: 'Half-Life dedicated Linux server mailing list'
Subject: [hlds_linux] l4d2: how to shutdown via cron?

All,

Since these mutators are coming every now and then, i need to update all my
l4d2 instances.
These are forks so the nicest thing to do is a shutdown, then it updates it
and done.

However, I only know that I should telnet to the fork port and type in
"shutdown"

Is there a easy way I can setup something in cron to issue a shutdown each
day?

Eric


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux

Reply via email to