Jelajahi Sumber

Release/161113 (#1185)

* Fixes #991 (#1165)

* stbuf will no longer be used on x64 #991

* Added BF1942 ncurses requirement to CentOS

* adding Call of Duty (#1118)

* adding Call of Duty 2 (#1127)

* Improvements up command_backup.sh
added backup trap and improved lockfile support
changes to the messages displayed on screen
renamed some functions
other misc changes
Daniel Gibbs 10 tahun lalu
induk
melakukan
f0bd1bfc5c
75 mengubah file dengan 619 tambahan dan 110 penghapusan
  1. 1 1
      7DaysToDie/sdtdserver
  2. 1 1
      ARKSurvivalEvolved/arkserver
  3. 1 1
      Arma3/arma3server
  4. 1 1
      Battlefield1942/bf1942server
  5. 1 1
      BlackMesa/bmdmserver
  6. 1 1
      BladeSymphony/bsserver
  7. 1 1
      BrainBread2/bb2server
  8. 185 0
      CallOfDuty/codserver
  9. 186 0
      CallOfDuty2/cod2server
  10. 1 1
      CodenameCURE/ccserver
  11. 1 1
      CounterStrike/csserver
  12. 1 1
      CounterStrikeConditionZero/csczserver
  13. 1 1
      CounterStrikeGlobalOffensive/csgoserver
  14. 1 1
      CounterStrikeSource/cssserver
  15. 1 1
      DayOfDefeat/dodserver
  16. 1 1
      DayOfDefeatSource/dodsserver
  17. 1 1
      DayOfInfamy/doiserver
  18. 1 1
      DeathmatchClassic/dmcserver
  19. 1 1
      DontStarveTogether/dstserver
  20. 1 1
      DoubleActionBoogaloo/dabserver
  21. 1 1
      FistfulOfFrags/fofserver
  22. 1 1
      GarrysMod/gmodserver
  23. 1 1
      GoldenEyeSource/gesserver
  24. 1 1
      HalfLife2Deathmatch/hl2dmserver
  25. 1 1
      HalfLifeDeathmatch/hldmserver
  26. 1 1
      HalfLifeDeathmatchSource/hldmsserver
  27. 1 1
      Hurtworld/hwserver
  28. 1 1
      Insurgency/insserver
  29. 2 2
      JustCause2/jc2server
  30. 1 1
      KillingFloor/kfserver
  31. 1 1
      Left4Dead/l4dserver
  32. 1 1
      Left4Dead2/l4d2server
  33. 1 1
      Minecraft/mcserver
  34. 1 1
      Mumble/mumbleserver
  35. 1 1
      NS2Combat/ns2cserver
  36. 1 1
      NaturalSelection2/ns2server
  37. 1 1
      NoMoreRoomInHell/nmrihserver
  38. 1 1
      OpposingForce/opforserver
  39. 1 1
      PiratesVikingandKnightsII/pvkiiserver
  40. 1 1
      ProjectZomboid/pzserver
  41. 1 1
      Quake2/q2server
  42. 1 1
      Quake3/q3server
  43. 1 1
      QuakeLive/qlserver
  44. 1 1
      RedOrchestra/roserver
  45. 1 1
      Ricochet/ricochetserver
  46. 1 1
      Rust/rustserver
  47. 1 1
      SeriousSam3BFE/ss3sserver
  48. 1 1
      Starbound/sbserver
  49. 1 1
      SvenCoop/svenserver
  50. 1 1
      TeamFortress2/tf2server
  51. 1 1
      TeamFortressClassic/tfcserver
  52. 1 1
      TeamSpeak3/ts3server
  53. 1 1
      Teeworlds/twserver
  54. 1 1
      Terraria/terrariaserver
  55. 1 1
      UnrealTournament/utserver
  56. 1 1
      UnrealTournament2004/ut2k4server
  57. 1 1
      UnrealTournament3/ut3server
  58. 1 1
      UnrealTournament99/ut99server
  59. 1 1
      WolfensteinEnemyTerritory/wetserver
  60. 10 1
      lgsm/functions/check_deps.sh
  61. 1 1
      lgsm/functions/check_ip.sh
  62. 21 0
      lgsm/functions/command_details.sh
  63. 1 1
      lgsm/functions/command_install.sh
  64. 1 1
      lgsm/functions/command_monitor.sh
  65. 1 1
      lgsm/functions/core_getopt.sh
  66. 2 0
      lgsm/functions/fix.sh
  67. 1 1
      lgsm/functions/fix_glibc.sh
  68. 3 1
      lgsm/functions/gsquery.py
  69. 33 1
      lgsm/functions/info_config.sh
  70. 5 1
      lgsm/functions/info_distro.sh
  71. 6 0
      lgsm/functions/info_glibc.sh
  72. 14 2
      lgsm/functions/install_config.sh
  73. 8 4
      lgsm/functions/install_server_files.sh
  74. 3 2
      lgsm/functions/update_steamcmd.sh
  75. 80 35
      tests/tests_jc2server.sh

+ 1 - 1
7DaysToDie/sdtdserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
ARKSurvivalEvolved/arkserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
Arma3/arma3server

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
Battlefield1942/bf1942server

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
BlackMesa/bmdmserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
BladeSymphony/bsserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
BrainBread2/bb2server

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 185 - 0
CallOfDuty/codserver

@@ -0,0 +1,185 @@
+#!/bin/bash
+# Project: Game Server Managers - LinuxGSM
+# Author: Daniel Gibbs
+# License: MIT License, Copyright (c) 2016 Daniel Gibbs
+# Purpose: Call of Duty | 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="161113"
+
+##########################
+######## Settings ########
+##########################
+
+#### Server Settings ####
+
+## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
+defaultmap="mp_neuville"
+maxclients="20"
+port="28960"
+ip="0.0.0.0"
+
+## 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"
+
+## 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"
+engine="idtech3"
+
+## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers
+servicename="cod-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="./cod_lnxded"
+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

+ 186 - 0
CallOfDuty2/cod2server

@@ -0,0 +1,186 @@
+#!/bin/bash
+# Project: Game Server Managers - LinuxGSM
+# Author: Daniel Gibbs
+# License: MIT License, Copyright (c) 2016 Daniel Gibbs
+# Purpose: Call of Duty 2 | 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="161113"
+
+##########################
+######## Settings ########
+##########################
+
+#### Server Settings ####
+
+## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
+
+defaultmap="mp_leningrad"
+maxclients="20"
+port="28960"
+ip="0.0.0.0"
+
+## 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"
+
+## 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 2"
+engine="iw2.0"
+
+## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers
+servicename="cod2-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="./cod2_lnxded"
+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

+ 1 - 1
CodenameCURE/ccserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
CounterStrike/csserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
CounterStrikeConditionZero/csczserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
CounterStrikeGlobalOffensive/csgoserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
CounterStrikeSource/cssserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
DayOfDefeat/dodserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
DayOfDefeatSource/dodsserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
DayOfInfamy/doiserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
DeathmatchClassic/dmcserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
DontStarveTogether/dstserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
DoubleActionBoogaloo/dabserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
FistfulOfFrags/fofserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
GarrysMod/gmodserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
GoldenEyeSource/gesserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
HalfLife2Deathmatch/hl2dmserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
HalfLifeDeathmatch/hldmserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
HalfLifeDeathmatchSource/hldmsserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
Hurtworld/hwserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
Insurgency/insserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 2 - 2
JustCause2/jc2server

@@ -3,7 +3,7 @@
 # Project: Game Server Managers - LinuxGSM
 # Author: Daniel Gibbs
 # License: MIT License, Copyright (c) 2016 Daniel Gibbs
-# Purpose: GAMENAME | Server Management Script
+# Purpose: Just Cause 2 | Server Management Script
 # Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors
 # Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki
 # Website: https://gameservermanagers.com
@@ -15,7 +15,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
KillingFloor/kfserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
Left4Dead/l4dserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
Left4Dead2/l4d2server

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
Minecraft/mcserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
Mumble/mumbleserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
NS2Combat/ns2cserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
NaturalSelection2/ns2server

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
NoMoreRoomInHell/nmrihserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
OpposingForce/opforserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
PiratesVikingandKnightsII/pvkiiserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
ProjectZomboid/pzserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
Quake2/q2server

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
Quake3/q3server

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
QuakeLive/qlserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
RedOrchestra/roserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
Ricochet/ricochetserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
Rust/rustserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
SeriousSam3BFE/ss3sserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
Starbound/sbserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
SvenCoop/svenserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
TeamFortress2/tf2server

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
TeamFortressClassic/tfcserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
TeamSpeak3/ts3server

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
Teeworlds/twserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
Terraria/terrariaserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
UnrealTournament/utserver

@@ -15,7 +15,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
UnrealTournament2004/ut2k4server

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
UnrealTournament3/ut3server

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
UnrealTournament99/ut99server

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 1 - 1
WolfensteinEnemyTerritory/wetserver

@@ -14,7 +14,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="161030"
+version="161113"
 
 ##########################
 ######## Settings ########

+ 10 - 1
lgsm/functions/check_deps.sh

@@ -185,9 +185,12 @@ if [ -n "$(command -v dpkg-query)" ]; then
 	# Brainbread 2 and Don't Starve Together
 	elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]; then
 		array_deps_required+=( libcurl4-gnutls-dev:i386 )
-	# Battlefield: 1942 requies ncurses
+	# Battlefield: 1942
 	elif [ "${gamename}" == "Battlefield: 1942" ]; then
 		array_deps_required+=( libncurses5:i386 )
+	# Call of Duty
+	elif [ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty 2" ]; then
+		array_deps_required+=( libstdc++5:i386 )
 	# Project Zomboid and Minecraft
 	elif [ "${engine}" ==  "projectzomboid" ]||[ "${engine}" == "lwjgl2" ]; then
 		javaversion=$(java -version 2>&1 | grep "version")
@@ -254,6 +257,12 @@ elif [ -n "$(command -v yum)" ]; then
 	# Brainbread 2 and Don't Starve Together
 	elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]; then
 		array_deps_required+=( libcurl.i686 )
+	# Battlefield: 1942
+	elif [ "${gamename}" == "Battlefield: 1942" ]; then
+		array_deps_required+=( ncurses-libs.i686 )
+	# Call of Duty
+	elif [ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty 2" ]; then
+		array_deps_required+=( compat-libstdc++-33.i686 )
 	# Project Zomboid and Minecraft
 	elif [ "${engine}" ==  "projectzomboid" ]||[ "${engine}" == "lwjgl2" ]; then
 		javaversion=$(java -version 2>&1 | grep "version")

+ 1 - 1
lgsm/functions/check_ip.sh

@@ -8,7 +8,7 @@
 local commandname="CHECK"
 local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
-if [ "${gamename}" != "TeamSpeak 3" ] && [ "${gamename}" != "Mumble" ]; then
+if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travistest}" != "1" ]; then
 	if [ ! -f "/bin/ip" ]; then
 		ipcommand="/sbin/ip"
 	else

+ 21 - 0
lgsm/functions/command_details.sh

@@ -341,6 +341,15 @@ fn_details_avalanche(){
 	} | column -s $'\t' -t
 }
 
+fn_details_cod(){
+	echo -e "netstat -atunp | grep cod_lnxded"
+	echo -e ""
+	{
+		echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
+		echo -e "> Game\tINBOUND\t${port}\tudp"
+	} | column -s $'\t' -t
+}
+
 fn_details_dontstarve(){
 	echo -e "netstat -atunp | grep dontstarve"
 	echo -e ""
@@ -643,6 +652,14 @@ fn_details_ark(){
 	} | column -s $'\t' -t
 }
 
+fn_details_cod2(){
+	echo -e "netstat -atunp | grep cod2_lnxded"
+	echo -e ""
+	{
+		echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
+		echo -e "> Game\tINBOUND\t${port}\tudp"
+	} | column -s $'\t' -t
+}
 
 # Run checks and gathers details to display.
 
@@ -698,6 +715,10 @@ fn_display_details() {
 		fn_details_sdtd
 	elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then
 		fn_details_ark
+	elif [ "${gamename}" == "Call of Duty" ]; then
+		fn_details_cod
+	elif [ "${gamename}" == "Call of Duty 2" ]; then
+		fn_details_cod2
 	elif [ "${gamename}" == "Hurtworld" ]; then
 		fn_details_hurtworld
 	elif [ "${gamename}" == "QuakeWorld" ]; then

+ 1 - 1
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}" == "Minecraft" ]||[ "${gamename}" == "Quake 2" ]||[ "${gamename}" == "Quake 3: Arena" ]||[ "${gamename}" == "QuakeWorld" ]||[ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament 3" ]||[ "${gamename}" == "Unreal Tournament" ]||[ "${gamename}" == "TeamSpeak 3" ]||[ "${gamename}" == "Mumble" ]||[ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
+elif [ "${gamename}" == "Battlefield: 1942" ]||[ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty 2" ]||[ "${gamename}" == "Minecraft" ]||[ "${gamename}" == "Quake 2" ]||[ "${gamename}" == "Quake 3: Arena" ]||[ "${gamename}" == "QuakeWorld" ]||[ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament 3" ]||[ "${gamename}" == "Unreal Tournament" ]||[ "${gamename}" == "TeamSpeak 3" ]||[ "${gamename}" == "Mumble" ]||[ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
 	installer=1
 	install_server_files.sh
 elif [ -n "${appid}" ]; then

+ 1 - 1
lgsm/functions/command_monitor.sh

@@ -79,7 +79,7 @@ fn_monitor_tmux(){
 		fn_print_ok_eol_nl
 		fn_script_log_pass "Checking session: OK"
 		# runs gsquery check on game with specific engines.
-		local allowed_engines_array=( avalanche goldsource idtech3 idtech3_ql quake refractor realvirtuality source spark unity3d unreal unreal2 )
+		local allowed_engines_array=( avalanche goldsource idtech3 idtech3_ql iw2.0 quake refractor realvirtuality source spark unity3d unreal unreal2 )
 		for allowed_engine in "${allowed_engines_array[@]}"
 		do
 			if [ "${allowed_engine}" == "${engine}" ]; then

+ 1 - 1
lgsm/functions/core_getopt.sh

@@ -622,7 +622,7 @@ case "${getopt}" in
 
 if [ "${gamename}" == "Mumble" ]; then
 	fn_getopt_mumble
-elif [ "${gamename}" == "Battlefield: 1942" ]||[ "${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 2" ]||[ "${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

+ 2 - 0
lgsm/functions/fix.sh

@@ -37,6 +37,8 @@ if [ "${function_selfname}" != "command_install.sh" ]; then
 
 	if  [ "${gamename}" == "ARMA 3" ]; then
 		fix_arma3.sh
+	elif [ "${gamename}" == "Call of Duty 2" ]; then
+		fix_cod2.sh
 	elif [ "${gamename}" == "Counter-Strike: Global Offensive" ]; then
 		fix_csgo.sh
 	elif [ "${gamename}" == "Don't Starve Together" ]; then

+ 1 - 1
lgsm/functions/fix_glibc.sh

@@ -40,4 +40,4 @@ do
 	fi
 done
 
-export LD_LIBRARY_PATH=:"${libdir}"
+export LD_LIBRARY_PATH=:"${libdir}"

+ 3 - 1
lgsm/functions/gsquery.py

@@ -26,6 +26,8 @@ class GameServer:
             self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00'
         elif self.option.engine == 'idtech3':
             self.query_prompt_string = b'\xff\xff\xff\xffgetstatus'
+        elif self.option.engine == 'iw2.0':
+            self.query_prompt_string = b'\xff\xff\xff\xffgetstatus'
         elif self.option.engine == 'quake':
             self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00'
         elif self.option.engine == 'quakelive':
@@ -113,7 +115,7 @@ if __name__ == '__main__':
         action='store',
         dest='engine',
         default=False,
-        help='Engine type: avalanche, goldsource, idtech2, idtech3, realvirtuality, quake, quakelive, refractor, spark, source, unity3d, unreal, unreal2.'
+        help='Engine type: avalanche, goldsource, idtech2, idtech3, iw2.0, realvirtuality, quake, quakelive, refractor, spark, source, unity3d, unreal, unreal2.'
     )
     parser.add_option(
         '-v', '--verbose',

+ 33 - 1
lgsm/functions/info_config.sh

@@ -66,6 +66,33 @@ fn_info_config_bf1942(){
 	fi
 }
 
+fn_info_config_cod(){
+	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_cod2(){
+	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_dontstarve(){
 	if [ ! -f "${servercfgfullpath}" ]; then
@@ -103,7 +130,6 @@ fn_info_config_minecraft(){
 		gamemode="${unavailable}"
 		gameworld="${unavailable}"
 	else
-
 		servername=$(grep "motd" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/motd//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		rconpassword=$(grep "rcon.password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon.password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		rconport=$(grep "rcon.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
@@ -510,6 +536,12 @@ if [ "${engine}" == "avalanche" ]; then
 # Battlefield: 1942
 elif [ "${gamename}" == "Battlefield: 1942" ]; then
 	fn_info_config_bf1942
+# Call of Duty
+elif [ "${gamename}" == "Call of Duty" ]; then
+	fn_info_config_cod
+# Call of Duty 2
+elif [ "${gamename}" == "Call of Duty 2" ]; then
+	fn_info_config_cod2
 # Dont Starve Together
 elif [ "${engine}" == "dontstarve" ]; then
 	fn_info_config_dontstarve

+ 5 - 1
lgsm/functions/info_distro.sh

@@ -108,12 +108,16 @@ fi
 
 ## Backup info
 if [ -d "${backupdir}" ]; then
-	# Ued space in backups dir.
+	# Used space in backups dir.
 	backupdirdu=$(du -sh "${backupdir}" | awk '{print $1}')
 	# If no backup dir, size is 0M
 	if [ -z "${backupdirdu}" ]; then
 		backupdirdu="0M"
 	fi
+
+	# number of backups set to 0 by default
+	backupcount=0
+
 	# If there are backups in backup dir.
 	if [ $(find "${backupdir}" -name "*.tar.gz" | wc -l) -ne "0" ]; then
 		# number of backups.

+ 6 - 0
lgsm/functions/info_glibc.sh

@@ -14,6 +14,12 @@ elif [ "${gamename}" == "Blade Symphony" ]; then
 	glibcfix="yes"
 elif [ "${gamename}" == "BrainBread 2" ]; then
 	glibcrequired="2.17"
+elif [ "${gamename}" == "Call of Duty" ]; then
+	glibcrequired="2.1"
+	glibcfix="no"
+elif [ "${gamename}" == "Call of Duty 2" ]; then
+	glibcrequired="2.1.3"
+	glibcfix="no"
 elif [ "${gamename}" == "Day of Infamy" ]; then
 	glibcrequired="2.15"
 	glibcfix="yes"

+ 14 - 2
lgsm/functions/install_config.sh

@@ -113,6 +113,18 @@ elif [ "${gamename}" == "Black Mesa: Deathmatch" ]; then
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
+elif [ "${gamename}" == "Call of Duty" ]; then
+	gamedirname="CallOfDuty"
+	array_configs+=( server.cfg )
+	fn_fetch_default_config
+	fn_default_config_remote
+	fn_set_config_vars
+elif [ "${gamename}" == "Call of Duty 2" ]; then
+	gamedirname="CallofDuty2"
+	array_configs+=( server.cfg )
+	fn_fetch_default_config
+	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Codename CURE" ]; then
 	gamedirname="CodenameCURE"
 	array_configs+=( server.cfg )
@@ -336,7 +348,7 @@ elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then
 	fn_set_config_vars
 elif [ "${gamename}" == "Starbound" ]; then
 	gamedirname="Starbound"
-	array_configs+=( starbound.config )
+	array_configs+=( starbound_server.config )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
@@ -405,4 +417,4 @@ elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-fi
+fi

+ 8 - 4
lgsm/functions/install_server_files.sh

@@ -11,6 +11,8 @@ local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 fn_install_server_files(){
 	if [ "${gamename}" == "Unreal Tournament 99" ]; then
 		fileurl="http://files.gameservermanagers.com/UnrealTournament99/ut99-server-451-ultimate-linux.tar.bz2"; filedir="${tmpdir}"; filename="ut99-server-451-ultimate-linux.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="49cb24d0550ff6ddeaba6007045c6edd"
+	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}" == "Unreal Tournament 2004" ]; then
 		fileurl="http://files.gameservermanagers.com/UnrealTournament2004/ut2004-server-3339-ultimate-linux.tar.bz2"; filedir="${tmpdir}"; filename="ut2004-server-3339-ultimate-linux.tar.bz2";  executecmd="noexecute" run="norun"; force="noforce"; md5="67c5e2cd9c2a4b04f163962ee41eff54"
 	elif [ "${gamename}" == "Unreal Tournament 3" ]; then
@@ -23,13 +25,14 @@ fn_install_server_files(){
 		fileurl="http://files.gameservermanagers.com/UnrealTournament/UnrealTournament-Server-XAN-3045522-Linux.zip"; filedir="${tmpdir}"; filename="UnrealTournament-Server-XAN-3045522-Linux.zip";  executecmd="noexecute" run="norun"; force="noforce"; md5="553fed5645a9fc623e92563049bf79f6"
 	elif [ "${gamename}" == "GoldenEye: Source" ]; then
 		fileurl="http://files.gameservermanagers.com/GoldenEyeSource/GoldenEye_Source_v5.0.1_full_server_linux.tar.bz2"; filedir="${tmpdir}"; filename="GoldenEye_Source_v5.0.1_server_full_Linux.tar.bz2";  executecmd="noexecute" run="norun"; force="noforce"; md5="ea227a150300abe346e757380325f84c"
+	elif [ "${gamename}" == "Call of Duty" ]; then
+		fileurl="http://files.gameservermanagers.com/CallOfDuty/cod-lnxded-1.5b-full.tar.bz2"; filedir="${tmpdir}"; filename="cod-lnxded-1.5-large.tar.bz2";  executecmd="noexecute" run="norun"; force="noforce"; md5="19629895a4cf6fd8f6d1ee198b5304cd"
 	elif [ "${gamename}" == "Quake 2" ]; then
 		fileurl="http://files.gameservermanagers.com/Quake2/quake2-3.20-glibc-i386-full-linux2.0.tar.bz2"; filedir="${lgsmdir}/tmp"; filename="quake2-3.20-glibc-i386-full-linux2.0.tar.bz2";  executecmd="noexecute" run="norun"; force="noforce"; md5="0b8c7e2d51f40b56b328c69e986e7c5f"
 	elif [ "${gamename}" == "Quake 3: Arena" ]; then
 		fileurl="http://files.gameservermanagers.com/Quake3/quake3-1.32c-x86-full-linux.tar.bz2"; filedir="${lgsmdir}/tmp"; filename="quake3-1.32c-x86-full-linux.tar.bz2";  executecmd="noexecute" run="norun"; force="noforce"; md5="fd7258d827474f67663dda297bff4306"
 	elif [ "${gamename}" == "QuakeWorld" ]; then
 		fileurl="http://files.gameservermanagers.com/QuakeWorld/nquake.server.linux.083116.full.tar.bz2"; filedir="${lgsmdir}/tmp"; filename="nquake.server.linux.083116.full.tar.bz2";  executecmd="noexecute" run="norun"; force="noforce"; md5="75a409cf08d808f075e4dacdc7b21b78"
-
 	fi
 	fn_fetch_file "${fileurl}" "${filedir}" "${filename}" "${executecmd}" "${run}" "${force}" "${md5}"
 	fn_dl_extract "${filedir}" "${filename}" "${filesdir}"
@@ -61,8 +64,9 @@ fn_install_server_files_steamcmd(){
 				check_steamcmd.sh
 			fi
 
-			# Detects if unbuffer command is available.
-			if [ $(command -v stdbuf) ]; then
+			# Detects if unbuffer command is available for 32 bit distributions only.
+			info_distro.sh
+			if [ $(command -v stdbuf) ]&&[ "${arch}" != "x86_64" ]; then
 				unbuffer="stdbuf -i0 -o0 -e0"
 			fi
 
@@ -134,4 +138,4 @@ if [ -z "${autoinstall}" ]; then
 			* ) echo "Please answer yes or no.";;
 		esac
 	done
-fi
+fi

+ 3 - 2
lgsm/functions/update_steamcmd.sh

@@ -19,8 +19,9 @@ fn_update_steamcmd_dl(){
 
 	cd "${rootdir}/steamcmd"
 
-	# Detects if unbuffer command is available.
-	if [ $(command -v stdbuf) ]; then
+	# Detects if unbuffer command is available for 32 bit distributions only.
+	info_distro.sh
+	if [ $(command -v stdbuf) ]&&[ "${arch}" != "x86_64" ]; then
 		unbuffer="stdbuf -i0 -o0 -e0"
 	fi
 

+ 80 - 35
tests/tests_jc2server.sh

@@ -1,60 +1,90 @@
 #!/bin/bash
-# TravisCI Tests: Just Cause 2
-# Server Management Script
+# Just Cause 2
+# Project: Game Server Managers - LinuxGSM
 # Author: Daniel Gibbs
+# License: MIT License, Copyright (c) 2016 Daniel Gibbs
+# Purpose: TravisCI Test: Just Cause 2 | Server Management Script
+# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors
+# Documentation: https://github.com/GameServerManagers/LinuxGSM/wiki
 # Website: https://gameservermanagers.com
-version="101716"
 
+travistest=1
+
+# Debugging
 if [ -f ".dev-debug" ]; then
 	exec 5>dev-debug.log
 	BASH_XTRACEFD="5"
 	set -x
 fi
 
-#### Variables ####
+version="161113"
 
-# Notification Alerts
-# (on|off)
+##########################
+######## Settings ########
+##########################
+
+#### Server Settings ####
+# No settings available for Just Cause 2
+
+## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
+# Edit with care
+fn_parms(){
+parms=""
+}
+
+#### LinuxGSM Settings ####
 
-# Email
+## Notification Alerts
+# (on|off)
+# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email
 emailalert="off"
 email="email@example.com"
-#emailfrom="email@example.com"
-
-# Pushbullet
-# https://www.pushbullet.com/#settings
+emailfrom=""
+# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet
 pushbulletalert="off"
 pushbullettoken="accesstoken"
 
-# Steam login
-steamuser="anonymous"
-steampass=""
-
-# Start Variables
+## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update
 updateonstart="off"
 
-fn_parms(){
-parms=""
-}
+## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup
+maxbackups="4"
+maxbackupdays="30"
+stoponbackup="on"
 
-#### Advanced Variables ####
+## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging
+consolelogging="on"
+logdays="7"
+
+#### LinuxGSM Advanced Settings ####
+
+## SteamCMD Settings
+# Server appid
+appid="261140"
+# Steam App Branch Select
+# Allows to opt into the various Steam app branches. Default branch is "".
+# Example: "-beta latest_experimental"
+branch=""
 
-# Github Branch Select
+## Github Branch Select
 # Allows for the use of different function files
 # from a different repo and/or branch.
 githubuser="GameServerManagers"
 githubrepo="LinuxGSM"
 githubbranch="$TRAVIS_BRANCH"
 
-# Steam
-appid="261140"
-
-# Server Details
-servicename="jc2-server"
+## LinuxGSM Server Details
+# Do not edit
 gamename="Just Cause 2"
 engine="avalanche"
 
-# Directories
+## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers
+servicename="jc2-server"
+
+#### Directories ####
+# Edit with care
+
+## Work Directories
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 lockselfname=".${servicename}.lock"
@@ -63,6 +93,8 @@ functionsdir="${lgsmdir}/functions"
 libdir="${lgsmdir}/lib"
 tmpdir="${lgsmdir}/tmp"
 filesdir="${rootdir}/serverfiles"
+
+## Server Specific Directories
 systemdir="${filesdir}"
 executabledir="${filesdir}"
 executable="./Jcmp-Server"
@@ -70,24 +102,26 @@ servercfg="config.lua"
 servercfgdefault="config.lua"
 servercfgdir="${filesdir}"
 servercfgfullpath="${servercfgdir}/${servercfg}"
+
+## Backup Directory
 backupdir="${rootdir}/backups"
 
-# Logging
-logdays="7"
+## Logging Directories
 #gamelogdir="" # No server logs available
 scriptlogdir="${rootdir}/log/script"
 consolelogdir="${rootdir}/log/console"
-consolelogging="on"
-
 scriptlog="${scriptlogdir}/${servicename}-script.log"
 consolelog="${consolelogdir}/${servicename}-console.log"
 emaillog="${scriptlogdir}/${servicename}-email.log"
 
-scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
-consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').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
+########################
+######## Script ########
+###### Do not edit #####
+########################
 
 # Fetches core_dl for file downloads
 fn_fetch_core_dl(){
@@ -144,6 +178,17 @@ 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