<DIV>&nbsp;</DIV>
<DIV>I didn't write these but they work great for me.</DIV>
<DIV>&nbsp;</DIV>
<DIV>First the startup script itself:</DIV>
<DIV>&nbsp;</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>&nbsp;</DIV>
<DIV>#!/bin/sh</DIV>
<DIV># Change into correct directory before starting<BR>echo 'Switching to /place/where/cod/is/installed directory...'<BR>cd&nbsp;/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>&nbsp;</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 &lt;t_chinnery@iprimus.com.au&gt;</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>&gt; #!/bin/bash<BR>&gt; <BR>&gt; echo cod_load.sh: Load Call of Duty With Screen<BR>&gt; <BR>&gt; cd /home/coduser/.callofduty<BR>&gt; <BR>&gt; echo cod_load.sh: Screen Call of Duty Detached Console<BR>&gt; <BR>&gt; screen -S cod -m -d ./cod.sh<BR>&gt; <BR>&gt; 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>&gt; #!/bin/bash<BR>&gt; <BR>&gt; echo cod.sh: Launching Call of Duty<BR>&gt; <BR>&gt; cd /usr/local/games/callofduty<BR>&gt; <BR>&gt; echo cod.sh: Loop Initialize<BR>&gt; while true<BR>&gt; do<BR>&gt; echo cod.sh: Loop Start<BR>&gt; echo
 cod.sh: To Exit Loop Hit CTRL-C While Sleeping<BR>&gt; sleep 5<BR>&gt; echo cod.sh: Server Start<BR>&gt; ./cod_lnxded +set dedicated 1 +set com_hunkMegs 128 +set com_zoneMegs 32 +exec serverexec.cfg<BR>&gt; echo cod.sh: Server Exit<BR>&gt; echo cod.sh: To Exit Loop Hit CTRL-C While Sleeping<BR>&gt; echo cod.sh: Sleep 15 Seconds<BR>&gt; sleep 15<BR>&gt; echo cod.sh: Loop Restart<BR>&gt; 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>&gt; Hi All<BR>&gt; <BR>&gt; Finally got my cod server running, running version 1.4.<BR>&gt; <BR>&gt; I start the server
 manually through ssh and whenever i log off ssh it closes<BR>&gt; the server so i want it to run as a service but my linux knowledge is pretty<BR>&gt; limited does any one havea script for doing thisor can point me in the right<BR>&gt; direction.<BR>&gt; <BR>&gt; Many thanks<BR>&gt; <BR>&gt; James<BR>&gt; <BR>&gt; <BR>&gt; </BLOCKQUOTE>