[cod] startup script
Troy Chinnery
t_chinnery at iprimus.com.au
Thu May 20 00:26:43 EDT 2004
I nicked this from the [mohaa] list a while back, I think. I've adapted it to
run all my servers on linux, not just game servers too. (code quoted for effect).
cod_load.sh:
> #!/bin/bash
>
> echo cod_load.sh: Load Call of Duty With Screen
>
> cd /home/coduser/.callofduty
>
> echo cod_load.sh: Screen Call of Duty Detached Console
>
> screen -S cod -m -d ./cod.sh
>
> echo cod_load.sh: Finished Screen Command
You could put that executable in /usr/bin or just in /home/coduser (Don't
forget to set the executable bit (chmod ugo+x cod_load.sh)
cod.sh:
> #!/bin/bash
>
> echo cod.sh: Launching Call of Duty
>
> cd /usr/local/games/callofduty
>
> echo cod.sh: Loop Initialize
> while true
> do
> echo cod.sh: Loop Start
> echo cod.sh: To Exit Loop Hit CTRL-C While Sleeping
> sleep 5
> echo cod.sh: Server Start
> ./cod_lnxded +set dedicated 1 +set com_hunkMegs 128 +set com_zoneMegs 32 +exec serverexec.cfg
> echo cod.sh: Server Exit
> echo cod.sh: To Exit Loop Hit CTRL-C While Sleeping
> echo cod.sh: Sleep 15 Seconds
> sleep 15
> echo cod.sh: Loop Restart
> done
Set dedicated to 2 for an Internet server of course. Pretty elegant solution
to auto restarting the server as well.
Can type 'screen -r cod' to get to the CoD console, and hit ctrl+a,d to detach
it again. I've seen far more complex ones do pretty much the same thing. But
for more features, like log archiving etc etc you would need something a
little more complex at least.
--
Nevyn.
James Casey - DigitalNetwork Limited wrote:
> Hi All
>
> Finally got my cod server running, running version 1.4.
>
> I start the server manually through ssh and whenever i log off ssh it closes
> the server so i want it to run as a service but my linux knowledge is pretty
> limited does any one havea script for doing thisor can point me in the right
> direction.
>
> Many thanks
>
> James
>
>
>
More information about the Cod
mailing list