Step 6: Starting Your CoD2 Server
Create a .sh file with the following contents:
#!/bin/bash
sv_maxclients=“32″
fs_game=“your_mod_folder_here“
fs_homepath=“/home/USER_HERE/YOUR_COD_DIR“
cod=“/full/path/to/cod2_1_3_lnxded“
com_hunkMegs=“256″
config=“configfile.cfg“
net_port=“28960″
args=\
„+set fs_homepath \“$fs_homepath\“ „\
„+set fs_game $fs_game „\
„+set net_port $net_port „\
„+set com_hunkMegs $com_hunkMegs „\
„+set sv_maxclients $sv_maxclients „\
„+set fs_basepath \“$fs_homepath\“ „\
„+exec $config“
$cod $args +set g_gametype tdm +map mp_toujane
Adjust the variables to match your server setup.
Start the server using:
./filename.sh
Keeping the Server Running
To keep your server running after disconnecting from your SSH session, it is recommended to use screen:
screen -AmdS cod2
screen -x cod2
./filename.sh
