DV8R
11-26-2003, 05:58 PM
MAKE SURE YOU ARE NOT RUNNING A SERVER AT THE TIME YOU RUN THIS SCRIPT IT WILL START AN ADDITIONAL SERVER.
Heres the auto restart script I use for my linux box. You can also rename all the COD descriptions and use it for just about any game "I think..." Does work for MOHAA and all expansions as well.
Very simple to use just copy and paste the following into "2" seperate files and use note pad to save them as .sh files "or just rename them when they are on the server from .txt to .sh
Copy the following and make the appropriate changes dependign on your COD directory and (COD startup commands "+set blah blah" etc).
1st. File name mload.sh ===================
(Copy only the text in orange)
#!/bin/bash
echo mload.sh: Load Call of Duty With Screen
cd /home/virtual/
echo mload.sh: Screen Call of Duty Detached Console
screen -S COD -m -d ./mlds.sh
echo mload.sh: Finished Screen Command
Save the file as mload.sh and close.
2nd. File name mlds.sh ===================
(Copy only the text in orange)
#!/bin/bash
echo mlds.sh: Launching Call of Duty
cd /home/virtual/your root call of duty directory where the main folder is
echo mlds.sh: Loop Initialize
while true
do
echo mlds.sh: Loop Start
echo mlds.sh: To Exit Loop Hit CTRL-C While Sleeping
sleep 5
echo mlds.sh: Server Start
./cod_lnxded +set dedicated 2 +exec serverCOD.cfg
echo mlds.sh: Server Exit
echo mlds.sh: To Exit Loop Hit CTRL-C While Sleeping
echo mlds.sh: Sleep 15 Seconds
sleep 15
echo mlds.sh: Loop Restart
done
Save the file as mlds.sh and close.
Uploading the files================
Upload these 2 files to your Call of duty root directory where the main folder resides.
Use your shell program to access the server. Goto your root call of duty directory where the 2 files you just made reside and enter the following in the shell window....
./mload.sh
The window should say loading call of duty with screen blah blah and drop you to an empty line.
You can now close the shell program and if the server crashes it will restart by itself with out you having to screw around with it 98% of the time anyways. If it does crash and doesnt restart you have to type the following in the shell window:
ps -ef | grep root
and look for:
root 7341 1 0 16:24 ? 00:00:00 SCREEN -S COD -m -d ./mlds.sh
the above line is the one you look for to see if the server is running. If it is not youll notice a sleep5 or sleep 15 very near the above line. Simply type:
kill 7341
"for example your number will change every time you run the ./mload.sh" and the SCREEN command will shut down.
then make sure your in you COD root directory and issue the:
./mload.sh
command again and do a:
ps -ef | grep root
again to see if its still showing the sleep command. You may want to do the greep root 3 times to make sure its not going to run the sleep. If its not showing sleep then the COD server is up and running.
If you still get sleep after the 3 times kill the
SCREEN and check you mods and server cfg for problems.
Dont over complicate this its actually very simple just read slow and follow the directions and you will love this script.
Any questions reply and ill help ya get this going.
DV8R
TEAM WARZONE =]TW[=
www.teamwarzone.com
Heres the auto restart script I use for my linux box. You can also rename all the COD descriptions and use it for just about any game "I think..." Does work for MOHAA and all expansions as well.
Very simple to use just copy and paste the following into "2" seperate files and use note pad to save them as .sh files "or just rename them when they are on the server from .txt to .sh
Copy the following and make the appropriate changes dependign on your COD directory and (COD startup commands "+set blah blah" etc).
1st. File name mload.sh ===================
(Copy only the text in orange)
#!/bin/bash
echo mload.sh: Load Call of Duty With Screen
cd /home/virtual/
echo mload.sh: Screen Call of Duty Detached Console
screen -S COD -m -d ./mlds.sh
echo mload.sh: Finished Screen Command
Save the file as mload.sh and close.
2nd. File name mlds.sh ===================
(Copy only the text in orange)
#!/bin/bash
echo mlds.sh: Launching Call of Duty
cd /home/virtual/your root call of duty directory where the main folder is
echo mlds.sh: Loop Initialize
while true
do
echo mlds.sh: Loop Start
echo mlds.sh: To Exit Loop Hit CTRL-C While Sleeping
sleep 5
echo mlds.sh: Server Start
./cod_lnxded +set dedicated 2 +exec serverCOD.cfg
echo mlds.sh: Server Exit
echo mlds.sh: To Exit Loop Hit CTRL-C While Sleeping
echo mlds.sh: Sleep 15 Seconds
sleep 15
echo mlds.sh: Loop Restart
done
Save the file as mlds.sh and close.
Uploading the files================
Upload these 2 files to your Call of duty root directory where the main folder resides.
Use your shell program to access the server. Goto your root call of duty directory where the 2 files you just made reside and enter the following in the shell window....
./mload.sh
The window should say loading call of duty with screen blah blah and drop you to an empty line.
You can now close the shell program and if the server crashes it will restart by itself with out you having to screw around with it 98% of the time anyways. If it does crash and doesnt restart you have to type the following in the shell window:
ps -ef | grep root
and look for:
root 7341 1 0 16:24 ? 00:00:00 SCREEN -S COD -m -d ./mlds.sh
the above line is the one you look for to see if the server is running. If it is not youll notice a sleep5 or sleep 15 very near the above line. Simply type:
kill 7341
"for example your number will change every time you run the ./mload.sh" and the SCREEN command will shut down.
then make sure your in you COD root directory and issue the:
./mload.sh
command again and do a:
ps -ef | grep root
again to see if its still showing the sleep command. You may want to do the greep root 3 times to make sure its not going to run the sleep. If its not showing sleep then the COD server is up and running.
If you still get sleep after the 3 times kill the
SCREEN and check you mods and server cfg for problems.
Dont over complicate this its actually very simple just read slow and follow the directions and you will love this script.
Any questions reply and ill help ya get this going.
DV8R
TEAM WARZONE =]TW[=
www.teamwarzone.com