<DIV> </DIV>
<DIV>I didn't write these but they work great for me.</DIV>
<DIV> </DIV>
<DIV>First the startup script itself:</DIV>
<DIV> </DIV>
<DIV>#!/bin/sh</DIV>
<DIV>screen -d -m -S cod1 ./mohcod_run +set fs_homepath ./ +set fs_basepath ./ +set fs_game pam +set comzoneMegs 32 +set vm_game 0 +set ttycon 0 +exec codserver.cfg +map mp_stalingrad<BR></DIV>
<DIV>Now the script that calls that script:</DIV>
<DIV> </DIV>
<DIV>#!/bin/sh</DIV>
<DIV># Change into correct directory before starting<BR>echo 'Switching to /place/where/cod/is/installed directory...'<BR>cd /place/where/cod/is/installed</DIV>
<DIV># If the server was currently running shut it down first<BR>./cod_shutdown</DIV>
<DIV>echo 'Pausing 5 seconds..'<BR># Delay while server shutting down<BR>sleep 5</DIV>
<DIV>echo 'Starting up CoD server..'<BR># Startup the server<BR>./mohcod.sh<BR></DIV>
<DIV>And now the shutdown script:</DIV>
<DIV> </DIV>
<DIV>#!/bin/sh</DIV>
<DIV># Shutdown the screen process named cod<BR>echo 'Shutting down CoD server..'<BR>screen -r cod1 -X quit<BR></DIV>
<DIV><BR><BR><B><I>Troy Chinnery <t_chinnery@iprimus.com.au></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">I nicked this from the [mohaa] list a while back, I think. I've adapted it to <BR>run all my servers on linux, not just game servers too. (code quoted for effect).<BR><BR>cod_load.sh:<BR>> #!/bin/bash<BR>> <BR>> echo cod_load.sh: Load Call of Duty With Screen<BR>> <BR>> cd /home/coduser/.callofduty<BR>> <BR>> echo cod_load.sh: Screen Call of Duty Detached Console<BR>> <BR>> screen -S cod -m -d ./cod.sh<BR>> <BR>> echo cod_load.sh: Finished Screen Command<BR><BR>You could put that executable in /usr/bin or just in /home/coduser (Don't <BR>forget to set the executable bit (chmod ugo+x cod_load.sh)<BR><BR>cod.sh:<BR>> #!/bin/bash<BR>> <BR>> echo cod.sh: Launching Call of Duty<BR>> <BR>> cd /usr/local/games/callofduty<BR>> <BR>> echo cod.sh: Loop Initialize<BR>> while true<BR>> do<BR>> echo cod.sh: Loop Start<BR>> echo
cod.sh: To Exit Loop Hit CTRL-C While Sleeping<BR>> sleep 5<BR>> echo cod.sh: Server Start<BR>> ./cod_lnxded +set dedicated 1 +set com_hunkMegs 128 +set com_zoneMegs 32 +exec serverexec.cfg<BR>> echo cod.sh: Server Exit<BR>> echo cod.sh: To Exit Loop Hit CTRL-C While Sleeping<BR>> echo cod.sh: Sleep 15 Seconds<BR>> sleep 15<BR>> echo cod.sh: Loop Restart<BR>> done<BR><BR>Set dedicated to 2 for an Internet server of course. Pretty elegant solution <BR>to auto restarting the server as well.<BR>Can type 'screen -r cod' to get to the CoD console, and hit ctrl+a,d to detach <BR>it again. I've seen far more complex ones do pretty much the same thing. But <BR>for more features, like log archiving etc etc you would need something a <BR>little more complex at least.<BR><BR>--<BR>Nevyn.<BR><BR><BR>James Casey - DigitalNetwork Limited wrote:<BR><BR>> Hi All<BR>> <BR>> Finally got my cod server running, running version 1.4.<BR>> <BR>> I start the server
manually through ssh and whenever i log off ssh it closes<BR>> the server so i want it to run as a service but my linux knowledge is pretty<BR>> limited does any one havea script for doing thisor can point me in the right<BR>> direction.<BR>> <BR>> Many thanks<BR>> <BR>> James<BR>> <BR>> <BR>> </BLOCKQUOTE>