diff --git a/7DaysToDie/sdtdserver b/7DaysToDie/sdtdserver index 1e5bca25e..1b554719c 100644 --- a/7DaysToDie/sdtdserver +++ b/7DaysToDie/sdtdserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/ARKSurvivalEvolved/arkserver b/ARKSurvivalEvolved/arkserver index bc4c53812..f96e49bf2 100644 --- a/ARKSurvivalEvolved/arkserver +++ b/ARKSurvivalEvolved/arkserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/Arma3/arma3server b/Arma3/arma3server index b132595a5..083e4ea13 100644 --- a/Arma3/arma3server +++ b/Arma3/arma3server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/Battlefield1942/bf1942server b/Battlefield1942/bf1942server index d011e57ac..25ea4291d 100644 --- a/Battlefield1942/bf1942server +++ b/Battlefield1942/bf1942server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/BlackMesa/bmdmserver b/BlackMesa/bmdmserver index 025374c70..ea25b01f8 100644 --- a/BlackMesa/bmdmserver +++ b/BlackMesa/bmdmserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/BladeSymphony/bsserver b/BladeSymphony/bsserver index 5e1a91654..fed7213e3 100644 --- a/BladeSymphony/bsserver +++ b/BladeSymphony/bsserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/BrainBread2/bb2server b/BrainBread2/bb2server index 977e60025..ee8f3c4e3 100644 --- a/BrainBread2/bb2server +++ b/BrainBread2/bb2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## @@ -41,7 +41,7 @@ gslt="" ## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters # Edit with care | https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server fn_parms(){ -parms="-game brainbread2 -insecure -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +parms="-game brainbread2 -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" } #### LinuxGSM Settings #### diff --git a/CallOfDuty/codserver b/CallOfDuty/codserver index 8bf07b570..093c375a6 100755 --- a/CallOfDuty/codserver +++ b/CallOfDuty/codserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/CallOfDuty2/cod2server b/CallOfDuty2/cod2server index 49a32f1e5..48b43b34d 100755 --- a/CallOfDuty2/cod2server +++ b/CallOfDuty2/cod2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/CallOfDuty4/cod4server b/CallOfDuty4/cod4server new file mode 100644 index 000000000..d77707606 --- /dev/null +++ b/CallOfDuty4/cod4server @@ -0,0 +1,188 @@ +#!/bin/bash +# Project: Game Server Managers - LinuxGSM +# Author: Daniel Gibbs +# License: MIT License, Copyright (c) 2016 Daniel Gibbs +# Purpose: Call of Duty 4 | Server Management Script +# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors +# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki +# Website: https://gameservermanagers.com + +# Debugging +if [ -f ".dev-debug" ]; then + exec 5>dev-debug.log + BASH_XTRACEFD="5" + set -x +fi + +version="161221" + +########################## +######## Settings ######## +########################## + +#### Server Settings #### + +## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters + +defaultmap="mp_crossfire" +maxclients="32" +port="28960" +ip="138.68.147.159" + +## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters +fn_parms(){ +parms="+set sv_punkbuster 0 +set fs_basepath ${filesdir} +set dedicated 1 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxclients} +exec ${servercfg} +map ${defaultmap}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) +# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email +emailalert="off" +email="email@example.com" +emailfrom="" + +# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging +consolelogging="on" +logdays="7" + +#### Advanced Variables #### + +## Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="GameServerManagers" +githubrepo="LinuxGSM" +githubbranch="master" + +## LinuxGSM Server Details +# Do not edit +gamename="Call of Duty 4" +engine="iw3.0" + +## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers +servicename="cod4-server" + +#### Directories #### +# Edit with care + +## Work Directories +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" +tmpdir="${lgsmdir}/tmp" +filesdir="${rootdir}/serverfiles" + +## Server Specific Directories +systemdir="${filesdir}" +executabledir="${filesdir}" +executable="./cod4x18_dedrun" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/main" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +gamelogdir="${filesdir}/Logs" +scriptlogdir="${rootdir}/log/script" +consolelogdir="${rootdir}/log/console" +scriptlog="${scriptlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +emaillog="${scriptlogdir}/${servicename}-email.log" + +## Logs Naming +scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +######################## +######## Script ######## +###### Do not edit ##### +######################## + +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir -p "${filedir}" + fi + echo -e " fetching ${filename}...\c" + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit 1 + fi + chmod +x "${filedir}/${filename}" +fi +source "${filedir}/${filename}" +} + +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl +} + +core_functions.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl +} + +# Prevent from running this script as root. +if [ "$(whoami)" = "root" ]; then + if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then + echo "[ FAIL ] Do NOT run this script as root!" + exit 1 + else + core_functions.sh + check_root.sh + fi +fi + +core_dl.sh +core_functions.sh +getopt=$1 +core_getopt.sh diff --git a/CallOfDutyUnitedOffensive/coduoserver b/CallOfDutyUnitedOffensive/coduoserver index 37e053e10..64c6bdfb0 100755 --- a/CallOfDutyUnitedOffensive/coduoserver +++ b/CallOfDutyUnitedOffensive/coduoserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/CallOfDutyWorldAtWar/codwawserver b/CallOfDutyWorldAtWar/codwawserver index c5bfbf785..bfb080f98 100755 --- a/CallOfDutyWorldAtWar/codwawserver +++ b/CallOfDutyWorldAtWar/codwawserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/CodenameCURE/ccserver b/CodenameCURE/ccserver index 0fcd67964..8815e7c50 100644 --- a/CodenameCURE/ccserver +++ b/CodenameCURE/ccserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/CounterStrike/csserver b/CounterStrike/csserver index 8fae4ad6d..0f0ab0665 100644 --- a/CounterStrike/csserver +++ b/CounterStrike/csserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/CounterStrikeConditionZero/csczserver b/CounterStrikeConditionZero/csczserver index 21b58f060..c32332f95 100644 --- a/CounterStrikeConditionZero/csczserver +++ b/CounterStrikeConditionZero/csczserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/CounterStrikeGlobalOffensive/csgoserver b/CounterStrikeGlobalOffensive/csgoserver index 00234ea57..ef945f4d9 100755 --- a/CounterStrikeGlobalOffensive/csgoserver +++ b/CounterStrikeGlobalOffensive/csgoserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/CounterStrikeSource/cssserver b/CounterStrikeSource/cssserver index 6710cd78d..ddb55ae1c 100644 --- a/CounterStrikeSource/cssserver +++ b/CounterStrikeSource/cssserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/DayOfDefeat/dodserver b/DayOfDefeat/dodserver index f1638263e..ac3c70e81 100644 --- a/DayOfDefeat/dodserver +++ b/DayOfDefeat/dodserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/DayOfDefeatSource/dodsserver b/DayOfDefeatSource/dodsserver index bee83c953..583035330 100644 --- a/DayOfDefeatSource/dodsserver +++ b/DayOfDefeatSource/dodsserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/DayOfInfamy/doiserver b/DayOfInfamy/doiserver index da1605b39..3a17b0201 100644 --- a/DayOfInfamy/doiserver +++ b/DayOfInfamy/doiserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/DeathmatchClassic/dmcserver b/DeathmatchClassic/dmcserver index 58b6c4282..823150526 100644 --- a/DeathmatchClassic/dmcserver +++ b/DeathmatchClassic/dmcserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/DontStarveTogether/dstserver b/DontStarveTogether/dstserver index 260a57a39..857e08da0 100644 --- a/DontStarveTogether/dstserver +++ b/DontStarveTogether/dstserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/DoubleActionBoogaloo/dabserver b/DoubleActionBoogaloo/dabserver index 0938bd94a..2d889a31b 100644 --- a/DoubleActionBoogaloo/dabserver +++ b/DoubleActionBoogaloo/dabserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/FistfulOfFrags/fofserver b/FistfulOfFrags/fofserver index 224ad89db..49c7666cb 100644 --- a/FistfulOfFrags/fofserver +++ b/FistfulOfFrags/fofserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/GarrysMod/gmodserver b/GarrysMod/gmodserver index 379e36a08..c0329bb47 100644 --- a/GarrysMod/gmodserver +++ b/GarrysMod/gmodserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/GoldenEyeSource/gesserver b/GoldenEyeSource/gesserver index c661a3d91..b41fb6e4f 100644 --- a/GoldenEyeSource/gesserver +++ b/GoldenEyeSource/gesserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/HalfLife2Deathmatch/hl2dmserver b/HalfLife2Deathmatch/hl2dmserver index 49be6d637..e806c0ac5 100644 --- a/HalfLife2Deathmatch/hl2dmserver +++ b/HalfLife2Deathmatch/hl2dmserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/HalfLifeDeathmatch/hldmserver b/HalfLifeDeathmatch/hldmserver index 53bd98dc4..f0085130f 100644 --- a/HalfLifeDeathmatch/hldmserver +++ b/HalfLifeDeathmatch/hldmserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/HalfLifeDeathmatchSource/hldmsserver b/HalfLifeDeathmatchSource/hldmsserver index d0c9c33db..a8441d652 100644 --- a/HalfLifeDeathmatchSource/hldmsserver +++ b/HalfLifeDeathmatchSource/hldmsserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/Hurtworld/hwserver b/Hurtworld/hwserver index 930f367be..ca599ac78 100644 --- a/Hurtworld/hwserver +++ b/Hurtworld/hwserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/Insurgency/insserver b/Insurgency/insserver index 6427fcdb7..e3a2212a5 100644 --- a/Insurgency/insserver +++ b/Insurgency/insserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/JustCause2/jc2server b/JustCause2/jc2server index 1a4fa6c9a..3688cbc3c 100644 --- a/JustCause2/jc2server +++ b/JustCause2/jc2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/KillingFloor/kfserver b/KillingFloor/kfserver index 53080e2a7..4d92fbcc3 100644 --- a/KillingFloor/kfserver +++ b/KillingFloor/kfserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/Left4Dead/l4dserver b/Left4Dead/l4dserver index b550880fa..eab523850 100644 --- a/Left4Dead/l4dserver +++ b/Left4Dead/l4dserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/Left4Dead2/l4d2server b/Left4Dead2/l4d2server index 8aee908b5..5887be549 100644 --- a/Left4Dead2/l4d2server +++ b/Left4Dead2/l4d2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/Minecraft/mcserver b/Minecraft/mcserver index 320edc90d..f7c69ec57 100644 --- a/Minecraft/mcserver +++ b/Minecraft/mcserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/Mumble/mumbleserver b/Mumble/mumbleserver index be06c44ef..27b9a55c1 100644 --- a/Mumble/mumbleserver +++ b/Mumble/mumbleserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/NS2Combat/ns2cserver b/NS2Combat/ns2cserver index 437921ad3..9b621eaec 100644 --- a/NS2Combat/ns2cserver +++ b/NS2Combat/ns2cserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/NaturalSelection2/ns2server b/NaturalSelection2/ns2server index 3ce13f844..6c68ac06e 100644 --- a/NaturalSelection2/ns2server +++ b/NaturalSelection2/ns2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/NoMoreRoomInHell/nmrihserver b/NoMoreRoomInHell/nmrihserver index 6409591fc..8abbee131 100644 --- a/NoMoreRoomInHell/nmrihserver +++ b/NoMoreRoomInHell/nmrihserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/OpposingForce/opforserver b/OpposingForce/opforserver index 8fe185650..a36dd83db 100644 --- a/OpposingForce/opforserver +++ b/OpposingForce/opforserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/PiratesVikingandKnightsII/pvkiiserver b/PiratesVikingandKnightsII/pvkiiserver index e2c920423..f1592016e 100644 --- a/PiratesVikingandKnightsII/pvkiiserver +++ b/PiratesVikingandKnightsII/pvkiiserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/ProjectZomboid/pzserver b/ProjectZomboid/pzserver index 481dbdd75..a5f295b15 100644 --- a/ProjectZomboid/pzserver +++ b/ProjectZomboid/pzserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/Quake2/q2server b/Quake2/q2server index 206ab8379..c8c9bfe84 100644 --- a/Quake2/q2server +++ b/Quake2/q2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/Quake3/q3server b/Quake3/q3server index ae71118ec..078e0502d 100644 --- a/Quake3/q3server +++ b/Quake3/q3server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/QuakeLive/qlserver b/QuakeLive/qlserver index d7be6d83d..babb453bd 100755 --- a/QuakeLive/qlserver +++ b/QuakeLive/qlserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/RedOrchestra/roserver b/RedOrchestra/roserver index 85bd1b103..ffa02313a 100644 --- a/RedOrchestra/roserver +++ b/RedOrchestra/roserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/Ricochet/ricochetserver b/Ricochet/ricochetserver index aaaf3f761..d5f205db4 100644 --- a/Ricochet/ricochetserver +++ b/Ricochet/ricochetserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/Rust/rustserver b/Rust/rustserver index f02e29231..22c489a78 100644 --- a/Rust/rustserver +++ b/Rust/rustserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## @@ -29,6 +29,7 @@ ip="0.0.0.0" port="28015" rconport="28016" rconpassword="CHANGE_ME" +rconweb="1" maxplayers="50" # Advanced Start Settings seed="" # default random; range : 1 to 2147483647 ; used to change or reproduce a procedural map @@ -39,7 +40,7 @@ tickrate="30" # default 30; range : 15 to 100 ## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters # Edit with care | https://developer.valvesoftware.com/wiki/Rust_Dedicated_Server fn_parms(){ -parms="-batchmode +server.ip ${ip} +server.port ${port} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${servicename}\" ${conditionalseed} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile ${gamelogfile}" +parms="-batchmode +server.ip ${ip} +server.port ${port} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${servicename}\" ${conditionalseed} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.web ${rconweb} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile ${gamelogfile}" } # Specific to Rust diff --git a/SeriousSam3BFE/ss3sserver b/SeriousSam3BFE/ss3sserver index f668959d6..170abc607 100644 --- a/SeriousSam3BFE/ss3sserver +++ b/SeriousSam3BFE/ss3sserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/Starbound/sbserver b/Starbound/sbserver index d4d93913f..09555200a 100644 --- a/Starbound/sbserver +++ b/Starbound/sbserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/SvenCoop/svenserver b/SvenCoop/svenserver index c69706307..039bb1928 100644 --- a/SvenCoop/svenserver +++ b/SvenCoop/svenserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/TeamFortress2/tf2server b/TeamFortress2/tf2server index c4ae5feae..d1be35534 100644 --- a/TeamFortress2/tf2server +++ b/TeamFortress2/tf2server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/TeamFortressClassic/tfcserver b/TeamFortressClassic/tfcserver index 68be7bfb0..3d4c3b3d6 100644 --- a/TeamFortressClassic/tfcserver +++ b/TeamFortressClassic/tfcserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/TeamSpeak3/ts3server b/TeamSpeak3/ts3server index b22971108..4352c13bf 100644 --- a/TeamSpeak3/ts3server +++ b/TeamSpeak3/ts3server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/Teeworlds/twserver b/Teeworlds/twserver index 367baa386..8456c64a6 100644 --- a/Teeworlds/twserver +++ b/Teeworlds/twserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/Terraria/terrariaserver b/Terraria/terrariaserver index cc68d2632..564440e32 100644 --- a/Terraria/terrariaserver +++ b/Terraria/terrariaserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/UnrealTournament/utserver b/UnrealTournament/utserver index 23a0d0ff1..e5c1e13dd 100644 --- a/UnrealTournament/utserver +++ b/UnrealTournament/utserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/UnrealTournament2004/ut2k4server b/UnrealTournament2004/ut2k4server index 2ee0f9b3f..8eb5f1137 100644 --- a/UnrealTournament2004/ut2k4server +++ b/UnrealTournament2004/ut2k4server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/UnrealTournament3/ut3server b/UnrealTournament3/ut3server index f721859b0..5e96d62f8 100644 --- a/UnrealTournament3/ut3server +++ b/UnrealTournament3/ut3server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/UnrealTournament99/ut99server b/UnrealTournament99/ut99server index 8a86a4bfb..8de3f2b21 100644 --- a/UnrealTournament99/ut99server +++ b/UnrealTournament99/ut99server @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/WolfensteinEnemyTerritory/wetserver b/WolfensteinEnemyTerritory/wetserver index 7cddd0575..2404333c3 100644 --- a/WolfensteinEnemyTerritory/wetserver +++ b/WolfensteinEnemyTerritory/wetserver @@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ######## diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 5ab856ed0..9d9d8fddc 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -152,12 +152,12 @@ fn_details_gameserver(){ if [ -n "${tickrate}" ]; then echo -e "${blue}Tick rate:\t${default}${tickrate}" fi - + # Cluster (Don't Starve Together) if [ -n "${cluster}" ]; then echo -e "${blue}Cluster:\t${default}${cluster}" fi - + # Shard (Don't Starve Together) if [ -n "${shard}" ]; then echo -e "${blue}Shard:\t${default}${shard}" @@ -378,6 +378,15 @@ fn_details_cod2(){ } | column -s $'\t' -t } +fn_details_cod4(){ + echo -e "netstat -atunp" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + fn_details_codwaw(){ echo -e "netstat -atunp | grep codwaw_lnxded" echo -e "" @@ -752,6 +761,8 @@ fn_display_details() { fn_details_coduo elif [ "${gamename}" == "Call of Duty 2" ]; then fn_details_cod2 + elif [ "${gamename}" == "Call of Duty 4" ]; then + fn_details_cod4 elif [ "${gamename}" == "Call of Duty: World at War" ]; then fn_details_codwaw elif [ "${gamename}" == "Hurtworld" ]; then diff --git a/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh index d7c3cbc54..a840af48a 100644 --- a/lgsm/functions/command_install.sh +++ b/lgsm/functions/command_install.sh @@ -18,7 +18,7 @@ check_deps.sh if [ "${gamename}" == "Unreal Tournament 2004" ]; then install_server_files.sh install_ut2k4_key.sh -elif [ "${gamename}" == "Battlefield: 1942" ]||[ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty: United Offensive" ]||[ "${gamename}" == "Call of Duty 2" ]||[ "${gamename}" == "Call of Duty: World at War" ]||[ "${gamename}" == "Minecraft" ]||[ "${gamename}" == "Quake 2" ]||[ "${gamename}" == "Quake 3: Arena" ]||[ "${gamename}" == "QuakeWorld" ]||[ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament" ]||[ "${gamename}" == "Unreal Tournament 3" ]||[ "${gamename}" == "TeamSpeak 3" ]||[ "${gamename}" == "Mumble" ]||[ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then +elif [ "${gamename}" == "Battlefield: 1942" ]||[ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty: United Offensive" ]||[ "${gamename}" == "Call of Duty 2" ]||[ "${gamename}" == "Call of Duty 4" ]||[ "${gamename}" == "Call of Duty: World at War" ]||[ "${gamename}" == "Minecraft" ]||[ "${gamename}" == "Quake 2" ]||[ "${gamename}" == "Quake 3: Arena" ]||[ "${gamename}" == "QuakeWorld" ]||[ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament" ]||[ "${gamename}" == "Unreal Tournament 3" ]||[ "${gamename}" == "TeamSpeak 3" ]||[ "${gamename}" == "Mumble" ]||[ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then installer=1 install_server_files.sh elif [ -n "${appid}" ]; then diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index 95aa10536..c5483a864 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -144,29 +144,29 @@ fn_stop_graceful_sdtd(){ fn_stop_tmux } -# Attempts graceful of source using rcon '/stop' command. +# Attempts graceful of source using rcon 'stop' command. fn_stop_graceful_minecraft(){ - fn_print_dots "Graceful: console /stop" - fn_script_log_info "Graceful: console /stop" + fn_print_dots "Graceful: console stop" + fn_script_log_info "Graceful: console stop" # sends quit - tmux send -t "${servicename}" /stop ENTER > /dev/null 2>&1 + tmux send -t "${servicename}" stop ENTER > /dev/null 2>&1 # waits up to 30 seconds giving the server time to shutdown gracefuly for seconds in {1..30}; do check_status.sh if [ "${status}" == "0" ]; then - fn_print_ok "Graceful: console /stop: ${seconds}: " + fn_print_ok "Graceful: console stop: ${seconds}: " fn_print_ok_eol_nl - fn_script_log_pass "Graceful: console /stop: OK: ${seconds} seconds" + fn_script_log_pass "Graceful: console stop: OK: ${seconds} seconds" break fi sleep 1 - fn_print_dots "Graceful: console /stop: ${seconds}" + fn_print_dots "Graceful: console stop: ${seconds}" done check_status.sh if [ "${status}" != "0" ]; then - fn_print_error "Graceful: console /stop: " + fn_print_error "Graceful: console stop: " fn_print_fail_eol_nl - fn_script_log_error "Graceful: console /stop: FAIL" + fn_script_log_error "Graceful: console stop: FAIL" fi sleep 1 fn_stop_tmux diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 8434f4454..03aa7359a 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -699,7 +699,7 @@ case "${getopt}" in if [ "${gamename}" == "Mumble" ]; then fn_getopt_mumble -elif [ "${gamename}" == "Battlefield: 1942" ]||[ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty: United Offensive" ]||[ "${gamename}" == "Call of Duty 2" ]||[ "${gamename}" == "Call of Duty: World at War" ]||[ "${gamename}" == "QuakeWorld" ]||[ "${gamename}" == "Quake 2" ]||[ "${gamename}" == "Quake 3: Arena" ]||[ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then +elif [ "${gamename}" == "Battlefield: 1942" ]||[ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty: United Offensive" ]||[ "${gamename}" == "Call of Duty 2" ]||[ "${gamename}" == "Call of Duty 4" ]||[ "${gamename}" == "Call of Duty: World at War" ]||[ "${gamename}" == "QuakeWorld" ]||[ "${gamename}" == "Quake 2" ]||[ "${gamename}" == "Quake 3: Arena" ]||[ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then fn_getopt_generic_no_update elif [ "${engine}" == "lwjgl2" ]; then fn_getopt_minecraft diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 09cd8900d..829bba841 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -94,6 +94,20 @@ fn_info_config_cod2(){ fi } +fn_info_config_cod4(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + rconpassword="${unavailable}" + else + servername=$(grep "sv_hostname " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | xargs) + rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + servername=${servername:-"NOT SET"} + rconpassword=${rconpassword=:-"NOT SET"} + fi +} + fn_info_config_codwaw(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -123,7 +137,6 @@ fn_info_config_dontstarve(){ gamemode=$(grep "game_mode" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/game_mode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') tickrate=$(grep "tick_rate" "${clustercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') masterport=$(grep "master_port" "${clustercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - ip=$(grep "bind_ip" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bind_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') ipsetinconfig=1 ipinconfigvar="bind_ip" @@ -136,7 +149,7 @@ fn_info_config_dontstarve(){ tickrate=${tickrate:-"0"} masterport=${masterport:-"0"} fi - + if [ ! -f "${servercfgfullpath}" ]; then port="${zero}" steamauthenticationport="${zero}" @@ -145,7 +158,7 @@ fn_info_config_dontstarve(){ port=$(grep "server_port" "${servercfgfullpath}" | grep "^server_port" | grep -v "#" | tr -cd '[:digit:]') steamauthenticationport=$(grep "authentication_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') steammasterserverport=$(grep "master_server_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - + # Not Set port=${port:-"0"} steamauthenticationport=${steamauthenticationport:-"0"} @@ -575,6 +588,9 @@ elif [ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty: Unit # Call of Duty 2 elif [ "${gamename}" == "Call of Duty 2" ]; then fn_info_config_cod2 +# Call of Duty 4 +elif [ "${gamename}" == "Call of Duty 4" ]; then + fn_info_config_cod4 # Call of Duty: World at War elif [ "${gamename}" == "Call of Duty: World at War" ]; then fn_info_config_codwaw diff --git a/lgsm/functions/info_glibc.sh b/lgsm/functions/info_glibc.sh index b8b29239c..951adefd7 100644 --- a/lgsm/functions/info_glibc.sh +++ b/lgsm/functions/info_glibc.sh @@ -23,6 +23,9 @@ elif [ "${gamename}" == "Call of Duty 2" ]; then elif [ "${gamename}" == "Call of Duty: United Offensive" ]; then glibcrequired="2.1" glibcfix="no" +elif [ "${gamename}" == "Call of Duty 4" ]; then + glibcrequired="2.3" + glibcfix="no" elif [ "${gamename}" == "Call of Duty: World at War" ]; then glibcrequired="2.3.2" glibcfix="no" diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index b5f7a1148..a9a97423f 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -83,20 +83,20 @@ fn_set_dst_config_vars(){ randomkey=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) sed -i "s/CLUSTERKEY/${randomkey}/g" "${clustercfgfullpath}" sleep 1 - else + else echo "${clustercfg} is already configured." fn_script_log_info "${clustercfg} is already configured." fi - + ## server.ini # removing unnecessary options (dependent on sharding & shard type) - if [ "${sharding}" == "false" ]; then + if [ "${sharding}" == "false" ]; then sed -i "s/ISMASTER//g" "${servercfgfullpath}" sed -i "/SHARDNAME/d" "${servercfgfullpath}" elif [ "${master}" == "true" ]; then sed -i "/SHARDNAME/d" "${servercfgfullpath}" fi - + echo "changing shard name." fn_script_log_info "changing shard name." sed -i "s/SHARDNAME/${shard}/g" "${servercfgfullpath}" @@ -105,7 +105,7 @@ fn_set_dst_config_vars(){ fn_script_log_info "changing master setting." sed -i "s/ISMASTER/${master}/g" "${servercfgfullpath}" sleep 1 - + ## worldgenoverride.lua if [ "${cave}" == "true" ]; then echo "defining ${shard} as cave in ${servercfgdir}/worldgenoverride.lua." @@ -177,7 +177,13 @@ elif [ "${gamename}" == "Call of Duty: United Offensive" ]; then fn_default_config_remote fn_set_config_vars elif [ "${gamename}" == "Call of Duty 2" ]; then - gamedirname="CallofDuty2" + gamedirname="CallOfDuty2" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${gamename}" == "Call of Duty 4" ]; then + gamedirname="CallOfDuty4" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index bc28bd2f2..330e4fb40 100644 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -17,6 +17,8 @@ fn_install_server_files(){ fileurl="http://files.gameservermanagers.com/CallOfDutyUnitedOffensive/coduo-lnxded-1.51b-full.tar.bz2"; filedir="${tmpdir}"; filename="coduo-lnxded-1.51b-full.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="f1804ef13036e2b4ab535db000b19e97" elif [ "${gamename}" == "Call of Duty 2" ]; then fileurl="http://files.gameservermanagers.com/CallOfDuty2/cod2-lnxded-1.3-full.tar.bz2"; filedir="${tmpdir}"; filename="cod2-lnxded-1.3-full.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="078128f83d06dc3d7699428dc2870214" + elif [ "${gamename}" == "Call of Duty 4" ]; then + fileurl="http://files.gameservermanagers.com/CallOfDuty4/cod4x18_dedrun.tar.bz2"; filedir="${tmpdir}"; filename="cod4x18_dedrun.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="bebdfc1755626462bdaad49f6f926c08" elif [ "${gamename}" == "Call of Duty: World at War" ]; then fileurl="http://files.gameservermanagers.com/CallOfDutyWorldAtWar/codwaw-lnxded-1.7-full.tar.bz2"; filedir="${tmpdir}"; filename="codwaw-lnxded-1.7-full.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="0489697ff3bf678c109bfb377d1b7895" elif [ "${gamename}" == "GoldenEye: Source" ]; then diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index c4d46cbcb..a03b45e85 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -17,7 +17,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="161125" +version="161221" ########################## ######## Settings ########