Преглед на файлове

Merge branch 'develop' into feature/sbotserver

Daniel Gibbs преди 7 години
родител
ревизия
8814bc07be
променени са 47 файла, в които са добавени 262 реда и са изтрити 201 реда
  1. 13 0
      .editorconfig
  2. 13 3
      .github/ISSUE_TEMPLATE/bug_report.md
  3. 6 0
      .github/ISSUE_TEMPLATE/feature_request.md
  4. 3 3
      .github/ISSUE_TEMPLATE/new-server-request.md
  5. 4 0
      .github/release-drafter.yml
  6. 4 0
      .github/topissuebot.yml
  7. 4 0
      .github/write-good.yml
  8. 2 1
      lgsm/config-default/config-lgsm/arkserver/_default.cfg
  9. 7 7
      lgsm/config-default/config-lgsm/csgoserver/_default.cfg
  10. 1 1
      lgsm/config-default/config-lgsm/inssserver/_default.cfg
  11. 31 33
      lgsm/functions/alert_discord.sh
  12. 1 1
      lgsm/functions/alert_mailgun.sh
  13. 1 1
      lgsm/functions/alert_pushover.sh
  14. 1 1
      lgsm/functions/alert_telegram.sh
  15. 2 2
      lgsm/functions/check_config.sh
  16. 1 1
      lgsm/functions/check_deps.sh
  17. 1 1
      lgsm/functions/check_ip.sh
  18. 1 1
      lgsm/functions/check_logs.sh
  19. 1 1
      lgsm/functions/check_status.sh
  20. 1 3
      lgsm/functions/command_console.sh
  21. 0 1
      lgsm/functions/command_debug.sh
  22. 1 1
      lgsm/functions/command_details.sh
  23. 2 2
      lgsm/functions/command_dev_clear_functions.sh
  24. 1 1
      lgsm/functions/command_dev_query_raw.sh
  25. 18 0
      lgsm/functions/command_donate.sh
  26. 5 5
      lgsm/functions/command_fastdl.sh
  27. 6 6
      lgsm/functions/command_install.sh
  28. 4 4
      lgsm/functions/command_monitor.sh
  29. 1 1
      lgsm/functions/command_postdetails.sh
  30. 1 1
      lgsm/functions/command_start.sh
  31. 9 11
      lgsm/functions/command_stop.sh
  32. 6 6
      lgsm/functions/command_update.sh
  33. 0 8
      lgsm/functions/command_validate.sh
  34. 2 2
      lgsm/functions/command_wipe.sh
  35. 10 4
      lgsm/functions/core_functions.sh
  36. 16 11
      lgsm/functions/core_getopt.sh
  37. 14 14
      lgsm/functions/fix.sh
  38. 3 3
      lgsm/functions/fix_steamcmd.sh
  39. 35 35
      lgsm/functions/info_config.sh
  40. 7 3
      lgsm/functions/info_distro.sh
  41. 12 11
      lgsm/functions/info_parms.sh
  42. 4 4
      lgsm/functions/install_header.sh
  43. 1 1
      lgsm/functions/install_server_files.sh
  44. 1 1
      lgsm/functions/mods_core.sh
  45. 2 2
      lgsm/functions/mods_list.sh
  46. 1 1
      lgsm/functions/update_steamcmd.sh
  47. 2 2
      lgsm/functions/update_ts3.sh

+ 13 - 0
.editorconfig

@@ -0,0 +1,13 @@
+# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs.
+# Atom: Please assure your Atom's config setting Tab Type is set to auto, otherwise Atom-EditorConfig may not work as expected. Also disable whitespace package.
+# http://editorconfig.org/
+
+root = true
+
+[*]
+charset = utf-8
+indent_style = tab
+indent_size = 4
+trim_trailing_whitespace = true
+end_of_line = lf
+insert_final_newline = true

+ 13 - 3
.github/ISSUE_TEMPLATE/bug_report.md

@@ -1,6 +1,7 @@
+
 ---
 name: Bug report
-about: Create a report to help us improve
+about: Found a bug? Raise a report
 
 ---
 
@@ -8,18 +9,27 @@ Follow **[this guide](https://linuxgsm.com/support/#guide)** to make sure you po
 For general support visit the **[steam group](https://linuxgsm.com/steam)**.
 
 GitHub is **ONLY** for:
+```
 * LinuxGSM bugs
 * feature suggestions
 * code contributions
+```
 
 GitHub is **NOT** for:
+```
 * General support
 * Specific game server issues (e.g CS:GO, TF2)
 * Dedicated server issues (e.g Ubuntu, CentOS)
 * Anything not directly related to LinuxGSM development
-
+```
 Any general support issues on GitHub will be closed.
 
+*Please use the template below*
+
+**Basic info**
+Game: 
+Distro: 
+
 **Describe the bug**
 A clear and concise description of what the bug is.
 
@@ -33,7 +43,7 @@ Steps to reproduce the behaviour:
 **Expected behaviour**
 A clear and concise description of what you expected to happen.
 
-** Minimum Information **
+**Minimum Information**
 The game server you are running (e.g. Rust/CS:GO).
 The link from `./gameserver postdetails` command.
 

+ 6 - 0
.github/ISSUE_TEMPLATE/feature_request.md

@@ -20,6 +20,12 @@ GitHub is **NOT** for:
 
 Any general support issues on GitHub will be closed.
 
+*Please use the template below*
+
+**Basic info**
+Game: 
+Distro: 
+
 **Is your feature request related to a problem? Please describe.**
 A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
 

+ 3 - 3
.github/ISSUE_TEMPLATE/new-server-request.md

@@ -4,13 +4,13 @@ about: Suggest a new game server to be added
 
 ---
 
-**What game server Would you like adding?**
+**What game server would you like adding?**
 
 **Can you link to any tutorials or guides?**
 Any useful guides will help with development
 
 **Is the server on Steam?**
-If yes Use SteamDB to get the appid. https://steamdb.info/
+If yes Use SteamDB to get the appid. (https://steamdb.info)
 
 **Is the server supported on Linux?**
-We only support Linux servers and dont support Wine.
+We only support Linux servers and do not support Wine.

+ 4 - 0
.github/release-drafter.yml

@@ -0,0 +1,4 @@
+template: |
+  ## Changelog
+
+  $CHANGES

+ 4 - 0
.github/topissuebot.yml

@@ -0,0 +1,4 @@
+# Configuration for top-issue-bot
+labelName: ":thumbsup: Top Issue!"
+labelColor: "f442c2"
+numberOfIssuesToLabel: 5

+ 4 - 0
.github/write-good.yml

@@ -0,0 +1,4 @@
+# .github/write-good.yml
+writeGood: true
+alex: true
+spellchecker: true

+ 2 - 1
lgsm/config-default/config-lgsm/arkserver/_default.cfg

@@ -13,12 +13,13 @@ ip="0.0.0.0"
 port="7777"
 queryport="27015"
 rconport="27020"
+# Default Map: TheIsland, Ragnarok, CrystalIsles, Aberration_P, ScorchedEarth_P
 defaultmap="TheIsland"
 maxplayers="70"
 
 ## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
 fn_parms(){
-parms="\"${defaultmap}?listen?MultiHome=${ip}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port}?\""
+parms="\"${defaultmap}?AltSaveDirectoryName=${defaultmap}?listen?MultiHome=${ip}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port} -automanagedmods\""
 }
 
 #### LinuxGSM Settings ####

+ 7 - 7
lgsm/config-default/config-lgsm/csgoserver/_default.cfg

@@ -10,14 +10,14 @@
 
 ## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
 # https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers#Starting_the_Server
-# [Game Modes]			gametype	gamemode
-# Arms Race				1			0
-# Classic Casual		0			0
-# Classic Competitive	0			1
+# [Game Modes]			gametype	gamemode	mapgroup (you can mix these across Game Modes, but use only one)
+# Arms Race				1			0			mg_armsrace
+# Classic Casual		0			0			mg_casualsigma, mg_casualdelta
+# Classic Competitive	0			1			mg_active, mg_reserves, mg_hostage, mg_de_dust2
 # Custom				3			0
-# Deathmatch			1			2
-# Demolition			1			1
-# Wingman				0			2
+# Deathmatch			1			2			mg_deathmatch
+# Demolition			1			1			mg_demolition
+# Wingman				0			2			
 gametype="0"
 gamemode="0"
 mapgroup="mg_active"

+ 1 - 1
lgsm/config-default/config-lgsm/inssserver/_default.cfg

@@ -21,7 +21,7 @@ maxplayers="28"
 
 ## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
 fn_parms(){
-parms="${defaultmap}?Scenario=${defaultscenario}?MaxPlayers=${maxplayers} -password=${serverpassword} -Port=${port} -QueryPort=${queryport} -hostname='${servername}' -log"
+parms="${defaultmap}?Scenario=${defaultscenario}?MaxPlayers=${maxplayers}?Port=${port}?QueryPort=${queryport}  -password=${serverpassword} -hostname='${servername}' -log"
 }
 
 #### LinuxGSM Settings ####

+ 31 - 33
lgsm/functions/alert_discord.sh

@@ -1,49 +1,47 @@
 #!/bin/bash
 # LinuxGSM alert_discord.sh function
 # Author: Daniel Gibbs
-# Contributor: faflfama
+# Contributor: faflfama, diamondburned
 # Website: https://linuxgsm.com
 # Description: Sends Discord alert.
 
+if ! command -v jq > /dev/null; then
+	fn_print_fail_nl "Sending Discord alert: jq is missing."
+	fn_script_log_fatal "Sending Discord alert: jq is missing."
+fi
+
+escaped_servername="$(echo -n "${servername}" | jq -sRr "@json")"
+escaped_alertbody="$(echo -n "${alertbody}" | jq -sRr "@json")"
+
 json=$(cat <<EOF
 {
-"username":"LinuxGSM",
-"avatar_url":"https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.png",
-"file":"content",
-
-"embeds": [{
-	"color": "2067276",
-	"author": {"name": "${alertemoji} ${alertsubject} ${alertemoji}", "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.png"},
-	"title": "",
-	"description": "",
-	"url": "",
-	"type": "content",
-	"thumbnail": {"url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.png"},
-	"footer": {"text": "LinuxGSM", "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.png"},
-	"fields": [
-			{
-				"name": "Alert Message",
-				"value": "${alertbody}"
-			},
+	"username":"LinuxGSM",
+	"avatar_url":"https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/data/alert_discord_logo.png",
+	"file":"content",
+	"embeds": [{
+		"color": "2067276",
+		"author": {"name": "${alertemoji} ${alertsubject}", "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.png"},
+		"title": "",
+		"description": ${escaped_alertbody},
+		"url": "",
+		"type": "content",
+		"thumbnail": {},
+		"footer": {"text": "Hostname: ${HOSTNAME} / More info: ${alerturl}", "icon_url": ""},
+		"fields": [
 			{
 				"name": "Game",
-				"value": "${gamename}"
-			},
-			{
-				"name": "Server name",
-				"value": "${servername}"
-			},
-			{
-				"name": "Hostname",
-				"value": "${HOSTNAME}"
+				"value": "${gamename}",
+				"inline": true
 			},
 			{
 				"name": "Server IP",
-				"value": "[${extip:-$ip}:${port}](https://www.gametracker.com/server_info/${extip:-$ip}:${port})"
+				"value": "[${extip:-$ip}:${port}](https://www.gametracker.com/server_info/${extip:-$ip}:${port})",
+				"inline": true
 			},
 			{
-				"name": "More info",
-				"value": "${alerturl}"
+				"name": "Server Name",
+				"value": ${escaped_servername},
+				"inline": true
 			}
 		]
 	}]
@@ -52,8 +50,8 @@ EOF
 )
 
 fn_print_dots "Sending Discord alert"
-sleep 0.5
-discordsend=$(${curlpath} -sSL -H "Content-Type: application/json" -X POST -d """${json}""" "${discordwebhook}")
+
+discordsend=$(${curlpath} -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "$json" | jq -c .)" "${discordwebhook}")
 
 if [ -n "${discordsend}" ]; then
 	fn_print_fail_nl "Sending Discord alert: ${discordsend}"

+ 1 - 1
lgsm/functions/alert_mailgun.sh

@@ -17,7 +17,7 @@ mailgunsend=$(${curlpath} -s --user "api:${mailguntoken}" \
 -F subject="${alertemoji} ${alertsubject} ${alertemoji}" \
 -F o:tag='alert' \
 -F o:tag='LinuxGSM' \
--F text="$(cat "${alertlog}")" https://api.mailgun.net/v3/${mailgundomain}/messages)
+-F text="$(cat "${alertlog}")" "https://api.mailgun.net/v3/${mailgundomain}/messages")
 
 if [ -z "${mailgunsend}" ]; then
 	fn_print_fail_nl "Sending Email alert: Mailgun: ${email}"

+ 1 - 1
lgsm/functions/alert_pushover.sh

@@ -24,7 +24,7 @@ else
 	alertpriority="0"
 fi
 
-pushoversend=$(${curlpath} -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}"  -F priority="${alertpriority}" -F title="${alertemoji} ${alertsubject} ${alertemoji}" -F message=" <b>Message</b><br>${alertbody}<br><br><b>Game</b><br>${gamename}<br><br><b>Server name</b><br>${servername}<br><br><b>Hostname</b><br>${HOSTNAME}<br><br><b>Server IP</b><br><a href='https://www.gametracker.com/server_info/${ip}:${port}'>${ip}:${port}</a><br><br><b>More info</b><br><a href='${alerturl}'>${alerturl}</a>" "https://api.pushover.net/1/messages.json" | grep errors)
+pushoversend=$(${curlpath} -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}"  -F priority="${alertpriority}" -F title="${alertemoji} ${alertsubject} ${alertemoji}" -F message=" <b>Message</b><br>${alertbody}<br><br><b>Game</b><br>${gamename}<br><br><b>Server name</b><br>${servername}<br><br><b>Hostname</b><br>${HOSTNAME}<br><br><b>Server IP</b><br><a href='https://www.gametracker.com/server_info/${extip:-$ip}:${port}'>${extip:-$ip}:${port}</a><br><br><b>More info</b><br><a href='${alerturl}'>${alerturl}</a>" "https://api.pushover.net/1/messages.json" | grep errors)
 
 if [ -n "${pushoversend}" ]; then
 	fn_print_fail_nl "Sending Pushover alert: ${pushoversend}"

+ 1 - 1
lgsm/functions/alert_telegram.sh

@@ -12,7 +12,7 @@ json=$(cat <<EOF
 {
 	"chat_id": "${telegramchatid}",
 	"parse_mode": "HTML",
-	"text": "${alertemoji} <b>${alertsubject}</b> ${alertemoji}\n\n<b>Message</b>\n${alertbody}\n\n<b>Game</b>\n${gamename}\n\n<b>Server name</b>\n${servername}\n\n<b>Hostname</b>\n${HOSTNAME}\n\n<b>Server IP</b>\n<a href='https://www.gametracker.com/server_info/${ip}:${port}'>${ip}:${port}</a>\n\n<b>More info</b>\n<a href='${alerturl}'>${alerturl}</a>",
+	"text": "${alertemoji} <b>${alertsubject}</b> ${alertemoji}\n\n<b>Message</b>\n${alertbody}\n\n<b>Game</b>\n${gamename}\n\n<b>Server name</b>\n${servername}\n\n<b>Hostname</b>\n${HOSTNAME}\n\n<b>Server IP</b>\n<a href='https://www.gametracker.com/server_info/${extip:-$ip}:${port}'>${extip:-$ip}:${port}</a>\n\n<b>More info</b>\n<a href='${alerturl}'>${alerturl}</a>",
 	"disable_web_page_preview": "yes",
 EOF
 )

+ 2 - 2
lgsm/functions/check_config.sh

@@ -8,7 +8,7 @@ local commandname="CHECK"
 local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if [ ! -e "${servercfgfullpath}" ]; then
-	if [ "${gamename}" != "Hurtworld" ]&&[ "${shortname}" != "ut3" ]&&[ "${shortname}" != "kf2" ]; then
+	if [ "${shortname}" != "hw" ]&&[ "${shortname}" != "ut3" ]&&[ "${shortname}" != "kf2" ]; then
 		fn_print_dots ""
 		sleep 0.5
 		fn_print_warn_nl "Configuration file missing!"
@@ -20,7 +20,7 @@ if [ ! -e "${servercfgfullpath}" ]; then
 	fi
 fi
 
-if [ "${gamename}" == "Rust" ]; then
+if [ "${shortname}" == "rust" ]; then
 	if  [ -z "${rconpassword}" ]; then
 		fn_print_dots ""
 		sleep 0.5

+ 1 - 1
lgsm/functions/check_deps.sh

@@ -474,7 +474,7 @@ fn_deps_build_redhat(){
 	# Brainbread 2, Don't Starve Together & Team Fortress 2
 	elif [ "${shortname}" == "bb2" ]||[ "${shortname}" == "dst" ]||[ "${shortname}" == "tf2" ]; then
 		array_deps_required+=( libcurl.i686 )
-		if [ "${gamename}" == "Team Fortress 2" ]; then
+		if [ "${shortname}" == "tf2" ]; then
 			array_deps_required+=( gperftools-libs.i686 )
 		fi
 	# Battlefield: 1942

+ 1 - 1
lgsm/functions/check_ip.sh

@@ -7,7 +7,7 @@
 
 local commandname="CHECK"
 
-if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travistest}" != "1" ]; then
+if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${travistest}" != "1" ]; then
 	if [ ! -f "/bin/ip" ]; then
 		ipcommand="/sbin/ip"
 	else

+ 1 - 1
lgsm/functions/check_logs.sh

@@ -16,7 +16,7 @@ fn_check_logs(){
 }
 
 # Create directories for the script and console logs
-if [ ! -d "${lgsmlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${gamename}" != "TeamSpeak 3" ]; then
+if [ ! -d "${lgsmlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${shortname}" != "ts3" ]; then
 	fn_check_logs
 fi
 

+ 1 - 1
lgsm/functions/check_status.sh

@@ -12,7 +12,7 @@ if [ "${shortname}" == "ts3" ]; then
 	# 1: Server is running
 	# 0: Server seems to have died
 	# 0: No server running (ts3server.pid is missing)
-	status=$("${executabledir}/ts3server_startscript.sh" status servercfgfullpathfile=${servercfgfullpath})
+	status=$("${executabledir}/ts3server_startscript.sh" status servercfgfullpathfile="${servercfgfullpath}")
 	if [ "${status}" == "Server is running" ]; then
 		status=1
 	else

+ 1 - 3
lgsm/functions/command_console.sh

@@ -10,10 +10,8 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 fn_print_header
-if [ "${gamename}" == "Rust" ]||[ "${gamename}" == "Hurtworld" ]||[ "${gamename}" == "ARK: Survival Evolved" ]; then
+if [ "${shortname}" == "rust" ]||[ "${shortname}" == "hw" ]||[ "${shortname}" == "ark" ]; then
 	fn_print_information_nl "${gamename} does not produce a verbose output to the console"
-fi
-if [ "${gamename}" == "Rust" ]||[ "${gamename}" == "Hurtworld" ]||[ "${gamename}" == "ARK: Survival Evolved" ]; then
 	fn_print_information_nl "${gamename} does not allow server commands to be entered in to the console"
 fi
 fn_print_information_nl "Press \"CTRL+b\" then \"d\" to exit console."

+ 0 - 1
lgsm/functions/command_debug.sh

@@ -56,7 +56,6 @@ if [ "${multiple_ip}" == "1" ]; then
 else
 	echo -e "${blue}Server IP:\t${default}${ip}:${port}"
 fi
-echo -e "${blue}Server IP:\t${default}${ip}:${port}"
 # External server ip
 if [ -n "${extip}" ]; then
 	if [ "${ip}" != "${extip}" ]; then

+ 1 - 1
lgsm/functions/command_details.sh

@@ -24,7 +24,7 @@ fn_info_message_gameserver
 fn_info_message_script
 fn_info_message_backup
 # Some game servers do not have parms.
-if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${engine}" != "avalanche2.0" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]&&[ "${engine}" != "renderware" ]; then
+if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "jc2" ]&&[ "${shortname}" != "dst" ]&&[ "${shortname}" != "pz" ]&&[ "${engine}" != "renderware" ]; then
 	fn_parms
 	fn_info_message_commandlineparms
 fi

+ 2 - 2
lgsm/functions/command_dev_clear_functions.sh

@@ -9,7 +9,7 @@ echo "Clear Functions"
 echo "================================="
 echo ""
 if fn_prompt_yn "Do you want to delete all functions?" Y; then
-	rm -rfv "${functionsdir}"/*
-	rm -rfv "${configdirdefault}"/*
+	rm -rfv "${functionsdir:?}/"*
+	rm -rfv "${configdirdefault:?}/"*
 fi
 core_exit.sh

+ 1 - 1
lgsm/functions/command_dev_query_raw.sh

@@ -24,7 +24,7 @@ info_config.sh
 info_parms.sh
 if [ "${engine}" == "idtech3_ql" ]; then
 	local engine="quakelive"
-elif [ "${gamename}" == "Killing Floor 2" ]; then
+elif [ "${shortname}" == "kf2" ]; then
 	local engine="unreal4"
 fi
 

+ 18 - 0
lgsm/functions/command_donate.sh

@@ -0,0 +1,18 @@
+#!/bin/bash
+# LinuxGSM command_donate.sh function
+# Author: Daniel Gibbs
+# Website: https://linuxgsm.com
+# Description: Shows ways to donate
+
+echo -e ""
+echo -e "${lightyellow}Support LinuxGSM${default}"
+echo -e "================================="
+echo -e ""
+echo -e "Been using LinuxGSM?"
+echo -e "Consider donating to support development."
+echo -e ""
+echo -e "* ${blue}Patreon:${default} https://linuxgsm.com/patreon"
+echo -e "* ${blue}PayPal:${default} https://linuxgsm.com/paypal"
+echo -e "* ${blue}Flattr:${default} https://linuxgsm.com/flattr"
+echo -e ""
+echo -e "LinuxGSM has been going since 2012"

+ 5 - 5
lgsm/functions/command_fastdl.sh

@@ -51,7 +51,7 @@ if [ -d "${fastdldir}" ]; then
 fi
 
 # Garry's Mod Specific
-if [ "${gamename}" == "Garry's Mod" ]; then
+if [ "${shortname}" == "gmod" ]; then
 	# Prompt for download enforcer, which is using a .lua addfile resource generator
 	if fn_prompt_yn "Force clients to download files?" Y; then
 		luaresource="on"
@@ -152,7 +152,7 @@ fn_fastdl_preview(){
 	echo -e "analysing required files"
 	fn_script_log_info "Analysing required files"
 	# Garry's Mod
-	if [ "${gamename}" == "Garry's Mod" ]; then
+	if [ "${shortname}" == "gmod" ]; then
 		cd "${systemdir}" || exit
 		allowed_extentions_array=( "*.ain" "*.bsp" "*.mdl" "*.mp3" "*.ogg" "*.otf" "*.pcf" "*.phy" "*.png" "*.vtf" "*.vmt" "*.vtx" "*.vvd" "*.ttf" "*.wav" )
 		for allowed_extention in "${allowed_extentions_array[@]}"; do
@@ -207,7 +207,7 @@ fn_fastdl_preview(){
 		sleep 0.5
 		totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt")
 		# Calculates total file size
-		while read dufile; do
+		while read -r dufile; do
 			filesize=$(stat -c %s "${dufile}")
 			filesizetotal=$(( ${filesizetotal} + ${filesize} ))
 			exitcode=$?
@@ -358,7 +358,7 @@ fn_fastdl_build(){
 	# Copy all needed files for FastDL
 	echo -e "copying files to ${fastdldir}"
 	fn_script_log_info "Copying files to ${fastdldir}"
-	if [ "${gamename}" == "Garry's Mod" ]; then
+	if [ "${shortname}" == "gmod" ]; then
 		fn_fastdl_gmod
 		fn_fastdl_gmod_dl_enforcer
 	else
@@ -387,7 +387,7 @@ fn_fastdl_gmod_dl_enforcer(){
 		echo -en "creating new download enforcer: ${luafastdlfile}..."
 		touch "${luafastdlfullpath}"
 		# Read all filenames and put them into a lua file at the right path
-		while read line; do
+		while read -r line; do
 			echo "resource.AddFile( \"${line}\" )" >> "${luafastdlfullpath}"
 		done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -printf '%P\n')
 		exitcode=$?

+ 6 - 6
lgsm/functions/command_install.sh

@@ -19,7 +19,7 @@ else
 	check_deps.sh
 	installflag=1
 	# Download and install
-	if [ "${gamename}" == "Unreal Tournament 2004" ]; then
+	if [ "${shortname}" == "ut2k4" ]; then
 		install_server_files.sh
 		install_ut2k4_key.sh
 	elif [ -z "${appid}" ]; then
@@ -32,15 +32,15 @@ else
 
 	# Configuration
 	install_config.sh
-	if [ "${gamename}" == "BrainBread 2" ]||[ "${gamename}" == "Black Mesa: Deathmatch" ]||[ "${gamename}" == "Counter-Strike: Global Offensive" ]||[ "${gamename}" == "Empires Mod" ]||[ "${gamename}" == "Garry’s Mod" ]||[ "${gamename}" == "No more Room in Hell" ]||[ "${gamename}" == "Team Fortress 2" ]||[ "${gamename}" == "Tower Unite" ]; then
+	if [ "${shortname}" == "bb2" ]||[ "${shortname}" == "bmdm" ]||[ "${shortname}" == "csgo" ]||[ "${shortname}" == "em" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "nmrih" ]||[ "${shortname}" == "tf2" ]||[ "${shortname}" == "tu" ]; then
 		install_gslt.sh
-	elif [ "${gamename}" == "Don't Starve Together" ]; then
+	elif [ "${shortname}" == "dst" ]; then
 		install_dst_token.sh
-	elif [ "${gamename}" == "Squad" ]; then
+	elif [ "${shortname}" == "squad" ]; then
 		install_squad_license.sh
-	elif [ "${gamename}" == "TeamSpeak 3" ]; then
+	elif [ "${shortname}" == "ts3" ]; then
 		install_ts3db.sh
-	elif [ "${gamename}" == "Multi Theft Auto" ]; then
+	elif [ "${shortname}" == "mta" ]; then
 		command_install_resources_mta.sh
 	fi
 

+ 4 - 4
lgsm/functions/command_monitor.sh

@@ -110,9 +110,9 @@ fn_monitor_check_session(){
 		fn_print_ok_eol_nl
 		fn_script_log_pass "Checking session: OK"
 	else
-		if [ "${gamename}" == "TeamSpeak 3" ]; then
+		if [ "${shortname}" == "ts3" ]; then
 			fn_print_error "Checking session: ${ts3error}: "
-		elif [ "${gamename}" == "Mumble" ]; then
+		elif [ "${shortname}" == "mumble" ]; then
 			fn_print_error "Checking session: Not listening to port ${queryport}"
 		else
 			fn_print_error "Checking session: "
@@ -137,7 +137,7 @@ fn_monitor_query(){
 		if [ "${allowed_engine}" == "${engine}" ]; then
 			if [ "${engine}" == "idtech3_ql" ]; then
 				local engine="quakelive"
-			elif [ "${gamename}" == "Killing Floor 2" ]; then
+			elif [ "${shortname}" == "kf2" ]; then
 				local engine="unreal4"
 			fi
 
@@ -186,7 +186,7 @@ fn_monitor_check_lockfile
 fn_monitor_check_update
 fn_monitor_check_session
 # Query has to be enabled in Starbound config
-if [ "${gamename}" == "Starbound" ]; then
+if [ "${shortname}" == "sb" ]; then
 	if [ "${queryenabled}" == "true" ]; then
 		fn_monitor_query
 	fi

+ 1 - 1
lgsm/functions/command_postdetails.sh

@@ -68,7 +68,7 @@ else
 		fn_info_message_script
 		fn_info_message_backup
 		# Some game servers do not have parms.
-		if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${engine}" != "avalanche2.0" ]&&[ "${engine}" != "avalanche3.0" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]&&[ "${engine}" != "renderware" ]; then
+		if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "jc2" ]&&[ "${shortname}" != "jc3" ]&&[ "${shortname}" != "dst" ]&&[ "${shortname}" != "pz" ]&&[ "${engine}" != "renderware" ]; then
 			fn_parms
 			fn_info_message_commandlineparms
 		fi

+ 1 - 1
lgsm/functions/command_start.sh

@@ -214,7 +214,7 @@ if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateon
 	command_update.sh
 fi
 
-if [ "${gamename}" == "TeamSpeak 3" ]; then
+if [ "${shortname}" == "ts3" ]; then
 	fn_start_teamspeak3
 else
 	fn_start_tmux

+ 9 - 11
lgsm/functions/command_stop.sh

@@ -174,22 +174,22 @@ fn_stop_graceful_sdtd(){
 }
 
 fn_stop_graceful_select(){
-	if [ "${gamename}" == "7 Days To Die" ]; then
+	if [ "${shortname}" == "sdtd" ]; then
 		fn_stop_graceful_sdtd
 	elif [ "${engine}" == "Spark" ]; then
 		fn_stop_graceful_cmd "q" 30
-	elif [ "${gamename}" == "Terraria" ]; then
+	elif [ "${shortname}" == "terraria" ]; then
 		fn_stop_graceful_cmd "exit" 30
-	elif [ "${gamename}" == "Minecraft" ]; then
+	elif [ "${shortname}" == "mc" ]; then
 		fn_stop_graceful_cmd "stop" 30
-	elif [ "${gamename}" == "Multi Theft Auto" ]; then
+	elif [ "${shortname}" == "mta" ]; then
 		# we need a long wait time here as resources are stopped individually and process their own shutdowns
 		fn_stop_graceful_cmd "quit" 120
 	elif [ "${engine}" == "goldsource" ]; then
 		fn_stop_graceful_goldsource
-	elif [ "${engine}" == "avalanche2.0" ]||[ "${engine}" == "avalanche3.0" ]||[ "${gamename}" == "Factorio" ]||[ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal4" ]||[ "${engine}" == "unreal3" ]||[ "${engine}" == "unreal2" ]||[ "${engine}" == "unreal" ]||[ "${gamename}" == "Mumble" ]||[ "${shortname}" == "wurm" ]; then
+	elif [ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal4" ]||[ "${engine}" == "unreal3" ]||[ "${engine}" == "unreal2" ]||[ "${engine}" == "unreal" ]||[ "${shortname}" == "fctr" ]||[ "${shortname}" == "mumble" ]||[ "${shortname}" == "wurm" ]||[ "${shortname}" == "jc2" ]||[ "${shortname}" == "jc3" ]; then
 		fn_stop_graceful_ctrlc
-	elif  [ "${engine}" == "source" ]||[ "${engine}" == "quake" ]||[ "${engine}" == "idtech2" ]||[ "${engine}" == "idtech3" ]||[ "${engine}" == "idtech3_ql" ]||[ "${engine}" == "Just Cause 2" ]||[ "${engine}" == "projectzomboid" ]||[ "${shortname}" == "rw" ]; then
+	elif  [ "${engine}" == "source" ]||[ "${engine}" == "quake" ]||[ "${engine}" == "idtech2" ]||[ "${engine}" == "idtech3" ]||[ "${engine}" == "idtech3_ql" ]||[ "${shortname}" == "jc2" ]||[ "${shortname}" == "pz" ]||[ "${shortname}" == "rw" ]; then
 		fn_stop_graceful_cmd "quit" 30
 	fi
 }
@@ -212,9 +212,7 @@ fn_stop_ark(){
 
 	if [ "${#queryport}" -gt 0 ] ; then
 		for (( pidcheck=0 ; pidcheck < ${maxpiditer} ; pidcheck++ )) ; do
-			pid=$(netstat -nap 2>/dev/null | grep "^udp[[:space:]]" |\
-				grep ":${queryport}[[:space:]]" | rev | awk '{print $1}' |\
-				rev | cut -d\/ -f1)
+			pid=$(netstat -nap 2>/dev/null | grep "^udp[[:space:]]" | grep ":${queryport}[[:space:]]" | rev | awk '{print $1}' | rev | cut -d\/ -f1)
 			#
 			# check for a valid pid
 			pid=${pid//[!0-9]/}
@@ -263,7 +261,7 @@ fn_stop_tmux(){
 	if [ "${status}" == "0" ]; then
 		# ARK doesn't clean up immediately after tmux is killed.
 		# Make certain the ports are cleared before continuing.
-		if [ "${gamename}" == "ARK: Survival Evolved" ]; then
+		if [ "${shortname}" == "ark" ]; then
 			fn_stop_ark
 		fi
 		fn_print_ok_nl "${servername}"
@@ -280,7 +278,7 @@ fn_stop_pre_check(){
 	if [ "${status}" == "0" ]; then # $status comes from check_status.sh, which is run by check.sh for this command
 		fn_print_info_nl "${servername} is already stopped"
 		fn_script_log_error "${servername} is already stopped"
-	elif [ "${gamename}" == "TeamSpeak 3" ]; then
+	elif [ "${shortname}" == "ts3" ]; then
 		fn_stop_teamspeak3
 	else
 		fn_stop_graceful_select

+ 6 - 6
lgsm/functions/command_update.sh

@@ -9,19 +9,19 @@ local commandaction="Update"
 local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_print_dots ""
-sleep 0.5
+sleep 0.2
 check.sh
 logs.sh
 
-if [ "${gamename}" == "TeamSpeak 3" ]; then
+if [ "${shortname}" == "ts3" ]; then
 	update_ts3.sh
-elif [ "${engine}" == "lwjgl2" ]; then
+elif [ "${shortname}" == "mc" ]; then
 	update_minecraft.sh
-elif [ "${gamename}" == "Mumble" ]; then
+elif [ "${shortname}" == "mumble" ]; then
 	update_mumble.sh
-elif [ "${gamename}" == "Factorio" ]; then
+elif [ "${shortname}" == "fctr" ]; then
 	update_factorio.sh
-elif [ "${gamename}" == "Multi Theft Auto" ]; then
+elif [ "${shortname}" == "mta" ]; then
 	update_mta.sh
 else
 	update_steamcmd.sh

+ 0 - 8
lgsm/functions/command_validate.sh

@@ -51,17 +51,9 @@ if [ "${status}" != "0" ]; then
 	exitbypass=1
 	command_stop.sh
 	fn_validation "${appid}"
-	# will also check for second appid
-	if [ "${gamename}" == "Classic Offensive" ]; then
-		fn_validation "${appid_co}"
-	fi
 	exitbypass=1
 	command_start.sh
 else
 	fn_validation
-	# will also check for second appid
-	if [ "${gamename}" == "Classic Offensive" ]; then
-		fn_validation "${appid_co}"
-	fi
 fi
 core_exit.sh

+ 2 - 2
lgsm/functions/command_wipe.sh

@@ -43,7 +43,7 @@ fn_wipe_exit_code(){
 # Removes files to wipe server
 fn_wipe_server_remove_files(){
 	# Rust Wipe
-	if [ "${gamename}" == "Rust" ]; then
+	if [ "${shortname}" == "rust" ]; then
 		# Wipe pocedural map
 		if [ -n "$(find "${serveridentitydir}" -type f -name "proceduralmap.*.map")" ]; then
 			currentaction="Removing map file(s): ${serveridentitydir}/proceduralmap.*.map"
@@ -188,7 +188,7 @@ fn_wipe_server_remove_files(){
 
 # Check if there is something to wipe, prompt the user, and call appropriate functions
 # Rust Wipe
-if [ "${gamename}" == "Rust" ]; then
+if [ "${shortname}" == "rust" ]; then
 	if [ -d "${serveridentitydir}/storage" ]||[ -d "${serveridentitydir}/user" ]||[ -n "$(find "${serveridentitydir}" -type f -name "proceduralmap*.sav")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "barren*.sav")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "Log.*.txt")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "player.deaths.*.db")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "player.blueprints.*.db")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "sv.files.*.db")" ]; then
 		fn_print_warning_nl "Any user, storage, log and map data from ${serveridentitydir} will be erased."
 		if ! fn_prompt_yn "Continue?" Y; then

+ 10 - 4
lgsm/functions/core_functions.sh

@@ -51,6 +51,12 @@ fn_fetch_function
 
 # Commands
 
+
+command_backup.sh(){
+functionfile="${FUNCNAME}"
+fn_fetch_function
+}
+
 command_console.sh(){
 functionfile="${FUNCNAME}"
 fn_fetch_function
@@ -61,22 +67,22 @@ functionfile="${FUNCNAME}"
 fn_fetch_function
 }
 
-command_postdetails.sh(){
+command_details.sh(){
 functionfile="${FUNCNAME}"
 fn_fetch_function
 }
 
-command_details.sh(){
+command_donate.sh(){
 functionfile="${FUNCNAME}"
 fn_fetch_function
 }
 
-command_test_alert.sh(){
+command_postdetails.sh(){
 functionfile="${FUNCNAME}"
 fn_fetch_function
 }
 
-command_backup.sh(){
+command_test_alert.sh(){
 functionfile="${FUNCNAME}"
 fn_fetch_function
 }

+ 16 - 11
lgsm/functions/core_getopt.sh

@@ -20,6 +20,7 @@ cmd_backup=( "b;backup" "command_backup.sh" "Create backup archives of the serve
 cmd_update_linuxgsm=( "ul;update-lgsm;uf;update-functions" "command_update_linuxgsm.sh" "Check and apply any LinuxGSM updates." )
 cmd_test_alert=( "ta;test-alert" "command_test_alert.sh" "Send a test alert." )
 cmd_monitor=( "m;monitor" "command_monitor.sh" "Check server status and restart if crashed." )
+cmd_donate=( "do;donate" "command_donate.sh" "Donation options." )
 # Console servers only
 cmd_console=( "c;console" "command_console.sh" "Access server console." )
 cmd_debug=( "d;debug" "command_debug.sh" "Start server directly in your terminal." )
@@ -51,6 +52,7 @@ cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect require
 cmd_dev_query_raw=( "qr;query-raw" "command_dev_query_raw.sh" "The raw output of gamedig and gsquery." )
 cmd_dev_clear_functions=( "cf;clear-functions" "command_dev_clear_functions.sh" "Delete the contents of the functions dir." )
 
+
 ### Set specific opt here ###
 
 currentopt=( "${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monitor[@]}" "${cmd_test_alert[@]}" "${cmd_details[@]}" "${cmd_postdetails[@]}" )
@@ -59,10 +61,10 @@ currentopt=( "${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monit
 currentopt+=( "${cmd_update_linuxgsm[@]}" )
 
 # Exclude noupdate games here
-if [ "${gamename}" != "Battlefield: 1942" ]&&[ "${engine}" != "quake" ]&&[ "${engine}" != "idtech2" ]&&[ "${engine}" != "idtech3" ]&&[ "${engine}" != "iw2.0" ]&&[ "${engine}" != "iw3.0" ]&&[ "${gamename}" != "San Andreas Multiplayer" ]; then
+if [ "${engine}" != "quake" ]&&[ "${engine}" != "idtech2" ]&&[ "${engine}" != "idtech3" ]&&[ "${engine}" != "iw2.0" ]&&[ "${engine}" != "iw3.0" ]&&[ "${shortname}" != "bf1942" ]&&[ "${shortname}" != "samp" ]; then
 	currentopt+=( "${cmd_update[@]}" )
 	# force update for SteamCMD only or MTA
-	if [ -n "${appid}" ]||[ "${gamename}" == "Multi Theft Auto" ]; then
+	if [ -n "${appid}" ]||[ "${shortname}" == "mta" ]; then
 		currentopt+=( "${cmd_force_update[@]}" )
 	fi
 fi
@@ -76,7 +78,7 @@ fi
 currentopt+=( "${cmd_backup[@]}" )
 
 # Exclude games without a console
-if [ "${gamename}" != "TeamSpeak 3" ]; then
+if [ "${shortname}" != "ts3" ]; then
 	currentopt+=( "${cmd_console[@]}" "${cmd_debug[@]}" )
 fi
 
@@ -88,16 +90,16 @@ if [ "${engine}" == "source" ]; then
 fi
 
 # TeamSpeak exclusive
-if [ "${gamename}" == "TeamSpeak 3" ]; then
+if [ "${shortname}" != "ts3" ]; then
 	currentopt+=( "${cmd_change_password[@]}" )
 fi
 
 # Unreal exclusive
-if [ "${gamename}" == "Rust" ]; then
+if [ "${shortname}" == "rust" ]; then
 	currentopt+=( "${cmd_wipe[@]}" "${cmd_wipeall[@]}" )
 fi
 if [ "${engine}" == "unreal2" ]; then
-	if [ "${gamename}" == "Unreal Tournament 2004" ]; then
+	if [ "${shortname}" == "ut2k4" ]; then
 		currentopt+=( "${cmd_install_cdkey[@]}" "${cmd_map_compressor_u2[@]}" )
 	else
 		currentopt+=( "${cmd_map_compressor_u2[@]}" )
@@ -108,22 +110,22 @@ if [ "${engine}" == "unreal" ]; then
 fi
 
 # DST exclusive
-if [ "${gamename}" == "Don't Starve Together" ]; then
+if [ "${shortname}" == "dst" ]; then
 	currentopt+=( "${cmd_install_dst_token[@]}" )
 fi
 
 # MTA exclusive
-if [ "${gamename}" == "Multi Theft Auto" ]; then
+if [ "${shortname}" == "mta" ]; then
 	currentopt+=( "${cmd_install_default_resources[@]}" )
 fi
 
 # Squad license exclusive
-if [ "${gamename}" == "Squad" ]; then
+if [ "${shortname}" == "squad" ]; then
 	currentopt+=( "${cmd_install_squad_license[@]}" )
 fi
 
 ## Mods commands
-if [ "${engine}" == "source" ]||[ "${gamename}" == "Rust" ]||[ "${gamename}" == "Hurtworld" ]||[ "${gamename}" == "7 Days To Die" ]; then
+if [ "${engine}" == "source" ]||[ "${shortname}" == "rust" ]||[ "${shortname}" == "hq" ]||[ "${shortname}" == "sdtd" ]; then
 	currentopt+=( "${cmd_mods_install[@]}" "${cmd_mods_remove[@]}" "${cmd_mods_update[@]}" )
 fi
 
@@ -136,6 +138,9 @@ if [ -f ".dev-debug" ]; then
 	currentopt+=( "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_clear_functions[@]}" )
 fi
 
+## Donate
+currentopt+=( "${cmd_donate[@]}" )
+
 ### Build list of available commands
 optcommands=()
 index="0"
@@ -150,7 +155,7 @@ done
 fn_opt_usage(){
 	echo "Usage: $0 [option]"
 	echo -e ""
-	echo "${gamename} - Linux Game Server Manager - Version ${version}"
+	echo "LinuxGSM - ${gamename} - Version ${version}"
 	echo "https://linuxgsm.com/${gameservername}"
 	echo -e ""
 	echo -e "${lightyellow}Commands${default}"

+ 14 - 14
lgsm/functions/fix.sh

@@ -42,25 +42,25 @@ if [ "${function_selfname}" != "command_install.sh" ]&&[ -z "${fixbypass}" ]; th
 		fix_steamcmd.sh
 	fi
 
-	if  [ "${gamename}" == "ARMA 3" ]; then
+	if  [ "${shortname}" == "arma3" ]; then
 		fix_arma3.sh
 	elif [ "${shortname}" == "ark" ]; then
 		fix_ark.sh
-	elif [ "${gamename}" == "Counter-Strike: Global Offensive" ]; then
+	elif [ "${shortname}" == "csgo" ]; then
 		fix_csgo.sh
-	elif [ "${gamename}" == "Don't Starve Together" ]; then
+	elif [ "${shortname}" == "dst" ]; then
 		fix_dst.sh
-	elif [ "${gamename}" == "GoldenEye: Source" ]; then
+	elif [ "${shortname}" == "ges" ]; then
 		fix_ges.sh
-	elif [ "${gamename}" == "Insurgency" ]; then
+	elif [ "${shortname}" == "ins" ]; then
 		fix_ins.sh
-	elif [ "${gamename}" == "Rust" ]; then
+	elif [ "${shortname}" == "rust" ]; then
 		fix_rust.sh
 	elif [ "${shortname}" == "rw" ]; then
 		fix_rw.sh
 	elif [ "${shortname}" == "ss3" ]; then
 		fix_ss3.sh
-	elif [ "${gamename}" == "Multi Theft Auto" ]; then
+	elif [ "${shortname}" == "mta" ]; then
 		fix_mta.sh
 	elif [ "${shortname}" == "wurm" ]; then
 		fix_wurm.sh
@@ -73,19 +73,19 @@ if [ "${function_selfname}" == "command_install.sh" ]; then
 		echo "Applying Post-Install Fixes"
 		echo "================================="
 		sleep 0.5
-		if [ "${gamename}" == "Killing Floor" ]; then
+		if [ "${shortname}" == "kf" ]; then
 			fix_kf.sh
-		elif [ "${gamename}" == "Killing Floor 2" ]; then
+		elif [ "${shortname}" == "kf2" ]; then
 			fix_kf2.sh
-		elif [ "${gamename}" == "Red Orchestra: Ostfront 41-45" ]; then
+		elif [ "${shortname}" == "ro" ]; then
 			fix_ro.sh
-		elif [ "${gamename}" == "Unreal Tournament 2004" ]; then
+		elif [ "${shortname}" == "ut2k4" ]; then
 			fix_ut2k4.sh
-		elif [ "${gamename}" == "Unreal Tournament" ]; then
+		elif [ "${shortname}" == "ut" ]; then
 			fix_ut.sh
-		elif [ "${gamename}" == "Unreal Tournament 3" ]; then
+		elif [ "${shortname}" == "ut3" ]; then
 			fix_ut3.sh
-		elif [ "${gamename}" == "Team Fortress 2" ]; then
+		elif [ "${shortname}" == "tf2" ]; then
 			fix_tf2.sh
 		else
 			fn_print_information_nl "No fixes required."

+ 3 - 3
lgsm/functions/fix_steamcmd.sh

@@ -17,7 +17,7 @@ if [ ! -f "${HOME}/.steam/sdk32/steamclient.so" ]; then
 	fn_fix_msg_end
 fi
 
-if [ "${gamename}" == "Serious Sam 3: BFE" ]; then
+if [ "${shortname}" == "ss3" ]; then
 	# Fixes: .steam/bin32/libsteam.so: cannot open shared object file: No such file or directory
 	if [ ! -f "${HOME}/.steam/bin32/libsteam.so" ]; then
 		fixname="libsteam.so"
@@ -26,7 +26,7 @@ if [ "${gamename}" == "Serious Sam 3: BFE" ]; then
 		cp -v "${serverfiles}/Bin/libsteam.so" "${HOME}/.steam/bin32/libsteam.so" >> "${lgsmlog}"
 		fn_fix_msg_end
 	fi
-elif [ "${gamename}" == "Hurtworld" ]; then
+elif [ "${shortname}" == "hw" ]; then
 	# Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
 	if [ ! -f "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" ]; then
 		fixname="steamclient.so x86"
@@ -40,7 +40,7 @@ elif [ "${gamename}" == "Hurtworld" ]; then
 		cp -v "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" >> "${lgsmlog}"
 		fn_fix_msg_end
 	fi
-elif [ "${gamename}" == "Tower Unite" ]; then
+elif [ "${shortname}" == "tu" ]; then
 	# Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
 	if [ ! -f "${executabledir}/steamclient.so" ]; then
 		fixname="steamclient.so"

+ 35 - 35
lgsm/functions/info_config.sh

@@ -1127,109 +1127,109 @@ fn_info_config_stationeers(){
 }
 
 # ARK: Survival Evolved
-if [ "${gamename}" == "ARK: Survivial Evolved" ]; then
+if [ "${shortname}" == "ark" ]; then
 	fn_info_config_ark
 # Ballistic Overkill
-elif [ "${gamename}" == "Ballistic Overkill" ]; then
+elif [ "${shortname}" == "bo" ]; then
 	fn_info_config_ballistic_overkill
 # Battalion 1944
-elif [ "${gamename}" == "Battalion 1944" ]; then
+elif [ "${shortname}" == "bt1944" ]; then
 	fn_info_config_battalion1944
 # Battlefield: 1942
-elif [ "${gamename}" == "Battlefield: 1942" ]; then
+elif [ "${shortname}" == "bf1942" ]; then
 	fn_info_config_bf1942
 # Call of Duty
-elif [ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty: United Offensive" ]; then
+elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]; then
 	fn_info_config_cod
 # Call of Duty 2
-elif [ "${gamename}" == "Call of Duty 2" ]; then
+elif [ "${shortname}" == "cod2" ]; then
 	fn_info_config_cod2
 # Call of Duty 4
-elif [ "${gamename}" == "Call of Duty 4" ]; then
+elif [ "${shortname}" == "cod4" ]; then
 	fn_info_config_cod4
 # Call of Duty: World at War
-elif [ "${gamename}" == "Call of Duty: World at War" ]; then
+elif [ "${shortname}" == "codwaw" ]; then
 	fn_info_config_codwaw
 # Dont Starve Together
-elif [ "${engine}" == "dontstarve" ]; then
+elif [ "${shortname}" == "dst" ]; then
 	fn_info_config_dontstarve
 # Eco
 elif [ "${shortname}" == "eco" ]; then
 	fn_info_config_eco
 # Factorio
-elif [ "${gamename}" == "Factorio" ]; then
+elif [ "${shortname}" == "fctr" ]; then
 	fn_info_config_factorio
 # Insurgency: Sandstorm
 elif [ "${shortname}" == "inss" ]; then
 	fn_info_config_inss
 # Just Cause 2
-elif [ "${gamename}" == "Just Cause 2" ]; then
+elif [ "${shortname}" == "jc2" ]; then
 	fn_info_config_justcause2
 # Just Cause 3
-elif [ "${gamename}" == "Just Cause 3" ]; then
+elif [ "${shortname}" == "jc3" ]; then
 	fn_info_config_justcause3
 # Killing Floor 2
 elif [ "${shortname}" == "kf2" ]; then
 	fn_info_config_kf2
 # QuakeWorld
-elif [ "${gamename}" == "QuakeWorld" ]; then
+elif [ "${shortname}" == "qw" ]; then
 	fn_info_config_quakeworld
 # Quake 2
-elif [ "${gamename}" == "Quake 2" ]; then
+elif [ "${shortname}" == "q2" ]; then
 	fn_info_config_quake2
 # Quake 3
-elif [ "${gamename}" == "Quake 3: Arena" ]; then
+elif [ "${shortname}" == "q3" ]; then
 	fn_info_config_quake3
 # Quake Live
-elif [ "${gamename}" == "Quake Live" ]; then
+elif [ "${shortname}" == "ql" ]; then
 	fn_info_config_quakelive
 # Minecraft
-elif [ "${engine}" == "lwjgl2" ]; then
+elif [ "${shortname}" == "mc" ]; then
 	fn_info_config_minecraft
 # Post Scriptum: The Bloody Seventh
 elif [ "${shortname}" == "pstbs" ]; then
 	fn_info_config_pstbs
 # Project Cars
-elif [ "${gamename}" == "Project Cars" ]; then
+elif [ "${shortname}" == "pc" ]; then
 	fn_info_config_projectcars
 # Project Zomboid
-elif [ "${engine}" == "projectzomboid" ]; then
+elif [ "${shortname}" == "pz" ]; then
 	fn_info_config_projectzomboid
 # ARMA 3
-elif [ "${engine}" == "realvirtuality" ]; then
+elif [ "${shortname}" == "arma3" ]; then
 	fn_info_config_realvirtuality
 # Rising World
 elif [ "${shortname}" == "rw" ]; then
 	fn_info_config_risingworld
 # Serious Sam
-elif [ "${engine}" == "seriousengine35" ]; then
+elif [ "${shortname}" == "ss3" ]; then
 	fn_info_config_seriousengine35
 # Source Engine Games
 elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
 	fn_info_config_source
 # Starbound
-elif [ "${engine}" == "starbound" ]; then
+elif [ "${shortname}" == "sb" ]; then
 	fn_info_config_starbound
 # TeamSpeak 3
-elif [ "${gamename}" == "TeamSpeak 3" ]; then
+elif [ "${shortname}" == "ts3" ]; then
 	fn_info_config_teamspeak3
 # Mumble
-elif [ "${gamename}" == "Mumble" ]; then
+elif [ "${shortname}" == "mumble" ]; then
 	fn_info_config_mumble
 # San Andreas Multiplayer
-elif [ "${gamename}" == "San Andreas Multiplayer" ]; then
+elif [ "${shortname}" == "samp" ]; then
 	fn_info_config_samp
 # StickyBots
 elif [ "${shortname}" == "pstbs" ]; then
 	fn_info_config_sbots
 # Teeworlds
-elif [ "${engine}" == "teeworlds" ]; then
+elif [ "${shortname}" == "tw" ]; then
 	fn_info_config_teeworlds
 # Terraria
-elif [ "${engine}" == "terraria" ]; then
+elif [ "${shortname}" == "terraria" ]; then
 	fn_info_config_terraria
 # Tower Unite
-elif [ "${gamename}" == "Tower Unite" ]; then
+elif [ "${shortname}" == "tu" ]; then
 	fn_info_config_towerunite
 # Unreal/Unreal 2 engine
 elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
@@ -1238,19 +1238,19 @@ elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
 elif [ "${engine}" == "unreal3" ]; then
 	fn_info_config_unreal3
 # 7 Day To Die (unity3d)
-elif [ "${gamename}" == "7 Days To Die" ]; then
+elif [ "${shortname}" == "sdtd" ]; then
 	fn_info_config_sdtd
-elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
+elif [ "${shortname}" == "wet" ]; then
 	fn_info_config_wolfensteinenemyterritory
-elif [ "${gamename}" == "ET: Legacy" ]; then
+elif [ "${shortname}" == "etl" ]; then
 	fn_info_config_etlegacy
-elif [ "${gamename}" == "Wurm Unlimited" ]; then
+elif [ "${shortname}" == "wurm" ]; then
 	fn_info_config_wurmunlimited
-elif [ "${gamename}" == "Multi Theft Auto" ]; then
+elif [ "${shortname}" == "mta" ]; then
 	fn_info_config_mta
-elif [ "${gamename}" == "Squad" ]; then
+elif [ "${shortname}" == "squad" ]; then
 	fn_info_config_squad
 # Stationeers
-elif [ "${gamename}" == "Stationeers" ]; then
+elif [ "${shortname}" == "st" ]; then
 	fn_info_config_stationeers
 fi

+ 7 - 3
lgsm/functions/info_distro.sh

@@ -206,10 +206,14 @@ fi
 
 # External IP address
 if [ -z "${extip}" ]; then
-	extip=$(${curlpath} -m 3 ifconfig.co > "${tmpdir}/extip.txt" 2>/dev/null)
-	if [ $? -ne 0 ]; then
+	extip=$(${curlpath} -4 -m 3 ifconfig.co 2>/dev/null)
+	exitcode=$?
+	# Should ifconfig.co return an error will use last known IP
+	if [ ${exitcode} -eq 0 ]; then
+		echo "${extip}" > "${tmpdir}/extip.txt"
+	else
 		if [ -f "${tmpdir}/extip.txt" ]; then
-			echo "${tmpdir}/extip.txt"
+			extip=$(cat ${tmpdir}/extip.txt)
 		else
 			echo "x.x.x.x"
 		fi

+ 12 - 11
lgsm/functions/info_parms.sh

@@ -31,6 +31,7 @@ fn_info_parms_cod(){
 	defaultmap=${defaultmap:-"NOT SET"}
 	maxplayers=${maxplayers:-"0"}
 	port=${port:-"0"}
+	queryport=${port:-"0"}
 }
 
 fn_info_parms_dst(){
@@ -162,33 +163,33 @@ fn_info_parms_kf2(){
 }
 
 # ARK: Survival Evolved
-if [ "${gamename}" == "ARK: Survival Evolved" ]; then
+if [ "${shortname}" == "ark" ]; then
 	fn_info_parms_ark
 # ARMA 3
-elif [ "${engine}" == "realvirtuality" ]; then
+elif [ "${shortname}" == "arma3" ]; then
 	fn_info_parms_realvirtuality
 # Call of Duty
-elif [ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty: United Offensive" ]||[ "${engine}" == "iw2.0" ]||[ "${engine}" == "iw3.0" ]; then
+elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${engine}" == "iw2.0" ]||[ "${engine}" == "iw3.0" ]; then
 	fn_info_parms_cod
 # Eco
-elif [ "${gamename}" == "Eco" ]; then
+elif [ "${shortname}" == "eco" ]; then
 	fn_info_parms_eco
 # Factorio
-elif [ "${gamename}" == "Factorio" ]; then
+elif [ "${shortname}" == "fctr" ]; then
 	fn_info_parms_factorio
 elif [ "${shortname}" == "inss" ]; then
 	fn_info_parms_inss
 elif [ "${shortname}" == "kf2" ]; then
 	fn_info_parms_kf2
 # Project Zomboid
-elif [ "${engine}" == "projectzomboid" ]; then
+elif [ "${shortname}" == "pz" ]; then
 	fn_info_parms_projectzomboid
-elif [ "${gamename}" == "QuakeWorld" ]; then
+elif [ "${shortname}" == "qw" ]; then
 	fn_info_parms_quakeworld
-elif [ "${gamename}" == "Quake 2" ]||[ "${gamename}" == "Quake 3: Arena" ]; then
+elif [ "${shortname}" == "q2" ]||[ "${shortname}" == "q3" ]; then
 	fn_info_parms_quake2
 # Rust
-elif [ "${gamename}" == "Rust" ]; then
+elif [ "${shortname}" == "rust" ]; then
 	fn_info_parms_rust
 # Rising World
 elif [ "${shortname}" == "rw" ]; then
@@ -197,14 +198,14 @@ elif [ "${shortname}" == "rw" ]; then
 elif [ "${shortname}" == "sbots" ]; then
 	fn_info_parms_stickybots
 # Serious Sam
-elif [ "${engine}" == "seriousengine35" ]; then
+elif [ "${shortname}" == "ss3" ]; then
 	fn_info_config_seriousengine35
 elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
 	fn_info_parms_source
 # Spark
 elif [ "${engine}" == "spark" ]; then
 	fn_info_parms_spark
-elif [ "${gamename}" == "Tower Unite" ]; then
+elif [ "${shortname}" == "tu" ]; then
 	fn_info_config_towerunite
 # Unreal/Unreal 2 engine
 elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then

+ 4 - 4
lgsm/functions/install_header.sh

@@ -10,9 +10,9 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 clear
 echo "================================="
-echo "${gamename}"
-echo "Linux Game Server Manager"
+echo "LinuxGSM - ${gamename}"
 echo "by Daniel Gibbs"
-echo "Contributors: http://goo.gl/qLmitD"
-echo "https://linuxgsm.com"
+echo "Website: https://linuxgsm.com"
+echo "Contributors: https://linuxgsm.com/contrib"
+echo "Donate: https://linuxgsm.com/donate"
 echo "================================="

+ 1 - 1
lgsm/functions/install_server_files.sh

@@ -72,7 +72,7 @@ fn_install_server_files_steamcmd(){
 			fi
 
 			if [ "${counter}" -ge "7" ]; then
-				echo "Removing $(find ${serverfiles} -type d -print0 | grep -Ez '[^/]{30}$')"
+				echo "Removing $(find "${serverfiles}" -type d -print0 | grep -Ez '[^/]{30}$')"
 				find "${serverfiles}" -type d -print0 | grep -Ez '[^/]{30}$' | xargs -0 rm -rf
 			fi
 			if [ "${counter}" -ge "9" ]; then

+ 1 - 1
lgsm/functions/mods_core.sh

@@ -43,7 +43,7 @@ fn_mod_lowercase(){
 		fileswc=$(find "${extractdir}" -depth | wc -l)
 		echo -en "\r"
 		while read -r src; do
-			dst=$(dirname "${src}"`/`basename "${src}" | tr '[A-Z]' '[a-z]')
+			dst=$(dirname "${src}"$(/)basename "${src}" | tr 'A-Z' 'a-z')
 			if [ "${src}" != "${dst}" ]
 			then
 				[ ! -e "${dst}" ] && mv -T "${src}" "${dst}" || echo "${src} was not renamed"

+ 2 - 2
lgsm/functions/mods_list.sh

@@ -61,8 +61,8 @@ mod_info_metamod=( MOD "metamod" "MetaMod" "${metamodurl}" "${metamodlatestfile}
 mod_info_sourcemod=( MOD "sourcemod" "SourceMod" "${sourcemodurl}" "${sourcemodlatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "GAMES" "NOTGAMES" "http://www.sourcemod.net" "Admin Features (requires MetaMod)" )
 
 # CS:GO Mods
-mod_info_gokz=( MOD "gokz" "GOKZ" "https://bitbucket.org/kztimerglobalteam/gokz/downloads/GOKZ-latest.zip" "gokz-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "Counter Strike: Global Offensive" "NOTGAMES" "https://bitbucket.org/kztimerglobalteam/gokz/src/master/" "Implements the KZ game mode (requires SourceMod and MetaMod)")
-mod_info_ttt=( MOD "ttt" "Trouble in Terrorist Town" "https://csgottt.com/downloads/ttt-latest-dev-${sourcemodmversion}.zip" "ttt-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "Counter Strike: Global Offensive" "NOTGAMES" "https://github.com/Bara/TroubleinTerroristTown" "Implements the TTT game mode (requires SourceMod and MetaMod)")
+mod_info_gokz=( MOD "gokz" "GOKZ" "https://bitbucket.org/kztimerglobalteam/gokz/downloads/GOKZ-latest.zip" "gokz-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter Strike: Global Offensive" "NOTGAMES" "https://bitbucket.org/kztimerglobalteam/gokz/src/master/" "Implements the KZ game mode (requires SourceMod and MetaMod)")
+mod_info_ttt=( MOD "ttt" "Trouble in Terrorist Town" "https://csgottt.com/downloads/ttt-latest-dev-${sourcemodmversion}.zip" "ttt-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter Strike: Global Offensive" "NOTGAMES" "https://github.com/Bara/TroubleinTerroristTown" "Implements the TTT game mode (requires SourceMod and MetaMod)")
 
 # Garry's Mod Addons
 mod_info_ulib=( MOD "ulib" "ULib" "https://codeload.github.com/TeamUlysses/ulib/zip/master" "ulib-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "Complete Framework" )

+ 1 - 1
lgsm/functions/update_steamcmd.sh

@@ -157,7 +157,7 @@ fn_update_steamcmd_check(){
 	fi
 
 	# Set branch for updateinfo
-	IFS=' ' read -ra branchsplits <<< ${branch}
+	IFS=' ' read -ra branchsplits <<< "${branch}"
 	if [ "${#branchsplits[@]}" -gt 1 ]; then
 		branchname="${branchsplits[1]}"
 	else

+ 2 - 2
lgsm/functions/update_ts3.sh

@@ -63,7 +63,7 @@ fn_update_ts3_currentbuild(){
 	fi
 
 	# Get current build from logs
-	currentbuild=$(cat $(find ./* -name 'ts3server*_0.log' 2> /dev/null | sort | grep -Ev '${rootdir}/.ts3version' | tail -1) | grep -Eo 'TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | grep -Eo '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | sort -V | tail -1)
+	currentbuild=$(cat $(find ./* -name "ts3server*_0.log" 2> /dev/null | sort | grep -Ev "${rootdir}/.ts3version" | tail -1) | grep -Eo "TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | grep -Eo "((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | sort -V | tail -1)
 	if [ -z "${currentbuild}" ]; then
 		fn_print_error_nl "Checking for update: teamspeak.com: Current build version not found"
 		fn_script_log_error "Checking for update: teamspeak.com: Current build version not found"
@@ -74,7 +74,7 @@ fn_update_ts3_currentbuild(){
 		command_stop.sh
 		exitbypass=1
 		command_start.sh
-		currentbuild=$(cat $(find ./* -name 'ts3server*_0.log' 2> /dev/null | sort | grep -Ev '${rootdir}/.ts3version' | tail -1) | grep -Eo 'TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | grep -Eo '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}')
+		currentbuild=$(cat $(find ./* -name "ts3server*_0.log" 2> /dev/null | sort | grep -Ev "${rootdir}/.ts3version" | tail -1) | grep -Eo "TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | grep -Eo "((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}")
 		if [ -z "${currentbuild}" ]; then
 			fn_print_fail_nl "Checking for update: teamspeak.com: Current build version still not found"
 			fn_script_log_fatal "Checking for update: teamspeak.com: Current build version still not found"