Răsfoiți Sursa

Merge branch 'release/181027'

Daniel Gibbs 7 ani în urmă
părinte
comite
cd0cdbcd52
54 a modificat fișierele cu 716 adăugiri și 280 ștergeri
  1. 22 0
      .gitattributes
  2. 0 0
      README.md
  3. 2 1
      lgsm/config-default/config-lgsm/arkserver/_default.cfg
  4. 2 1
      lgsm/config-default/config-lgsm/csgoserver/_default.cfg
  5. 1 0
      lgsm/config-default/config-lgsm/fctrserver/_default.cfg
  6. 121 0
      lgsm/config-default/config-lgsm/wurmserver/_default.cfg
  7. 1 0
      lgsm/data/serverlist.csv
  8. 18 11
      lgsm/functions/check.sh
  9. 39 1
      lgsm/functions/check_deps.sh
  10. 9 4
      lgsm/functions/check_ip.sh
  11. 6 4
      lgsm/functions/check_permissions.sh
  12. 6 4
      lgsm/functions/check_root.sh
  13. 1 13
      lgsm/functions/check_status.sh
  14. 3 3
      lgsm/functions/command_backup.sh
  15. 5 0
      lgsm/functions/command_debug.sh
  16. 55 13
      lgsm/functions/command_dev_detect_deps.sh
  17. 36 32
      lgsm/functions/command_install.sh
  18. 11 7
      lgsm/functions/command_monitor.sh
  19. 8 7
      lgsm/functions/command_postdetails.sh
  20. 8 3
      lgsm/functions/command_start.sh
  21. 4 2
      lgsm/functions/command_stop.sh
  22. 9 9
      lgsm/functions/command_update_linuxgsm.sh
  23. 1 1
      lgsm/functions/command_validate.sh
  24. 9 9
      lgsm/functions/core_dl.sh
  25. 6 0
      lgsm/functions/core_exit.sh
  26. 10 0
      lgsm/functions/core_functions.sh
  27. 18 18
      lgsm/functions/core_messages.sh
  28. 4 2
      lgsm/functions/fix.sh
  29. 4 0
      lgsm/functions/fix_kf.sh
  30. 1 0
      lgsm/functions/fix_kf2.sh
  31. 4 0
      lgsm/functions/fix_ro.sh
  32. 1 0
      lgsm/functions/fix_ut3.sh
  33. 23 0
      lgsm/functions/fix_wurm.sh
  34. 39 0
      lgsm/functions/info_config.sh
  35. 31 18
      lgsm/functions/info_distro.sh
  36. 3 0
      lgsm/functions/info_glibc.sh
  37. 33 6
      lgsm/functions/info_messages.sh
  38. 16 3
      lgsm/functions/install_config.sh
  39. 8 8
      lgsm/functions/install_logs.sh
  40. 1 1
      lgsm/functions/install_server_files.sh
  41. 8 8
      lgsm/functions/mods_core.sh
  42. 5 1
      lgsm/functions/mods_list.sh
  43. 9 1
      lgsm/functions/query_gamedig.sh
  44. 6 2
      lgsm/functions/query_gsquery.py
  45. 9 7
      lgsm/functions/update_factorio.sh
  46. 0 1
      lgsm/functions/update_minecraft.sh
  47. 2 3
      lgsm/functions/update_mta.sh
  48. 0 1
      lgsm/functions/update_mumble.sh
  49. 3 3
      lgsm/functions/update_steamcmd.sh
  50. 19 4
      lgsm/functions/update_ts3.sh
  51. 61 53
      linuxgsm.sh
  52. 5 5
      tests/tests_fctrserver.sh
  53. 5 5
      tests/tests_jc2server.sh
  54. 5 5
      tests/tests_ts3server.sh

+ 22 - 0
.gitattributes

@@ -0,0 +1,22 @@
+# crlf line endings for text files
+* text eol=lf
+
+# Denote all files that are truly binary and should not be modified.
+*.png binary
+*.jpg binary
+*.so.6 binary
+
+# Custom for Visual Studio
+*.cs     diff=csharp
+
+# Standard to msysgit
+*.doc	 diff=astextplain
+*.DOC	 diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot  diff=astextplain
+*.DOT  diff=astextplain
+*.pdf  diff=astextplain
+*.PDF	 diff=astextplain
+*.rtf	 diff=astextplain
+*.RTF	 diff=astextplain

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
README.md


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

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

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

@@ -17,6 +17,7 @@
 # Custom				3			0
 # Custom				3			0
 # Deathmatch			1			2
 # Deathmatch			1			2
 # Demolition			1			1
 # Demolition			1			1
+# Wingman				0			2
 gametype="0"
 gametype="0"
 gamemode="0"
 gamemode="0"
 mapgroup="mg_active"
 mapgroup="mg_active"
@@ -41,7 +42,7 @@ wsstartmap=""
 
 
 ## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
 ## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
 fn_parms(){
 fn_parms(){
-parms="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +mapgroup ${mapgroup} +game_mode ${gamemode} +game_type ${gametype} +host_workshop_collection ${wscollectionid} +workshop_start_map ${wsstartmap} -authkey ${wsapikey} -nobreakpad"
+parms="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +mapgroup ${mapgroup} +game_type ${gametype} +game_mode ${gamemode} +host_workshop_collection ${wscollectionid} +workshop_start_map ${wsstartmap} -authkey ${wsapikey} -nobreakpad"
 }
 }
 
 
 #### LinuxGSM Settings ####
 #### LinuxGSM Settings ####

+ 1 - 0
lgsm/config-default/config-lgsm/fctrserver/_default.cfg

@@ -13,6 +13,7 @@ ip="0.0.0.0"
 port="34197"
 port="34197"
 rconport="34198"
 rconport="34198"
 rconpassword="CHANGE_ME"
 rconpassword="CHANGE_ME"
+# (stable|experimental)
 branch="stable"
 branch="stable"
 
 
 ## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
 ## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters

+ 121 - 0
lgsm/config-default/config-lgsm/wurmserver/_default.cfg

@@ -0,0 +1,121 @@
+##################################
+######## 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 Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
+fn_parms(){
+	# Note Parameters are editing in the game server config file.
+	source "${servercfgfullpath}"
+	parms="ADMINPWD=\"$ADMINPWD\" EPICSETTINGS=\"$EPICSETTINGS\" EXTERNALPORT=\"$EXTERNALPORT\" HOMESERVER=\"$HOMESERVER\" HOMEKINGDOM=\"$HOMEKINGDOM\" LOGINSERVER=\"$LOGINSERVER\" MAXPLAYERS=\"$MAXPLAYERS\" QUERYPORT=\"$QUERYPORT\" SERVERNAME=\"$SERVERNAME\" SERVERPASSWORD=\"$SERVERPASSWORD\" START=\"$START\" IP=\"$IP\""
+}
+
+#### 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=""
+
+## 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="402370"
+# 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="Wurm Unlimited"
+engine="wurm"
+
+#### Directories ####
+# Edit with care
+
+## Server Specific Directories
+systemdir="${serverfiles}"
+executabledir="${systemdir}"
+executable="xvfb-run ./WurmServerLauncher"
+servercfg="${servicename}.cfg"
+servercfgdefault="server.cfg"
+servercfgdir="${systemdir}"
+servercfgfullpath="${servercfgdir}/${servercfg}"
+
+## Backup Directory
+backupdir="${rootdir}/backups"
+
+## Logging Directories
+logdir="${rootdir}/log"
+gamelogdir="${serverfiles}/Logs"
+lgsmlogdir="${logdir}/script"
+consolelogdir="${logdir}/console"
+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 - 0
lgsm/data/serverlist.csv

@@ -79,5 +79,6 @@ ut3,ut3server,Unreal Tournament 3
 ut99,ut99server,Unreal Tournament 99
 ut99,ut99server,Unreal Tournament 99
 vs,vsserver,Vampire Slayer
 vs,vsserver,Vampire Slayer
 wet,wetserver,Wolfenstein: Enemy Territory
 wet,wetserver,Wolfenstein: Enemy Territory
+wurm,wurmserver,Wurm Unlimited
 etl,etlserver,ET: Legacy
 etl,etlserver,ET: Legacy
 zps,zpsserver,Zombie Panic! Source
 zps,zpsserver,Zombie Panic! Source

+ 18 - 11
lgsm/functions/check.sh

@@ -10,11 +10,16 @@ local commandname="CHECK"
 # Every command that requires checks just references check.sh
 # Every command that requires checks just references check.sh
 # check.sh selects which checks to run by using arrays
 # check.sh selects which checks to run by using arrays
 
 
-check_root.sh
+if [ "${userinput}" != "install" ]&&[ "${userinput}" != "auto-install" ]&&[ "${userinput}" != "i" ]&&[ "${userinput}" != "ai" ]; then
+	check_root.sh
+fi
+
 check_tmuxception.sh
 check_tmuxception.sh
 
 
-if [ "${function_selfname}" != "command_monitor.sh" ]; then
-	check_permissions.sh
+if [ "$(whoami)" != "root" ]; then
+	if [ "${function_selfname}" != "command_monitor.sh" ]; then
+		check_permissions.sh
+	fi
 fi
 fi
 
 
 if [ "${function_selfname}" != "command_install.sh" ]&&[ "${function_selfname}" != "command_update_functions.sh" ]&&[ "${function_selfname}" != "command_update_linuxgsm.sh" ]&&[ "${function_selfname}" != "command_details.sh" ]&&[ "${function_selfname}" != "command_postdetails.sh" ]; then
 if [ "${function_selfname}" != "command_install.sh" ]&&[ "${function_selfname}" != "command_update_functions.sh" ]&&[ "${function_selfname}" != "command_update_linuxgsm.sh" ]&&[ "${function_selfname}" != "command_details.sh" ]&&[ "${function_selfname}" != "command_postdetails.sh" ]; then
@@ -29,13 +34,15 @@ do
 	fi
 	fi
 done
 done
 
 
-local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh )
-for allowed_command in "${allowed_commands_array[@]}"
-do
-	if [ "${allowed_command}" == "${function_selfname}" ]; then
-		check_glibc.sh
-	fi
-done
+if [ "$(whoami)" != "root" ]; then
+	local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh )
+	for allowed_command in "${allowed_commands_array[@]}"
+	do
+		if [ "${allowed_command}" == "${function_selfname}" ]; then
+			check_glibc.sh
+		fi
+	done
+fi
 
 
 local allowed_commands_array=( command_backup.sh command_console.sh command_debug.sh command_details.sh command_unreal2_maps.sh command_fastdl.sh command_mods_install.sh command_mods_remove.sh command_mods_update.sh command_monitor.sh command_postdetails.sh command_restart.sh command_start.sh command_stop.sh command_test_alert.sh command_ts3_server_pass.sh command_update.sh command_update_functions.sh command_validate.sh command_wipe.sh command_unreal2_maps.sh command_ut99maps.sh)
 local allowed_commands_array=( command_backup.sh command_console.sh command_debug.sh command_details.sh command_unreal2_maps.sh command_fastdl.sh command_mods_install.sh command_mods_remove.sh command_mods_update.sh command_monitor.sh command_postdetails.sh command_restart.sh command_start.sh command_stop.sh command_test_alert.sh command_ts3_server_pass.sh command_update.sh command_update_functions.sh command_validate.sh command_wipe.sh command_unreal2_maps.sh command_ut99maps.sh)
 for allowed_command in "${allowed_commands_array[@]}"
 for allowed_command in "${allowed_commands_array[@]}"
@@ -61,7 +68,7 @@ do
 	fi
 	fi
 done
 done
 
 
-local allowed_commands_array=( command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh command_dev_query_raw.sh )
+local allowed_commands_array=( command_debug.sh command_details.sh command_postdetails.sh command_monitor.sh command_start.sh command_stop.sh command_dev_query_raw.sh )
 for allowed_command in "${allowed_commands_array[@]}"
 for allowed_command in "${allowed_commands_array[@]}"
 do
 do
 	if [ "${allowed_command}" == "${function_selfname}" ]; then
 	if [ "${allowed_command}" == "${function_selfname}" ]; then

+ 39 - 1
lgsm/functions/check_deps.sh

@@ -95,6 +95,39 @@ fn_install_mono_repo(){
 	fi
 	fi
 }
 }
 
 
+fn_install_universe_repo(){
+	# Defensive coding - As this is an ubuntu only issue then check to make sure this fix is needed, and we are using ubuntu
+   if [ "${jquniversemissing}" != "0" ]&&[ "${distroid}" == "ubuntu" ]; then
+		fn_print_warning_nl "Ubuntu 18.04.1 contains a bug which means the sources.list file does not populate with the Ubuntu universe repository."
+		fn_print_information_nl "Attempting to add Universe Repo"
+		sleep 0.5
+		sudo -v > /dev/null 2>&1
+		if [ $? -eq 0 ]; then
+			echo -en ".\r"
+			sleep 1
+			echo -en "..\r"
+			sleep 1
+			echo -en "...\r"
+			sleep 1
+			echo -en "   \r"
+			cmd="sudo apt-add-repository universe"
+			eval ${cmd}
+			if [ $? -eq 0 ]; then
+				fn_print_complete_nl "Installing universe repository completed."
+				fn_script_log_pass "Installing universe repository completed."
+			else
+				fn_print_failure_nl "Unable to install universe repository."
+				fn_script_log_fatal "Unable to install universe repository."
+			fi
+		else
+			fn_print_warning_nl "$(whoami) does not have sudo access. Manually add Universe repository."
+			fn_script_log_warn "$(whoami) does not have sudo access. Manually add Universe repository."
+			echo "	Please run the following command as a user with sudo access, and re-run the installation"
+			echo "	sudo apt-add-repository universe"
+		fi
+	fi
+}
+
 fn_deps_detector(){
 fn_deps_detector(){
 	# Checks if dependency is missing
 	# Checks if dependency is missing
 	if [ "${tmuxcheck}" == "1" ]; then
 	if [ "${tmuxcheck}" == "1" ]; then
@@ -109,6 +142,11 @@ fn_deps_detector(){
 		unset javacheck
 		unset javacheck
 	elif [ "${deptocheck}" == "jq" ]&&[ "${distroversion}" == "6" ]; then
 	elif [ "${deptocheck}" == "jq" ]&&[ "${distroversion}" == "6" ]; then
 		jqstatus=1
 		jqstatus=1
+	elif [ "${deptocheck}" == "jq" ]&&[ "${distroid}" == "ubuntu" ]&&[ "${distroversion}" == "18.04" ]&& ! grep -qE "^deb .*universe" /etc/apt/sources.list; then
+		#1985 ubuntu 18.04.1 bug does not set sources.list correctly which means universe is not active by default
+		#If the universe repo does not exist, mark as dependency missing and universe missing
+		depstatus=1
+		jquniversemissing=1
 	elif [ "${deptocheck}" == "mono-complete" ]; then
 	elif [ "${deptocheck}" == "mono-complete" ]; then
 		if [ "$(command -v mono 2>/dev/null)" ]&&[ "$(mono --version 2>&1 | grep -Po '(?<=version )\d')" -ge 5 ]; then
 		if [ "$(command -v mono 2>/dev/null)" ]&&[ "$(mono --version 2>&1 | grep -Po '(?<=version )\d')" -ge 5 ]; then
 			# Mono >= 5.0.0 already installed
 			# Mono >= 5.0.0 already installed
@@ -361,7 +399,7 @@ fn_deps_build_debian(){
 		array_deps_required+=( libxrandr2:i386 libglu1-mesa:i386 libxtst6:i386 libusb-1.0-0-dev:i386 libxxf86vm1:i386 libopenal1:i386 libssl1.0.0:i386 libgtk2.0-0:i386 libdbus-glib-1-2:i386 libnm-glib-dev:i386 )
 		array_deps_required+=( libxrandr2:i386 libglu1-mesa:i386 libxtst6:i386 libusb-1.0-0-dev:i386 libxxf86vm1:i386 libopenal1:i386 libssl1.0.0:i386 libgtk2.0-0:i386 libdbus-glib-1-2:i386 libnm-glib-dev:i386 )
 	# Sven Co-op
 	# Sven Co-op
 	elif [ "${shortname}" == "sven" ]; then
 	elif [ "${shortname}" == "sven" ]; then
-		array_deps_required+=( libssl1.0.0:i386 )
+		array_deps_required+=( libssl1.0.0:i386 zlib1g:i386 )
 	# Unreal Engine
 	# Unreal Engine
 	elif [ "${executable}" == "./ucc-bin" ]; then
 	elif [ "${executable}" == "./ucc-bin" ]; then
 		#UT2K4
 		#UT2K4

+ 9 - 4
lgsm/functions/check_ip.sh

@@ -6,7 +6,6 @@
 # If multiple interfaces are detected the user will need to manually set using ip="0.0.0.0".
 # If multiple interfaces are detected the user will need to manually set using ip="0.0.0.0".
 
 
 local commandname="CHECK"
 local commandname="CHECK"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 
 if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travistest}" != "1" ]; then
 if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travistest}" != "1" ]; then
 	if [ ! -f "/bin/ip" ]; then
 	if [ ! -f "/bin/ip" ]; then
@@ -25,7 +24,11 @@ if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travi
 		sleep 0.5
 		sleep 0.5
 		# Multiple interfaces
 		# Multiple interfaces
 		if [ "${getipwc}" -ge "2" ]; then
 		if [ "${getipwc}" -ge "2" ]; then
-			fn_print_fail "Check IP: Multiple IP addresses found."
+			if [ "${function_selfname}" == "command_details.sh" ]; then
+			    fn_print_warn "Check IP: Multiple IP addresses found."
+			else
+			    fn_print_fail "Check IP: Multiple IP addresses found."
+			fi
 			sleep 0.5
 			sleep 0.5
 			echo -en "\n"
 			echo -en "\n"
 			# IP is set within game config
 			# IP is set within game config
@@ -54,7 +57,7 @@ if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travi
 			echo -en "https://linuxgsm.com/network-interfaces\n"
 			echo -en "https://linuxgsm.com/network-interfaces\n"
 			echo -en ""
 			echo -en ""
 			# Do not exit for details and postdetails commands
 			# Do not exit for details and postdetails commands
-			if [ "${commandaction}" != "Details" ]&&[ "${commandaction}" != "Postdetails" ]; then
+			if [ "${function_selfname}" != "command_details.sh" ]||[ "${function_selfname}" != "command_postdetails.sh" ]; then
 				fn_script_log_fatal "https://linuxgsm.com/network-interfaces\n"
 				fn_script_log_fatal "https://linuxgsm.com/network-interfaces\n"
 				core_exit.sh
 				core_exit.sh
 			else
 			else
@@ -76,7 +79,9 @@ if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travi
 			fn_script_log_fatal "IP address not set in game config."
 			fn_script_log_fatal "IP address not set in game config."
 			fn_script_log_fatal "Specify the IP you want to bind within: ${servercfgfullpath}."
 			fn_script_log_fatal "Specify the IP you want to bind within: ${servercfgfullpath}."
 			fn_script_log_fatal "https://linuxgsm.com/network-interfaces\n"
 			fn_script_log_fatal "https://linuxgsm.com/network-interfaces\n"
-			core_exit.sh
+			if [ "${function_selfname}" != "command_details.sh" ];then
+			    core_exit.sh
+			fi
 		else
 		else
 			fn_print_info_nl "Check IP: ${getip}"
 			fn_print_info_nl "Check IP: ${getip}"
 			fn_script_log_info "IP automatically set as: ${getip}"
 			fn_script_log_info "IP automatically set as: ${getip}"

+ 6 - 4
lgsm/functions/check_permissions.sh

@@ -230,8 +230,10 @@ fn_sys_perm_error_process(){
 # Run perm error detect & fix/alert functions on /sys directories
 # Run perm error detect & fix/alert functions on /sys directories
 
 
 ## Run checks
 ## Run checks
-fn_check_ownership
-fn_check_permissions
-if [ "${function_selfname}" == "command_start.sh" ]; then
-	fn_sys_perm_error_process
+if [ "$(whoami)" != "root" ]; then
+	fn_check_ownership
+	fn_check_permissions
+	if [ "${function_selfname}" == "command_start.sh" ]; then
+		fn_sys_perm_error_process
+	fi
 fi
 fi

+ 6 - 4
lgsm/functions/check_root.sh

@@ -8,9 +8,11 @@ local commandname="CHECK"
 local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 
 if [ "$(whoami)" = "root" ]; then
 if [ "$(whoami)" = "root" ]; then
-	fn_print_fail_nl "Do NOT run this script as root!"
-	if [ -d "${lgsmlogdir}" ]; then
-		fn_script_log_fatal "${selfname} attempted to run as root."
+	if [ "${function_selfname}" != "command_install.sh" ]; then
+		fn_print_fail_nl "Do NOT run this script as root!"
+		if [ -d "${lgsmlogdir}" ]; then
+			fn_script_log_fatal "${selfname} attempted to run as root."
+		fi
+		core_exit.sh
 	fi
 	fi
-	core_exit.sh
 fi
 fi

+ 1 - 13
lgsm/functions/check_status.sh

@@ -8,7 +8,7 @@
 local commandname="CHECK"
 local commandname="CHECK"
 local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 
-if [ "${gamename}" == "TeamSpeak 3" ]; then
+if [ "${shortname}" == "ts3" ]; then
 	# 1: Server is running
 	# 1: Server is running
 	# 0: Server seems to have died
 	# 0: Server seems to have died
 	# 0: No server running (ts3server.pid is missing)
 	# 0: No server running (ts3server.pid is missing)
@@ -19,18 +19,6 @@ if [ "${gamename}" == "TeamSpeak 3" ]; then
 		ts3error="${status}"
 		ts3error="${status}"
 		status=0
 		status=0
 	fi
 	fi
-
-elif [ "${gamename}" == "Mumble" ]; then
-	# Get config info
-	info_config.sh
-	# 1: Server is listening
-	# 0: Server is not listening, considered closed
-	mumblepid=$(netstat -nap  2>/dev/null | grep udp | grep "${port}" | grep murmur | awk '{ print $6 }' | awk -F'/' '{ print $1 }')
-	if [ -z "${mumblepid}" ]; then
-		status=0
-	else
-		status=1
-	fi
 else
 else
 	status=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | grep -Ecx "^${servicename}")
 	status=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | grep -Ecx "^${servicename}")
 fi
 fi

+ 3 - 3
lgsm/functions/command_backup.sh

@@ -14,12 +14,12 @@ check.sh
 # Trap to remove lockfile on quit.
 # Trap to remove lockfile on quit.
 fn_backup_trap(){
 fn_backup_trap(){
 	echo ""
 	echo ""
-	echo -ne "backup ${backupname}.tar.gz..."
+	echo -en "backup ${backupname}.tar.gz..."
 	fn_print_canceled_eol_nl
 	fn_print_canceled_eol_nl
 	fn_script_log_info "Backup ${backupname}.tar.gz: CANCELED"
 	fn_script_log_info "Backup ${backupname}.tar.gz: CANCELED"
 	sleep 0.5
 	sleep 0.5
 	rm -f "${backupdir}/${backupname}.tar.gz" | tee -a "${lgsmlog}"
 	rm -f "${backupdir}/${backupname}.tar.gz" | tee -a "${lgsmlog}"
-	echo -ne "backup ${backupname}.tar.gz..."
+	echo -en "backup ${backupname}.tar.gz..."
 	fn_print_removed_eol_nl
 	fn_print_removed_eol_nl
 	fn_script_log_info "Backup ${backupname}.tar.gz: REMOVED"
 	fn_script_log_info "Backup ${backupname}.tar.gz: REMOVED"
 	# Remove lock file
 	# Remove lock file
@@ -47,7 +47,7 @@ fn_backup_init(){
 	sleep 0.5
 	sleep 0.5
 	fn_print_ok "Backup starting"
 	fn_print_ok "Backup starting"
 	sleep 0.5
 	sleep 0.5
-	echo -ne "\n"
+	echo -en "\n"
 	if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
 	if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
 		fn_print_info_nl "There are no previous backups"
 		fn_print_info_nl "There are no previous backups"
 	else
 	else

+ 5 - 0
lgsm/functions/command_debug.sh

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

+ 55 - 13
lgsm/functions/command_dev_detect_deps.sh

@@ -36,58 +36,100 @@ sort "${tmpdir}/.depdetect_readelf" |uniq >"${tmpdir}/.depdetect_readelf_uniq"
 
 
 while read -r lib; do
 while read -r lib; do
 	echo "${lib}"
 	echo "${lib}"
-	if [ "${lib}" == "libm.so.6" ]||[ "${lib}" == "libc.so.6" ]||[ "${lib}" == "libtcmalloc_minimal.so.4" ]||[ "${lib}" == "libpthread.so.0" ]||[ "${lib}" == "libdl.so.2" ]||[ "${lib}" == "libnsl.so.1" ]||[ "${lib}" == "libgcc_s.so.1" ]||[ "${lib}" == "librt.so.1" ]||[ "${lib}" == "ld-linux.so.2" ]; then
-		echo "glibc.i686" >> "${tmpdir}/.depdetect_centos_list"
-		echo "lib32gcc1" >> "${tmpdir}/.depdetect_ubuntu_list"
-		echo "lib32gcc1" >> "${tmpdir}/.depdetect_debian_list"
-	elif [ "${lib}" == "libstdc++.so.6" ]; then
+	local libs_array=( libm.so.6 libc.so.6 libtcmalloc_minimal.so.4 libpthread.so.0 libdl.so.2 libnsl.so.1 libgcc_s.so.1 librt.so.1 ld-linux.so.2 libdbus-glib-1.so.2 libgio-2.0.so.0 libglib-2.0.so.0 libGL.so.1 libgobject-2.0.so.0 libnm-glib.so.4 libnm-util.so.2 )
+	for lib_file in "${libs_array[@]}"
+	do
+		if [ "${lib}" == "${lib_file}" ]; then
+			echo "glibc.i686" >> "${tmpdir}/.depdetect_centos_list"
+			echo "lib32gcc1" >> "${tmpdir}/.depdetect_ubuntu_list"
+			echo "lib32gcc1" >> "${tmpdir}/.depdetect_debian_list"
+			libdetected=1
+		fi
+	done
+
+	local libs_array=( libawt.so libjava.so libjli.so libjvm.so libnet.so libnio.so libverify.so )
+	for lib_file in "${libs_array[@]}"
+	do
+		if [ "${lib}" == "${lib_file}" ]; then
+			echo "java-1.8.0-openjdk" >> "${tmpdir}/.depdetect_centos_list"
+			echo "default-jre" >> "${tmpdir}/.depdetect_ubuntu_list"
+			echo "default-jre" >> "${tmpdir}/.depdetect_debian_list"
+			libdetected=1
+		fi
+	done
+
+	local libs_array=( libtier0.so libtier0_srv.so libvstdlib_srv.so Core.so libvstdlib.so libtier0_s.so Editor.so Engine.so liblua.so libsteam_api.so ld-linux-x86-64.so.2 libPhysX3_x86.so libPhysX3Common_x86.so libPhysX3Cooking_x86.so)
+	for lib_file in "${libs_array[@]}"
+	do
+		# Known shared libs what dont requires dependencies
+		if [ "${lib}" == "${lib_file}" ]; then
+			libdetected=1
+		fi
+	done
+
+	if [ "${lib}" == "libstdc++.so.6" ]; then
 		echo "libstdc++.i686" >> "${tmpdir}/.depdetect_centos_list"
 		echo "libstdc++.i686" >> "${tmpdir}/.depdetect_centos_list"
 		echo "libstdc++6:i386" >> "${tmpdir}/.depdetect_ubuntu_list"
 		echo "libstdc++6:i386" >> "${tmpdir}/.depdetect_ubuntu_list"
 		echo "libstdc++6:i386" >> "${tmpdir}/.depdetect_debian_list"
 		echo "libstdc++6:i386" >> "${tmpdir}/.depdetect_debian_list"
+		libdetected=1
 	elif [ "${lib}" == "libstdc++.so.5" ]; then
 	elif [ "${lib}" == "libstdc++.so.5" ]; then
 		echo "compat-libstdc++-33.i686" >> "${tmpdir}/.depdetect_centos_list"
 		echo "compat-libstdc++-33.i686" >> "${tmpdir}/.depdetect_centos_list"
 		echo "libstdc++5:i386" >> "${tmpdir}/.depdetect_ubuntu_list"
 		echo "libstdc++5:i386" >> "${tmpdir}/.depdetect_ubuntu_list"
 		echo "libstdc++5:i386" >> "${tmpdir}/.depdetect_debian_list"
 		echo "libstdc++5:i386" >> "${tmpdir}/.depdetect_debian_list"
+		libdetected=1
 	elif [ "${lib}" == "libcurl-gnutls.so.4" ]; then
 	elif [ "${lib}" == "libcurl-gnutls.so.4" ]; then
 		echo "libcurl.i686" >> "${tmpdir}/.depdetect_centos_list"
 		echo "libcurl.i686" >> "${tmpdir}/.depdetect_centos_list"
 		echo "libcurl4-gnutls-dev:i386" >> "${tmpdir}/.depdetect_ubuntu_list"
 		echo "libcurl4-gnutls-dev:i386" >> "${tmpdir}/.depdetect_ubuntu_list"
 		echo "libcurl4-gnutls-dev:i386" >> "${tmpdir}/.depdetect_debian_list"
 		echo "libcurl4-gnutls-dev:i386" >> "${tmpdir}/.depdetect_debian_list"
+		libdetected=1
 	elif [ "${lib}" == "libspeex.so.1" ]||[ "${lib}" == "libspeexdsp.so.1" ]; then
 	elif [ "${lib}" == "libspeex.so.1" ]||[ "${lib}" == "libspeexdsp.so.1" ]; then
 		echo "speex.i686" >> "${tmpdir}/.depdetect_centos_list"
 		echo "speex.i686" >> "${tmpdir}/.depdetect_centos_list"
 		echo "speex:i386" >> "${tmpdir}/.depdetect_ubuntu_list"
 		echo "speex:i386" >> "${tmpdir}/.depdetect_ubuntu_list"
 		echo "speex:i386" >> "${tmpdir}/.depdetect_debian_list"
 		echo "speex:i386" >> "${tmpdir}/.depdetect_debian_list"
+		libdetected=1
 	elif [ "${lib}" == "./libSDL-1.2.so.0" ]||[ "${lib}" == "libSDL-1.2.so.0" ]; then
 	elif [ "${lib}" == "./libSDL-1.2.so.0" ]||[ "${lib}" == "libSDL-1.2.so.0" ]; then
 		echo "SDL.i686" >> "${tmpdir}/.depdetect_centos_list"
 		echo "SDL.i686" >> "${tmpdir}/.depdetect_centos_list"
 		echo "libsdl1.2debian" >> "${tmpdir}/.depdetect_ubuntu_list"
 		echo "libsdl1.2debian" >> "${tmpdir}/.depdetect_ubuntu_list"
 		echo "libsdl1.2debian" >> "${tmpdir}/.depdetect_debian_list"
 		echo "libsdl1.2debian" >> "${tmpdir}/.depdetect_debian_list"
+		libdetected=1
 	elif [ "${lib}" == "libtbb.so.2" ]; then
 	elif [ "${lib}" == "libtbb.so.2" ]; then
 		echo "tbb.i686" >> "${tmpdir}/.depdetect_centos_list"
 		echo "tbb.i686" >> "${tmpdir}/.depdetect_centos_list"
 		echo "libtbb2" >> "${tmpdir}/.depdetect_ubuntu_list"
 		echo "libtbb2" >> "${tmpdir}/.depdetect_ubuntu_list"
 		echo "libtbb2" >> "${tmpdir}/.depdetect_debian_list"
 		echo "libtbb2" >> "${tmpdir}/.depdetect_debian_list"
-	elif [ "${lib}" == "libawt.so" ]||[ "${lib}" == "libjava.so" ]||[ "${lib}" == "libjli.so" ]||[ "${lib}" == "libjvm.so" ]||[ "${lib}" == "libnet.so" ]||[ "${lib}" == "libnio.so" ]||[ "${lib}" == "libverify.so" ]; then
-		echo "java-1.8.0-openjdk" >> "${tmpdir}/.depdetect_centos_list"
-		echo "default-jre" >> "${tmpdir}/.depdetect_ubuntu_list"
-		echo "default-jre" >> "${tmpdir}/.depdetect_debian_list"
+		libdetected=1
+
 	elif [ "${lib}" == "libXrandr.so.2" ]; then
 	elif [ "${lib}" == "libXrandr.so.2" ]; then
 		echo "libXrandr" >> "${tmpdir}/.depdetect_centos_list"
 		echo "libXrandr" >> "${tmpdir}/.depdetect_centos_list"
 		echo "libxrandr2" >> "${tmpdir}/.depdetect_ubuntu_list"
 		echo "libxrandr2" >> "${tmpdir}/.depdetect_ubuntu_list"
 		echo "libxrandr2" >> "${tmpdir}/.depdetect_debian_list"
 		echo "libxrandr2" >> "${tmpdir}/.depdetect_debian_list"
+		libdetected=1
 	elif [ "${lib}" == "libXext.so.6" ]; then
 	elif [ "${lib}" == "libXext.so.6" ]; then
 		echo "libXext" >> "${tmpdir}/.depdetect_centos_list"
 		echo "libXext" >> "${tmpdir}/.depdetect_centos_list"
 		echo "libxext6" >> "${tmpdir}/.depdetect_ubuntu_list"
 		echo "libxext6" >> "${tmpdir}/.depdetect_ubuntu_list"
 		echo "libxext6" >> "${tmpdir}/.depdetect_debian_list"
 		echo "libxext6" >> "${tmpdir}/.depdetect_debian_list"
+		libdetected=1
 	elif [ "${lib}" == "libXtst.so.6" ]; then
 	elif [ "${lib}" == "libXtst.so.6" ]; then
 		echo "libXtst" >> "${tmpdir}/.depdetect_centos_list"
 		echo "libXtst" >> "${tmpdir}/.depdetect_centos_list"
 		echo "libxtst6" >> "${tmpdir}/.depdetect_ubuntu_list"
 		echo "libxtst6" >> "${tmpdir}/.depdetect_ubuntu_list"
 		echo "libxtst6" >> "${tmpdir}/.depdetect_debian_list"
 		echo "libxtst6" >> "${tmpdir}/.depdetect_debian_list"
+		libdetected=1
+	elif [ "${lib}" == "libpulse.so.0" ]; then
+		echo "pulseaudio-libs" >> "${tmpdir}/.depdetect_centos_list"
+		echo "libpulse0" >> "${tmpdir}/.depdetect_ubuntu_list"
+		echo "libpulse0" >> "${tmpdir}/.depdetect_debian_list"
+		libdetected=1
+	elif [ "${lib}" == "libopenal.so.1" ]; then
+		echo "" >> "${tmpdir}/.depdetect_centos_list"
+		echo "libopenal1" >> "${tmpdir}/.depdetect_ubuntu_list"
+		echo "libopenal1" >> "${tmpdir}/.depdetect_debian_list"
+		libdetected=1
+	fi
 
 
-	elif [ "${lib}" == "libtier0.so" ]||[ "${lib}" == "libtier0_srv.so" ]||[ "${lib}" == "libvstdlib_srv.so" ]||[ "${lib}" == "Core.so" ]||[ "${lib}" == "libvstdlib.so" ]||[ "${lib}" == "libtier0_s.so" ]||[ "${lib}" == "Editor.so" ]||[ "${lib}" == "Engine.so" ]||[ "${lib}" == "liblua.so" ]||[ "${lib}" == "libsteam_api.so" ]||[ "${lib}" == "ld-linux-x86-64.so.2" ]||[ "${lib}" == "libPhysX3_x86.so" ]||[ "${lib}" == "libPhysX3Common_x86.so" ]||[ "${lib}" == "libPhysX3Cooking_x86.so" ]; then
-		# Known shared libs what dont requires dependencies
-		:
-	else
+	if [ "${libdetected}" != "1" ]; then
 		unknownlib=1
 		unknownlib=1
 		echo "${lib}" >> "${tmpdir}/.depdetect_unknown"
 		echo "${lib}" >> "${tmpdir}/.depdetect_unknown"
 	fi
 	fi
+	unset libdetected
 done < "${tmpdir}/.depdetect_readelf_uniq"
 done < "${tmpdir}/.depdetect_readelf_uniq"
 
 
 sort "${tmpdir}/.depdetect_centos_list" | uniq >> "${tmpdir}/.depdetect_centos_list_uniq"
 sort "${tmpdir}/.depdetect_centos_list" | uniq >> "${tmpdir}/.depdetect_centos_list_uniq"

+ 36 - 32
lgsm/functions/command_install.sh

@@ -10,37 +10,41 @@ local commandaction="Install"
 local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 
 check.sh
 check.sh
-install_header.sh
-install_server_dir.sh
-install_logs.sh
-check_deps.sh
-installflag=1
-# Download and install
-if [ "${gamename}" == "Unreal Tournament 2004" ]; then
-	install_server_files.sh
-	install_ut2k4_key.sh
-elif [ -z "${appid}" ]; then
-	installer=1
-	install_server_files.sh
-elif [ -n "${appid}" ]; then
-	install_steamcmd.sh
-	install_server_files.sh
-fi
+if [ "$(whoami)" = "root" ]; then
+	check_deps.sh
+else
+	install_header.sh
+	install_server_dir.sh
+	install_logs.sh
+	check_deps.sh
+	installflag=1
+	# Download and install
+	if [ "${gamename}" == "Unreal Tournament 2004" ]; then
+		install_server_files.sh
+		install_ut2k4_key.sh
+	elif [ -z "${appid}" ]; then
+		installer=1
+		install_server_files.sh
+	elif [ -n "${appid}" ]; then
+		install_steamcmd.sh
+		install_server_files.sh
+	fi
 
 
-# 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
-	install_gslt.sh
-elif [ "${gamename}" == "Don't Starve Together" ]; then
-	install_dst_token.sh
-elif [ "${gamename}" == "Squad" ]; then
-	install_squad_license.sh
-elif [ "${gamename}" == "TeamSpeak 3" ]; then
-	install_ts3db.sh
-elif [ "${gamename}" == "Multi Theft Auto" ]; then
-	command_install_resources_mta.sh
-fi
+	# 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
+		install_gslt.sh
+	elif [ "${gamename}" == "Don't Starve Together" ]; then
+		install_dst_token.sh
+	elif [ "${gamename}" == "Squad" ]; then
+		install_squad_license.sh
+	elif [ "${gamename}" == "TeamSpeak 3" ]; then
+		install_ts3db.sh
+	elif [ "${gamename}" == "Multi Theft Auto" ]; then
+		command_install_resources_mta.sh
+	fi
 
 
-fix.sh
-install_complete.sh
-core_exit.sh
+	fix.sh
+	install_complete.sh
+	core_exit.sh
+fi

+ 11 - 7
lgsm/functions/command_monitor.sh

@@ -26,7 +26,7 @@ for queryattempt in {1..5}; do
 		fi
 		fi
 		"${functionsdir}"/query_gsquery.py -a "${ip}" -p "${queryport}" -e "${engine}" > /dev/null 2>&1
 		"${functionsdir}"/query_gsquery.py -a "${ip}" -p "${queryport}" -e "${engine}" > /dev/null 2>&1
 		querystatus="$?"
 		querystatus="$?"
-	elif [ "${querymethod}" ==  "telnet" ]; then
+	elif [ "${querymethod}" ==  "tcp" ]; then
 		bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}''
 		bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}''
 		querystatus="$?"
 		querystatus="$?"
 	fi
 	fi
@@ -131,7 +131,7 @@ fn_monitor_check_session(){
 fn_monitor_query(){
 fn_monitor_query(){
 	fn_script_log_info "Querying port: query enabled"
 	fn_script_log_info "Querying port: query enabled"
 	# engines that work with query
 	# engines that work with query
-	local allowed_engines_array=( avalanche2.0 avalanche3.0 goldsource idtech2 idtech3 idtech3_ql iw2.0 iw3.0 madness quake refractor realvirtuality source spark starbound unity3d unreal unreal2 unreal4 )
+	local allowed_engines_array=( avalanche2.0 avalanche3.0 goldsource idtech2 idtech3 idtech3_ql iw2.0 iw3.0 lwjgl2 madness quake refractor realvirtuality source spark starbound unity3d unreal unreal2 unreal4 wurm )
 	for allowed_engine in "${allowed_engines_array[@]}"
 	for allowed_engine in "${allowed_engines_array[@]}"
 	do
 	do
 		if [ "${allowed_engine}" == "${engine}" ]; then
 		if [ "${allowed_engine}" == "${engine}" ]; then
@@ -143,7 +143,11 @@ fn_monitor_query(){
 
 
 			# will first attempt to use gamedig then gsquery
 			# will first attempt to use gamedig then gsquery
 			totalseconds=0
 			totalseconds=0
-			local query_methods_array=( gamedig gsquery )
+			if [ "${shortname}" == "wurm" ]; then
+				local query_methods_array=( gsquery )
+			else
+				local query_methods_array=( gamedig gsquery )
+			fi
 			for query_method in "${query_methods_array[@]}"
 			for query_method in "${query_methods_array[@]}"
 			do
 			do
 				if [ "${query_method}" == "gamedig" ]; then
 				if [ "${query_method}" == "gamedig" ]; then
@@ -165,8 +169,8 @@ fn_monitor_query(){
 	done
 	done
 }
 }
 
 
-fn_monitor_query_telnet(){
-	querymethod="telnet"
+fn_monitor_query_tcp(){
+	querymethod="tcp"
 	fn_monitor_loop
 	fn_monitor_loop
 }
 }
 
 
@@ -186,8 +190,8 @@ if [ "${gamename}" == "Starbound" ]; then
 	if [ "${queryenabled}" == "true" ]; then
 	if [ "${queryenabled}" == "true" ]; then
 		fn_monitor_query
 		fn_monitor_query
 	fi
 	fi
-elif [ "${gamename}" == "TeamSpeak 3" ]||[ "${gamename}" == "Eco" ]; then
-	fn_monitor_query_telnet
+elif [ "${shortname}" == "ts3" ]||[ "${shortname}" == "eco" ]||[ "${shortname}" == "mumble" ]; then
+	fn_monitor_query_tcp
 else
 else
 	fn_monitor_query
 	fn_monitor_query
 fi
 fi

+ 8 - 7
lgsm/functions/command_postdetails.sh

@@ -51,15 +51,16 @@ fi
 if [ -n "${alertflag}" ]; then
 if [ -n "${alertflag}" ]; then
 	postdetailslog="${alertlog}"
 	postdetailslog="${alertlog}"
 else
 else
+	# Run checks and gathers details to display.
+	check.sh
+	info_config.sh
+	info_parms.sh
+	info_distro.sh
+	info_glibc.sh
+	info_messages.sh
+	query_gamedig.sh
 	touch "${postdetailslog}" || fn_bad_postdetailslog
 	touch "${postdetailslog}" || fn_bad_postdetailslog
 	{
 	{
-		# Run checks and gathers details to display.
-		check.sh
-		info_config.sh
-		info_distro.sh
-		info_glibc.sh
-		info_parms.sh
-		info_messages.sh
 		fn_info_message_distro
 		fn_info_message_distro
 		fn_info_message_performance
 		fn_info_message_performance
 		fn_info_message_disk
 		fn_info_message_disk

+ 8 - 3
lgsm/functions/command_start.sh

@@ -58,8 +58,11 @@ fn_start_teamspeak3(){
 }
 }
 
 
 fn_start_tmux(){
 fn_start_tmux(){
-	fn_parms
-
+	if [ "${parmsbypass}" ]; then
+		parms=""
+	else
+		fn_parms
+	fi
 	# check for tmux size variables
 	# check for tmux size variables
 	if [[ "${servercfgtmuxwidth}" =~ ^[0-9]+$ ]]; then
 	if [[ "${servercfgtmuxwidth}" =~ ^[0-9]+$ ]]; then
 		sessionwidth="${servercfgtmuxwidth}"
 		sessionwidth="${servercfgtmuxwidth}"
@@ -198,7 +201,9 @@ if [ "${status}" != "0" ]; then # $status comes from check_status.sh, which is r
 		core_exit.sh
 		core_exit.sh
 	fi
 	fi
 fi
 fi
-fix.sh
+if [ -z "${fixbypass}" ];then
+	fix.sh
+fi
 info_config.sh
 info_config.sh
 logs.sh
 logs.sh
 
 

+ 4 - 2
lgsm/functions/command_stop.sh

@@ -187,7 +187,7 @@ fn_stop_graceful_select(){
 		fn_stop_graceful_cmd "quit" 120
 		fn_stop_graceful_cmd "quit" 120
 	elif [ "${engine}" == "goldsource" ]; then
 	elif [ "${engine}" == "goldsource" ]; then
 		fn_stop_graceful_goldsource
 		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" ]; then
+	elif [ "${engine}" == "avalanche2.0" ]||[ "${engine}" == "avalanche3.0" ]||[ "${gamename}" == "Factorio" ]||[ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal4" ]||[ "${engine}" == "unreal3" ]||[ "${engine}" == "unreal2" ]||[ "${engine}" == "unreal" ]||[ "${gamename}" == "Mumble" ]||[ "${shortname}" == "wurm" ]; then
 		fn_stop_graceful_ctrlc
 		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" ]||[ "${engine}" == "Just Cause 2" ]||[ "${engine}" == "projectzomboid" ]||[ "${shortname}" == "rw" ]; then
 		fn_stop_graceful_cmd "quit" 30
 		fn_stop_graceful_cmd "quit" 30
@@ -301,4 +301,6 @@ fn_stop_pre_check
 if [ -f "${rootdir}/${lockselfname}" ]; then
 if [ -f "${rootdir}/${lockselfname}" ]; then
 	rm -f "${rootdir}/${lockselfname}"
 	rm -f "${rootdir}/${lockselfname}"
 fi
 fi
-core_exit.sh
+if [ -z "${exitbypass}" ]; then
+	core_exit.sh
+fi

+ 9 - 9
lgsm/functions/command_update_linuxgsm.sh

@@ -12,11 +12,11 @@ fn_print_dots "Updating LinuxGSM"
 sleep 0.5
 sleep 0.5
 check.sh
 check.sh
 fn_script_log_info "Updating LinuxGSM"
 fn_script_log_info "Updating LinuxGSM"
-echo -ne "\n"
+echo -en "\n"
 
 
 if [ -z "${legacymode}" ]; then
 if [ -z "${legacymode}" ]; then
 	# Check and update _default.cfg
 	# Check and update _default.cfg
-	echo -ne "    checking config _default.cfg...\c"
+	echo -en "    checking config _default.cfg...\c"
 	config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(${curlpath} -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg"))
 	config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(${curlpath} -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg"))
 	if [ "${config_file_diff}" != "" ]; then
 	if [ "${config_file_diff}" != "" ]; then
 		fn_print_update_eol_nl
 		fn_print_update_eol_nl
@@ -30,7 +30,7 @@ if [ -z "${legacymode}" ]; then
 		fn_script_log_info "checking config _default.cfg: OK"
 		fn_script_log_info "checking config _default.cfg: OK"
 	fi
 	fi
 
 
-	echo -ne "    checking linuxgsm.sh...\c"
+	echo -en "    checking linuxgsm.sh...\c"
 	tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(${curlpath} -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh"))
 	tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(${curlpath} -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh"))
 	if [ "${tmp_script_diff}" != "" ]; then
 	if [ "${tmp_script_diff}" != "" ]; then
 		fn_print_update_eol_nl
 		fn_print_update_eol_nl
@@ -42,11 +42,11 @@ if [ -z "${legacymode}" ]; then
 		fn_script_log_info "checking linuxgsm.sh: OK"
 		fn_script_log_info "checking linuxgsm.sh: OK"
 		fn_print_ok_eol_nl
 		fn_print_ok_eol_nl
 	fi
 	fi
-	echo -ne "    checking ${selfname}...\c"
+	echo -en "    checking ${selfname}...\c"
 	script_diff=$(diff <(sed '\/shortname/d;\/gameservername/d;\/gamename/d;\/githubuser/d;\/githubrepo/d;\/githubbranch/d' "${tmpdir}/linuxgsm.sh") <(sed '\/shortname/d;\/gameservername/d;\/gamename/d;\/githubuser/d;\/githubrepo/d;\/githubbranch/d' "${rootdir}/${selfname}"))
 	script_diff=$(diff <(sed '\/shortname/d;\/gameservername/d;\/gamename/d;\/githubuser/d;\/githubrepo/d;\/githubbranch/d' "${tmpdir}/linuxgsm.sh") <(sed '\/shortname/d;\/gameservername/d;\/gamename/d;\/githubuser/d;\/githubrepo/d;\/githubbranch/d' "${rootdir}/${selfname}"))
 	if [ "${script_diff}" != "" ]; then
 	if [ "${script_diff}" != "" ]; then
 		fn_print_update_eol_nl
 		fn_print_update_eol_nl
-		echo -ne "    backup ${selfname}...\c"
+		echo -en "    backup ${selfname}...\c"
 		mkdir -p "${backupdir}/script/"
 		mkdir -p "${backupdir}/script/"
 		cp "${rootdir}/${selfname}" "${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak"
 		cp "${rootdir}/${selfname}" "${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak"
 		if [ $? -ne 0 ]; then
 		if [ $? -ne 0 ]; then
@@ -56,7 +56,7 @@ if [ -z "${legacymode}" ]; then
 			fn_print_ok_eol_nl
 			fn_print_ok_eol_nl
 			echo -e "	Backup: ${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak"
 			echo -e "	Backup: ${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak"
 		fi
 		fi
-		echo -ne "    fetching ${selfname}...\c"
+		echo -en "    fetching ${selfname}...\c"
 		cp "${tmpdir}/linuxgsm.sh" "${rootdir}/${selfname}"
 		cp "${tmpdir}/linuxgsm.sh" "${rootdir}/${selfname}"
 		sed -i "s/shortname=\"core\"/shortname=\"${shortname}\"/g" "${rootdir}/${selfname}"
 		sed -i "s/shortname=\"core\"/shortname=\"${shortname}\"/g" "${rootdir}/${selfname}"
 		sed -i "s/gameservername=\"core\"/gameservername=\"${gameservername}\"/g" "${rootdir}/${selfname}"
 		sed -i "s/gameservername=\"core\"/gameservername=\"${gameservername}\"/g" "${rootdir}/${selfname}"
@@ -78,14 +78,14 @@ if [ -n "${functionsdir}" ]; then
 		cd "${functionsdir}" || exit
 		cd "${functionsdir}" || exit
 		for functionfile in *
 		for functionfile in *
 		do
 		do
-			echo -ne "    checking function ${functionfile}...\c"
+			echo -en "    checking function ${functionfile}...\c"
 			github_file_url_dir="lgsm/functions"
 			github_file_url_dir="lgsm/functions"
 			get_function_file=$(${curlpath} --fail -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}")
 			get_function_file=$(${curlpath} --fail -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}")
 			exitcode=$?
 			exitcode=$?
 			function_file_diff=$(diff "${functionsdir}/${functionfile}" <(${curlpath} --fail -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}"))
 			function_file_diff=$(diff "${functionsdir}/${functionfile}" <(${curlpath} --fail -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}"))
 			if [ ${exitcode} -ne 0 ]; then
 			if [ ${exitcode} -ne 0 ]; then
 				fn_print_fail_eol_nl
 				fn_print_fail_eol_nl
-				echo -ne "    removing unknown function ${functionfile}...\c"
+				echo -en "    removing unknown function ${functionfile}...\c"
 				fn_script_log_fatal "removing unknown function ${functionfile}"
 				fn_script_log_fatal "removing unknown function ${functionfile}"
 				rm -f "${functionfile}"
 				rm -f "${functionfile}"
 				if [ $? -ne 0 ]; then
 				if [ $? -ne 0 ]; then
@@ -113,5 +113,5 @@ else
 	fn_print_ok "Updating functions"
 	fn_print_ok "Updating functions"
 	fn_script_log_pass "Updating functions"
 	fn_script_log_pass "Updating functions"
 fi
 fi
-echo -ne "\n"
+echo -en "\n"
 core_exit.sh
 core_exit.sh

+ 1 - 1
lgsm/functions/command_validate.sh

@@ -25,7 +25,7 @@ fn_validation(){
 		unbuffer="stdbuf -i0 -o0 -e0"
 		unbuffer="stdbuf -i0 -o0 -e0"
 	fi
 	fi
 
 
-	if [ "${engine}" == "goldsource" ]; then
+	if [ "${appid}" == "90" ]; then
 		${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +app_update "${appid}" ${branch} validate +quit | tee -a "${lgsmlog}"
 		${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +app_update "${appid}" ${branch} validate +quit | tee -a "${lgsmlog}"
 	else
 	else
 		${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} validate +quit | tee -a "${lgsmlog}"
 		${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} validate +quit | tee -a "${lgsmlog}"

+ 9 - 9
lgsm/functions/core_dl.sh

@@ -24,7 +24,7 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 fn_dl_md5(){
 fn_dl_md5(){
 	# Runs MD5 Check if available
 	# Runs MD5 Check if available
 	if [ "${md5}" != "0" ]&&[ "${md5}" != "nomd5" ]; then
 	if [ "${md5}" != "0" ]&&[ "${md5}" != "nomd5" ]; then
-		echo -ne "verifying ${local_filename} with MD5..."
+		echo -en "verifying ${local_filename} with MD5..."
 		sleep 0.5
 		sleep 0.5
 		local md5sumcmd=$(md5sum "${local_filedir}/${local_filename}"|awk '{print $1;}')
 		local md5sumcmd=$(md5sum "${local_filedir}/${local_filename}"|awk '{print $1;}')
 		if [ "${md5sumcmd}" != "${md5}" ]; then
 		if [ "${md5sumcmd}" != "${md5}" ]; then
@@ -53,7 +53,7 @@ fn_dl_extract(){
 	local_filename="${2}"
 	local_filename="${2}"
 	extractdir="${3}"
 	extractdir="${3}"
 	# extracts archives
 	# extracts archives
-	echo -ne "extracting ${local_filename}..."
+	echo -en "extracting ${local_filename}..."
 	mime=$(file -b --mime-type "${local_filedir}/${local_filename}")
 	mime=$(file -b --mime-type "${local_filedir}/${local_filename}")
 	if [ ! -d "${extractdir}" ]; then
 	if [ ! -d "${extractdir}" ]; then
 		mkdir "${extractdir}"
 		mkdir "${extractdir}"
@@ -85,12 +85,12 @@ fn_dl_extract(){
 # Trap to remove file download if canceled before completed
 # Trap to remove file download if canceled before completed
 fn_fetch_trap(){
 fn_fetch_trap(){
 	echo ""
 	echo ""
-	echo -ne "downloading ${local_filename}..."
+	echo -en "downloading ${local_filename}..."
 	fn_print_canceled_eol_nl
 	fn_print_canceled_eol_nl
 	fn_script_log_info "Downloading ${local_filename}...CANCELED"
 	fn_script_log_info "Downloading ${local_filename}...CANCELED"
 	sleep 0.5
 	sleep 0.5
 	rm -f "${local_filedir}/${local_filename}"
 	rm -f "${local_filedir}/${local_filename}"
-	echo -ne "downloading ${local_filename}..."
+	echo -en "downloading ${local_filename}..."
 	fn_print_removed_eol_nl
 	fn_print_removed_eol_nl
 	fn_script_log_info "Downloading ${local_filename}...REMOVED"
 	fn_script_log_info "Downloading ${local_filename}...REMOVED"
 	core_exit.sh
 	core_exit.sh
@@ -112,14 +112,14 @@ fn_fetch_file(){
 		fi
 		fi
 		# Trap will remove part downloaded files if canceled
 		# Trap will remove part downloaded files if canceled
 		trap fn_fetch_trap INT
 		trap fn_fetch_trap INT
-		# if larger file shows progress bar
-		if [ "${local_filename##*.}" == "bz2" ]||[ "${local_filename##*.}" == "gz" ]||[ "${local_filename##*.}" == "zip" ]||[ "${local_filename##*.}" == "jar" ]; then
-			echo -ne "downloading ${local_filename}..."
+		# larger files show a progress bar
+		if [ "${local_filename##*.}" == "bz2" ]||[ "${local_filename##*.}" == "gz" ]||[ "${local_filename##*.}" == "zip" ]||[ "${local_filename##*.}" == "jar" ]||[ "${local_filename##*.}" == "xz" ]; then
+			echo -en "downloading ${local_filename}..."
 			sleep 0.5
 			sleep 0.5
-			echo -ne "downloading ${local_filename}..."
+			echo -en "downloading ${local_filename}..."
 			curlcmd=$(${curlpath} --progress-bar --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}")
 			curlcmd=$(${curlpath} --progress-bar --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}")
 		else
 		else
-			echo -ne "    fetching ${local_filename}...\c"
+			echo -en "    fetching ${local_filename}...\c"
 			curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
 			curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
 		fi
 		fi
 		local exitcode=$?
 		local exitcode=$?

+ 6 - 0
lgsm/functions/core_exit.sh

@@ -14,6 +14,12 @@ fn_exit_dev_debug(){
 	fi
 	fi
 }
 }
 
 
+# If running dependency check as root will remove any files that belong to root user.
+if [ "$(whoami)" == "root" ]; then
+	find "${lgsmdir}"/ -group root -prune -exec rm -rf {} + > /dev/null 2>&1
+	find "${logdir}"/ -group root -prune -exec rm -rf {} + > /dev/null 2>&1
+fi
+
 if [ -n "${exitbypass}" ]; then
 if [ -n "${exitbypass}" ]; then
 	unset exitbypass
 	unset exitbypass
 elif [ -n "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then
 elif [ -n "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then

+ 10 - 0
lgsm/functions/core_functions.sh

@@ -367,6 +367,11 @@ functionfile="${FUNCNAME}"
 fn_fetch_function
 fn_fetch_function
 }
 }
 
 
+fix_ss3.sh(){
+functionfile="${FUNCNAME}"
+fn_fetch_function
+}
+
 fix_ut2k4.sh(){
 fix_ut2k4.sh(){
 functionfile="${FUNCNAME}"
 functionfile="${FUNCNAME}"
 fn_fetch_function
 fn_fetch_function
@@ -377,6 +382,11 @@ functionfile="${FUNCNAME}"
 fn_fetch_function
 fn_fetch_function
 }
 }
 
 
+fix_wurm.sh(){
+functionfile="${FUNCNAME}"
+fn_fetch_function
+}
+
 # Info
 # Info
 
 
 info_config.sh(){
 info_config.sh(){

+ 18 - 18
lgsm/functions/core_messages.sh

@@ -7,26 +7,26 @@
 
 
 # nl: new line: message is following by a new line
 # nl: new line: message is following by a new line
 # eol: end of line: message is placed at the end of the current line
 # eol: end of line: message is placed at the end of the current line
-
-if [ "${ansi}" != "off" ]; then
-	# echo colors
-	default="\e[0m"
-	red="\e[31m"
-	lightred="\e[91m"
-	green="\e[32m"
-	lightgreen="\e[92m"
-	yellow="\e[33m"
-	lightyellow="\e[93m"
-	blue="\e[34m"
-	lightblue="\e[94m"
-	magenta="\e[35m"
-	lightmagenta="\e[95m"
-	cyan="\e[36m"
-	lightcyan="\e[96m"
-
+fn_ansi_loader(){
+	if [ "${ansi}" != "off" ]; then
+		# echo colors
+		default="\e[0m"
+		red="\e[31m"
+		lightred="\e[91m"
+		green="\e[32m"
+		lightgreen="\e[92m"
+		yellow="\e[33m"
+		lightyellow="\e[93m"
+		blue="\e[34m"
+		lightblue="\e[94m"
+		magenta="\e[35m"
+		lightmagenta="\e[95m"
+		cyan="\e[36m"
+		lightcyan="\e[96m"
+	fi
 	# carriage return & erase to end of line
 	# carriage return & erase to end of line
 	creeol="\r\033[K"
 	creeol="\r\033[K"
-fi
+}
 
 
 # Log display
 # Log display
 ########################
 ########################

+ 4 - 2
lgsm/functions/fix.sh

@@ -37,7 +37,7 @@ fn_fix_msg_end(){
 }
 }
 
 
 # Fixes that are run on start
 # Fixes that are run on start
-if [ "${function_selfname}" != "command_install.sh" ]; then
+if [ "${function_selfname}" != "command_install.sh" ]&&[ -z "${fixbypass}" ]; then
 	if [ -n "${appid}" ]; then
 	if [ -n "${appid}" ]; then
 		fix_steamcmd.sh
 		fix_steamcmd.sh
 	fi
 	fi
@@ -62,13 +62,15 @@ if [ "${function_selfname}" != "command_install.sh" ]; then
 		fix_ss3.sh
 		fix_ss3.sh
 	elif [ "${gamename}" == "Multi Theft Auto" ]; then
 	elif [ "${gamename}" == "Multi Theft Auto" ]; then
 		fix_mta.sh
 		fix_mta.sh
+	elif [ "${shortname}" == "wurm" ]; then
+		fix_wurm.sh
 	fi
 	fi
 fi
 fi
 
 
 # Fixes that are run on install only.
 # Fixes that are run on install only.
 if [ "${function_selfname}" == "command_install.sh" ]; then
 if [ "${function_selfname}" == "command_install.sh" ]; then
 		echo ""
 		echo ""
-		echo "Applying ${gamename} Server Fixes"
+		echo "Applying Post-Install Fixes"
 		echo "================================="
 		echo "================================="
 		sleep 0.5
 		sleep 0.5
 		if [ "${gamename}" == "Killing Floor" ]; then
 		if [ "${gamename}" == "Killing Floor" ]; then

+ 4 - 0
lgsm/functions/fix_kf.sh

@@ -21,9 +21,13 @@ echo "applying server name fix."
 sleep 0.5
 sleep 0.5
 echo "forcing server restart..."
 echo "forcing server restart..."
 sleep 0.5
 sleep 0.5
+exitbypass=1
 command_start.sh
 command_start.sh
 sleep 5
 sleep 5
+exitbypass=1
 command_stop.sh
 command_stop.sh
+exitbypass=1
 command_start.sh
 command_start.sh
 sleep 5
 sleep 5
+exitbypass=1
 command_stop.sh
 command_stop.sh

+ 1 - 0
lgsm/functions/fix_kf2.sh

@@ -17,4 +17,5 @@ sleep 1
 exitbypass=1
 exitbypass=1
 command_start.sh
 command_start.sh
 sleep 10
 sleep 10
+exitbypass=1
 command_stop.sh
 command_stop.sh

+ 4 - 0
lgsm/functions/fix_ro.sh

@@ -24,9 +24,13 @@ echo "applying server name fix."
 sleep 0.5
 sleep 0.5
 echo "forcing server restart..."
 echo "forcing server restart..."
 sleep 0.5
 sleep 0.5
+exitbypass=1
 command_start.sh
 command_start.sh
 sleep 5
 sleep 5
+exitbypass=1
 command_stop.sh
 command_stop.sh
+exitbypass=1
 command_start.sh
 command_start.sh
 sleep 5
 sleep 5
+exitbypass=1
 command_stop.sh
 command_stop.sh

+ 1 - 0
lgsm/functions/fix_ut3.sh

@@ -17,4 +17,5 @@ sleep 1
 exitbypass=1
 exitbypass=1
 command_start.sh
 command_start.sh
 sleep 10
 sleep 10
+exitbypass=1
 command_stop.sh
 command_stop.sh

+ 23 - 0
lgsm/functions/fix_wurm.sh

@@ -0,0 +1,23 @@
+#!/bin/bash
+# LinuxGSM fix_wurm.sh function
+# Author: Daniel Gibbs
+# Website: https://linuxgsm.com
+# Description: Resolves various issues with ARK: Survival Evolved.
+
+# Copies steamclient.so to correct location
+if [ ! -f "${serverfiles}/nativelibs" ]; then
+	cp -f "${serverfiles}/linux64/steamclient.so" "${serverfiles}/nativelibs"
+fi
+
+# First run requires start with no parms
+# After first run new dirs are created
+if [ ! -d "${serverfiles}/Creative" ]; then
+	parmsbypass=1
+	fixbypass=1
+	exitbypass=1
+	command_start.sh
+	sleep 10
+	exitbypass=1
+	command_stop.sh
+	unset parmsbypass
+fi

+ 39 - 0
lgsm/functions/info_config.sh

@@ -304,6 +304,9 @@ fn_info_config_minecraft(){
 		rconport="${zero}"
 		rconport="${zero}"
 		maxplayers="${zero}"
 		maxplayers="${zero}"
 		port="${zero}"
 		port="${zero}"
+		queryport="${zero}"
+		queryenabled="${unavailable}"
+		rconport="${zero}"
 		gamemode="${unavailable}"
 		gamemode="${unavailable}"
 		gameworld="${unavailable}"
 		gameworld="${unavailable}"
 	else
 	else
@@ -312,6 +315,9 @@ fn_info_config_minecraft(){
 		rconport=$(grep "rcon.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		rconport=$(grep "rcon.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		port=$(grep "server-port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		port=$(grep "server-port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
+		queryport=$(grep "query.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
+		queryenabled=$(grep "enable-query" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/enable-query//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		rconport=$(grep "rcon.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		gamemode=$(grep "gamemode" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		gamemode=$(grep "gamemode" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 
 
@@ -1004,6 +1010,37 @@ fn_info_config_etlegacy(){
 	fi
 	fi
 }
 }
 
 
+fn_info_config_wurmunlimited(){
+	if [ ! -f "${servercfgfullpath}" ]; then
+		port="${zero}"
+		queryport="${zero}"
+		rconpassword="${unavailable}"
+		servername="${unavailable}"
+		serverpassword="${unavailable}"
+		adminpassword="${unavailable}"
+		maxplayers="${zero}"
+	else
+
+		port=$(grep "EXTERNALPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
+		queryport=$(grep "QUERYPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
+		servername=$(grep "SERVERNAME=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERNAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		serverpassword=$(grep "SERVERPASSWORD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERPASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		adminpassword=$(grep "ADMINPWD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMINPWD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		maxplayers=$(grep "MAXPLAYERS=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
+
+		ip=$(grep "IP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/IP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		ipsetinconfig=1
+		ipinconfigvar="IP"
+
+		# Not Set
+		port=${port:-"3724"}
+		queryport=${queryport:-"27017"}
+		servername=${servername:-"NOT SET"}
+		serverpassword=${serverpassword:-"NOT SET"}
+		adminpassword=${adminpassword:-"NOT SET"}
+		maxplayers=${maxplayers:-"0"}
+	fi
+}
 
 
 fn_info_config_squad(){
 fn_info_config_squad(){
 	if [ ! -f "${servercfgfullpath}" ]; then
 	if [ ! -f "${servercfgfullpath}" ]; then
@@ -1163,6 +1200,8 @@ elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
 	fn_info_config_wolfensteinenemyterritory
 	fn_info_config_wolfensteinenemyterritory
 elif [ "${gamename}" == "ET: Legacy" ]; then
 elif [ "${gamename}" == "ET: Legacy" ]; then
 	fn_info_config_etlegacy
 	fn_info_config_etlegacy
+elif [ "${gamename}" == "Wurm Unlimited" ]; then
+	fn_info_config_wurmunlimited
 elif [ "${gamename}" == "Multi Theft Auto" ]; then
 elif [ "${gamename}" == "Multi Theft Auto" ]; then
 	fn_info_config_mta
 	fn_info_config_mta
 elif [ "${gamename}" == "Squad" ]; then
 elif [ "${gamename}" == "Squad" ]; then

+ 31 - 18
lgsm/functions/info_distro.sh

@@ -91,18 +91,29 @@ load=$(uptime|awk -F 'load average: ' '{ print $2 }')
 
 
 ## Memory information
 ## 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
+
 # Available RAM and swap.
 # Available RAM and swap.
-physmemtotalmb=$(($(grep MemTotal /proc/meminfo | awk '{print $2}')/1024))
-physmemtotal=$(numfmt --to=iec --from=iec --suffix=B "$(grep ^MemTotal /proc/meminfo | awk '{print $2}')K")
-physmemfree=$(numfmt --to=iec --from=iec --suffix=B "$(grep ^MemAvailable /proc/meminfo | awk '{print $2}')K")
-physmemused=$(numfmt --to=iec --from=iec --suffix=B "$(($(grep "^MemTotal\:" /proc/meminfo | awk '{print $2}')-$(grep "^MemFree\:" /proc/meminfo | awk '{print $2}')-$(grep "^Buffers\:" /proc/meminfo | awk '{print $2}')-$(grep "^Cached\:" /proc/meminfo | awk '{print $2}')-$(grep "^SReclaimable\:" /proc/meminfo | awk '{print $2}')))K")
-{ # try
-	physmemavailable=$(numfmt --to=iec --from=iec --suffix=B "$(grep ^MemAvailable /proc/meminfo | awk '{print $2}')K")
-	physmemcached=$(numfmt --to=iec --from=iec --suffix=B "$(($(grep ^Cached /proc/meminfo | awk '{print $2}')+$(grep "^SReclaimable\:" /proc/meminfo | awk '{print $2}')))K")
-} 2>/dev/null || { # fail silently, catch
-	physmemavailable="n/a"
-	physmemcached="n/a"
-}
+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")
 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")
 swapfree=$(numfmt --to=iec --from=iec --suffix=B "$(grep ^SwapFree /proc/meminfo | awk '{print $2}')K")
@@ -174,13 +185,15 @@ if [ -z "${extip}" ]; then
 fi
 fi
 
 
 # Steam Master Server - checks if detected by master server
 # Steam Master Server - checks if detected by master server
-if [ "${ip}" ] && [ "${port}" ]; then
-	if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]||[ "${shortname}" == "jc2" ]||[ "${shortname}" == "ql" ]; then
-		masterserver=$(${curlpath} -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${ip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l)
-		if [ "${steammaster}" == "1" ]; then
-			masterserver="true"
-		else
-			masterserver="false"
+if [ ! "$(command -v jq 2>/dev/null)" ]; then
+	if [ "${ip}" ] && [ "${port}" ]; then
+		if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]||[ "${shortname}" == "jc2" ]||[ "${shortname}" == "ql" ]; then
+			masterserver=$(${curlpath} -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${ip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l)
+			if [ "${steammaster}" == "1" ]; then
+				masterserver="true"
+			else
+				masterserver="false"
+			fi
 		fi
 		fi
 	fi
 	fi
 fi
 fi

+ 3 - 0
lgsm/functions/info_glibc.sh

@@ -195,6 +195,9 @@ elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
 elif [ "${gamename}" == "ET: Legacy" ]; then
 elif [ "${gamename}" == "ET: Legacy" ]; then
 	glibcrequired="2.7"
 	glibcrequired="2.7"
 	glibcfix="no"
 	glibcfix="no"
+elif [ "${gamename}" == "Wurm Unlimited" ]; then
+	glibcrequired="2.14"
+	glibcfix="no"
 elif [ "${gamename}" == "Multi Theft Auto" ]; then
 elif [ "${gamename}" == "Multi Theft Auto" ]; then
 	glibcrequired="2.7"
 	glibcrequired="2.7"
 	glibcfix="no"
 	glibcfix="no"

+ 33 - 6
lgsm/functions/info_messages.sh

@@ -24,7 +24,11 @@ fn_info_message_head(){
 	echo -e "${HOSTNAME}"
 	echo -e "${HOSTNAME}"
 	echo -e ""
 	echo -e ""
 	echo -e "Server IP"
 	echo -e "Server IP"
-	echo -e "${ip}:${port}"
+	if [ "${multiple_ip}" == "1" ]; then
+	    echo -e "NOT SET"
+	else
+	    echo -e "${ip}:${port}"
+	fi
 }
 }
 
 
 fn_info_message_distro(){
 fn_info_message_distro(){
@@ -139,7 +143,11 @@ fn_info_message_gameserver(){
 		fi
 		fi
 
 
 		# Server ip
 		# Server ip
-		echo -e "${blue}Server IP:\t${default}${ip}:${port}"
+		if [ "${multiple_ip}" == "1" ]; then
+			echo -e "${blue}Server IP:\t${default}NOT SET"
+		else
+			echo -e "${blue}Server IP:\t${default}${ip}:${port}"
+		fi
 
 
 		# External server ip
 		# External server ip
 		if [ -n "${extip}" ]; then
 		if [ -n "${extip}" ]; then
@@ -155,7 +163,7 @@ fn_info_message_gameserver(){
 
 
 		# Query enabled (Starbound)
 		# Query enabled (Starbound)
 		if [ -n "${queryenabled}" ]; then
 		if [ -n "${queryenabled}" ]; then
-			echo -e "${blue}Query enabled:\t${default}${rconpassword}"
+			echo -e "${blue}Query enabled:\t${default}${queryenabled}"
 		fi
 		fi
 
 
 		# RCON enabled (Starbound)
 		# RCON enabled (Starbound)
@@ -222,6 +230,11 @@ fn_info_message_gameserver(){
 			echo -e "${blue}Default Map:\t${default}${defaultmap}"
 			echo -e "${blue}Default Map:\t${default}${defaultmap}"
 		fi
 		fi
 
 
+		# Game type
+		if [ -n "${gametype}" ]; then
+			echo -e "${blue}Game type:\t${default}${gametype}"
+		fi
+
 		# Game mode
 		# Game mode
 		if [ -n "${gamemode}" ]; then
 		if [ -n "${gamemode}" ]; then
 			echo -e "${blue}Game mode:\t${default}${gamemode}"
 			echo -e "${blue}Game mode:\t${default}${gamemode}"
@@ -447,7 +460,7 @@ fn_info_message_ports(){
 
 
 	parmslocation="${red}UNKNOWN${default}"
 	parmslocation="${red}UNKNOWN${default}"
 	# engines/games that require editing in the config file
 	# engines/games that require editing in the config file
-	local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "seriousengine35" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" )
+	local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "seriousengine35" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" "wurm" )
 	for port_edit in "${ports_edit_array[@]}"
 	for port_edit in "${ports_edit_array[@]}"
 	do
 	do
 		if [ "${shortname}" == "ut3" ]; then
 		if [ "${shortname}" == "ut3" ]; then
@@ -462,7 +475,7 @@ fn_info_message_ports(){
 	local ports_edit_array=( "goldsource" "Factorio" "Hurtworld" "iw3.0" "Rust" "spark" "source" "starbound" "unreal4" "realvirtuality")
 	local ports_edit_array=( "goldsource" "Factorio" "Hurtworld" "iw3.0" "Rust" "spark" "source" "starbound" "unreal4" "realvirtuality")
 	for port_edit in "${ports_edit_array[@]}"
 	for port_edit in "${ports_edit_array[@]}"
 	do
 	do
-		if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
+		if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then
 			parmslocation="${configdirserver}"
 			parmslocation="${configdirserver}"
 		fi
 		fi
 	done
 	done
@@ -690,6 +703,8 @@ fn_info_message_minecraft(){
 	{
 	{
 		echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
 		echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
 		echo -e "> Game\tINBOUND\t${port}\ttcp"
 		echo -e "> Game\tINBOUND\t${port}\ttcp"
+		echo -e "> Game\tINBOUND\t${queryport}\tudp"
+		echo -e "> Game\tINBOUND\t${rconport}\ttcp"
 	} | column -s $'\t' -t
 	} | column -s $'\t' -t
 }
 }
 
 
@@ -1078,6 +1093,16 @@ fn_info_message_etlegacy(){
 	} | column -s $'\t' -t
 	} | column -s $'\t' -t
 }
 }
 
 
+fn_info_message_wurmunlimited(){
+	echo -e "netstat -atunp | grep WurmServer"
+	echo -e ""
+	{
+		echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
+		echo -e "> Game\tINBOUND\t${port}\ttcp"
+		echo -e "> Game/Query\tINBOUND\t${queryport}\tudp"
+	} | column -s $'\t' -t
+}
+
 fn_info_message_mta(){
 fn_info_message_mta(){
 	echo -e "netstat -atunp | grep mta-server64"
 	echo -e "netstat -atunp | grep mta-server64"
 	echo -e ""
 	echo -e ""
@@ -1153,6 +1178,8 @@ fn_info_message_select_engine(){
 		fn_info_message_mumble
 		fn_info_message_mumble
 	elif [ "${gamename}" == "Rust" ]; then
 	elif [ "${gamename}" == "Rust" ]; then
 		fn_info_message_rust
 		fn_info_message_rust
+	elif [ "${gamename}" == "Wurm Unlimited" ]; then
+		fn_info_message_wurmunlimited
 	elif [ "${shortname}" == "rw" ]; then
 	elif [ "${shortname}" == "rw" ]; then
 		fn_info_message_risingworld
 		fn_info_message_risingworld
 	elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
 	elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
@@ -1235,4 +1262,4 @@ fn_info_message_password_strip(){
 		fi
 		fi
 
 
 	fi
 	fi
-}
+}

+ 16 - 3
lgsm/functions/install_config.sh

@@ -60,18 +60,25 @@ fn_set_config_vars(){
 	if [ -f "${servercfgfullpath}" ]; then
 	if [ -f "${servercfgfullpath}" ]; then
 		random=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs)
 		random=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs)
 		servername="LinuxGSM"
 		servername="LinuxGSM"
-		rconpass="admin$random"
+		rconpass="admin${random}"
 		echo "changing hostname."
 		echo "changing hostname."
 		fn_script_log_info "changing hostname."
 		fn_script_log_info "changing hostname."
 		sleep 0.5
 		sleep 0.5
+		# prevents var from being overwritten with the servername
 		if grep -q "SERVERNAME=SERVERNAME" "${lgsmdir}/config-default/config-game/${config}" 2>/dev/null; then
 		if grep -q "SERVERNAME=SERVERNAME" "${lgsmdir}/config-default/config-game/${config}" 2>/dev/null; then
 			sed -i "s/SERVERNAME=SERVERNAME/SERVERNAME=${servername}/g" "${servercfgfullpath}"
 			sed -i "s/SERVERNAME=SERVERNAME/SERVERNAME=${servername}/g" "${servercfgfullpath}"
+		elif grep -q "SERVERNAME=\"SERVERNAME\"" "${lgsmdir}/config-default/config-game/${config}" 2>/dev/null; then
+			sed -i "s/SERVERNAME=\"SERVERNAME\"/SERVERNAME=\"${servername}\"/g" "${servercfgfullpath}"
 		else
 		else
 			sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}"
 			sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}"
 		fi
 		fi
 		echo "changing rcon/admin password."
 		echo "changing rcon/admin password."
 		fn_script_log_info "changing rcon/admin password."
 		fn_script_log_info "changing rcon/admin password."
-		sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgfullpath}"
+		if [ "${shortname}" == "squad" ]; then
+			sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgdir}/Rcon.cfg"
+		else
+			sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgfullpath}"
+		fi
 		sleep 0.5
 		sleep 0.5
 	else
 	else
 		fn_script_log_warn "Config file not found, cannot alter it."
 		fn_script_log_warn "Config file not found, cannot alter it."
@@ -490,7 +497,7 @@ elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then
 	fn_set_config_vars
 	fn_set_config_vars
 elif [ "${gamename}" == "Squad" ]; then
 elif [ "${gamename}" == "Squad" ]; then
 	gamedirname="Squad"
 	gamedirname="Squad"
-	array_configs+=( Server.cfg )
+	array_configs+=( Server.cfg Rcon.cfg )
 	fn_fetch_default_config
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_default_config_remote
 	fn_set_config_vars
 	fn_set_config_vars
@@ -584,6 +591,12 @@ elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
 	fn_fetch_default_config
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_default_config_remote
 	fn_set_config_vars
 	fn_set_config_vars
+elif [ "${gamename}" == "Wurm Unlimited" ]; then
+	gamedirname="WurmUnlimited"
+	array_configs+=( server.cfg )
+	fn_fetch_default_config
+	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Zombie Panic! Source" ]; then
 elif [ "${gamename}" == "Zombie Panic! Source" ]; then
 	gamedirname="ZombiePanicSource"
 	gamedirname="ZombiePanicSource"
 	array_configs+=( server.cfg )
 	array_configs+=( server.cfg )

+ 8 - 8
lgsm/functions/install_logs.sh

@@ -15,7 +15,7 @@ if [ "${checklogs}" != "1" ]; then
 fi
 fi
 sleep 0.5
 sleep 0.5
 # Create LinuxGSM logs
 # Create LinuxGSM logs
-echo -ne "installing log dir: ${logdir}..."
+echo -en "installing log dir: ${logdir}..."
 mkdir -p "${logdir}"
 mkdir -p "${logdir}"
 if [ $? -ne 0 ]; then
 if [ $? -ne 0 ]; then
 	fn_print_fail_eol_nl
 	fn_print_fail_eol_nl
@@ -24,7 +24,7 @@ else
 	fn_print_ok_eol_nl
 	fn_print_ok_eol_nl
 fi
 fi
 
 
-echo -ne "installing LinuxGSM log dir: ${lgsmlogdir}..."
+echo -en "installing LinuxGSM log dir: ${lgsmlogdir}..."
 mkdir -p "${lgsmlogdir}"
 mkdir -p "${lgsmlogdir}"
 if [ $? -ne 0 ]; then
 if [ $? -ne 0 ]; then
 	fn_print_fail_eol_nl
 	fn_print_fail_eol_nl
@@ -32,7 +32,7 @@ if [ $? -ne 0 ]; then
 else
 else
 	fn_print_ok_eol_nl
 	fn_print_ok_eol_nl
 fi
 fi
-echo -ne "creating LinuxGSM log: ${lgsmlog}..."
+echo -en "creating LinuxGSM log: ${lgsmlog}..."
 touch "${lgsmlog}"
 touch "${lgsmlog}"
 if [ $? -ne 0 ]; then
 if [ $? -ne 0 ]; then
 	fn_print_fail_eol_nl
 	fn_print_fail_eol_nl
@@ -42,7 +42,7 @@ else
 fi
 fi
 # Create Console logs
 # Create Console logs
 if [ -n "${consolelogdir}" ]; then
 if [ -n "${consolelogdir}" ]; then
-	echo -ne "installing console log dir: ${consolelogdir}..."
+	echo -en "installing console log dir: ${consolelogdir}..."
 	mkdir -p "${consolelogdir}"
 	mkdir -p "${consolelogdir}"
 	if [ $? -ne 0 ]; then
 	if [ $? -ne 0 ]; then
 		fn_print_fail_eol_nl
 		fn_print_fail_eol_nl
@@ -50,7 +50,7 @@ if [ -n "${consolelogdir}" ]; then
 	else
 	else
 		fn_print_ok_eol_nl
 		fn_print_ok_eol_nl
 	fi
 	fi
-	echo -ne "creating console log: ${consolelog}..."
+	echo -en "creating console log: ${consolelog}..."
 	touch "${consolelog}"
 	touch "${consolelog}"
 	if [ $? -ne 0 ]; then
 	if [ $? -ne 0 ]; then
 		fn_print_fail_eol_nl
 		fn_print_fail_eol_nl
@@ -62,7 +62,7 @@ fi
 
 
 # Create Game logs
 # Create Game logs
 if [ -n "${gamelogdir}" ]&&[ ! -d "${gamelogdir}" ]; then
 if [ -n "${gamelogdir}" ]&&[ ! -d "${gamelogdir}" ]; then
-	echo -ne "installing game log dir: ${gamelogdir}..."
+	echo -en "installing game log dir: ${gamelogdir}..."
 	mkdir -p "${gamelogdir}"
 	mkdir -p "${gamelogdir}"
 	if [ $? -ne 0 ]; then
 	if [ $? -ne 0 ]; then
 		fn_print_fail_eol_nl
 		fn_print_fail_eol_nl
@@ -78,7 +78,7 @@ fi
 # log/server is in log/: symlink not created
 # log/server is in log/: symlink not created
 if [ -n "${gamelogdir}" ]; then
 if [ -n "${gamelogdir}" ]; then
 	if [ "${gamelogdir:0:${#logdir}}" != "${logdir}" ]; then
 	if [ "${gamelogdir:0:${#logdir}}" != "${logdir}" ]; then
-		echo -ne "creating symlink to game log dir: ${logdir}/server -> ${gamelogdir}..."
+		echo -en "creating symlink to game log dir: ${logdir}/server -> ${gamelogdir}..."
 		ln -nfs "${gamelogdir}" "${logdir}/server"
 		ln -nfs "${gamelogdir}" "${logdir}/server"
 		if [ $? -ne 0 ]; then
 		if [ $? -ne 0 ]; then
 			fn_print_fail_eol_nl
 			fn_print_fail_eol_nl
@@ -92,7 +92,7 @@ fi
 # If server uses SteamCMD create a symbolic link to the Steam logs
 # If server uses SteamCMD create a symbolic link to the Steam logs
 if [ -d "${rootdir}/Steam/logs" ]; then
 if [ -d "${rootdir}/Steam/logs" ]; then
 	if [ ! -L "${logdir}/steamcmd" ]; then
 	if [ ! -L "${logdir}/steamcmd" ]; then
-		echo -ne "creating symlink to steam log dir: ${logdir}/steamcmd -> ${rootdir}/Steam/logs..."
+		echo -en "creating symlink to steam log dir: ${logdir}/steamcmd -> ${rootdir}/Steam/logs..."
 		ln -nfs "${rootdir}/Steam/logs" "${logdir}/steamcmd"
 		ln -nfs "${rootdir}/Steam/logs" "${logdir}/steamcmd"
 		if [ $? -ne 0 ]; then
 		if [ $? -ne 0 ]; then
 			fn_print_fail_eol_nl
 			fn_print_fail_eol_nl

+ 1 - 1
lgsm/functions/install_server_files.sh

@@ -87,7 +87,7 @@ fn_install_server_files_steamcmd(){
 			fi
 			fi
 
 
 			if [ "${counter}" -le "4" ]; then
 			if [ "${counter}" -le "4" ]; then
-				if [ "${engine}" == "goldsource" ]; then
+				if [ "${appid}" == "90" ]; then
 					${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +quit
 					${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +quit
 					local exitcode=$?
 					local exitcode=$?
 				else
 				else

+ 8 - 8
lgsm/functions/mods_core.sh

@@ -37,7 +37,7 @@ fn_mod_install_files(){
 fn_mod_lowercase(){
 fn_mod_lowercase(){
 	if [ "${modlowercase}" == "LowercaseOn" ]; then
 	if [ "${modlowercase}" == "LowercaseOn" ]; then
 
 
-		echo -ne "converting ${modprettyname} files to lowercase..."
+		echo -en "converting ${modprettyname} files to lowercase..."
 		sleep 0.5
 		sleep 0.5
 		fn_script_log_info "Converting ${modprettyname} files to lowercase"
 		fn_script_log_info "Converting ${modprettyname} files to lowercase"
 		fileswc=$(find "${extractdir}" -depth | wc -l)
 		fileswc=$(find "${extractdir}" -depth | wc -l)
@@ -50,10 +50,10 @@ fn_mod_lowercase(){
 				local exitcode=$?
 				local exitcode=$?
 				((renamedwc++))
 				((renamedwc++))
 			fi
 			fi
-			echo -ne "${renamedwc} / ${totalfileswc} / ${fileswc} converting ${modprettyname} files to lowercase..." $'\r'
+			echo -en "${renamedwc} / ${totalfileswc} / ${fileswc} converting ${modprettyname} files to lowercase..." $'\r'
 			((totalfileswc++))
 			((totalfileswc++))
 		done < <(find "${extractdir}" -depth)
 		done < <(find "${extractdir}" -depth)
-		echo -ne "${renamedwc} / ${totalfileswc} / ${fileswc} converting ${modprettyname} files to lowercase..."
+		echo -en "${renamedwc} / ${totalfileswc} / ${fileswc} converting ${modprettyname} files to lowercase..."
 
 
 		if [ ${exitcode} -ne 0 ]; then
 		if [ ${exitcode} -ne 0 ]; then
 			fn_print_fail_eol_nl
 			fn_print_fail_eol_nl
@@ -67,7 +67,7 @@ fn_mod_lowercase(){
 
 
 # Create ${modcommand}-files.txt containing the full extracted file/directory list
 # Create ${modcommand}-files.txt containing the full extracted file/directory list
 fn_mod_create_filelist(){
 fn_mod_create_filelist(){
-	echo -ne "building ${modcommand}-files.txt..."
+	echo -en "building ${modcommand}-files.txt..."
 	sleep 0.5
 	sleep 0.5
 	# ${modsdir}/${modcommand}-files.txt
 	# ${modsdir}/${modcommand}-files.txt
 	find "${extractdir}" -mindepth 1 -printf '%P\n' > "${modsdir}/${modcommand}-files.txt"
 	find "${extractdir}" -mindepth 1 -printf '%P\n' > "${modsdir}/${modcommand}-files.txt"
@@ -89,7 +89,7 @@ fn_mod_create_filelist(){
 
 
 # Copy the mod into serverfiles
 # Copy the mod into serverfiles
 fn_mod_copy_destination(){
 fn_mod_copy_destination(){
-	echo -ne "copying ${modprettyname} to ${modinstalldir}..."
+	echo -en "copying ${modprettyname} to ${modinstalldir}..."
 	sleep 0.5
 	sleep 0.5
 	cp -Rf "${extractdir}/." "${modinstalldir}/"
 	cp -Rf "${extractdir}/." "${modinstalldir}/"
 	local exitcode=$?
 	local exitcode=$?
@@ -115,7 +115,7 @@ fn_mod_tidy_files_list(){
 	# Check file list validity
 	# Check file list validity
 	fn_check_mod_files_list
 	fn_check_mod_files_list
 	# Output to the user
 	# Output to the user
-	echo -ne "tidy up ${modcommand}-files.txt..."
+	echo -en "tidy up ${modcommand}-files.txt..."
 	sleep 0.5
 	sleep 0.5
 	fn_script_log_info "Tidy up ${modcommand}-files.txt"
 	fn_script_log_info "Tidy up ${modcommand}-files.txt"
 	# Lines/files to remove from file list (end with ";" separator)
 	# Lines/files to remove from file list (end with ";" separator)
@@ -385,7 +385,7 @@ fn_mods_create_tmp_dir(){
 	if [ ! -d "${modstmpdir}" ]; then
 	if [ ! -d "${modstmpdir}" ]; then
 		mkdir -p "${modstmpdir}"
 		mkdir -p "${modstmpdir}"
 		exitcode=$?
 		exitcode=$?
-		echo -ne "creating mod download directory ${modstmpdir}..."
+		echo -en "creating mod download directory ${modstmpdir}..."
 		if [ ${exitcode} -ne 0 ]; then
 		if [ ${exitcode} -ne 0 ]; then
 			fn_print_fail_eol_nl
 			fn_print_fail_eol_nl
 			fn_script_log_fatal "Creating mod download directory ${modstmpdir}"
 			fn_script_log_fatal "Creating mod download directory ${modstmpdir}"
@@ -400,7 +400,7 @@ fn_mods_create_tmp_dir(){
 # Remove the tmp mod download directory when finished
 # Remove the tmp mod download directory when finished
 fn_mods_clear_tmp_dir(){
 fn_mods_clear_tmp_dir(){
 	if [ -d "${modstmpdir}" ]; then
 	if [ -d "${modstmpdir}" ]; then
-		echo -ne "clearing mod download directory ${modstmpdir}..."
+		echo -en "clearing mod download directory ${modstmpdir}..."
 		rm -r "${modstmpdir}"
 		rm -r "${modstmpdir}"
 		exitcode=$?
 		exitcode=$?
 		if [ ${exitcode} -ne 0 ]; then
 		if [ ${exitcode} -ne 0 ]; then

+ 5 - 1
lgsm/functions/mods_list.sh

@@ -60,6 +60,10 @@ modseparator="MOD"
 mod_info_metamod=( MOD "metamod" "MetaMod" "${metamodurl}" "${metamodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/metaplugins.ini;" "source;" "GAMES" "NOTGAMES" "https://www.sourcemm.net" "Plugins Framework" )
 mod_info_metamod=( MOD "metamod" "MetaMod" "${metamodurl}" "${metamodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/metaplugins.ini;" "source;" "GAMES" "NOTGAMES" "https://www.sourcemm.net" "Plugins Framework" )
 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)" )
 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)")
+
 # Garry's Mod Addons
 # 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" )
 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" )
 mod_info_ulx=( MOD "ulx" "ULX" "https://codeload.github.com/TeamUlysses/ulx/zip/master" "ulx-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "Admin Panel (requires ULib)" )
 mod_info_ulx=( MOD "ulx" "ULX" "https://codeload.github.com/TeamUlysses/ulx/zip/master" "ulx-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "Admin Panel (requires ULib)" )
@@ -81,4 +85,4 @@ mod_info_hwoxide=( MOD "hwoxide" "Oxide for Hurtworld" "${oxidehurtworldlatestli
 mod_info_sdtdoxide=( MOD "sdtdoxide" "Oxide for 7 Days To Die" "${oxidesdtdlatestlink}" "Oxide.SevenDaysToDie.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "7 Days To Die;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-7-days-to-die.813/" "Allows for the use of plugins" )
 mod_info_sdtdoxide=( MOD "sdtdoxide" "Oxide for 7 Days To Die" "${oxidesdtdlatestlink}" "Oxide.SevenDaysToDie.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "7 Days To Die;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-7-days-to-die.813/" "Allows for the use of plugins" )
 
 
 # REQUIRED: Set all mods info into the global array
 # REQUIRED: Set all mods info into the global array
-mods_global_array=( "${mod_info_metamod[@]}" "${mod_info_sourcemod[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" )
+mods_global_array=( "${mod_info_metamod[@]}" "${mod_info_sourcemod[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" )

+ 9 - 1
lgsm/functions/query_gamedig.sh

@@ -14,7 +14,7 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ];
 			local engine="unreal4"
 			local engine="unreal4"
 		fi
 		fi
 
 
-		local engine_query_array=( avalanche3.0 madness quakelive realvirtuality refractor source goldsource spark starbound unity3d unreal4 )
+		local engine_query_array=( avalanche3.0 madness quakelive realvirtuality refractor source goldsource spark starbound unity3d unreal4 wurm )
 		for engine_query in "${engine_query_array[@]}"
 		for engine_query in "${engine_query_array[@]}"
 		do
 		do
 			if [ "${engine_query}" == "${engine}" ]; then
 			if [ "${engine_query}" == "${engine}" ]; then
@@ -46,6 +46,14 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ];
 			fi
 			fi
 		done
 		done
 
 
+		local engine_query_array=( lwjgl2 )
+		for engine_query in "${engine_query_array[@]}"
+		do
+			if [ "${engine_query}" == "${engine}" ]; then
+				gamedigengine="minecraft"
+			fi
+		done
+
 		local shortname_query_array=( ts3 )
 		local shortname_query_array=( ts3 )
 		for shortname_query in "${shortname_query_array[@]}"
 		for shortname_query in "${shortname_query_array[@]}"
 		do
 		do

+ 6 - 2
lgsm/functions/query_gsquery.py

@@ -17,21 +17,25 @@ class gsquery:
         self.server_response_timeout = 5
         self.server_response_timeout = 5
         self.default_buffer_length = 1024
         self.default_buffer_length = 1024
         #
         #
-        sourcequery=[ 'avalanche3.0','madness','quakelive','realvirtuality','refractor','source','goldsource','spark','starbound','unity3d', 'unreal4' ]
+        sourcequery=[ 'avalanche3.0','madness','quakelive','realvirtuality','refractor','source','goldsource','spark','starbound','unity3d', 'unreal4', 'wurm' ]
         idtech3query=['idtech3','quake','iw3.0']
         idtech3query=['idtech3','quake','iw3.0']
         idtech2query=['idtech2','iw2.0']
         idtech2query=['idtech2','iw2.0']
+        minecraftquery=['minecraft','lwjgl2']
         if self.option.engine in sourcequery:
         if self.option.engine in sourcequery:
             self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0'
             self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0'
         elif self.option.engine in idtech2query:
         elif self.option.engine in idtech2query:
             self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00'
             self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00'
         elif self.option.engine in idtech3query:
         elif self.option.engine in idtech3query:
             self.query_prompt_string = b'\xff\xff\xff\xffgetstatus'
             self.query_prompt_string = b'\xff\xff\xff\xffgetstatus'
+        elif self.option.engine in minecraftquery:
+            self.query_prompt_string = b'\xFE\xFD\x09\x3d\x54\x1f\x93'
         elif self.option.engine == 'avalanche2.0':
         elif self.option.engine == 'avalanche2.0':
             self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40'
             self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40'
         elif self.option.engine == 'unreal':
         elif self.option.engine == 'unreal':
             self.query_prompt_string = b'\x5C\x69\x6E\x66\x6F\x5C'
             self.query_prompt_string = b'\x5C\x69\x6E\x66\x6F\x5C'
         elif self.option.engine == 'unreal2':
         elif self.option.engine == 'unreal2':
             self.query_prompt_string = b'\x79\x00\x00\x00\x00'
             self.query_prompt_string = b'\x79\x00\x00\x00\x00'
+
         self.connected = False
         self.connected = False
         self.response = None
         self.response = None
         self.sanity_checks()
         self.sanity_checks()
@@ -100,7 +104,7 @@ if __name__ == '__main__':
         action='store',
         action='store',
         dest='engine',
         dest='engine',
         default=False,
         default=False,
-        help='Engine type: avalanche2.0, avalanche3.0, goldsource, idtech2, idtech3, iw2.0, iw3.0, realvirtuality, quake, quakelive, refractor, spark, source, unity3d, unreal, unreal2.'
+        help='Engine type: avalanche2.0, avalanche3.0, goldsource, idtech2, idtech3, iw2.0, iw3.0, minecraft, quake, quakelive, realvirtuality, refractor, spark, source, unity3d, unreal, unreal2.'
     )
     )
     parser.add_option(
     parser.add_option(
         '-v', '--verbose',
         '-v', '--verbose',

+ 9 - 7
lgsm/functions/update_factorio.sh

@@ -10,8 +10,13 @@ local commandaction="Update"
 local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 
 fn_update_factorio_dl(){
 fn_update_factorio_dl(){
-	fn_fetch_file "https://www.factorio.com/get-download/${availablebuild}/headless/${factorioarch}" "${tmpdir}" "factorio_headless_${factorioarch}-${availablebuild}.tar.gz"
-	fn_dl_extract "${tmpdir}" "factorio_headless_${factorioarch}-${availablebuild}.tar.gz" "${tmpdir}"
+	if [ "${branch}" == "stable" ]; then
+		downloadbranch="stable"
+	elif [ "${branch}" == "experimental" ]; then
+		downloadbranch="latest"
+	fi
+	fn_fetch_file "https://factorio.com/get-download/${downloadbranch}/headless/${factorioarch}" "${tmpdir}" "factorio_headless_${factorioarch}-${availablebuild}.tar.xz"
+	fn_dl_extract "${tmpdir}" "factorio_headless_${factorioarch}-${availablebuild}.tar.xz" "${tmpdir}"
 	echo -e "copying to ${serverfiles}...\c"
 	echo -e "copying to ${serverfiles}...\c"
 	fn_script_log "Copying to ${serverfiles}"
 	fn_script_log "Copying to ${serverfiles}"
 	cp -R "${tmpdir}/factorio/"* "${serverfiles}"
 	cp -R "${tmpdir}/factorio/"* "${serverfiles}"
@@ -77,12 +82,10 @@ fn_update_factorio_arch(){
 fn_update_factorio_availablebuild(){
 fn_update_factorio_availablebuild(){
 	# Gets latest build info.
 	# Gets latest build info.
 	if [ "${branch}" != "stable" ]; then
 	if [ "${branch}" != "stable" ]; then
-		availablebuild=$(${curlpath} -s https://www.factorio.com/download-headless/"${branch}" | grep 'headless/linux64' | head -n 2 | tail -n 1 | grep -oP '(?<=get-download/).*?(?=/)')
+		availablebuild=$(${curlpath} -s https://factorio.com/get-download/stable/headless/linux64 | grep -o '[0-9]\.[0-9]\{2\}\.[0-9]\{2\}' | head -1)
 	else
 	else
-		availablebuild=$(${curlpath} -s https://www.factorio.com/download-headless | grep 'headless/linux64' | head -n 2 | tail -n 1 | grep -oP '(?<=get-download/).*?(?=/)')
+		availablebuild=$(${curlpath} -s https://factorio.com/get-download/latest/headless/linux64 | grep -o '[0-9]\.[0-9]\{2\}\.[0-9]\{2\}' | head -1)
 	fi
 	fi
-	sleep 0.5
-
 	# Checks if availablebuild variable has been set
 	# Checks if availablebuild variable has been set
 	if [ -z "${availablebuild}" ]; then
 	if [ -z "${availablebuild}" ]; then
 		fn_print_fail "Checking for update: factorio.com"
 		fn_print_fail "Checking for update: factorio.com"
@@ -112,7 +115,6 @@ fn_update_factorio_compare(){
 		echo -e "	Available build: ${green}${availablebuild} ${factorioarch} ${branch}${default}"
 		echo -e "	Available build: ${green}${availablebuild} ${factorioarch} ${branch}${default}"
 		echo -e ""
 		echo -e ""
 		sleep 0.5
 		sleep 0.5
-		echo ""
 		echo -en "Applying update.\r"
 		echo -en "Applying update.\r"
 		sleep 1
 		sleep 1
 		echo -en "Applying update..\r"
 		echo -en "Applying update..\r"

+ 0 - 1
lgsm/functions/update_minecraft.sh

@@ -102,7 +102,6 @@ fn_update_compare(){
 		echo -e "	Available build: ${green}${availablebuild}${default}"
 		echo -e "	Available build: ${green}${availablebuild}${default}"
 		echo -e ""
 		echo -e ""
 		sleep 0.5
 		sleep 0.5
-		echo ""
 		echo -en "Applying update.\r"
 		echo -en "Applying update.\r"
 		sleep 1
 		sleep 1
 		echo -en "Applying update..\r"
 		echo -en "Applying update..\r"

+ 2 - 3
lgsm/functions/update_mta.sh

@@ -92,11 +92,10 @@ fn_update_mta_compare(){
 		echo -e "\n"
 		echo -e "\n"
 		echo -e "Update ${mta_update_string}:"
 		echo -e "Update ${mta_update_string}:"
 		sleep 0.5
 		sleep 0.5
-		echo -e "       Current build: ${red}${currentbuild} ${default}"
-		echo -e "       Available build: ${green}${fullversion} ${default}"
+		echo -e "	Current build: ${red}${currentbuild} ${default}"
+		echo -e "	Available build: ${green}${fullversion} ${default}"
 		echo -e ""
 		echo -e ""
 		sleep 0.5
 		sleep 0.5
-		echo ""
 		echo -en "Applying update.\r"
 		echo -en "Applying update.\r"
 		sleep 1
 		sleep 1
 		echo -en "Applying update..\r"
 		echo -en "Applying update..\r"

+ 0 - 1
lgsm/functions/update_mumble.sh

@@ -108,7 +108,6 @@ fn_update_mumble_compare(){
 		echo -e "	Available build: ${green}${availablebuild} ${mumblearch}${default}"
 		echo -e "	Available build: ${green}${availablebuild} ${mumblearch}${default}"
 		echo -e ""
 		echo -e ""
 		sleep 0.5
 		sleep 0.5
-		echo ""
 		echo -en "Applying update.\r"
 		echo -en "Applying update.\r"
 		sleep 1
 		sleep 1
 		echo -en "Applying update..\r"
 		echo -en "Applying update..\r"

+ 3 - 3
lgsm/functions/update_steamcmd.sh

@@ -26,7 +26,7 @@ fn_update_steamcmd_dl(){
 	fi
 	fi
 
 
 	cd "${steamcmddir}" || exit
 	cd "${steamcmddir}" || exit
-	if [ "${engine}" == "goldsource" ]; then
+	if [ "${appid}" == "90" ]; then
 		${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +quit | tee -a "${lgsmlog}"
 		${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +quit | tee -a "${lgsmlog}"
 	else
 	else
 		${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} +quit | tee -a "${lgsmlog}"
 		${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} +quit | tee -a "${lgsmlog}"
@@ -111,7 +111,7 @@ fn_update_request_log(){
 		fn_print_ok_nl "Checking for update: Server logs: Update requested"
 		fn_print_ok_nl "Checking for update: Server logs: Update requested"
 		fn_script_log_pass "Checking for update: Server logs: Update requested"
 		fn_script_log_pass "Checking for update: Server logs: Update requested"
 		sleep 0.5
 		sleep 0.5
-		echo ""
+		echo -e ""
 		echo -en "Applying update.\r"
 		echo -en "Applying update.\r"
 		sleep 1
 		sleep 1
 		echo -en "Applying update..\r"
 		echo -en "Applying update..\r"
@@ -166,7 +166,7 @@ fn_update_steamcmd_check(){
 
 
 	# Gets availablebuild info
 	# Gets availablebuild info
 	cd "${steamcmddir}" || exit
 	cd "${steamcmddir}" || exit
-	availablebuild=$(./steamcmd.sh +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +app_info_print "${appid}" +quit | sed -n '/branch/,$p' | grep -m 1 buildid | tr -cd '[:digit:]')
+	availablebuild=$(./steamcmd.sh +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed '1,/branches/d' | sed "1,/${branchname}/d" | grep -m 1 buildid | tr -cd '[:digit:]')
 	if [ -z "${availablebuild}" ]; then
 	if [ -z "${availablebuild}" ]; then
 		fn_print_fail "Checking for update: SteamCMD"
 		fn_print_fail "Checking for update: SteamCMD"
 		sleep 0.5
 		sleep 0.5

+ 19 - 4
lgsm/functions/update_ts3.sh

@@ -8,7 +8,7 @@ local commandname="UPDATE"
 local commandaction="Update"
 local commandaction="Update"
 local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 
-fn_update_ts3_dl(){
+fn_update_ts3_dl_legacy(){
 	fn_fetch_file "http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2"
 	fn_fetch_file "http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2"
 	fn_dl_extract "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" "${tmpdir}"
 	fn_dl_extract "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" "${tmpdir}"
 	echo -e "copying to ${serverfiles}...\c"
 	echo -e "copying to ${serverfiles}...\c"
@@ -22,6 +22,21 @@ fn_update_ts3_dl(){
 	fi
 	fi
 }
 }
 
 
+fn_update_ts3_dl(){
+	latestmcreleaselink=$(${curlpath} -s 'https://www.teamspeak.com/versions/server.json' | jq -r '.linux.x86_64.mirrors."4Netplayers.de"')
+	fn_fetch_file "${latestmcbuildurl}" "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2"
+	fn_dl_extract "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" "${tmpdir}"
+	echo -e "copying to ${serverfiles}...\c"
+	fn_script_log "Copying to ${serverfiles}"
+	cp -R "${tmpdir}/teamspeak3-server_linux_${ts3arch}/"* "${serverfiles}"
+	local exitcode=$?
+	if [ "${exitcode}" == "0" ]; then
+		fn_print_ok_eol_nl
+	else
+		fn_print_fail_eol_nl
+	fi
+}
+
 fn_update_ts3_currentbuild(){
 fn_update_ts3_currentbuild(){
 	# Gets current build info
 	# Gets current build info
 	# Checks if current build info is available. If it fails, then a server restart will be forced to generate logs.
 	# Checks if current build info is available. If it fails, then a server restart will be forced to generate logs.
@@ -152,7 +167,7 @@ fn_update_ts3_compare(){
 	currentbuilddigit=$(echo "${currentbuild}" | tr -cd '[:digit:]')
 	currentbuilddigit=$(echo "${currentbuild}" | tr -cd '[:digit:]')
 	availablebuilddigit=$(echo "${availablebuild}" | tr -cd '[:digit:]')
 	availablebuilddigit=$(echo "${availablebuild}" | tr -cd '[:digit:]')
 
 
-	if [ "${currentbuilddigit}" -ne "${availablebuilddigit}" ]; then
+	if [ "${currentbuilddigit}" -lt "${availablebuilddigit}" ]; then
 		echo -e "\n"
 		echo -e "\n"
 		echo -e "Update available:"
 		echo -e "Update available:"
 		sleep 0.5
 		sleep 0.5
@@ -160,7 +175,6 @@ fn_update_ts3_compare(){
 		echo -e "	Available build: ${green}${availablebuild} ${ts3arch}${default}"
 		echo -e "	Available build: ${green}${availablebuild} ${ts3arch}${default}"
 		echo -e ""
 		echo -e ""
 		sleep 0.5
 		sleep 0.5
-		echo ""
 		echo -en "Applying update.\r"
 		echo -en "Applying update.\r"
 		sleep 1
 		sleep 1
 		echo -en "Applying update..\r"
 		echo -en "Applying update..\r"
@@ -208,10 +222,11 @@ if [ "${installer}" == "1" ]; then
 	# if jq available uses json update checker
 	# if jq available uses json update checker
 	if [ "$(command -v jq >/dev/null 2>&1)" ]; then
 	if [ "$(command -v jq >/dev/null 2>&1)" ]; then
 		fn_update_ts3_availablebuild
 		fn_update_ts3_availablebuild
+		fn_update_ts3_dl
 	else
 	else
 		fn_update_ts3_availablebuild_legacy
 		fn_update_ts3_availablebuild_legacy
+		fn_update_ts3_dl_legacy
 	fi
 	fi
-	fn_update_ts3_dl
 else
 else
 	# Checks for server update from teamspeak.com using a mirror dl.4players.de.
 	# Checks for server update from teamspeak.com using a mirror dl.4players.de.
 	fn_print_dots "Checking for update: teamspeak.com"
 	fn_print_dots "Checking for update: teamspeak.com"

+ 61 - 53
linuxgsm.sh

@@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 	set -x
 fi
 fi
 
 
-version="180908"
+version="181027"
 shortname="core"
 shortname="core"
 gameservername="core"
 gameservername="core"
 rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
 rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
@@ -38,6 +38,7 @@ tmpdir="${lgsmdir}/tmp"
 configdir="${lgsmdir}/config-lgsm"
 configdir="${lgsmdir}/config-lgsm"
 configdirserver="${configdir}/${gameservername}"
 configdirserver="${configdir}/${gameservername}"
 configdirdefault="${lgsmdir}/config-default"
 configdirdefault="${lgsmdir}/config-default"
+userinput="${1}"
 
 
 ## GitHub Branch Select
 ## GitHub Branch Select
 # Allows for the use of different function files
 # Allows for the use of different function files
@@ -75,18 +76,18 @@ fn_bootstrap_fetch_file(){
 		# If curl exists download file
 		# If curl exists download file
 		if [ "$(basename "${curlpath}")" == "curl" ]; then
 		if [ "$(basename "${curlpath}")" == "curl" ]; then
 			# trap to remove part downloaded files
 			# trap to remove part downloaded files
-			echo -ne "    fetching ${local_filename}...\c"
+			echo -en "    fetching ${local_filename}...\c"
 			curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
 			curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
 			local exitcode=$?
 			local exitcode=$?
 			if [ ${exitcode} -ne 0 ]; then
 			if [ ${exitcode} -ne 0 ]; then
-				echo -e "\e[0;31mFAIL\e[0m\n"
+				echo -e "FAIL"
 				if [ -f "${lgsmlog}" ]; then
 				if [ -f "${lgsmlog}" ]; then
 					echo -e "${remote_fileurl}" | tee -a "${lgsmlog}"
 					echo -e "${remote_fileurl}" | tee -a "${lgsmlog}"
 					echo "${curlcmd}" | tee -a "${lgsmlog}"
 					echo "${curlcmd}" | tee -a "${lgsmlog}"
 				fi
 				fi
 				exit 1
 				exit 1
 			else
 			else
-				echo -e "\e[0;32mOK\e[0m"
+				echo -e "OK"
 			fi
 			fi
 		else
 		else
 			echo "[ FAIL ] Curl is not installed"
 			echo "[ FAIL ] Curl is not installed"
@@ -254,9 +255,14 @@ fn_install_file(){
 	exit
 	exit
 }
 }
 
 
-# Prevent from running this script as root.
+# Prevent LinuxGSM from running as root. Except if doing a dependency install.
 if [ "$(whoami)" == "root" ]; then
 if [ "$(whoami)" == "root" ]; then
-	if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then
+	if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then
+		if [ "${shortname}" == "core" ]; then
+			echo "[ FAIL ] Do NOT run this script as root!"
+			exit 1
+		fi
+	elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then
 		echo "[ FAIL ] Do NOT run this script as root!"
 		echo "[ FAIL ] Do NOT run this script as root!"
 		exit 1
 		exit 1
 	else
 	else
@@ -267,7 +273,6 @@ fi
 
 
 # LinuxGSM installer mode
 # LinuxGSM installer mode
 if [ "${shortname}" == "core" ]; then
 if [ "${shortname}" == "core" ]; then
-	userinput=$1
 	datadir="${tmpdir}/data"
 	datadir="${tmpdir}/data"
 	serverlist="${datadir}/serverlist.csv"
 	serverlist="${datadir}/serverlist.csv"
 
 
@@ -310,63 +315,66 @@ if [ "${shortname}" == "core" ]; then
 # LinuxGSM Server Mode
 # LinuxGSM Server Mode
 else
 else
 	core_functions.sh
 	core_functions.sh
-
-	# Load LinuxGSM configs
-	# These are required to get all the default variables for the specific server.
-	# Load the default config. If missing download it. If changed reload it.
-	if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then
-		mkdir -p "${configdirdefault}/config-lgsm/${gameservername}"
-		fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
-	fi
-	if [ ! -f "${configdirserver}/_default.cfg" ]; then
-		mkdir -p "${configdirserver}"
-		echo -ne "    copying _default.cfg...\c"
-		cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
-		exitcode=$?
-		if [ ${exitcode} -ne 0 ]; then
-			echo -e "\e[0;31mFAIL\e[0m\n"
-			exit 1
-		else
-			echo -e "\e[0;32mOK\e[0m"
+	if [ "${shortname}" != "core-dep" ]; then
+		# Load LinuxGSM configs
+		# These are required to get all the default variables for the specific server.
+		# Load the default config. If missing download it. If changed reload it.
+		if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then
+			mkdir -p "${configdirdefault}/config-lgsm/${gameservername}"
+			fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
 		fi
 		fi
-	else
-		function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg")
-		if [ "${function_file_diff}" != "" ]; then
-			fn_print_warn_nl "_default.cfg has been altered. reloading config."
-			echo -ne "    copying _default.cfg...\c"
+		if [ ! -f "${configdirserver}/_default.cfg" ]; then
+			mkdir -p "${configdirserver}"
+			echo -en "    copying _default.cfg...\c"
 			cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
 			cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
 			exitcode=$?
 			exitcode=$?
 			if [ ${exitcode} -ne 0 ]; then
 			if [ ${exitcode} -ne 0 ]; then
-				echo -e "\e[0;31mFAIL\e[0m\n"
+				echo -e "FAIL"
 				exit 1
 				exit 1
 			else
 			else
-				echo -e "\e[0;32mOK\e[0m"
+				echo -e "OK"
+			fi
+		else
+			function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg")
+			if [ "${function_file_diff}" != "" ]; then
+				fn_print_warn_nl "_default.cfg has been altered. reloading config."
+				echo -en "    copying _default.cfg...\c"
+				cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
+				exitcode=$?
+				if [ ${exitcode} -ne 0 ]; then
+					echo -e "FAIL"
+					exit 1
+				else
+					echo -e "OK"
+				fi
 			fi
 			fi
 		fi
 		fi
-	fi
-	source "${configdirserver}/_default.cfg"
-	# Load the common.cfg config. If missing download it
-	if [ ! -f "${configdirserver}/common.cfg" ]; then
-		fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
-		source "${configdirserver}/common.cfg"
-	else
-		source "${configdirserver}/common.cfg"
-	fi
-	# Load the instance.cfg config. If missing download it
-	if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then
-		fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
-		source "${configdirserver}/${servicename}.cfg"
-	else
-		source "${configdirserver}/${servicename}.cfg"
-	fi
-	# Load the linuxgsm.sh in to tmpdir. If missing download it
-	if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then
-		fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5"
-	fi
+		source "${configdirserver}/_default.cfg"
+		# Load the common.cfg config. If missing download it
+		if [ ! -f "${configdirserver}/common.cfg" ]; then
+			fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
+			source "${configdirserver}/common.cfg"
+		else
+			source "${configdirserver}/common.cfg"
+		fi
+		# Load the instance.cfg config. If missing download it
+		if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then
+			fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
+			source "${configdirserver}/${servicename}.cfg"
+		else
+			source "${configdirserver}/${servicename}.cfg"
+		fi
 
 
+		# Load the linuxgsm.sh in to tmpdir. If missing download it
+		if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then
+			fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5"
+		fi
+	fi
+	# Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off
+	fn_ansi_loader
 	# Prevents running of core_exit.sh for Travis.
 	# Prevents running of core_exit.sh for Travis.
 	if [ "${travistest}" != "1" ]; then
 	if [ "${travistest}" != "1" ]; then
 		getopt=$1
 		getopt=$1
 		core_getopt.sh
 		core_getopt.sh
 	fi
 	fi
-fi
+fi

+ 5 - 5
tests/tests_fctrserver.sh

@@ -69,7 +69,7 @@ fn_bootstrap_fetch_file(){
 		# If curl exists download file
 		# If curl exists download file
 		if [ "$(basename "${curlpath}")" == "curl" ]; then
 		if [ "$(basename "${curlpath}")" == "curl" ]; then
 			# trap to remove part downloaded files
 			# trap to remove part downloaded files
-			echo -ne "    fetching ${local_filename}...\c"
+			echo -en "    fetching ${local_filename}...\c"
 			curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
 			curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
 			local exitcode=$?
 			local exitcode=$?
 			if [ ${exitcode} -ne 0 ]; then
 			if [ ${exitcode} -ne 0 ]; then
@@ -314,7 +314,7 @@ else
 	fi
 	fi
 	if [ ! -f "${configdirserver}/_default.cfg" ]; then
 	if [ ! -f "${configdirserver}/_default.cfg" ]; then
 		mkdir -p "${configdirserver}"
 		mkdir -p "${configdirserver}"
-		echo -ne "    copying _default.cfg...\c"
+		echo -en "    copying _default.cfg...\c"
 		cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
 		cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
 		exitcode=$?
 		exitcode=$?
 		if [ ${exitcode} -ne 0 ]; then
 		if [ ${exitcode} -ne 0 ]; then
@@ -327,7 +327,7 @@ else
 		function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg")
 		function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg")
 		if [ "${function_file_diff}" != "" ]; then
 		if [ "${function_file_diff}" != "" ]; then
 			fn_print_warn_nl "_default.cfg has been altered. reloading config."
 			fn_print_warn_nl "_default.cfg has been altered. reloading config."
-			echo -ne "    copying _default.cfg...\c"
+			echo -en "    copying _default.cfg...\c"
 			cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
 			cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
 			exitcode=$?
 			exitcode=$?
 			if [ ${exitcode} -ne 0 ]; then
 			if [ ${exitcode} -ne 0 ]; then
@@ -392,7 +392,7 @@ fn_setstatus(){
 	while [  "${requiredstatus}" != "${currentstatus}" ]; do
 	while [  "${requiredstatus}" != "${currentstatus}" ]; do
 		counter=$((counter+1))
 		counter=$((counter+1))
 		fn_currentstatus_tmux
 		fn_currentstatus_tmux
-		echo -ne "New status:  ${currentstatus}\\r"
+		echo -en "New status:  ${currentstatus}\\r"
 
 
 		if [ "${requiredstatus}" == "ONLINE" ]; then
 		if [ "${requiredstatus}" == "ONLINE" ]; then
 			(command_start.sh > /dev/null 2>&1)
 			(command_start.sh > /dev/null 2>&1)
@@ -407,7 +407,7 @@ fn_setstatus(){
 			exit 1
 			exit 1
 		fi
 		fi
 	done
 	done
-	echo -ne "New status:  ${currentstatus}\\r"
+	echo -en "New status:  ${currentstatus}\\r"
 	echo -e "\n"
 	echo -e "\n"
 	echo "Test starting:"
 	echo "Test starting:"
 	echo ""
 	echo ""

+ 5 - 5
tests/tests_jc2server.sh

@@ -69,7 +69,7 @@ fn_bootstrap_fetch_file(){
 		# If curl exists download file
 		# If curl exists download file
 		if [ "$(basename "${curlpath}")" == "curl" ]; then
 		if [ "$(basename "${curlpath}")" == "curl" ]; then
 			# trap to remove part downloaded files
 			# trap to remove part downloaded files
-			echo -ne "    fetching ${local_filename}...\c"
+			echo -en "    fetching ${local_filename}...\c"
 			curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
 			curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
 			local exitcode=$?
 			local exitcode=$?
 			if [ ${exitcode} -ne 0 ]; then
 			if [ ${exitcode} -ne 0 ]; then
@@ -314,7 +314,7 @@ else
 	fi
 	fi
 	if [ ! -f "${configdirserver}/_default.cfg" ]; then
 	if [ ! -f "${configdirserver}/_default.cfg" ]; then
 		mkdir -p "${configdirserver}"
 		mkdir -p "${configdirserver}"
-		echo -ne "    copying _default.cfg...\c"
+		echo -en "    copying _default.cfg...\c"
 		cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
 		cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
 		exitcode=$?
 		exitcode=$?
 		if [ ${exitcode} -ne 0 ]; then
 		if [ ${exitcode} -ne 0 ]; then
@@ -327,7 +327,7 @@ else
 		function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg")
 		function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg")
 		if [ "${function_file_diff}" != "" ]; then
 		if [ "${function_file_diff}" != "" ]; then
 			fn_print_warn_nl "_default.cfg has been altered. reloading config."
 			fn_print_warn_nl "_default.cfg has been altered. reloading config."
-			echo -ne "    copying _default.cfg...\c"
+			echo -en "    copying _default.cfg...\c"
 			cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
 			cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
 			exitcode=$?
 			exitcode=$?
 			if [ ${exitcode} -ne 0 ]; then
 			if [ ${exitcode} -ne 0 ]; then
@@ -392,7 +392,7 @@ fn_setstatus(){
 	while [  "${requiredstatus}" != "${currentstatus}" ]; do
 	while [  "${requiredstatus}" != "${currentstatus}" ]; do
 		counter=$((counter+1))
 		counter=$((counter+1))
 		fn_currentstatus_tmux
 		fn_currentstatus_tmux
-		echo -ne "New status:  ${currentstatus}\\r"
+		echo -en "New status:  ${currentstatus}\\r"
 
 
 		if [ "${requiredstatus}" == "ONLINE" ]; then
 		if [ "${requiredstatus}" == "ONLINE" ]; then
 			(command_start.sh > /dev/null 2>&1)
 			(command_start.sh > /dev/null 2>&1)
@@ -407,7 +407,7 @@ fn_setstatus(){
 			exit 1
 			exit 1
 		fi
 		fi
 	done
 	done
-	echo -ne "New status:  ${currentstatus}\\r"
+	echo -en "New status:  ${currentstatus}\\r"
 	echo -e "\n"
 	echo -e "\n"
 	echo "Test starting:"
 	echo "Test starting:"
 	echo ""
 	echo ""

+ 5 - 5
tests/tests_ts3server.sh

@@ -69,7 +69,7 @@ fn_bootstrap_fetch_file(){
 		# If curl exists download file
 		# If curl exists download file
 		if [ "$(basename "${curlpath}")" == "curl" ]; then
 		if [ "$(basename "${curlpath}")" == "curl" ]; then
 			# trap to remove part downloaded files
 			# trap to remove part downloaded files
-			echo -ne "    fetching ${local_filename}...\c"
+			echo -en "    fetching ${local_filename}...\c"
 			curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
 			curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
 			local exitcode=$?
 			local exitcode=$?
 			if [ ${exitcode} -ne 0 ]; then
 			if [ ${exitcode} -ne 0 ]; then
@@ -314,7 +314,7 @@ else
 	fi
 	fi
 	if [ ! -f "${configdirserver}/_default.cfg" ]; then
 	if [ ! -f "${configdirserver}/_default.cfg" ]; then
 		mkdir -p "${configdirserver}"
 		mkdir -p "${configdirserver}"
-		echo -ne "    copying _default.cfg...\c"
+		echo -en "    copying _default.cfg...\c"
 		cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
 		cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
 		exitcode=$?
 		exitcode=$?
 		if [ ${exitcode} -ne 0 ]; then
 		if [ ${exitcode} -ne 0 ]; then
@@ -327,7 +327,7 @@ else
 		function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg")
 		function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg")
 		if [ "${function_file_diff}" != "" ]; then
 		if [ "${function_file_diff}" != "" ]; then
 			fn_print_warn_nl "_default.cfg has been altered. reloading config."
 			fn_print_warn_nl "_default.cfg has been altered. reloading config."
-			echo -ne "    copying _default.cfg...\c"
+			echo -en "    copying _default.cfg...\c"
 			cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
 			cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
 			exitcode=$?
 			exitcode=$?
 			if [ ${exitcode} -ne 0 ]; then
 			if [ ${exitcode} -ne 0 ]; then
@@ -392,7 +392,7 @@ fn_setstatus(){
 	while [  "${requiredstatus}" != "${currentstatus}" ]; do
 	while [  "${requiredstatus}" != "${currentstatus}" ]; do
 		counter=$((counter+1))
 		counter=$((counter+1))
 		fn_currentstatus_ts3
 		fn_currentstatus_ts3
-		echo -ne "New status:  ${currentstatus}\\r"
+		echo -en "New status:  ${currentstatus}\\r"
 
 
 		if [ "${requiredstatus}" == "ONLINE" ]; then
 		if [ "${requiredstatus}" == "ONLINE" ]; then
 			(command_start.sh > /dev/null 2>&1)
 			(command_start.sh > /dev/null 2>&1)
@@ -407,7 +407,7 @@ fn_setstatus(){
 			exit 1
 			exit 1
 		fi
 		fi
 	done
 	done
-	echo -ne "New status:  ${currentstatus}\\r"
+	echo -en "New status:  ${currentstatus}\\r"
 	echo -e "\n"
 	echo -e "\n"
 	echo "Test starting:"
 	echo "Test starting:"
 	echo ""
 	echo ""

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff