Просмотр исходного кода

Merge branch 'hotfix/v20.3.1' into develop

Daniel Gibbs 6 лет назад
Родитель
Сommit
8fed4ba064

+ 0 - 119
.all-contributorsrc

@@ -1,119 +0,0 @@
-{
-  "files": [
-    "README.md"
-  ],
-  "imageSize": 100,
-  "commit": false,
-  "contributors": [
-    {
-      "login": "dgibbs64",
-      "name": "Daniel Gibbs",
-      "avatar_url": "https://avatars2.githubusercontent.com/u/4478206?v=4",
-      "profile": "https://danielgibbs.co.uk",
-      "contributions": [
-        "bug",
-        "code",
-        "ideas",
-        "question",
-        "review",
-        "content",
-        "doc",
-        "infra"
-      ]
-    },
-    {
-      "login": "Frisasky",
-      "name": "Frisasky",
-      "avatar_url": "https://avatars2.githubusercontent.com/u/26865851?v=4",
-      "profile": "https://github.com/Frisasky",
-      "contributions": [
-        "question",
-        "bug",
-        "code"
-      ]
-    },
-    {
-      "login": "kennyLtv",
-      "name": "Kenny Lindelof",
-      "avatar_url": "https://avatars2.githubusercontent.com/u/6133325?v=4",
-      "profile": "https://kennyl.design",
-      "contributions": [
-        "question"
-      ]
-    },
-    {
-      "login": "Scarsz",
-      "name": "Austin Shapiro",
-      "avatar_url": "https://avatars1.githubusercontent.com/u/7691988?v=4",
-      "profile": "https://scarsz.me",
-      "contributions": [
-        "bug",
-        "code"
-      ]
-    },
-    {
-      "login": "marvinlehmann",
-      "name": "Marvin Lehmann",
-      "avatar_url": "https://avatars2.githubusercontent.com/u/4151266?v=4",
-      "profile": "https://github.com/marvinlehmann",
-      "contributions": [
-        "bug",
-        "code"
-      ]
-    },
-    {
-      "login": "Bourne-ID",
-      "name": "Bourne-ID",
-      "avatar_url": "https://avatars1.githubusercontent.com/u/7073616?v=4",
-      "profile": "https://github.com/Bourne-ID",
-      "contributions": [
-        "review",
-        "content",
-        "doc",
-        "infra",
-        "review"
-      ]
-    },
-    {
-      "login": "cedarlug",
-      "name": "CedarLUG",
-      "avatar_url": "https://avatars2.githubusercontent.com/u/19336442?v=4",
-      "profile": "http://cedarlug.org",
-      "contributions": [
-        "bug",
-        "code",
-        "ideas",
-        "question",
-        "review"
-      ]
-    },
-    {
-      "login": "UltimateByte",
-      "name": "UltimateByte",
-      "avatar_url": "https://avatars3.githubusercontent.com/u/8805941?v=4",
-      "profile": "https://www.terageek.org | https://www.haisoft.fr",
-      "contributions": [
-        "bug",
-        "code",
-        "doc",
-        "ideas",
-        "review"
-      ]
-    },
-    {
-      "login": "borzaka",
-      "name": "Attila",
-      "avatar_url": "https://avatars0.githubusercontent.com/u/1230402?v=4",
-      "profile": "https://github.com/borzaka",
-      "contributions": [
-        "code",
-        "bug"
-      ]
-    }
-  ],
-  "contributorsPerLine": 7,
-  "projectName": "LinuxGSM",
-  "projectOwner": "GameServerManagers",
-  "repoType": "github",
-  "repoHost": "https://github.com"
-}

+ 1 - 1
.github/workflows/git-sync.yml

@@ -6,7 +6,7 @@ on:
     branches:    
       - master
       - 'develop'
-      - 'feature/update-lgsm'
+
 jobs:
   repo-sync:
     runs-on: ubuntu-latest

+ 1 - 5
lgsm/functions/check_ip.sh

@@ -44,11 +44,7 @@ if [ "${travistest}" != "1" ]; then
 				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
+				fn_script_log_fatal "Specify the IP you want to bind within: ${configdirserver}."
 			fi
 			echo -en "${getip}\n"
 			echo -en "\n"

+ 2 - 10
lgsm/functions/check_steamcmd.sh

@@ -31,18 +31,10 @@ fn_install_steamcmd(){
 fn_check_steamcmd_user(){
 	# Checks if steamuser is setup.
 	if [ "${steamuser}" == "username" ]; then
-		if [ "${legacymode}" == "1" ]; then
-			fn_print_fail_nl "Steam login not set. Update steamuser in ${selfname}"
-		else
-			fn_print_fail_nl "Steam login not set. Update steamuser in ${configdirserver}"
-		fi
+		fn_print_fail_nl "Steam login not set. Update steamuser in ${configdirserver}"
 		echo -e "	* Change steamuser=\"username\" to a valid steam login."
 		if [ -d "${lgsmlogdir}" ]; then
-			if [ "${legacymode}" == "1" ]; then
-				fn_script_log_fatal "Steam login not set. Update steamuser in ${selfname}"
-			else
-				fn_script_log_fatal "Steam login not set. Update steamuser in ${configdirserver}"
-			fi
+			fn_script_log_fatal "Steam login not set. Update steamuser in ${configdirserver}"
 		fi
 		core_exit.sh
 	fi

+ 0 - 2
lgsm/functions/command_monitor.sh

@@ -71,11 +71,9 @@ fn_monitor_check_queryport(){
 		fn_script_log_info "Checking port: CHECKING"
 		if [ -n "${rconenabled}" ]&&[ "${rconenabled}" != "true" ]&&[ ${shortname} == "av" ]; then
 			fn_print_warn "Checking port: Unable to query as rconport, rcon not enabled: "
-			fn_print_warn_eol_nl
 			fn_script_log_warn "Checking port: Unable to query rconport, rcon not enabled: WARN"
 		else
 			fn_print_error "Checking port: Unable to query queryport is not set: "
-			fn_print_error_eol_nl
 			fn_script_log_error "Checking port: Unable to query as queryport is not set: ERROR"
 		fi
 		core_exit.sh

+ 5 - 2
lgsm/functions/command_start.sh

@@ -165,13 +165,12 @@ fn_start_tmux(){
 	echo -en "\n"
 }
 
-
 check.sh
 
-fn_print_dots "${servername}"
 # Is the server already started.
 # $status comes from check_status.sh, which is run by check.sh for this command
 if [ "${status}" != "0" ]; then
+	fn_print_dots "${servername}"
 	fn_print_info_nl "${servername} is already running"
 	fn_script_log_error "${servername} is already running"
 	if [ -z "${exitbypass}" ]; then
@@ -189,8 +188,12 @@ if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateon
 	exitbypass=1
 	unset updateonstart
 	command_update.sh
+	commandname="START"
+	commandaction="Starting"
 fi
 
+fn_print_dots "${servername}"
+
 if [ "${shortname}" == "ts3" ]; then
 	fn_start_teamspeak3
 else

+ 33 - 33
lgsm/functions/command_update_linuxgsm.sh

@@ -32,39 +32,6 @@ else
 	fn_print_ok_nl "Selecting repo: ${remotereponame}"
 fi
 
-# Check _default.cfg.
-echo -en "checking ${remotereponame} config _default.cfg...\c"
-fn_script_log_info "Checking ${remotereponame} config _default.cfg"
-if [ "${remotereponame}" == "GitHub" ]; then
-	curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
-else
-	curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
-fi
-if [ $? != "0" ]; then
-	fn_print_fail_eol_nl
-	fn_script_log_fatal "Checking ${remotereponame} config _default.cfg"
-	fn_script_log_fatal "Curl returned error: $?"
-	core_exit.sh
-fi
-
-if [ "${remotereponame}" == "GitHub" ]; then
-	config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg"))
-else
-	config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg"))
-fi
-
-if [ "${config_file_diff}" != "" ]; then
-	fn_print_update_eol_nl
-	fn_script_log_update "Checking ${remotereponame} config _default.cfg"
-	rm -f "${configdirdefault:?}/config-lgsm/${gameservername:?}/_default.cfg"
-	fn_fetch_file_github "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "nochmodx" "norun" "noforce" "nomd5"
-	alert="config"
-	alert.sh
-else
-	fn_print_ok_eol_nl
-	fn_script_log_pass "Checking ${remotereponame} config _default.cfg"
-fi
-
 # Check linuxsm.sh
 echo -en "checking ${remotereponame} linuxgsm.sh...\c"
 if [ "${remotereponame}" == "GitHub" ]; then
@@ -144,6 +111,39 @@ else
 	fn_script_log_info "Checking ${selfname}"
 fi
 
+# Check _default.cfg.
+echo -en "checking ${remotereponame} config _default.cfg...\c"
+fn_script_log_info "Checking ${remotereponame} config _default.cfg"
+if [ "${remotereponame}" == "GitHub" ]; then
+	curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
+else
+	curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null
+fi
+if [ $? != "0" ]; then
+	fn_print_fail_eol_nl
+	fn_script_log_fatal "Checking ${remotereponame} config _default.cfg"
+	fn_script_log_fatal "Curl returned error: $?"
+	core_exit.sh
+fi
+
+if [ "${remotereponame}" == "GitHub" ]; then
+	config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg"))
+else
+	config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg"))
+fi
+
+if [ "${config_file_diff}" != "" ]; then
+	fn_print_update_eol_nl
+	fn_script_log_update "Checking ${remotereponame} config _default.cfg"
+	rm -f "${configdirdefault:?}/config-lgsm/${gameservername:?}/_default.cfg"
+	fn_fetch_file_github "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "nochmodx" "norun" "noforce" "nomd5"
+	alert="config"
+	alert.sh
+else
+	fn_print_ok_eol_nl
+	fn_script_log_pass "Checking ${remotereponame} config _default.cfg"
+fi
+
 # Check and update modules.
 if [ -n "${functionsdir}" ]; then
 	if [ -d "${functionsdir}" ]; then

+ 5 - 1
lgsm/functions/core_dl.sh

@@ -236,7 +236,11 @@ fn_fetch_file(){
 fn_fetch_file_github(){
 	github_file_url_dir="${1}"
 	github_file_url_name="${2}"
-	if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
+	if [ "${legacymode}" == "1" ]; then
+		# For legacy versions - code can be removed at a future date
+		remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+		remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+	elif [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
 		remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
 		remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
 	else

+ 1 - 1
lgsm/functions/core_functions.sh

@@ -7,7 +7,7 @@
 
 functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
-modulesversion="v20.3.0"
+modulesversion="v20.3.1"
 
 # Core
 

+ 9 - 1
lgsm/functions/core_legacy.sh

@@ -6,8 +6,16 @@
 
 functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
+# This is to help the transition to v20.3.0 and above
+legacy_versions_array=( v20.2.1 v20.2.0 v20.1.5 v20.1.4 v20.1.3 v20.1.2 v20.1.1 v20.1.0 v19.12.5 v19.12.4 v19.12.3 v19.12.2 v19.12.1 v19.12.0 )
+for legacy_version in "${legacy_versions_array[@]}"
+do
+	if [ "${version}" == "${legacy_version}" ]; then
+		legacymode=1
+	fi
+done
+
 if [ -z "${serverfiles}" ]; then
-	legacymode=1
 	serverfiles="${filesdir}"
 fi
 

+ 1 - 1
lgsm/functions/info_distro.sh

@@ -9,7 +9,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 ### Game Server pid
 if [ "${status}" == "1" ]; then
-	gameserverpid=$(tmux list-sessions -F "#{session_name} #{pane_pid}"| grep "^${sessionname}"|awk '{print $2}')
+	gameserverpid=$(tmux list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $2}')
 fi
 ### Distro information
 

+ 1 - 1
lgsm/functions/mods_core.sh

@@ -18,7 +18,7 @@ modsinstalledlistfullpath="${modsdir}/${modsinstalledlist}"
 
 # Download management.
 fn_mod_install_files(){
-	fn_fetch_file "${modurl}" "${modstmpdir}" "${modfilename}"
+	fn_fetch_file "${modurl}" "" "" "" "${modstmpdir}" "${modfilename}"
 	# Check if variable is valid checking if file has been downloaded and exists.
 	if [ ! -f "${modstmpdir}/${modfilename}" ]; then
 		fn_print_failure "An issue occurred downloading ${modprettyname}"

+ 0 - 4
lgsm/functions/update_factorio.sh

@@ -170,7 +170,3 @@ else
 	fn_update_factorio_remotebuild
 	fn_update_factorio_compare
 fi
-
-if [ "${commandname}" != "INSTALL" ]; then
-	core_exit.sh
-fi	

+ 0 - 4
lgsm/functions/update_minecraft.sh

@@ -218,7 +218,3 @@ else
 	fn_update_minecraft_remotebuild
 	fn_update_minecraft_compare
 fi
-
-if [ "${commandname}" != "INSTALL" ]; then
-	core_exit.sh
-fi	

+ 0 - 4
lgsm/functions/update_minecraft_bedrock.sh

@@ -178,7 +178,3 @@ else
 	fn_update_minecraft_remotebuild
 	fn_update_minecraft_compare
 fi
-
-if [ "${commandname}" != "INSTALL" ]; then
-	core_exit.sh
-fi	

+ 0 - 4
lgsm/functions/update_mta.sh

@@ -209,7 +209,3 @@ else
 	fn_update_mta_remotebuild
 	fn_update_mta_compare
 fi
-
-if [ "${commandname}" != "INSTALL" ]; then
-	core_exit.sh
-fi

+ 0 - 4
lgsm/functions/update_mumble.sh

@@ -148,7 +148,3 @@ else
 	fn_update_mumble_remotebuild
 	fn_update_mumble_compare
 fi
-
-if [ "${commandname}" != "INSTALL" ]; then
-	core_exit.sh
-fi	

+ 0 - 4
lgsm/functions/update_steamcmd.sh

@@ -246,7 +246,3 @@ else
 	fn_update_steamcmd_remotebuild
 	fn_update_steamcmd_compare
 fi
-
-if [ "${commandname}" != "INSTALL" ]; then
-	core_exit.sh
-fi	

+ 0 - 4
lgsm/functions/update_ts3.sh

@@ -219,7 +219,3 @@ else
 	fn_update_ts3_remotebuild
 	fn_update_ts3_compare
 fi
-
-if [ "${commandname}" != "INSTALL" ]; then
-	core_exit.sh
-fi	

+ 1 - 1
linuxgsm.sh

@@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="v20.3.0"
+version="v20.3.1"
 shortname="core"
 gameservername="core"
 commandname="CORE"

+ 1 - 1
tests/tests_fctrserver.sh

@@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="v20.3.0"
+version="v20.3.1"
 shortname="fctr"
 gameservername="fctrserver"
 commandname="CORE"

+ 1 - 1
tests/tests_jc2server.sh

@@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="v20.3.0"
+version="v20.3.1"
 shortname="jc2"
 gameservername="jc2server"
 commandname="CORE"

+ 1 - 1
tests/tests_mcserver.sh

@@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="v20.3.0"
+version="v20.3.1"
 shortname="mc"
 gameservername="mcserver"
 commandname="CORE"

+ 1 - 1
tests/tests_ts3server.sh

@@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="v20.3.0"
+version="v20.3.1"
 shortname="ts3"
 gameservername="ts3server"
 commandname="CORE"