Daniel Gibbs 8 лет назад
Родитель
Сommit
ab697817d7
32 измененных файлов с 349 добавлено и 113 удалено
  1. 2 1
      lgsm/config-default/config-lgsm/csgoserver/_default.cfg
  2. 2 1
      lgsm/config-default/config-lgsm/gmodserver/_default.cfg
  3. 1 1
      lgsm/config-default/config-lgsm/jc2server/_default.cfg
  4. 115 0
      lgsm/config-default/config-lgsm/jc3server/_default.cfg
  5. 1 5
      lgsm/config-default/config-lgsm/ns2cserver/_default.cfg
  6. 3 3
      lgsm/config-default/config-lgsm/ns2server/_default.cfg
  7. 2 3
      lgsm/config-default/config-lgsm/rustserver/_default.cfg
  8. 2 7
      lgsm/config-default/config-lgsm/zpsserver/_default.cfg
  9. 1 0
      lgsm/data/serverlist.csv
  10. 11 0
      lgsm/functions/alert.sh
  11. 1 1
      lgsm/functions/alert_mailgun.sh
  12. 21 9
      lgsm/functions/check_deps.sh
  13. 40 15
      lgsm/functions/check_ip.sh
  14. 1 1
      lgsm/functions/check_system_requirements.sh
  15. 1 1
      lgsm/functions/command_console.sh
  16. 1 1
      lgsm/functions/command_details.sh
  17. 1 1
      lgsm/functions/command_monitor.sh
  18. 1 1
      lgsm/functions/command_postdetails.sh
  19. 2 2
      lgsm/functions/command_start.sh
  20. 7 5
      lgsm/functions/command_stop.sh
  21. 2 0
      lgsm/functions/command_update_linuxgsm.sh
  22. 2 2
      lgsm/functions/core_dl.sh
  23. 7 7
      lgsm/functions/fix_csgo.sh
  24. 3 3
      lgsm/functions/gsquery.py
  25. 47 6
      lgsm/functions/info_config.sh
  26. 1 1
      lgsm/functions/info_distro.sh
  27. 11 2
      lgsm/functions/info_glibc.sh
  28. 31 13
      lgsm/functions/info_messages.sh
  29. 7 1
      lgsm/functions/install_config.sh
  30. 1 1
      lgsm/functions/mods_list.sh
  31. 5 1
      lgsm/functions/update_factorio.sh
  32. 16 18
      linuxgsm.sh

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

@@ -14,8 +14,9 @@
 # Arms Race				1			0
 # Classic Casual		0			0
 # Classic Competitive	0			1
-# Demolition			1			1
+# Custom				3			0
 # Deathmatch			1			2
+# Demolition			1			1
 gametype="0"
 gamemode="0"
 mapgroup="mg_active"

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

@@ -24,7 +24,8 @@ workshopcollectionid=""
 
 ## Custom Start Parameters
 # Default +r_hunkalloclightmaps 0, fixes a start issue on maps with many lights
-customparms="+r_hunkalloclightmaps 0"
+# Default -disableluarefresh, disables lua autorefresh reducing server lag. Auto refresh only useful for developers.
+customparms="+r_hunkalloclightmaps 0 -disableluarefresh"
 
 ## Optional: Game Server Login Token
 # GSLT can be used for running a public server.

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

@@ -83,7 +83,7 @@ branch=""
 ## LinuxGSM Server Details
 # Do not edit
 gamename="Just Cause 2"
-engine="avalanche"
+engine="avalanche2.0"
 
 #### Directories ####
 # Edit with care

+ 115 - 0
lgsm/config-default/config-lgsm/jc3server/_default.cfg

@@ -0,0 +1,115 @@
+##################################
+######## 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(){
+parms=""
+}
+
+#### 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
+telegramalert="off"
+telegramtoken="accesstoken"
+telegramchatid=""
+
+## Updating | https://github.com/GameServerManagers/LinuxGSM/wiki/Update
+updateonstart="off"
+
+## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup
+maxbackups="4"
+maxbackupdays="30"
+stoponbackup="on"
+
+## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging
+consolelogging="on"
+logdays="7"
+
+#### LinuxGSM Advanced Settings ####
+
+## SteamCMD Settings
+# Server appid
+appid="619960"
+# 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="Just Cause 3"
+engine="avalanche3.0"
+
+#### Directories ####
+# Edit with care
+
+## Server Specific Directories
+systemdir="${serverfiles}"
+executabledir="${serverfiles}"
+executable="./Server"
+servercfg="config.json"
+servercfgdefault="config.json"
+servercfgdir="${serverfiles}"
+servercfgfullpath="${servercfgdir}/${servercfg}"
+
+## Backup Directory
+backupdir="${rootdir}/backups"
+
+## Logging Directories
+logdir="${rootdir}/log"
+#gamelogdir="" # No server logs available
+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 - 5
lgsm/config-default/config-lgsm/ns2cserver/_default.cfg

@@ -8,10 +8,6 @@
 
 #### Server Settings ####
 
-## SteamCMD Login | https://github.com/GameServerManagers/LinuxGSM/wiki/SteamCMD#steamcmd-login
-steamuser="username"
-steampass='password'
-
 ## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
 ip="0.0.0.0"
 port="27015"
@@ -111,7 +107,7 @@ engine="spark"
 systemdir="${serverfiles}"
 executabledir="${serverfiles}/ia32"
 executable="./ns2combatserver_linux32"
-servercfgdir="${rootdir}/server1"
+servercfgdir="${serverfiles}/${servicename}"
 servercfgfullpath="${servercfgdir}"
 modstoragedir="${servercfgdir}/Workshop"
 

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

@@ -109,9 +109,9 @@ engine="spark"
 
 ## Server Specific Directories
 systemdir="${serverfiles}"
-executabledir="${serverfiles}"
-executable="./server_linux32"
-servercfgdir="${rootdir}/server1"
+executabledir="${serverfiles}/x64"
+executable="./server_linux"
+servercfgdir="${serverfiles}/${servicename}"
 servercfgfullpath="${servercfgdir}"
 modstoragedir="${servercfgdir}/Workshop"
 

+ 2 - 3
lgsm/config-default/config-lgsm/rustserver/_default.cfg

@@ -26,9 +26,6 @@ tickrate="30" # default 30; range : 15 to 100
 
 ## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
 fn_parms(){
-parms="-batchmode +server.ip ${ip} +server.port ${port} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${servicename}\" ${conditionalseed} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.web ${rconweb} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile \"${gamelogdate}\""
-}
-
 # Specific to Rust
 if [ -n "${seed}" ]; then
 	# If set, then add to start parms
@@ -37,6 +34,8 @@ else
 	# Keep randomness of the number if not set
 	conditionalseed=""
 fi
+parms="-batchmode +server.ip ${ip} +server.port ${port} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${servicename}\" ${conditionalseed} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.web ${rconweb} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile \"${gamelogdate}\""
+}
 
 #### LinuxGSM Settings ####
 

+ 2 - 7
lgsm/config-default/config-lgsm/zpsserver/_default.cfg

@@ -16,14 +16,9 @@ sourcetvport="27020"
 defaultmap="zps_deadend"
 maxplayers="20"
 
-## Optional: Game Server Login Token
-# GSLT can be used for running a public server.
-# More info: https://gameservermanagers.com/gslt
-gslt=""
-
 ## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
 fn_parms(){
-parms="-game zps -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
+parms="-game zps -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}"
 }
 
 #### LinuxGSM Settings ####
@@ -125,4 +120,4 @@ 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"
+consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"

+ 1 - 0
lgsm/data/serverlist.csv

@@ -33,6 +33,7 @@ hldm,hldmserver,Half-Life: Deathmatch
 hw,hwserver,Hurtworld
 ins,insserver,Insurgency
 jc2,jc2server,Just Cause 2
+jc3,jc3server,Just Cause 3
 kf,kfserver,Killing Floor
 kf2,kf2server,Killing Floor 2
 l4d,l4dserver,Left 4 Dead

+ 11 - 0
lgsm/functions/alert.sh

@@ -71,6 +71,15 @@ fn_alert_permissions(){
 	alertbody="${servicename} has permissions issues"
 }
 
+fn_alert_config(){
+	fn_script_log_info "Sending alert: New _default.cfg"
+	alertsubject="Alert - ${servicename} - New _default.cfg"
+	alertemoji="🎮"
+	alertsound="1"
+	alerturl="not enabled"
+	alertbody="${servicename} has recieved a new _default.cfg. Check file for changes."
+}
+
 if [ "${alert}" == "permissions" ]; then
 	fn_alert_permissions
 elif [ "${alert}" == "restart" ]; then
@@ -81,6 +90,8 @@ elif [ "${alert}" == "test" ]; then
 	fn_alert_test
 elif [ "${alert}" == "update" ]; then
 	fn_alert_update
+elif [ "${alert}" == "config" ]; then
+	fn_alert_config
 fi
 
 # Generate alert log

+ 1 - 1
lgsm/functions/alert_mailgun.sh

@@ -11,7 +11,7 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 fn_print_dots "Sending Email alert: Mailgun: ${email}"
 sleep 0.5
 
-mailgunsend=$(curl -s --user "api:${mailguntoken}" \
+mailgunsend=$(${curlpath} -s --user "api:${mailguntoken}" \
 -F from="LinuxGSM <${mailgunemailfrom}>" \
 -F to="LinuxGSM Admin <${mailgunemail}>" \
 -F subject="${alertemoji} ${alertsubject} ${alertemoji}" \

+ 21 - 9
lgsm/functions/check_deps.sh

@@ -167,14 +167,17 @@ if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
 
 	# Game Specific requirements
 
-	# Spark
-	if [ "${engine}" ==  "spark" ]; then
+	# Natural Selection 2
+	if [ "${gamename}" == "Natural Selection 2" ]; then
+		array_deps_required+=( speex libtbb2 )
+	# NS2: Combat
+	elif [ "${gamename}" == "NS2: Combat" ]; then
 		array_deps_required+=( speex:i386 libtbb2 )
 	# 7 Days to Die
-	elif [ "${gamename}" ==  "7 Days To Die" ]; then
+	elif [ "${gamename}" == "7 Days To Die" ]; then
 		array_deps_required+=( telnet expect )
 	# No More Room in Hell, Counter-Strike: Source and Garry's Mod
-	elif [ "${gamename}" == "No More Room in Hell" ]||[ "${gamename}" == "Counter-Strike: Source" ]||[ "${gamename}" == "Garry's Mod" ]; then
+	elif [ "${gamename}" == "No More Room in Hell" ]||[ "${gamename}" == "Counter-Strike: Source" ]||[ "${gamename}" == "Garry's Mod" ]||[ "${gamename}" == "Zombie Panic! Source" ]; then
 		if [ "${arch}" == "x86_64" ]; then
 			array_deps_required+=( lib32tinfo5 )
 		else
@@ -235,6 +238,8 @@ elif [ -n "$(command -v yum 2>/dev/null)" ]; then
 	# LinuxGSM requirements
 	if [ "${distroversion}" == "6" ]; then
 		array_deps_required=( curl wget util-linux-ng python file gzip bzip2 unzip binutils bc )
+	elif [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then
+        	array_deps_required=( curl wget util-linux python27 file gzip bzip2 unzip binutils bc )
 	else
 		array_deps_required=( curl wget util-linux python file gzip bzip2 unzip binutils bc )
 	fi
@@ -250,19 +255,26 @@ elif [ -n "$(command -v yum 2>/dev/null)" ]; then
 
 	# All servers except ts3,mumble,multitheftauto and minecraft servers require glibc.i686 and libstdc++.i686
 	if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${engine}" != "lwjgl2" ]&&[ "${engine}" != "renderware" ]; then
-		array_deps_required+=( glibc.i686 libstdc++.i686 )
+		if [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then
+            		array_deps_required+=( glibc.i686 libstdc++64.i686 )
+        	else
+			array_deps_required+=( glibc.i686 libstdc++.i686 )
+		fi
 	fi
 
 	# Game Specific requirements
 
-	# Spark
-	if [ "${engine}" ==  "spark" ]; then
+	# Natural Selection 2
+	if [ "${gamename}" == "Natural Selection 2" ]; then
+		array_deps_required+=( speex tbb )
+	# NS2: Combat
+	elif [ "${gamename}" == "NS2: Combat" ]; then
 		array_deps_required+=( speex.i686 tbb.i686 )
 	# 7 Days to Die
-	elif [ "${gamename}" ==  "7 Days To Die" ]; then
+	elif [ "${gamename}" == "7 Days To Die" ]; then
 		array_deps_required+=( telnet expect )
 	# No More Room in Hell, Counter-Strike: Source and Garry's Mod
-	elif [ "${gamename}" == "No More Room in Hell" ]||[ "${gamename}" == "Counter-Strike: Source" ]||[ "${gamename}" == "Garry's Mod" ]; then
+	elif [ "${gamename}" == "No More Room in Hell" ]||[ "${gamename}" == "Counter-Strike: Source" ]||[ "${gamename}" == "Garry's Mod" ]||[ "${gamename}" == "Zombie Panic! Source" ]; then
 		array_deps_required+=( ncurses-libs.i686 )
 	# Brainbread 2, Don't Starve Together & Team Fortress 2
 	elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]||[ "${gamename}" == "Team Fortress 2" ]; then

+ 40 - 15
lgsm/functions/check_ip.sh

@@ -17,37 +17,62 @@ if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travi
 	getip=$(${ipcommand} -o -4 addr|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -v 127.0.0)
 	getipwc=$(${ipcommand} -o -4 addr|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -vc 127.0.0)
 	info_config.sh
+
+	# IP is not set to specific IP
 	if [ "${ip}" == "0.0.0.0" ]||[ "${ip}" == "" ]; then
+		fn_print_dots "Check IP"
+		sleep 1
+		# Multiple interfaces
 		if [ "${getipwc}" -ge "2" ]; then
-			fn_print_dots "Check IP"
-			sleep 1
-			fn_print_fail "Check IP: Multiple active network interfaces found."
+			fn_print_fail "Check IP: Multiple IP addresses found."
 			sleep 1
 			echo -en "\n"
+			# IP is set within game config
 			if [ "${ipsetinconfig}" == "1" ]; then
-				fn_print_information "Specify the IP you want to use within the game server config file ${servercfg}.\n"
-				echo -en "${servercfgfullpath}\n"
+				fn_print_information "Specify the IP you want to bind within ${servercfg}.\n"
+				echo -en "	* location: ${servercfgfullpath}\n"
+				echo -en "\n"
 				echo -en "Set ${ipinconfigvar} to one of the following:\n"
+				fn_script_log_fatal "Multiple IP addresses found."
+				fn_script_log_fatal "Specify the IP you want to bind within: ${servercfgfullpath}."
+			# IP is set within LinuxGSM config
 			else
-				fn_print_information_nl "Specify the IP you want to use within a LinuxGSM config file."
-				echo -en "location: ${configdirserver}\n"
-				echo ""
+				fn_print_information_nl "Specify the IP you want to bind within a LinuxGSM config file.\n"
+				echo -en "	* location: ${configdirserver}\n"
+				echo -en "\n"
 				echo -en "Set ip=\"0.0.0.0\" to one of the following:\n"
+				fn_script_log_fatal "Multiple IP addresses found."
+				if [ "${legacymode}" == "1" ]; then
+					fn_script_log_fatal "Specify the IP you want to bind within the ${selfname} script."
+				else
+					fn_script_log_fatal "Specify the IP you want to bind within: ${configdirserver}."
+				fi
 			fi
 			echo -en "${getip}\n"
+			echo -en "\n"
+			echo -en "https://gameservermanagers.com/network-interfaces\n"
 			echo -en ""
+			fn_script_log_fatal "https://gameservermanagers.com/network-interfaces\n"
+			core_exit.sh
+		# Single interface
+		elif [ "${ipsetinconfig}" == "1" ]; then
+			fn_print_fail "Check IP: IP address not set in game config."
+			sleep 1
+			echo -en "\n"
+			fn_print_information "Specify the IP you want to bind within ${servercfg}.\n"
+			echo -en "	* location: ${servercfgfullpath}\n"
+			echo -en "\n"
+			echo -en "Set ${ipinconfigvar} to the following:\n"
+			echo -en "${getip}\n"
+			echo -en "\n"
 			echo -en "https://gameservermanagers.com/network-interfaces\n"
 			echo -en ""
-			fn_script_log_fatal "Multiple active network interfaces found."
-			if [ "${legacymode}" == "1" ]; then
-				fn_script_log_fatal "Manually specify the IP you want to use within the ${selfname} script."
-			else
-				fn_script_log_fatal "Manually specify the IP you want to use within: ${configdirserver}."
-			fi
+			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 "https://gameservermanagers.com/network-interfaces\n"
 			core_exit.sh
 		else
-			ip=${getip}
+			ip="${getip}"
 		fi
 	fi
 fi

+ 1 - 1
lgsm/functions/check_system_requirements.sh

@@ -14,7 +14,7 @@ info_distro.sh
 
 if [ "${gamename}" == "ARK: Survival Evolved" ]; then
 	ramrequirementmb="4000"
-	ramrequirementgb="1"
+	ramrequirementgb="4"
 elif [ "${gamename}" == "ARMA 3" ]; then
 	ramrequirementmb="1000"
 	ramrequirementgb="1"

+ 1 - 1
lgsm/functions/command_console.sh

@@ -30,7 +30,7 @@ if [ "${status}" != "0" ]; then
 	fn_print_ok_nl "Accessing console"
 	fn_script_log_pass "Console accessed"
 	sleep 1
-	tmux attach-session -t ${servicename}
+	tmux attach-session -t "=${servicename}"
 	fn_print_ok_nl "Closing console"
 	fn_script_log_pass "Console closed"
 else

+ 1 - 1
lgsm/functions/command_details.sh

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

+ 1 - 1
lgsm/functions/command_monitor.sh

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

+ 1 - 1
lgsm/functions/command_postdetails.sh

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

+ 2 - 2
lgsm/functions/command_start.sh

@@ -110,7 +110,7 @@ fn_start_tmux(){
 		fn_script_log "Tmux version: master (user compiled)"
 		echo "Tmux version: master (user compiled)" >> "${consolelog}"
 		if [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then
-			tmux pipe-pane -o -t "${servicename}" "exec cat >> '${consolelog}'"
+			tmux pipe-pane -o -t "=${servicename}" "exec cat >> '${consolelog}'"
 		fi
 	elif [ -n "${tmuxversion}" ]; then
 		# Get the digit version of tmux
@@ -128,7 +128,7 @@ fn_start_tmux(){
 			Currently installed: $(tmux -V)" > "${consolelog}"
 		# Console logging enable or not set
 		elif [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then
-			tmux pipe-pane -o -t "${servicename}" "exec cat >> '${consolelog}'"
+			tmux pipe-pane -o -t "=${servicename}" "exec cat >> '${consolelog}'"
 		fi
 	else
 		echo "Unable to detect tmux version" >> "${consolelog}"

+ 7 - 5
lgsm/functions/command_stop.sh

@@ -14,7 +14,7 @@ fn_stop_graceful_ctrlc(){
 	fn_print_dots "Graceful: CTRL+c"
 	fn_script_log_info "Graceful: CTRL+c"
 	# sends quit
-	tmux send-keys C-c -t "${servicename}" > /dev/null 2>&1
+	tmux send-keys C-c -t "=${servicename}" > /dev/null 2>&1
 	# waits up to 30 seconds giving the server time to shutdown gracefuly
 	for seconds in {1..30}; do
 		check_status.sh
@@ -44,7 +44,7 @@ fn_stop_graceful_cmd(){
 	fn_print_dots "Graceful: sending \"${1}\""
 	fn_script_log_info "Graceful: sending \"${1}\""
 	# sends specific stop command
-	tmux send -t "${servicename}" ${1} ENTER > /dev/null 2>&1
+	tmux send -t "=${servicename}" ${1} ENTER > /dev/null 2>&1
 	# waits up to given seconds giving the server time to shutdown gracefully
 	for ((seconds=1; seconds<=${2}; seconds++)); do
 		check_status.sh
@@ -75,7 +75,7 @@ fn_stop_graceful_goldsource(){
 	fn_print_dots "Graceful: sending \"quit\""
 	fn_script_log_info "Graceful: sending \"quit\""
 	# sends quit
-	tmux send -t "${servicename}" quit ENTER > /dev/null 2>&1
+	tmux send -t "=${servicename}" quit ENTER > /dev/null 2>&1
 	# waits 3 seconds as goldsource servers restart with the quit command
 	for seconds in {1..3}; do
 		sleep 1
@@ -180,6 +180,8 @@ fn_stop_graceful_sdtd(){
 fn_stop_graceful_select(){
 	if [ "${gamename}" == "7 Days To Die" ]; then
 		fn_stop_graceful_sdtd
+	elif [ "${engine}" == "Spark" ]; then
+		fn_stop_graceful_cmd "q" 30
 	elif [ "${gamename}" == "Terraria" ]; then
 		fn_stop_graceful_cmd "exit" 30
 	elif [ "${gamename}" == "Minecraft" ]; then
@@ -189,7 +191,7 @@ fn_stop_graceful_select(){
 		fn_stop_graceful_cmd "quit" 120
 	elif [ "${engine}" == "goldsource" ]; then
 		fn_stop_graceful_goldsource
-	elif [ "${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" ]; then
 		fn_stop_graceful_ctrlc
 	elif  [ "${engine}" == "source" ]||[ "${engine}" == "quake" ]||[ "${engine}" == "idtech2" ]||[ "${engine}" == "idtech3" ]||[ "${engine}" == "idtech3_ql" ]||[ "${engine}" == "Just Cause 2" ]||[ "${engine}" == "projectzomboid" ]; then
 		fn_stop_graceful_cmd "quit" 30
@@ -261,7 +263,7 @@ fn_stop_tmux(){
 	fn_script_log_info "tmux kill-session: ${servername}"
 	sleep 0.5
 	# Kill tmux session
-	tmux kill-session -t "${servicename}" > /dev/null 2>&1
+	tmux kill-session -t "=${servicename}" > /dev/null 2>&1
 	sleep 0.5
 	check_status.sh
 	if [ "${status}" == "0" ]; then

+ 2 - 0
lgsm/functions/command_update_linuxgsm.sh

@@ -23,6 +23,8 @@ if [ -z "${legacymode}" ];then
 		fn_script_log_info "checking config _default.cfg: UPDATE"
 		rm -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg"
 		fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforce" "nomd5"
+		alert="config"
+		alert.sh
 	else
 		fn_print_ok_eol_nl
 		fn_script_log_info "checking config _default.cfg: OK"

+ 2 - 2
lgsm/functions/core_dl.sh

@@ -105,8 +105,8 @@ fn_fetch_file(){
 	forcedl="${6:-0}"
 	md5="${7:-0}"
 
-	# If the file is missing, then download
-	if [ ! -f "${local_filedir}/${local_filename}" ]; then
+	# Download file if missing or download forced
+	if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then
 		if [ ! -d "${local_filedir}" ]; then
 			mkdir -p "${local_filedir}"
 		fi

+ 7 - 7
lgsm/functions/fix_csgo.sh

@@ -17,19 +17,19 @@ if [ ! -f "${serverfiles}/steam_appid.txt" ]; then
 fi
 
 # Fixes: Error parsing BotProfile.db - unknown attribute 'Rank'".
-if ! grep -q "//Rank" "${systemdir}/botprofile.db" > /dev/null 2>&1; then
+if [ -f "${systemdir}/botprofile.db" ] && grep "^\s*Rank" "${systemdir}/botprofile.db" > /dev/null 2>&1; then
 	fixname="botprofile.db"
 	fn_fix_msg_start
-	sed -i 's/\tRank/\t\/\/Rank/g' "${systemdir}/botprofile.db" > /dev/null 2>&1
+	sed -i 's/^\s*Rank/\t\/\/Rank/g' "${systemdir}/botprofile.db" > /dev/null 2>&1
 	fn_fix_msg_end
 fi
 
-# Fixes: Unknown command "cl_bobamt_vert".
-if ! grep -q "//exec default" "${servercfgdir}/valve.rc" > /dev/null 2>&1 || ! grep -q "//exec joystick" "${servercfgdir}/valve.rc" > /dev/null 2>&1; then
+# Fixes: Unknown command "cl_bobamt_vert" and exec: couldn't exec joystick.cfg.
+if [ -f "${servercfgdir}/valve.rc" ] && grep -E '^\s*exec\s*(default|joystick)\.cfg' "${servercfgdir}/valve.rc" > /dev/null 2>&1; then
 	fixname="valve.rc"
 	fn_fix_msg_start
-	sed -i 's/exec default.cfg/\/\/exec default.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1
-	sed -i 's/exec joystick.cfg/\/\/exec joystick.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1
+	sed -i 's/^\s*exec\s*default.cfg/\/\/exec default.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1
+	sed -i 's/^\s*exec\s*joystick.cfg/\/\/exec joystick.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1
 	fn_fix_msg_end
 fi
 
@@ -42,4 +42,4 @@ if [ -f "${systemdir}/subscribed_collection_ids.txt" ]||[ -f "${systemdir}/subsc
 	rm -f "${systemdir}/subscribed_file_ids.txt"
 	rm -f "${systemdir}/ugc_collection_cache.txt"
 	fn_fix_msg_end
-fi
+fi

+ 3 - 3
lgsm/functions/gsquery.py

@@ -17,7 +17,7 @@ class PythonGSQ:
         self.server_response_timeout = 5
         self.default_buffer_length = 1024
         #
-        sourcequery=['madness','quakelive','realvirtuality','refractor','source','goldsource','spark','starbound','unity3d']
+        sourcequery=[ 'avalanche3.0','madness','quakelive','realvirtuality','refractor','source','goldsource','spark','starbound','unity3d']
         idtech2query=['idtech3','quake','iw3.0']
         idtech3query=['idtech2','iw2.0']
         if self.option.engine in sourcequery:
@@ -26,7 +26,7 @@ class PythonGSQ:
             self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00'
         elif self.option.engine in idtech3query:
             self.query_prompt_string = b'\xff\xff\xff\xffgetstatus'
-        elif self.option.engine == 'avalanche':
+        elif self.option.engine == 'avalanche2.0':
             self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40'
         elif self.option.engine == 'unreal':
             self.query_prompt_string = b'\x5C\x69\x6E\x66\x6F\x5C'
@@ -100,7 +100,7 @@ if __name__ == '__main__':
         action='store',
         dest='engine',
         default=False,
-        help='Engine type: avalanche, 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, realvirtuality, quake, quakelive, refractor, spark, source, unity3d, unreal, unreal2.'
     )
     parser.add_option(
         '-v', '--verbose',

+ 47 - 6
lgsm/functions/info_config.sh

@@ -14,7 +14,7 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 # grep -v "foo" filter out lines that contain foo
 # cut -f1 -d "/" remove everything after /
 
-fn_info_config_avalanche(){
+fn_info_config_justcause2(){
 	if [ ! -f "${servercfgfullpath}" ]; then
 		servername="${unavailable}"
 		serverpassword="${unavailable}"
@@ -22,6 +22,7 @@ fn_info_config_avalanche(){
 		port="${zero}"
 	else
 		servername=$(grep "Name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		serverdescription=$(grep "Description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
 		port=$(grep "BindPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
@@ -38,6 +39,42 @@ fn_info_config_avalanche(){
 	fi
 }
 
+fn_info_config_justcause3(){
+	if [ ! -f "${servercfgfullpath}" ]; then
+		servername="${unavailable}"
+		serverdescription="${unavailable}"
+		serverpassword="${unavailable}"
+		maxplayers="${zero}"
+		port="${zero}"
+		queryPort="${zero}"
+		steamport="${zero}"
+		tickrate="${zero}"
+	else
+		servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		serverdescription=$(grep "description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		maxplayers=$(grep "\"maxPlayers\"" "${servercfgfullpath}" | tr -cd '[:digit:]')
+		port=$(grep "\"port\"" "${servercfgfullpath}" | tr -cd '[:digit:]')
+		queryport=$(grep "\"queryPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]')
+		steamport=$(grep "\"steamPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]')
+		tickrate=$(grep "\"maxTickRate\"" "${servercfgfullpath}" | tr -cd '[:digit:]')
+
+		ip=$(grep "host" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/host//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		ipsetinconfig=1
+		ipinconfigvar="host"
+
+		# Not Set
+		servername=${servername:-"NOT SET"}
+		serverdescription=${serverdescription:-"NOT SET"}
+		serverpassword=${serverpassword:-"NOT SET"}
+		maxplayers=${maxplayers=:-"0"}
+		port=${port=:-"0"}
+		queryport=${queryport=:-"0"}
+		steamport=${steamport=:-"0"}
+		tickrate=${tickrate=:-"0"}
+	fi
+}
+
 fn_info_config_ark(){
 	if [ ! -f "${servercfgfullpath}" ]; then
 		servername="${unavailable}"
@@ -475,7 +512,7 @@ fn_info_config_starbound(){
 		# Not Set
 		servername=${servername:-"NOT SET"}
 		queryenabled=${queryenabled:-"NOT SET"}
-		rconenabled==${rconenabled:-"NOT SET"}
+		rconenabled=${rconenabled:-"NOT SET"}
 		rconpassword=${rconpassword:-"NOT SET"}
 		port=${port:-"21025"}
 		queryport=${queryport:-"21025"}
@@ -853,11 +890,9 @@ fn_info_config_squad(){
 	maxplayers=${maxplayers:-"0"}
 }
 
-# Just Cause 2
-if [ "${engine}" == "avalanche" ]; then
-	fn_info_config_avalanche
+
 # ARK: Survival Evolved
-elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then
+if [ "${gamename}" == "ARK: Survivial Evolved" ]; then
 	fn_info_config_ark
 # Ballistic Overkill
 elif [ "${gamename}" == "Ballistic Overkill" ]; then
@@ -883,6 +918,12 @@ elif [ "${engine}" == "dontstarve" ]; then
 # Factorio
 elif [ "${gamename}" == "Factorio" ]; then
 	fn_info_config_factorio
+# Just Cause 2
+elif [ "${gamename}" == "Just Cause 2" ]; then
+	fn_info_config_justcause2
+# Just Cause 3
+elif [ "${gamename}" == "Just Cause 3" ]; then
+	fn_info_config_justcause3
 # Killing Floor 2
 elif [ "${shortname}" == "kf2" ]; then
 	fn_info_config_kf2

+ 1 - 1
lgsm/functions/info_distro.sh

@@ -136,5 +136,5 @@ fi
 
 # External IP address
 if [ -z "${extip}" ];then
-	extip=$(curl -m 3 ifconfig.co 2>/dev/null)
+	extip=$(${curlpath} -m 3 ifconfig.co 2>/dev/null)
 fi

+ 11 - 2
lgsm/functions/info_glibc.sh

@@ -107,9 +107,12 @@ elif [ "${gamename}" == "TeamSpeak 3" ]; then
 elif [ "${gamename}" == "Teeworlds" ]; then
 	glibcrequired="2.14"
 	glibcfix="no"
-elif [ "${engine}" == "avalanche" ]; then
+elif [ "${gamename}" == "Just Cause 2" ]; then
 	glibcrequired="2.13"
 	glibcfix="yes"
+elif [ "${gamename}" == "Just Cause 3" ]; then
+	glibcrequired="2.17"
+	glibcfix="no"
 elif [ "${engine}" == "dontstarve" ]; then
 	glibcrequired="2.15"
 	glibcfix="no"
@@ -131,7 +134,10 @@ elif [ "${engine}" == "source" ]; then
 elif [ "${engine}" == "goldsource" ]; then
 	glibcrequired="2.3.4"
 	glibcfix="no"
-elif [ "${engine}" == "spark" ]; then
+elif [ "${gamename}" == "Natural Selection 2" ]; then
+	glibcrequired="2.17"
+	glibcfix="no"
+elif [ "${gamename}" == "NS2: Combat" ]; then
 	glibcrequired="2.15"
 	glibcfix="yes"
 elif [ "${engine}" == "starbound" ]; then
@@ -173,6 +179,9 @@ elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
 elif [ "${gamename}" == "Multi Theft Auto" ]; then
 	glibcrequired="2.7"
 	glibcfix="no"
+elif [ "${gamename}" == "Zombie Panic! Source" ]; then
+	glibcrequired="2.15"
+	glibcfix="yes"
 else
 	glibcrequired="UNKNOWN"
 	glibcfix="no"

+ 31 - 13
lgsm/functions/info_messages.sh

@@ -126,6 +126,11 @@ fn_info_message_gameserver(){
 			echo -e "${blue}Server name:\t${default}${servername}"
 		fi
 
+		# Server description
+		if [ -n "${serverdescription}" ]; then
+			echo -e "${blue}Server Description:\t${default}${serverdescription}"
+		fi
+
 		# Branch
 		if [ -n "${branch}" ]; then
 			echo -e "${blue}Branch:\t${default}${branch}"
@@ -397,7 +402,7 @@ fn_info_message_ports(){
 
 	parmslocation="${red}UNKNOWN${default}"
 	# engines/games that require editing in the config file
-	local ports_edit_array=( "avalanche" "Ballistic Overkill" "dontstarve" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" )
+	local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "dontstarve" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" )
 	for port_edit in "${ports_edit_array[@]}"
 	do
 		if [ "${shortname}" == "ut3" ]; then
@@ -502,15 +507,6 @@ fn_info_message_ballisticoverkill(){
 	} | column -s $'\t' -t
 }
 
-fn_info_message_avalanche(){
-	echo -e "netstat -atunp | grep Jcmp-Server"
-	echo -e ""
-	{
-		echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
-		echo -e "> Game\tINBOUND\t${port}\tudp"
-	} | column -s $'\t' -t
-}
-
 fn_info_message_cod(){
 	echo -e "netstat -atunp | grep cod_lnxded"
 	echo -e ""
@@ -597,6 +593,26 @@ fn_info_message_hurtworld(){
 	} | column -s $'\t' -t
 }
 
+fn_info_message_justcause2(){
+	echo -e "netstat -atunp | grep Jcmp-Server"
+	echo -e ""
+	{
+		echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
+		echo -e "> Game\tINBOUND\t${port}\tudp"
+	} | column -s $'\t' -t
+}
+
+fn_info_message_justcause3(){
+	echo -e "netstat -atunp | grep Server"
+	echo -e ""
+	{
+		echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
+		echo -e "> Game\tINBOUND\t${port}\tudp"
+		echo -e "> Query\tINBOUND\t${queryport}\tudp"
+		echo -e "> Steam\tINBOUND\t${steamport}\tudp"
+	} | column -s $'\t' -t
+}
+
 fn_info_message_minecraft(){
 	echo -e "netstat -atunp | grep java"
 	echo -e ""
@@ -779,7 +795,7 @@ fn_info_message_source(){
 
 fn_info_message_spark(){
 	fn_info_message_password_strip
-	echo -e "netstat -atunp | grep server_linux3"
+	echo -e "netstat -atunp | grep server_linux"
 	echo -e ""
 	{
 		echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
@@ -985,6 +1001,10 @@ fn_info_message_select_engine(){
 		fn_info_message_factorio
 	elif [ "${gamename}" == "Hurtworld" ]; then
 		fn_info_message_hurtworld
+	elif [ "${gamename}" == "Just Cause 2" ]; then
+		fn_info_message_justcause2
+	elif [ "${gamename}" == "Just Cause 3" ]; then
+		fn_info_message_justcause3
 	elif [ "${shortname}" == "kf2" ]; then
 		fn_info_message_kf2
 	elif [ "${gamename}" == "Project Cars" ]; then
@@ -1013,8 +1033,6 @@ fn_info_message_select_engine(){
 		fn_info_message_rust
 	elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
 		fn_info_message_wolfensteinenemyterritory
-	elif [ "${engine}" == "avalanche" ]; then
-		fn_info_message_avalanche
 	elif [ "${engine}" == "refractor" ]; then
 		fn_info_message_refractor
 	elif [ "${engine}" == "dontstarve" ]; then

+ 7 - 1
lgsm/functions/install_config.sh

@@ -27,7 +27,7 @@ fn_fetch_default_config(){
 	mkdir -p "${lgsmdir}/config-default/config-game"
 	githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/master"
 	for config in "${array_configs[@]}"; do
-		fn_fetch_file "${githuburl}/${gamedirname}/${config}" "${lgsmdir}/config-default/config-game" "${config}" "nochmodx" "norun" "noforce" "nomd5"
+		fn_fetch_file "${githuburl}/${gamedirname}/${config}" "${lgsmdir}/config-default/config-game" "${config}" "nochmodx" "norun" "forcedl" "nomd5"
 	done
 }
 
@@ -336,6 +336,12 @@ elif [ "${gamename}" == "Just Cause 2" ]; then
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
+elif [ "${gamename}" == "Just Cause 3" ]; then
+	gamedirname="JustCause3"
+	array_configs+=( config.json )
+	fn_fetch_default_config
+	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Killing Floor" ]; then
 	gamedirname="KillingFloor"
 	array_configs+=( Default.ini )

+ 1 - 1
lgsm/functions/mods_list.sh

@@ -68,7 +68,7 @@ mod_info_darkrpmodification=( MOD "darkrpmodification" "DarkRP Modification" "ht
 # Oxidemod
 mod_info_rustoxide=( MOD "rustoxide" "Oxide for Rust" "https://github.com/OxideMod/Oxide/releases/download/latest/Oxide-Rust.zip" "Oxide-Rust.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Rust;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-rust.1659/" "Allows for the use of plugins" )
 mod_info_hwoxide=( MOD "hwoxide" "Oxide for Hurtworld" "https://github.com/OxideMod/Oxide/releases/download/latest/Oxide-Hurtworld.zip" "Oxide-Hurtworld.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Hurtworld;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-hurtworld.1332/" "Allows for the use of plugins" )
-mod_info_sdtdoxide=( MOD "sdtdoxide" "Oxide for 7 Days To Die" "https://github.com/OxideMod/Oxide/releases/download/latest/Oxide-SevenDays.zip" "Oxide-SevenDays.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" "https://github.com/OxideMod/Oxide/releases/download/latest/Oxide-SevenDaysToDie.zip" "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
 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_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" )

+ 5 - 1
lgsm/functions/update_factorio.sh

@@ -76,7 +76,11 @@ fn_update_factorio_arch(){
 
 fn_update_factorio_availablebuild(){
 	# Gets latest build info.
-	availablebuild=$(curl -s https://www.factorio.com/download-headless | grep 'headless/linux64' | head -n 1 | grep -oP '(?<=get-download/).*?(?=/)')
+	if [ "${branch}" ]; then
+		availablebuild=$(${curlpath} -s https://www.factorio.com/download-headless/"${branch}" | grep 'headless/linux64' | head -n 1 | grep -oP '(?<=get-download/).*?(?=/)')
+	else
+		availablebuild=$(${curlpath} -s https://www.factorio.com/download-headless | grep 'headless/linux64' | head -n 1 | grep -oP '(?<=get-download/).*?(?=/)')
+	fi
 	sleep 1
 
 	# Checks if availablebuild variable has been set

+ 16 - 18
linuxgsm.sh

@@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="171014"
+version="171216"
 shortname="core"
 gameservername="core"
 rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
@@ -64,8 +64,8 @@ fn_bootstrap_fetch_file(){
 	run="${5:-0}"
 	forcedl="${6:-0}"
 	md5="${7:-0}"
-	# If the file is missing, then download
-	if [ ! -f "${local_filedir}/${local_filename}" ]; then
+	# download file if missing or download forced
+	if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then
 		if [ ! -d "${local_filedir}" ]; then
 			mkdir -p "${local_filedir}"
 		fi
@@ -116,15 +116,15 @@ fn_bootstrap_fetch_file_github(){
 	github_file_url_name="${2}"
 	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
 
-	remote_remote_fileurl="${githuburl}"
-	local_local_filedir="${3}"
-	local_local_filename="${github_file_url_name}"
+	remote_fileurl="${githuburl}"
+	local_filedir="${3}"
+	local_filename="${github_file_url_name}"
 	chmodx="${4:-0}"
 	run="${5:-0}"
-	forcedldl="${6:-0}"
+	forcedl="${6:-0}"
 	md5="${7:-0}"
 	# Passes vars to the file download function
-	fn_bootstrap_fetch_file "${remote_remote_fileurl}" "${local_local_filedir}" "${local_local_filename}" "${chmodx}" "${run}" "${forcedldl}" "${md5}"
+	fn_bootstrap_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}"
 }
 
 # Installer menu
@@ -229,9 +229,9 @@ fn_install_getopt(){
 	echo "https://gameservermanagers.com"
 	echo -e ""
 	echo -e "Commands"
-	echo -e "install |Select server to install."
-	echo -e "servername |e.g $0 csgoserver. Enter the required servername will install it."
-	echo -e "list |List all servers available for install."
+	echo -e "install\t\t| Select server to install."
+	echo -e "servername\t| e.g $0 csgoserver. Enter name of server/game to install."
+	echo -e "list\t\t| List all servers available for install."
 	exit
 }
 
@@ -276,12 +276,8 @@ if [ "${shortname}" == "core" ]; then
 	datadir="${tmpdir}/data"
 	serverlist="${datadir}/serverlist.csv"
 
-	# Download the serverlist. This is the complete list of all supported servers.
-
-	if [ -f "${serverlist}" ]; then
-		rm "${serverlist}"
-	fi
-	fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "serverlist.csv" "nochmodx" "norun" "noforcedl" "nomd5"
+	# Download the latest serverlist. This is the complete list of all supported servers.
+	fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5"
 	if [ ! -f "${serverlist}" ]; then
 		echo "[ FAIL ] serverlist.csv could not be loaded."
 		exit 1
@@ -307,8 +303,10 @@ if [ "${shortname}" == "core" ]; then
 		fi
 	elif [ -n "${userinput}" ]; then
 		fn_server_info
-		if [ "${userinput}" == "${gameservername}" ]; then
+		if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then
 			fn_install_file
+		else
+			echo "[ FAIL ] unknown game server"
 		fi
 	else
 		fn_install_getopt