Explorar o código

Merge branch 'release/181124'

Daniel Gibbs %!s(int64=7) %!d(string=hai) anos
pai
achega
ac63201144
Modificáronse 33 ficheiros con 445 adicións e 140 borrados
  1. 13 0
      .editorconfig
  2. 4 0
      .github/release-drafter.yml
  3. 4 0
      .github/topissuebot.yml
  4. 4 0
      .github/write-good.yml
  5. 2 2
      lgsm/config-default/config-lgsm/arkserver/_default.cfg
  6. 7 7
      lgsm/config-default/config-lgsm/csgoserver/_default.cfg
  7. 1 1
      lgsm/config-default/config-lgsm/hwserver/_default.cfg
  8. 134 0
      lgsm/config-default/config-lgsm/inssserver/_default.cfg
  9. 1 1
      lgsm/config-default/config-lgsm/ns2cserver/_default.cfg
  10. 1 1
      lgsm/config-default/config-lgsm/ns2server/_default.cfg
  11. 1 1
      lgsm/config-default/config-lgsm/pstbsserver/_default.cfg
  12. 1 0
      lgsm/data/serverlist.csv
  13. 31 33
      lgsm/functions/alert_discord.sh
  14. 1 1
      lgsm/functions/alert_mailgun.sh
  15. 1 1
      lgsm/functions/alert_pushover.sh
  16. 1 1
      lgsm/functions/alert_telegram.sh
  17. 3 3
      lgsm/functions/check_ip.sh
  18. 1 1
      lgsm/functions/check_status.sh
  19. 0 1
      lgsm/functions/command_debug.sh
  20. 1 1
      lgsm/functions/command_dev_query_raw.sh
  21. 18 0
      lgsm/functions/command_donate.sh
  22. 10 4
      lgsm/functions/core_functions.sh
  23. 6 1
      lgsm/functions/core_getopt.sh
  24. 27 1
      lgsm/functions/info_config.sh
  25. 63 27
      lgsm/functions/info_distro.sh
  26. 40 40
      lgsm/functions/info_glibc.sh
  27. 31 0
      lgsm/functions/info_messages.sh
  28. 13 1
      lgsm/functions/info_parms.sh
  29. 4 4
      lgsm/functions/install_header.sh
  30. 1 1
      lgsm/functions/install_server_files.sh
  31. 2 2
      lgsm/functions/mods_list.sh
  32. 17 3
      lgsm/functions/query_gamedig.sh
  33. 1 1
      lgsm/functions/update_steamcmd.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

+ 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 - 2
lgsm/config-default/config-lgsm/arkserver/_default.cfg

@@ -13,13 +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/hwserver/_default.cfg

@@ -9,7 +9,7 @@
 #### Server Settings ####
 
 ## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
-servername="Hurtworld LinuxGSM Server"
+servername="LinuxGSM Server"
 ip="0.0.0.0"
 port="12871"
 queryport="12881"

+ 134 - 0
lgsm/config-default/config-lgsm/inssserver/_default.cfg

@@ -0,0 +1,134 @@
+##################################
+######## Default Settings ########
+##################################
+# DO NOT EDIT WILL BE OVERWRITTEN!
+# Copy settings from here and use them in either
+# common.cfg - applies settings to every instance
+# [instance].cfg - applies settings to a specific instance
+
+#### Server Settings ####
+
+## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
+
+ip="0.0.0.0"
+port="27102"
+queryport="27131"
+servername="LinuxGSM Server"
+serverpassword=""
+defaultmap="Oilfield"
+defaultscenario="Scenario_Oilfield_Push_Security"
+maxplayers="28"
+
+## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
+fn_parms(){
+parms="${defaultmap}?Scenario=${defaultscenario}?MaxPlayers=${maxplayers}?Port=${port}?QueryPort=${queryport}  -password=${serverpassword} -hostname='${servername}' -log"
+}
+
+#### LinuxGSM Settings ####
+
+## Notification Alerts
+# (on|off)
+
+# More info | https://github.com/GameServerManagers/LinuxGSM/wiki/Alerts#more-info
+postalert="off"
+postdays="7"
+posttarget="https://hastebin.com"
+
+# Discord Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Discord
+discordalert="off"
+discordwebhook="webhook"
+
+# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email
+emailalert="off"
+email="email@example.com"
+emailfrom=""
+
+# IFTTT Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/IFTTT
+iftttalert="off"
+ifttttoken="accesstoken"
+iftttevent="linuxgsm_alert"
+
+# Mailgun Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/mailgun
+mailgunalert="off"
+mailguntoken="accesstoken"
+mailgundomain="example.com"
+mailgunemailfrom="alert@example.com"
+mailgunemail="email@myemail.com"
+
+# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+channeltag=""
+
+# Pushover Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushover
+pushoveralert="off"
+pushovertoken="accesstoken"
+
+# Telegram Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Telegram
+# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring".
+# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need
+# any custom string in curl - simple ignore this parameter.
+telegramalert="off"
+telegramtoken="accesstoken"
+telegramchatid=""
+curlcustomstring=""
+
+## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update
+updateonstart="off"
+
+## 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"
+
+#### LinuxGSM Advanced Settings ####
+
+# ANSI Colors
+ansi="on"
+
+## SteamCMD Settings
+# Server appid
+appid="581330"
+# Steam App Branch Select
+# Allows to opt into the various Steam app branches. Default branch is "".
+# Example: "-beta latest_experimental"
+branch=""
+
+## LinuxGSM Server Details
+# Do not edit
+gamename="Insurgency: Sandstorm"
+engine="unreal4"
+
+#### Directories ####
+# Edit with care
+
+## Server Specific Directories
+systemdir="${serverfiles}/Insurgency"
+executabledir="${systemdir}/Binaries/Linux"
+executable="./InsurgencyServer-Linux-Shipping"
+servercfg="Game.ini"
+servercfgdefault="Game.ini"
+servercfgdir="${systemdir}/Saved/Config/LinuxServer"
+servercfgfullpath="${servercfgdir}/${servercfg}"
+
+## Backup Directory
+backupdir="${lgsmdir}/backup"
+
+## Logging Directories
+logdir="${rootdir}/log"
+gamelogdir="${systemdir}/Saved/Logs"
+lgsmlogdir="${logdir}/script"
+consolelogdir="${logdir}/console"
+gamelog="${gamelogdir}/${servicename}-game.log"
+lgsmlog="${lgsmlogdir}/${servicename}-script.log"
+consolelog="${consolelogdir}/${servicename}-console.log"
+alertlog="${lgsmlogdir}/${servicename}-alert.log"
+postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log"
+
+## Logs Naming
+lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
+consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"

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

@@ -13,7 +13,7 @@ ip="0.0.0.0"
 port="27015"
 defaultmap="co_core"
 maxplayers="24"
-servername="NS2C Server"
+servername="LinuxGSM Server"
 webadminuser="admin"
 webadminpass="admin"
 webadminport="8080"

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

@@ -17,7 +17,7 @@ ip="0.0.0.0"
 port="27015"
 defaultmap="ns2_summit"
 maxplayers="24"
-servername="NS2 Server"
+servername="LinuxGSM Server"
 webadminuser="admin"
 webadminpass="admin"
 webadminport="8080"

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

@@ -14,7 +14,7 @@ ip="0.0.0.0"
 randommap="ALWAYS"
 port="10027"
 queryport="10037"
-#servername="LinuxGSM server"
+#servername="LinuxGSM Server"
 # If your server is not meeting the minimal server requirement, do not host the server for 80 players, decrease that number.
 maxplayers="40"
 numreservedslots="2"

+ 1 - 0
lgsm/data/serverlist.csv

@@ -36,6 +36,7 @@ hldms,hldmsserver,Half-Life Deathmatch: Source
 hldm,hldmserver,Half-Life: Deathmatch
 hw,hwserver,Hurtworld
 ins,insserver,Insurgency
+inss,inssserver,Insurgency: Sandstorm
 jc2,jc2server,Just Cause 2
 jc3,jc3server,Just Cause 3
 kf,kfserver,Killing Floor

+ 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}/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
 )

+ 3 - 3
lgsm/functions/check_ip.sh

@@ -21,7 +21,7 @@ if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travi
 	# IP is not set to specific IP
 	if [ "${ip}" == "0.0.0.0" ]||[ "${ip}" == "" ]; then
 		fn_print_dots "Check IP"
-		sleep 0.5
+		sleep 0.2
 		# Multiple interfaces
 		if [ "${getipwc}" -ge "2" ]; then
 			if [ "${function_selfname}" == "command_details.sh" ]; then
@@ -29,7 +29,7 @@ if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travi
 			else
 			    fn_print_fail "Check IP: Multiple IP addresses found."
 			fi
-			sleep 0.5
+			sleep 0.2
 			echo -en "\n"
 			# IP is set within game config
 			if [ "${ipsetinconfig}" == "1" ]; then
@@ -85,7 +85,7 @@ if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travi
 		else
 			fn_print_info_nl "Check IP: ${getip}"
 			fn_script_log_info "IP automatically set as: ${getip}"
-			sleep 0.5
+			sleep 0.2
 			ip="${getip}"
 		fi
 	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

+ 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_dev_query_raw.sh

@@ -29,7 +29,7 @@ elif [ "${gamename}" == "Killing Floor 2" ]; then
 fi
 
 query_gamedig.sh
-echo "gamedig --type \"${gamedigengine}\" --host \"${ip}\" --query_port \"${queryport}\"|jq"
+echo "${gamedigcmd}"
 echo""
 echo "${gamedigraw}" | jq
 echo""

+ 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"

+ 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
 }

+ 6 - 1
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[@]}" )
@@ -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}"

+ 27 - 1
lgsm/functions/info_config.sh

@@ -297,6 +297,29 @@ fn_info_config_factorio(){
 	fi
 }
 
+fn_info_config_inss(){
+	if [ ! -f "${servercfgfullpath}" ]; then
+		rconenabled="${unavailable}"
+		rconpassword="${unavailable}"
+		rconport="${zero}"
+		maxplayers="${zero}"
+		port="${zero}"
+		queryport="${zero}"
+		queryenabled="${unavailable}"
+		rconport="${zero}"
+		gamemode="${unavailable}"
+		gameworld="${unavailable}"
+	else
+		rconenabled=$(grep "bEnabled" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		rconpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		rconport=$(grep "ListenPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
+
+		# Not Set
+		rconenabled=${rconenabled:-"NOT SET"}
+		rconpassword=${rconpassword:-"NOT SET"}
+		rconport=${rconport:-"0"}
+	fi	
+}
 fn_info_config_minecraft(){
 	if [ ! -f "${servercfgfullpath}" ]; then
 		servername="${unavailable}"
@@ -364,7 +387,7 @@ fn_info_config_pstbs(){
 	servername=${servername:-"NOT SET"}
 	serverpassword=${serverpassword:-"NOT SET"}
 	maxplayers=${maxplayers:-"0"}
-	numreservedslots=${maxplayers:-"0"}
+	numreservedslots=${numreservedslots:-"0"}
 }
 
 fn_info_config_projectcars(){
@@ -1121,6 +1144,9 @@ elif [ "${shortname}" == "eco" ]; then
 # Factorio
 elif [ "${gamename}" == "Factorio" ]; then
 	fn_info_config_factorio
+# Insurgency: Sandstorm
+elif [ "${shortname}" == "inss" ]; then
+	fn_info_config_inss
 # Just Cause 2
 elif [ "${gamename}" == "Just Cause 2" ]; then
 	fn_info_config_justcause2

+ 63 - 27
lgsm/functions/info_distro.sh

@@ -91,33 +91,65 @@ load=$(uptime|awk -F 'load average: ' '{ print $2 }')
 
 ## Memory information
 
-# Issue #2005 - Kernel 3.14+ contains MemAvailable which should be used. All others will be calculated
-
-# get the raw KB values of these fields
-physmemtotalkb=$(grep MemTotal /proc/meminfo | awk '{print $2}')
-physmemfreekb=$(grep ^MemFree /proc/meminfo | awk '{print $2}')
-physmembufferskb=$(grep ^Buffers /proc/meminfo | awk '{print $2}')
-physmemcachedkb=$(grep ^Cached /proc/meminfo | awk '{print $2}')
-physmemreclaimablekb=$(grep ^SReclaimable /proc/meminfo | awk '{print $2}')
-
-# check if MemAvailable Exists
-if grep -q ^MemAvailable /proc/meminfo; then
-    physmemactualfreekb=$(grep ^MemAvailable /proc/meminfo | awk '{print $2}')
-else
-    physmemactualfreekb=$((${physmemfreekb}+${physmembufferskb}+${physmemcachedkb}))
-fi
 
+## Memory information
 # Available RAM and swap.
-physmemtotalmb=$((${physmemtotalkb}/1024))
-physmemtotal=$(numfmt --to=iec --from=iec --suffix=B "${physmemtotalkb}K")
-physmemfree=$(numfmt --to=iec --from=iec --suffix=B "${physmemactualfreekb}K")
-physmemused=$(numfmt --to=iec --from=iec --suffix=B "$((${physmemtotalkb}-${physmemfreekb}-${physmembufferskb}-${physmemcachedkb}-${physmemreclaimablekb}))K")
-physmemavailable=$(numfmt --to=iec --from=iec --suffix=B "${physmemactualfreekb}K")
-physmemcached=$(numfmt --to=iec --from=iec --suffix=B "$((${physmemcachedkb}+${physmemreclaimablekb}))K")
 
-swaptotal=$(numfmt --to=iec --from=iec --suffix=B "$(grep ^SwapTotal /proc/meminfo | awk '{print $2}')K")
-swapfree=$(numfmt --to=iec --from=iec --suffix=B "$(grep ^SwapFree /proc/meminfo | awk '{print $2}')K")
-swapused=$(numfmt --to=iec --from=iec --suffix=B "$(($(grep ^SwapTotal /proc/meminfo | awk '{print $2}')-$(grep ^SwapFree /proc/meminfo | awk '{print $2}')))K")
+# Newer distros can use numfmt to give more accurate results
+if [ -n "$(command -v numfmt 2>/dev/null)" ]; then
+	# Issue #2005 - Kernel 3.14+ contains MemAvailable which should be used. All others will be calculated
+
+	# get the raw KB values of these fields
+	physmemtotalkb=$(grep MemTotal /proc/meminfo | awk '{print $2}')
+	physmemfreekb=$(grep ^MemFree /proc/meminfo | awk '{print $2}')
+	physmembufferskb=$(grep ^Buffers /proc/meminfo | awk '{print $2}')
+	physmemcachedkb=$(grep ^Cached /proc/meminfo | awk '{print $2}')
+	physmemreclaimablekb=$(grep ^SReclaimable /proc/meminfo | awk '{print $2}')
+
+	# check if MemAvailable Exists
+	if grep -q ^MemAvailable /proc/meminfo; then
+	    physmemactualfreekb=$(grep ^MemAvailable /proc/meminfo | awk '{print $2}')
+	else
+	    physmemactualfreekb=$((${physmemfreekb}+${physmembufferskb}+${physmemcachedkb}))
+	fi
+
+	# Available RAM and swap.
+	physmemtotalmb=$((${physmemtotalkb}/1024))
+	physmemtotal=$(numfmt --to=iec --from=iec --suffix=B "${physmemtotalkb}K")
+	physmemfree=$(numfmt --to=iec --from=iec --suffix=B "${physmemactualfreekb}K")
+	physmemused=$(numfmt --to=iec --from=iec --suffix=B "$((${physmemtotalkb}-${physmemfreekb}-${physmembufferskb}-${physmemcachedkb}-${physmemreclaimablekb}))K")
+	physmemavailable=$(numfmt --to=iec --from=iec --suffix=B "${physmemactualfreekb}K")
+	physmemcached=$(numfmt --to=iec --from=iec --suffix=B "$((${physmemcachedkb}+${physmemreclaimablekb}))K")
+
+	swaptotal=$(numfmt --to=iec --from=iec --suffix=B "$(grep ^SwapTotal /proc/meminfo | awk '{print $2}')K")
+	swapfree=$(numfmt --to=iec --from=iec --suffix=B "$(grep ^SwapFree /proc/meminfo | awk '{print $2}')K")
+	swapused=$(numfmt --to=iec --from=iec --suffix=B "$(($(grep ^SwapTotal /proc/meminfo | awk '{print $2}')-$(grep ^SwapFree /proc/meminfo | awk '{print $2}')))K")
+else
+# Older distros will need to use free.
+	# Older versions of free do not support -h option.
+	if [ "$(free -h > /dev/null 2>&1; echo $?)" -ne "0" ]; then
+		humanreadable="-m"
+	else
+		humanreadable="-h"
+	fi
+	physmemtotalmb=$(free -m | awk '/Mem:/ {print $2}')
+	physmemtotal=$(free ${humanreadable} | awk '/Mem:/ {print $2}')
+	physmemfree=$(free ${humanreadable} | awk '/Mem:/ {print $4}')
+	physmemused=$(free ${humanreadable} | awk '/Mem:/ {print $3}')
+
+	oldfree=$(free ${humanreadable} | awk '/cache:/')
+	if [ -n "${oldfree}" ]; then
+		physmemavailable="n/a"
+		physmemcached="n/a"
+	else
+		physmemavailable=$(free ${humanreadable} | awk '/Mem:/ {print $7}')
+		physmemcached=$(free ${humanreadable} | awk '/Mem:/ {print $6}')
+	fi
+
+	swaptotal=$(free ${humanreadable} | awk '/Swap:/ {print $2}')
+	swapused=$(free ${humanreadable} | awk '/Swap:/ {print $3}')
+	swapfree=$(free ${humanreadable} | awk '/Swap:/ {print $4}')
+fi
 
 ### Disk information
 
@@ -174,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

+ 40 - 40
lgsm/functions/info_glibc.sh

@@ -12,9 +12,6 @@ if [ "${gamename}" == "ARK: Survival Evolved" ]; then
 elif [ "${gamename}" == "Ballistic Overkill" ]; then
 	glibcrequired="2.15"
 	glibcfix="yes"
-elif [ "${gamename}" == "Battalion 1944" ]; then
-	glibcrequired="2.17"
-	glibcfix="no"
 elif [ "${gamename}" == "Base Defense" ]; then
 	glibcrequired="2.14"
 	glibcfix="no"
@@ -78,6 +75,9 @@ elif [ "${gamename}" == "Insurgency" ]; then
 elif [ "${shortname}" == "kf2" ]; then
 	glibcrequired="2.17"
 	glibcfix="no"
+elif [ "${shortname}" == "tu" ]; then
+	glibcrequired="2.15"
+	glibcfix="no"	
 elif [ "${gamename}" == "Mumble" ]; then
 	glibcrequired="NOT REQUIRED"
 	glibcfix="no"
@@ -129,31 +129,34 @@ elif [ "${gamename}" == "Just Cause 2" ]; then
 elif [ "${gamename}" == "Just Cause 3" ]; then
 	glibcrequired="2.17"
 	glibcfix="no"
-elif [ "${engine}" == "dontstarve" ]; then
+elif [ "${gamename}" == "Natural Selection 2" ]; then
+	glibcrequired="2.17"
+	glibcfix="no"
+elif [ "${gamename}" == "NS2: Combat" ]; then
 	glibcrequired="2.15"
+	glibcfix="yes"
+elif [ "${gamename}" == "TeamSpeak 3" ]; then
+	glibcrequired="NOT REQUIRED"
 	glibcfix="no"
-elif [ "${engine}" == "lwjgl2" ]; then
+elif [ "${gamename}" == "Mumble" ]; then
 	glibcrequired="NOT REQUIRED"
 	glibcfix="no"
-elif [ "${engine}" == "projectzomboid" ]; then
-	glibcrequired="2.15"
+elif [ "${engine}" == "refractor" ]; then
+	glibcrequired="2.0"
 	glibcfix="no"
-elif [ "${engine}" == "realvirtuality" ]; then
-	glibcrequired="2.13"
-	glibcfix="yes"
-elif [ "${engine}" == "seriousengine35" ]; then
-	glibcrequired="2.13"
-	glibcfix="yes"
-elif [ "${engine}" == "source" ]; then
-	glibcrequired="2.3.6"
+elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
+	glibcrequired="2.2.4"
 	glibcfix="no"
-elif [ "${engine}" == "goldsource" ]; then
-	glibcrequired="2.3.4"
+elif [ "${gamename}" == "ET: Legacy" ]; then
+	glibcrequired="2.7"
 	glibcfix="no"
-elif [ "${gamename}" == "Natural Selection 2" ]; then
-	glibcrequired="2.17"
+elif [ "${gamename}" == "Wurm Unlimited" ]; then
+	glibcrequired="2.14"
 	glibcfix="no"
-elif [ "${gamename}" == "NS2: Combat" ]; then
+elif [ "${gamename}" == "Multi Theft Auto" ]; then
+	glibcrequired="2.7"
+	glibcfix="no"
+elif [ "${gamename}" == "Zombie Panic! Source" ]; then
 	glibcrequired="2.15"
 	glibcfix="yes"
 elif [ "${engine}" == "starbound" ]; then
@@ -175,35 +178,32 @@ elif [ "${engine}" == "unreal3" ]; then
 	glibcrequired="2.3.2"
 	glibcfix="no"
 elif [ "${engine}" == "unreal4" ]; then
-	glibcrequired="2.14"
+	glibcrequired="2.17"
 	glibcfix="no"
 elif [ "${engine}" == "unity3d" ]; then
 	glibcrequired="2.15"
 	glibcfix="no"
-elif [ "${gamename}" == "TeamSpeak 3" ]; then
-	glibcrequired="NOT REQUIRED"
+elif [ "${engine}" == "dontstarve" ]; then
+	glibcrequired="2.15"
 	glibcfix="no"
-elif [ "${gamename}" == "Mumble" ]; then
+elif [ "${engine}" == "lwjgl2" ]; then
 	glibcrequired="NOT REQUIRED"
 	glibcfix="no"
-elif [ "${engine}" == "refractor" ]; then
-	glibcrequired="2.0"
-	glibcfix="no"
-elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
-	glibcrequired="2.2.4"
-	glibcfix="no"
-elif [ "${gamename}" == "ET: Legacy" ]; then
-	glibcrequired="2.7"
-	glibcfix="no"
-elif [ "${gamename}" == "Wurm Unlimited" ]; then
-	glibcrequired="2.14"
-	glibcfix="no"
-elif [ "${gamename}" == "Multi Theft Auto" ]; then
-	glibcrequired="2.7"
-	glibcfix="no"
-elif [ "${gamename}" == "Zombie Panic! Source" ]; then
+elif [ "${engine}" == "projectzomboid" ]; then
 	glibcrequired="2.15"
+	glibcfix="no"
+elif [ "${engine}" == "realvirtuality" ]; then
+	glibcrequired="2.13"
 	glibcfix="yes"
+elif [ "${engine}" == "seriousengine35" ]; then
+	glibcrequired="2.13"
+	glibcfix="yes"
+elif [ "${engine}" == "source" ]; then
+	glibcrequired="2.3.6"
+	glibcfix="no"
+elif [ "${engine}" == "goldsource" ]; then
+	glibcrequired="2.3.4"
+	glibcfix="no"	
 else
 	glibcrequired="UNKNOWN"
 	glibcfix="no"

+ 31 - 0
lgsm/functions/info_messages.sh

@@ -225,11 +225,25 @@ fn_info_message_gameserver(){
 			echo -e "${blue}Current Map:\t${default}${gdmap}"
 		fi
 
+		if [ -n "${defaultscenario}" ]; then
+			# Current Scenario
+			if [ -n "${gdgamemode}" ]; then
+				echo -e "${blue}Current Scenario:\t${default}${gdgamemode}"
+			fi
+		else
+			echo -e "${blue}Current Game Mode:\t${default}${gdgamemode}"
+		fi
+
 		# Default Map
 		if [ -n "${defaultmap}" ]; then
 			echo -e "${blue}Default Map:\t${default}${defaultmap}"
 		fi
 
+		# Default Scenario
+		if [ -n "${defaultscenario}" ]; then
+			echo -e "${blue}Default Scenario:\t${default}${defaultscenario}"
+		fi
+
 		# Game type
 		if [ -n "${gametype}" ]; then
 			echo -e "${blue}Game type:\t${default}${gametype}"
@@ -444,6 +458,10 @@ fn_info_message_commandlineparms(){
 	echo -e "${lightgreen}Command-line Parameters${default}"
 	fn_info_message_password_strip
 	fn_messages_separator
+	if [ "${serverpassword}" == "NOT SET" ]; then
+		unset serverpassword
+	fi
+	fn_parms
 	echo -e "${executable} ${parms}"
 }
 
@@ -677,6 +695,17 @@ fn_info_message_hurtworld(){
 	} | column -s $'\t' -t
 }
 
+fn_info_message_inss(){
+	echo -e "netstat -atunp | grep Insurgency"
+	echo -e ""
+	{
+		echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
+		echo -e "> Game\tINBOUND\t${port}\tudp"
+		echo -e "> Query\tINBOUND\t${queryport}\tudp"
+		echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
+	} | column -s $'\t' -t
+}
+
 fn_info_message_justcause2(){
 	echo -e "netstat -atunp | grep Jcmp-Server"
 	echo -e ""
@@ -1144,6 +1173,8 @@ fn_info_message_select_engine(){
 		fn_info_message_factorio
 	elif [ "${gamename}" == "Hurtworld" ]; then
 		fn_info_message_hurtworld
+	elif [ "${shortname}" == "inss" ]; then
+		fn_info_message_inss
 	elif [ "${gamename}" == "Just Cause 2" ]; then
 		fn_info_message_justcause2
 	elif [ "${gamename}" == "Just Cause 3" ]; then

+ 13 - 1
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(){
@@ -45,13 +46,22 @@ fn_info_parms_eco(){
 	queryport=${webadminport}
 }
 
-
 fn_info_parms_factorio(){
 	port=${port:-"0"}
 	rconport=${rconport:-"0"}
 	rconpassword=${rconpassword:-"NOT SET"}
 }
 
+fn_info_parms_inss(){
+	port=${port:-"0"}
+	queryport=${queryport:-"0"}
+	servername=${servername:-"NOT SET"}
+	serverpassword=${serverpassword:-"NOT SET"}
+	defaultmap=${defaultmap:-"NOT SET"}
+	defaultscenario=${defaultscenario:-"NOT SET"}
+	maxplayers=${maxplayers:-"0"}
+}
+
 fn_info_parms_hurtworld(){
 	servername=${servername:-"NOT SET"}
 	port=${port:-"0"}
@@ -158,6 +168,8 @@ elif [ "${gamename}" == "Eco" ]; then
 # Factorio
 elif [ "${gamename}" == "Factorio" ]; then
 	fn_info_parms_factorio
+elif [ "${shortname}" == "inss" ]; then
+	fn_info_parms_inss
 elif [ "${shortname}" == "kf2" ]; then
 	fn_info_parms_kf2
 # Project Zomboid

+ 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

+ 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" )

+ 17 - 3
lgsm/functions/query_gamedig.sh

@@ -73,10 +73,18 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ];
 	# will bypass query if server offline
 	check_status.sh
 	if [ "${status}" != "0" ]; then
-		# checks if query is working 0 = pass
-		querystatus=$(gamedig --type "${gamedigengine}" --host "${ip}" --query_port "${queryport}" | jq '.error|length')
-		# raw output
+		# checks if query is working null = pass
+		gamedigcmd=$(echo "gamedig --type \"${gamedigengine}\" --host \"${ip}\" --query_port \"${queryport}\"|jq")
 		gamedigraw=$(gamedig --type "${gamedigengine}" --host "${ip}" --query_port "${queryport}")
+		querystatus=$(echo "${gamedigraw}" | jq '.error|length')
+		
+		if [ "${querystatus}" != "null" ]; then
+			gamedigcmd=$(echo "gamedig --type \"${gamedigengine}\" --host \"${ip}\" --port \"${queryport}\"|jq")
+			gamedigraw=$(gamedig --type "${gamedigengine}" --host "${ip}" --port "${queryport}")
+			querystatus=$(echo "${gamedigraw}" | jq '.error|length')
+			
+		fi	
+		
 
 		# server name
 		gdname=$(echo "${gamedigraw}" | jq -re '.name')
@@ -102,6 +110,12 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ];
 			gdmap=
 		fi
 
+		# current gamemode
+		gdgamemode=$(echo "${gamedigraw}" | jq -re '.raw.rules.GameMode_s')
+		if [ "${gdgamemode}" == "null" ]; then
+			gdgamemode=
+		fi
+
 		# numbots
 		gdbots=$(echo "${gamedigraw}" | jq -re '.raw.numbots')
 		if [ "${gdbots}" == "null" ]; then

+ 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