4
0
Эх сурвалжийг харах

feat(refactor): general refactor of if statements (#2492)

* Codacy recommendation fixes
Daniel Gibbs 6 жил өмнө
parent
commit
1d41bc66d3
46 өөрчлөгдсөн 177 нэмэгдсэн , 191 устгасан
  1. 1 1
      .gitattributes
  2. 1 1
      .github/ISSUE_TEMPLATE/new-server-request.md
  3. 1 1
      .github/potential-duplicates.yml
  4. 2 2
      .github/request-info.yml
  5. 1 1
      .github/topissuebot.yml
  6. 1 1
      .github/welcome.yml
  7. 1 1
      .github/write-good.yml
  8. 1 1
      .gitignore
  9. 1 1
      CONTRIBUTING.md
  10. 0 1
      LICENSE
  11. 1 1
      README.md
  12. 1 1
      lgsm/functions/alert_email.sh
  13. 1 1
      lgsm/functions/check_deps.sh
  14. 3 3
      lgsm/functions/check_permissions.sh
  15. 0 1
      lgsm/functions/check_system_dir.sh
  16. 1 1
      lgsm/functions/command_dev_clear_functions.sh
  17. 1 1
      lgsm/functions/command_donate.sh
  18. 3 3
      lgsm/functions/command_fastdl.sh
  19. 2 2
      lgsm/functions/command_monitor.sh
  20. 1 1
      lgsm/functions/command_restart.sh
  21. 3 3
      lgsm/functions/command_start.sh
  22. 1 1
      lgsm/functions/command_update_functions.sh
  23. 2 2
      lgsm/functions/core_dl.sh
  24. 1 1
      lgsm/functions/core_trap.sh
  25. 1 1
      lgsm/functions/fix_ark.sh
  26. 1 1
      lgsm/functions/fix_arma3.sh
  27. 1 1
      lgsm/functions/fix_ges.sh
  28. 1 1
      lgsm/functions/fix_kf.sh
  29. 1 1
      lgsm/functions/fix_rw.sh
  30. 1 1
      lgsm/functions/fix_sdtd.sh
  31. 1 1
      lgsm/functions/fix_ut.sh
  32. 1 1
      lgsm/functions/fix_ut2k4.sh
  33. 2 2
      lgsm/functions/info_distro.sh
  34. 34 34
      lgsm/functions/info_messages.sh
  35. 90 102
      lgsm/functions/install_config.sh
  36. 1 1
      lgsm/functions/install_server_dir.sh
  37. 1 1
      lgsm/functions/install_server_files.sh
  38. 1 1
      lgsm/functions/install_squad_license.sh
  39. 2 2
      lgsm/functions/logs.sh
  40. 1 1
      lgsm/functions/mods_core.sh
  41. 1 1
      lgsm/functions/query_gamedig.sh
  42. 1 1
      linuxgsm.sh
  43. 1 1
      tests/tests_fctrserver.sh
  44. 1 1
      tests/tests_jc2server.sh
  45. 1 1
      tests/tests_mcserver.sh
  46. 1 1
      tests/tests_ts3server.sh

+ 1 - 1
.gitattributes

@@ -19,4 +19,4 @@
 *.pdf  diff=astextplain
 *.PDF	 diff=astextplain
 *.rtf	 diff=astextplain
-*.RTF	 diff=astextplain
+*.RTF	 diff=astextplain

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

@@ -26,4 +26,4 @@ If yes Use SteamDB to get the appid. (https://steamdb.info).
 We only support Linux servers and do not support Wine.
 
 * [ ] Yes
-* [ ] No
+* [ ] No

+ 1 - 1
.github/potential-duplicates.yml

@@ -10,4 +10,4 @@ referenceComment: >
   Potential duplicates:
   {{#issues}}
     - [#{{ number }}] {{ title }} ({{ accuracy }}%)
-  {{/issues}}
+  {{/issues}}

+ 2 - 2
.github/request-info.yml

@@ -3,7 +3,7 @@
 # *Required* Comment to reply with
 requestInfoReplyComment: >
   ![More Data required](https://i.imgur.com/yS9cecv.png)
-  More data is required to assist with this issue 
+  More data is required to assist with this issue
   or issue template was not used correctly.
   https://linuxgsm.com/support/#guide
 
@@ -14,4 +14,4 @@ requestInfoReplyComment: >
 #  - updates
 
 # *OPTIONAL* Label to be added to Issues and Pull Requests with insufficient information given
-requestInfoLabelToAdd: "needs more info"
+requestInfoLabelToAdd: "needs more info"

+ 1 - 1
.github/topissuebot.yml

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

+ 1 - 1
.github/welcome.yml

@@ -18,4 +18,4 @@ newPRWelcomeComment: >
 firstPRMergeComment: >
   Congratulations on merging your first pull request! Thank you for supporting LinuxGSM!
 
-# It is recommend to include as many gifs and emojis as possible
+# It is recommend to include as many gifs and emojis as possible

+ 1 - 1
.github/write-good.yml

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

+ 1 - 1
.gitignore

@@ -1,2 +1,2 @@
 *.db
-.idea
+.idea

+ 1 - 1
CONTRIBUTING.md

@@ -33,4 +33,4 @@ This will help us in understanding your code and determining where problems may
 Start reading our code and you'll get the hang of it. Explore how functions are organized and you'll see how we strive for readable code.
 
 Please give the following document a read and adjust your code according to its specifications.
-[Syntax & Coding Conventions](https://github.com/GameServerManagers/LinuxGSM/wiki/Syntax-and-Conventions)
+[Syntax & Coding Conventions](https://github.com/GameServerManagers/LinuxGSM/wiki/Syntax-and-Conventions)

+ 0 - 1
LICENSE

@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
-

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 1 - 1
README.md


+ 1 - 1
lgsm/functions/alert_email.sh

@@ -23,4 +23,4 @@ if [ "${exitcode}" == "0" ]; then
 else
 	fn_print_fail_nl "Sending Email alert: ${email}"
 	fn_script_log_fatal "Sending Email alert: ${email}"
-fi
+fi

+ 1 - 1
lgsm/functions/check_deps.sh

@@ -120,7 +120,7 @@ fn_install_universe_repo(){
 			sleep 1
 			echo -en "   \r"
 			cmd="sudo apt-add-repository universe"
-			eval ${cmd}
+			eval "${cmd}"
 			if [ $? -eq 0 ]; then
 				fn_print_complete_nl "Installing universe repository completed."
 				fn_script_log_pass "Installing universe repository completed."

+ 3 - 3
lgsm/functions/check_permissions.sh

@@ -9,17 +9,17 @@ local commandname="CHECK"
 
 fn_check_ownership(){
 	if [ -f "${rootdir}/${selfname}" ]; then
-		if [ "$(find "${rootdir}/${selfname}" -not -user $(whoami) | wc -l)" -ne "0" ]; then
+		if [ "$(find "${rootdir}/${selfname}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then
 			selfownissue=1
 		fi
 	fi
 	if [ -d "${functionsdir}" ]; then
-		if [ "$(find "${functionsdir}" -not -user $(whoami) | wc -l)" -ne "0" ]; then
+		if [ "$(find "${functionsdir}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then
 			funcownissue=1
 		fi
 	fi
 	if [ -d "${serverfiles}" ]; then
-		if [ "$(find "${serverfiles}" -not -user $(whoami) | wc -l)" -ne "0" ]; then
+		if [ "$(find "${serverfiles}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then
 			filesownissue=1
 		fi
 	fi

+ 0 - 1
lgsm/functions/check_system_dir.sh

@@ -20,4 +20,3 @@ if [ ! -d "${checkdir}" ]; then
 	fi
 	core_exit.sh
 fi
-

+ 1 - 1
lgsm/functions/command_dev_clear_functions.sh

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

+ 1 - 1
lgsm/functions/command_donate.sh

@@ -15,4 +15,4 @@ echo -e "* ${blue}Patreon:${default} https://linuxgsm.com/patreon"
 echo -e "* ${blue}PayPal:${default} https://linuxgsm.com/paypal"
 echo -e "* ${blue}Flattr:${default} https://linuxgsm.com/flattr"
 echo -e ""
-echo -e "LinuxGSM has been going since 2012"
+echo -e "LinuxGSM has been going since 2012"

+ 3 - 3
lgsm/functions/command_fastdl.sh

@@ -196,7 +196,7 @@ fn_fastdl_preview(){
 						echo "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt"
 					done < <(find "${systemdir}/${directory}" -type f -iname ${allowed_extention})
 					tput rc; tput el
-					printf "gathering ${directory} ${allowed_extention} : ${fileswc}..."
+					echo "gathering ${directory} ${allowed_extention} : ${fileswc}..."
 					if [ ${fileswc} != 0 ]; then
 						fn_print_ok_eol_nl
 					else
@@ -245,7 +245,7 @@ fn_fastdl_gmod(){
 		while read -r fastdlfile; do
 			((fileswc++))
 			tput rc; tput el
-			printf "copying ${allowed_extention} : ${fileswc}..."
+			echo "copying ${allowed_extention} : ${fileswc}..."
 			cp --parents "${fastdlfile}" "${fastdldir}"
 			exitcode=$?
 			if [ ${exitcode} -ne 0 ]; then
@@ -255,7 +255,7 @@ fn_fastdl_gmod(){
 			else
 				fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}"
 			fi
-		done < <(find . -type f -iname ${allowed_extention})
+		done < <(find . -type f -iname "${allowed_extention}")
 		if [ ${fileswc} != 0 ]; then
 			fn_print_ok_eol_nl
 		fi

+ 2 - 2
lgsm/functions/command_monitor.sh

@@ -96,8 +96,8 @@ fn_monitor_check_lockfile(){
 }
 
 fn_monitor_check_update(){
-	# Monitor will not check if update is running.
-	if [ "$(ps -ef | grep "${selfname} update" | grep -v grep | wc -l)" != "0" ]; then
+	# Monitor will check if update is already running.
+	if [ "$(pgrep "${selfname} update" | wc -l)" != "0" ]; then
 		fn_print_error_nl "SteamCMD is currently checking for updates"
 		fn_script_log_error "SteamCMD is currently checking for updates"
 		core_exit.sh

+ 1 - 1
lgsm/functions/command_restart.sh

@@ -11,4 +11,4 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 info_config.sh
 exitbypass=1
 command_stop.sh
-command_start.sh
+command_start.sh

+ 3 - 3
lgsm/functions/command_start.sh

@@ -35,7 +35,7 @@ fn_start_teamspeak3(){
 	if [ ! -f "${executabledir}/.ts3server_license_accepted" ]; then
 		install_eula.sh
 	fi
-	cd "${executabledir}"
+	cd "${executabledir}" || exit
 	if [ "${ts3serverpass}" == "1" ]; then
 		./ts3server_startscript.sh start serveradmin_password="${newpassword}" inifile="${servercfgfullpath}" > /dev/null 2>&1
 	else
@@ -86,7 +86,7 @@ fn_start_tmux(){
 
 	# Create lockfile
 	date > "${rootdir}/${lockselfname}"
-	cd "${executabledir}"
+	cd "${executabledir}" || exit
 	tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${servicename}" "${executable} ${parms}" 2> "${lgsmlogdir}/.${servicename}-tmux-error.tmp"
 
 	# Create logfile.
@@ -154,7 +154,7 @@ fn_sleep_time
 			echo ""
 			echo "Fix"
 			echo "================================="
-				if [ ! $(grep "tty:" /etc/group|grep "$(whoami)") ]; then
+				if [ ! "$(grep "tty:" /etc/group|grep "$(whoami)")" ]; then
 					echo "$(whoami) is not part of the tty group."
 					fn_script_log_info "$(whoami) is not part of the tty group."
 					group=$(grep tty /etc/group)

+ 1 - 1
lgsm/functions/command_update_functions.sh

@@ -10,4 +10,4 @@ functionfile="${FUNCNAME}"
 fn_fetch_function
 }
 
-command_update_linuxgsm.sh
+command_update_linuxgsm.sh

+ 2 - 2
lgsm/functions/core_dl.sh

@@ -34,7 +34,7 @@ fn_clear_tmp(){
 			fn_print_error_eol_nl
 			fn_script_log_error "clearing LinuxGSM tmp directory"
 		fi
-	fi	
+	fi
 }
 
 fn_dl_md5(){
@@ -260,4 +260,4 @@ curlpath=$(command -v curl 2>/dev/null)
 if [ "$(basename "${curlpath}")" != "curl" ]; then
 	echo "[ FAIL ] Curl is not installed"
 	exit 1
-fi
+fi

+ 1 - 1
lgsm/functions/core_trap.sh

@@ -10,4 +10,4 @@ fn_exit_trap(){
 }
 
 # trap to give an exit code.
-trap fn_exit_trap INT
+trap fn_exit_trap INT

+ 1 - 1
lgsm/functions/fix_ark.sh

@@ -11,4 +11,4 @@ fi
 
 if [ ! -d "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ]; then
 	ln -s "$HOME/Steam/steamapps/" "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps"
-fi
+fi

+ 1 - 1
lgsm/functions/fix_arma3.sh

@@ -14,4 +14,4 @@ if [ ! -d "${HOME}/.local/share/Arma 3" ]||[ ! -d "${HOME}/.local/share/Arma 3 -
 	fn_fix_msg_start
 	mkdir -p "${HOME}/.local/share/Arma 3 - Other Profiles"
 	fn_fix_msg_end
-fi
+fi

+ 1 - 1
lgsm/functions/fix_ges.sh

@@ -8,4 +8,4 @@ local commandname="FIX"
 local commandaction="Fix"
 
 # Fixes: MALLOC_CHECK_ needing to be set to 0.
-export MALLOC_CHECK_=0
+export MALLOC_CHECK_=0

+ 1 - 1
lgsm/functions/fix_kf.sh

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

+ 1 - 1
lgsm/functions/fix_rw.sh

@@ -7,4 +7,4 @@
 local commandname="FIX"
 local commandaction="Fix"
 
-export LD_LIBRARY_PATH="${serverfiles}/linux64:${serverfiles}:$LD_LIBRARY_PATH"
+export LD_LIBRARY_PATH="${serverfiles}/linux64:${serverfiles}:$LD_LIBRARY_PATH"

+ 1 - 1
lgsm/functions/fix_sdtd.sh

@@ -7,4 +7,4 @@
 local commandname="FIX"
 local commandaction="Fix"
 
-export LD_LIBRARY_PATH="${serverfiles}"
+export LD_LIBRARY_PATH="${serverfiles}"

+ 1 - 1
lgsm/functions/fix_ut.sh

@@ -11,4 +11,4 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 #Set Binary Executable
 echo "chmod +x ${executabledir}/${executable}"
 chmod +x "${executabledir}/${executable}"
-fn_sleep_time
+fn_sleep_time

+ 1 - 1
lgsm/functions/fix_ut2k4.sh

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

+ 2 - 2
lgsm/functions/info_distro.sh

@@ -235,9 +235,9 @@ fi
 if [ "$(command -v jq 2>/dev/null)" ]; then
 	if [ "${ip}" ]&&[ "${port}" ]; then
 		if [ "${steammaster}" == "true" ]; then
-			masterserver=$(${curlpath} -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${ip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l)
+			masterserver="$(${curlpath} -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${ip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l)"
 			if [ "${masterserver}" == "0" ]; then
-				masterserver=$(${curlpath} -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${extip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l)
+				masterserver="$(${curlpath} -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${extip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l)"
 			fi
 			if [ "${masterserver}" == "0" ]; then
 				displaymasterserver="false"

+ 34 - 34
lgsm/functions/info_messages.sh

@@ -1228,85 +1228,87 @@ fn_info_message_soldat() {
 
 fn_info_message_select_engine(){
 	# Display details depending on game or engine.
-	if [ "${gamename}" == "7 Days To Die" ]; then
+	if [ "${shortname}" == "sdtd" ]; then
 		fn_info_message_sdtd
-	elif [ "${gamename}" == "ARK: Survival Evolved" ]; then
+	elif [ "${shortname}" == "ark" ]; then
 		fn_info_message_ark
-	elif [ "${gamename}" == "Ballistic Overkill" ]; then
+	elif [ "${shortname}" == "bo" ]; then
 		fn_info_message_ballisticoverkill
-	elif [ "${gamename}" == "Barotrauma" ]; then
+	elif [ "${shortname}" == "bt" ]; then
 		fn_info_message_barotrauma
-	elif [ "${gamename}" == "Battalion 1944" ]; then
+	elif [ "${shortname}" == "bt1944" ]; then
 		fn_info_message_battalion1944
-	elif [ "${gamename}" == "Call of Duty" ]; then
+	elif [ "${shortname}" == "cod" ]; then
 		fn_info_message_cod
-	elif [ "${gamename}" == "Call of Duty: United Offensive" ]; then
+	elif [ "${shortname}" == "coduo" ]; then
 		fn_info_message_coduo
-	elif [ "${gamename}" == "Call of Duty 2" ]; then
+	elif [ "${shortname}" == "cod2" ]; then
 		fn_info_message_cod2
-	elif [ "${gamename}" == "Call of Duty 4" ]; then
+	elif [ "${shortname}" == "cod4" ]; then
 		fn_info_message_cod4
-	elif [ "${gamename}" == "Call of Duty: World at War" ]; then
+	elif [ "${shortname}" == "codwaw" ]; then
 		fn_info_message_codwaw
-	elif [ "${gamename}" == "Eco" ]; then
+	elif [ "${shortname}" == "eco" ]; then
 		fn_info_message_eco
-	elif [ "${gamename}" == "ET: Legacy" ]; then
+	elif [ "${shortname}" == "etl" ]; then
 		fn_info_message_etlegacy
-	elif [ "${gamename}" == "Factorio" ]; then
+	elif [ "${shortname}" == "fctr" ]; then
 		fn_info_message_factorio
-	elif [ "${gamename}" == "Hurtworld" ]; then
+	elif [ "${shortname}" == "hw" ]; then
 		fn_info_message_hurtworld
 	elif [ "${shortname}" == "inss" ]; then
 		fn_info_message_inss
-	elif [ "${gamename}" == "Just Cause 2" ]; then
+	elif [ "${shortname}" == "jc2" ]; then
 		fn_info_message_justcause2
-	elif [ "${gamename}" == "Just Cause 3" ]; then
+	elif [ "${shortname}" == "jc3" ]; then
 		fn_info_message_justcause3
 	elif [ "${shortname}" == "kf2" ]; then
 		fn_info_message_kf2
 	elif [ "${shortname}" == "pstbs" ]; then
 		fn_info_message_pstbs
-	elif [ "${gamename}" == "Project Cars" ]; then
+	elif [ "${shortname}" == "pc" ]; then
 		fn_info_message_projectcars
-	elif [ "${gamename}" == "QuakeWorld" ]; then
+	elif [ "${shortname}" == "qw" ]; then
 		fn_info_message_quake
-	elif [ "${gamename}" == "Quake 2" ]; then
+	elif [ "${shortname}" == "q2" ]; then
 		fn_info_message_quake2
-	elif [ "${gamename}" == "Quake 3: Arena" ]; then
+	elif [ "${shortname}" == "q3" ]; then
 		fn_info_message_quake3
-	elif [ "${gamename}" == "Quake Live" ]; then
+	elif [ "${shortname}" == "ql" ]; then
 		fn_info_message_quakelive
-	elif [ "${gamename}" == "San Andreas Multiplayer" ]; then
+	elif [ "${shortname}" == "samp" ]; then
 		fn_info_message_samp
-	elif [ "${gamename}" == "Squad" ]; then
+	elif [ "${shortname}" == "squad" ]; then
 		fn_info_message_squad
-	elif [ "${gamename}" == "Stationeers" ]; then
+	elif [ "${shortname}" == "st" ]; then
 		fn_info_message_stationeers
+	elif [ "${shortname}" == "sof2" ]; then
+	  fn_info_message_sof2
 	elif [ "${shortname}" == "sol" ]; then
 		fn_info_message_soldat
 	elif [ "${shortname}" == "sbots" ]; then
 		fn_info_message_sbots
-	elif [ "${gamename}" == "TeamSpeak 3" ]; then
+	elif [ "${shortname}" == "ts3" ]; then
 		fn_info_message_teamspeak3
-	elif [ "${gamename}" == "Tower Unite" ]; then
+	elif [ "${shortname}" == "tu" ]; then
 		fn_info_message_towerunite
 	elif [ "${shortname}" == "unt" ]; then
 		fn_info_message_unturned
 	elif [ "${shortname}" == "mh" ]; then
 		fn_info_message_mordhau
-	elif [ "${gamename}" == "Multi Theft Auto" ]; then
+	elif [ "${shortname}" == "mta" ]; then
 		fn_info_message_mta
-	elif [ "${gamename}" == "Mumble" ]; then
+	elif [ "${shortname}" == "mumble" ]; then
 		fn_info_message_mumble
-	elif [ "${gamename}" == "Return to Castle Wolfenstein" ]; then
+	elif [ "${shortname}" == "rtcw" ]; then
 		fn_info_message_rtcw
-	elif [ "${gamename}" == "Rust" ]; then
+	elif [ "${shortname}" == "rust" ]; then
 		fn_info_message_rust
-	elif [ "${gamename}" == "Wurm Unlimited" ]; then
+	elif [ "${shortname}" == "wurm" ]; then
 		fn_info_message_wurmunlimited
 	elif [ "${shortname}" == "rw" ]; then
 		fn_info_message_risingworld
-	elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
+	elif [ "${shortname}" == "wet" ]; then
 		fn_info_message_wolfensteinenemyterritory
 	elif [ "${engine}" == "refractor" ]; then
 		fn_info_message_refractor
@@ -1324,8 +1326,6 @@ fn_info_message_select_engine(){
 		fn_info_message_seriousengine35
 	elif [ "${engine}" == "source" ]; then
 		fn_info_message_source
-	elif [ "${gamename}" == "Soldier Of Fortune 2: Gold Edition" ]; then
-	  fn_info_message_sof2
 	elif [ "${engine}" == "spark" ]; then
 		fn_info_message_spark
 	elif [ "${engine}" == "starbound" ]; then

+ 90 - 102
lgsm/functions/install_config.sh

@@ -40,10 +40,10 @@ fn_default_config_remote(){
 		if [ "${config}" == "${servercfgdefault}" ]; then
 			mkdir -p "${servercfgdir}"
 			cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}"
-		elif [ "${gamename}" == "ARMA 3" ]&&[ "${config}" == "${networkcfgdefault}" ]; then
+		elif [ "${shortname}" == "arma3" ]&&[ "${config}" == "${networkcfgdefault}" ]; then
 			mkdir -p "${servercfgdir}"
 			cp -nv "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}"
-		elif [ "${gamename}" == "Don't Starve Together" ]&&[ "${config}" == "${clustercfgdefault}" ]; then
+		elif [ "${shortname}" == "dst" ]&&[ "${config}" == "${clustercfgdefault}" ]; then
 			cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}"
 		else
 			mkdir -p "${servercfgdir}"
@@ -144,514 +144,502 @@ fn_set_dst_config_vars(){
 	echo ""
 }
 
-if [ "${gamename}" == "7 Days To Die" ]; then
+if [ "${shortname}" == "sdtd" ]; then
 	gamedirname="7DaysToDie"
 	fn_default_config_local
-elif [ "${gamename}" == "Action half-life" ]; then
+elif [ "${shortname}" == "ahl" ]; then
 	gamedirname="ActionHalfLife"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "ARK: Survival Evolved" ]; then
+elif [ "${shortname}" == "ark" ]; then
 	gamedirname="ARKSurvivalEvolved"
 	fn_check_cfgdir
 	array_configs+=( GameUserSettings.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "ARMA 3" ]; then
+elif [ "${shortname}" == "arma3" ]; then
 	gamedirname="Arma3"
 	fn_check_cfgdir
 	array_configs+=( server.cfg network.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Ballistic Overkill" ]; then
+elif [ "${shortname}" == "bo" ]; then
 	gamedirname="BallisticOverkill"
 	array_configs+=( config.txt )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Base Defense" ]; then
+elif [ "${shortname}" == "bo" ]; then
 	gamedirname="BaseDefense"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Barotrauma" ]; then
+elif [ "${shortname}" == "bt" ]; then
 	gamedirname="Barotrauma"
 	fn_check_cfgdir
 	array_configs+=( serversettings.xml )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Battalion 1944" ]; then
+elif [ "${shortname}" == "Battalion 1944" ]; then
 	gamedirname="Battalion1944"
 	fn_check_cfgdir
 	array_configs+=( DefaultGame.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Battlefield: 1942" ]; then
+elif [ "${shortname}" == "bt1942" ]; then
 	gamedirname="Battlefield1942"
 	array_configs+=( serversettings.con )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Blade Symphony" ]; then
+elif [ "${shortname}" == "bs" ]; then
 	gamedirname="BladeSymphony"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "BrainBread" ]; then
+elif [ "${shortname}" == "bb" ]; then
 	gamedirname="BrainBread"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "BrainBread 2" ]; then
+elif [ "${shortname}" == "bb2" ]; then
 	gamedirname="BrainBread2"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Black Mesa: Deathmatch" ]; then
+elif [ "${shortname}" == "bmdm" ]; then
 	gamedirname="BlackMesa"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Call of Duty" ]; then
+elif [ "${shortname}" == "cod" ]; then
 	gamedirname="CallOfDuty"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Call of Duty: United Offensive" ]; then
+elif [ "${shortname}" == "coduo" ]; then
 	gamedirname="CallOfDutyUnitedOffensive"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Call of Duty 2" ]; then
+elif [ "${shortname}" == "cod2" ]; then
 	gamedirname="CallOfDuty2"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Call of Duty 4" ]; then
+elif [ "${shortname}" == "cod4" ]; then
 	gamedirname="CallOfDuty4"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Call of Duty: World at War" ]; then
+elif [ "${shortname}" == "codwaw" ]; then
 	gamedirname="CallOfDutyWorldAtWar"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Codename CURE" ]; then
+elif [ "${shortname}" == "cc" ]; then
 	gamedirname="CodenameCURE"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Counter-Strike 1.6" ]; then
+elif [ "${shortname}" == "cs" ]; then
 	gamedirname="CounterStrike"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Counter-Strike: Condition Zero" ]; then
+elif [ "${shortname}" == "cscz" ]; then
 	gamedirname="CounterStrikeConditionZero"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Counter-Strike: Global Offensive" ]; then
+elif [ "${shortname}" == "csgo" ]; then
 	gamedirname="CounterStrikeGlobalOffensive"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Classic Offensive" ]; then
-	gamedirname="ClassicOffensive"
-	array_configs+=( server.cfg )
-	fn_fetch_default_config
-	fn_default_config_remote
-	fn_set_config_vars
-elif [ "${gamename}" == "Counter-Strike: Source" ]; then
+elif [ "${shortname}" == "css" ]; then
 	gamedirname="CounterStrikeSource"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Day of Defeat" ]; then
+elif [ "${shortname}" == "dod" ]; then
 	gamedirname="DayOfDefeat"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Day of Defeat: Source" ]; then
+elif [ "${shortname}" == "dods" ]; then
 	gamedirname="DayOfDefeatSource"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Day of Infamy" ]; then
+elif [ "${shortname}" == "doi" ]; then
 	gamedirname="DayOfInfamy"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Deathmatch Classic" ]; then
+elif [ "${shortname}" == "dmc" ]; then
 	gamedirname="DeathmatchClassic"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Don't Starve Together" ]; then
+elif [ "${shortname}" == "dst" ]; then
 	gamedirname="DontStarveTogether"
 	fn_check_cfgdir
 	array_configs+=( cluster.ini server.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_dst_config_vars
-elif [ "${gamename}" == "Double Action: Boogaloo" ]; then
+elif [ "${shortname}" == "dab" ]; then
 	gamedirname="DoubleActionBoogaloo"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Dystopia" ]; then
+elif [ "${shortname}" == "dys" ]; then
 	gamedirname="Dystopia"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Eco" ]; then
+elif [ "${shortname}" == "eco" ]; then
 	gamedirname="Eco"
 	array_configs+=( Network.eco )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "ET: Legacy" ]; then
+elif [ "${shortname}" == "etl" ]; then
 	gamedirname="ETLegacy"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Factorio" ]; then
+elif [ "${shortname}" == "fctr" ]; then
 	gamedirname="Factorio"
 	array_configs+=( server-settings.json )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Fistful of Frags" ]; then
+elif [ "${shortname}" == "fof" ]; then
 	gamedirname="FistfulofFrags"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Garry's Mod" ]; then
+elif [ "${shortname}" == "gmod" ]; then
 	gamedirname="GarrysMod"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "GoldenEye: Source" ]; then
+elif [ "${shortname}" == "ges" ]; then
 	gamedirname="GoldenEyeSource"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Half Life: Deathmatch" ]; then
+elif [ "${shortname}" == "hldm" ]; then
 	gamedirname="HalfLifeDeathmatch"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Half-Life Deathmatch: Source" ]; then
+elif [ "${shortname}" == "hldms" ]; then
 	gamedirname="HalfLifeDeathmatchSource"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Half-Life: Opposing Force" ]; then
+elif [ "${shortname}" == "opfor" ]; then
 	gamedirname="OpposingForce"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Half Life 2: Deathmatch" ]; then
+elif [ "${shortname}" == "hl2dm" ]; then
 	gamedirname="HalfLife2Deathmatch"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Insurgency" ]; then
+elif [ "${shortname}" == "ins" ]; then
 	gamedirname="Insurgency"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "IOSoccer" ]; then
+elif [ "${shortname}" == "ios" ]; then
 	gamedirname="IOSoccer"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Just Cause 2" ]; then
+elif [ "${shortname}" == "jc2" ]; then
 	gamedirname="JustCause2"
 	array_configs+=( config.lua )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Just Cause 3" ]; then
+elif [ "${shortname}" == "jc3" ]; then
 	gamedirname="JustCause3"
 	array_configs+=( config.json )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Killing Floor" ]; then
+elif [ "${shortname}" == "kf" ]; then
 	gamedirname="KillingFloor"
 	array_configs+=( Default.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Left 4 Dead" ]; then
-	gamedirname="Left4Dead"
-	array_configs+=( server.cfg )
-	fn_fetch_default_config
-	fn_default_config_remote
-	fn_set_config_vars
-elif [ "${gamename}" == "Left 4 Dead" ]; then
+elif [ "${shortname}" == "l4d" ]; then
 	gamedirname="Left4Dead"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Left 4 Dead 2" ]; then
+elif [ "${shortname}" == "l4d2" ]; then
 	gamedirname="Left4Dead2"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Minecraft" ]; then
+elif [ "${shortname}" == "mc" ]; then
 	gamedirname="Minecraft"
 	array_configs+=( server.properties )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "MORDHAU" ]; then
+elif [ "${shortname}" == "mh" ]; then
 	gamedirname="Mordhau"
 	fn_check_cfgdir
 	array_configs+=( Game.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Natural Selection" ]; then
+elif [ "${shortname}" == "ns" ]; then
 	gamedirname="NaturalSelection"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "No More Room in Hell" ]; then
+elif [ "${shortname}" == "nmrih" ]; then
 	gamedirname="NoMoreRoominHell"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Nuclear Dawn" ]; then
+elif [ "${shortname}" == "nd" ]; then
 	gamedirname="NuclearDawn"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Multi Theft Auto" ]; then
+elif [ "${shortname}" == "mta" ]; then
 	gamedirname="MultiTheftAuto"
 	fn_check_cfgdir
 	array_configs+=( acl.xml mtaserver.conf vehiclecolors.conf )
 	fn_fetch_default_config
 	fn_default_config_remote
-elif [ "${gamename}" == "Mumble" ]; then
+elif [ "${shortname}" == "mumble" ]; then
 	gamedirname="Mumble"
 	array_configs+=( murmur.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
-elif [ "${gamename}" == "Pirates, Vikings, and Knights II" ]; then
+elif [ "${shortname}" == "pvkii" ]; then
 	gamedirname="PiratesVikingandKnightsII"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Project Zomboid" ]; then
+elif [ "${shortname}" == "pz" ]; then
 	gamedirname="ProjectZomboid"
 	fn_check_cfgdir
 	array_configs+=( server.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Project Cars" ]; then
+elif [ "${shortname}" == "pc" ]; then
 	gamedirname="ProjectCars"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Quake 2" ]; then
+elif [ "${shortname}" == "q2" ]; then
 	gamedirname="Quake2"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Quake 3: Arena" ]; then
+elif [ "${shortname}" == "q3" ]; then
 	gamedirname="Quake3Arena"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Quake Live" ]; then
+elif [ "${shortname}" == "ql" ]; then
 	gamedirname="QuakeLive"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "QuakeWorld" ]; then
+elif [ "${shortname}" == "qw" ]; then
 	gamedirname="QuakeWorld"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Ricochet" ]; then
+elif [ "${shortname}" == "ricochet" ]; then
 	gamedirname="Ricochet"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Return to Castle Wolfenstein" ]; then
+elif [ "${shortname}" == "rtcw" ]; then
 	gamedirname="ReturnToCastleWolfenstein"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Rust" ]; then
+elif [ "${shortname}" == "rust" ]; then
 	gamedirname="Rust"
 	fn_check_cfgdir
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-elif [ "${gamename}" == "San Andreas Multiplayer" ]; then
+elif [ "${shortname}" == "samp" ]; then
 	gamedirname="SanAndreasMultiplayer"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then
+elif [ "${shortname}" == "ss3" ]; then
 	gamedirname="SeriousSam3BFE"
 	array_configs+=( server.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Soldat" ]; then
+elif [ "${shortname}" == "sol" ]; then
 	gamedirname="Soldat"
 	array_configs+=( soldat.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Soldier Of Fortune 2: Gold Edition" ]; then
+elif [ "${shortname}" == "sof2" ]; then
 	gamedirname="SoldierOfFortune2Gold"
 	array_configs+=( server.cfg mapcycle.txt)
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "SourceForts Classic" ]; then
+elif [ "${shortname}" == "sfc" ]; then
 	gamedirname="SourceFortsClassic"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Squad" ]; then
+elif [ "${shortname}" == "squad" ]; then
 	gamedirname="Squad"
 	array_configs+=( Admins.cfg Bans.cfg License.cfg Server.cfg Rcon.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Starbound" ]; then
+elif [ "${shortname}" == "sb" ]; then
 	gamedirname="Starbound"
 	array_configs+=( starbound_server.config )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Stationeers" ]; then
+elif [ "${shortname}" == "st" ]; then
 	gamedirname="Stationeers"
 	array_configs+=( default.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Sven Co-op" ]; then
+elif [ "${shortname}" == "sven" ]; then
 	gamedirname="SvenCoop"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Team Fortress 2" ]; then
+elif [ "${shortname}" == "tf2" ]; then
 	gamedirname="TeamFortress2"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Team Fortress Classic" ]; then
+elif [ "${shortname}" == "tfc" ]; then
 	gamedirname="TeamFortressClassic"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "The Specialists" ]; then
+elif [ "${shortname}" == "ts" ]; then
 	gamedirname="TheSpecialists"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "TeamSpeak 3" ]; then
+elif [ "${shortname}" == "ts3" ]; then
 	gamedirname="TeamSpeak3"
 	array_configs+=( ts3server.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
-elif [ "${gamename}" == "Teeworlds" ]; then
+elif [ "${shortname}" == "tw" ]; then
 	gamedirname="Teeworlds"
 	array_configs+=( server.cfg ctf.cfg dm.cfg duel.cfg tdm.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Terraria" ]; then
+elif [ "${shortname}" == "terraria" ]; then
 	gamedirname="Terraria"
 	array_configs+=( serverconfig.txt )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Tower Unite" ]; then
+elif [ "${shortname}" == "tu" ]; then
 	gamedirname="TowerUnite"
 	fn_check_cfgdir
 	array_configs+=( TowerServer.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Unreal Tournament" ]; then
+elif [ "${shortname}" == "ut" ]; then
 	gamedirname="UnrealTournament"
 	array_configs+=( Game.ini Engine.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Unreal Tournament 2004" ]; then
+elif [ "${shortname}" == "ut2k4" ]; then
 	gamedirname="UnrealTournament2004"
 	array_configs+=( UT2004.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Unreal Tournament 99" ]; then
+elif [ "${shortname}" == "ut99" ]; then
 	gamedirname="UnrealTournament99"
 	array_configs+=( Default.ini )
 	fn_fetch_default_config
@@ -663,31 +651,31 @@ elif [ "${shortname}" == "unt" ]; then
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Vampire Slayer" ]; then
+elif [ "${shortname}" == "vs" ]; then
 	gamedirname="VampireSlayer"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
+elif [ "${shortname}" == "wet" ]; then
 	gamedirname="WolfensteinEnemyTerritory"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Wurm Unlimited" ]; then
+elif [ "${shortname}" == "wurm" ]; then
 	gamedirname="WurmUnlimited"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Zombie Master: Reborn" ]; then
+elif [ "${shortname}" == "zmr" ]; then
 	gamedirname="ZombieMasterReborn"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
-elif [ "${gamename}" == "Zombie Panic! Source" ]; then
+elif [ "${shortname}" == "zps" ]; then
 	gamedirname="ZombiePanicSource"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config

+ 1 - 1
lgsm/functions/install_server_dir.sh

@@ -24,4 +24,4 @@ if [ -z "${autoinstall}" ]; then
 fi
 if [ ! -d "${serverfiles}" ]; then
 	mkdir -v "${serverfiles}"
-fi
+fi

+ 1 - 1
lgsm/functions/install_server_files.sh

@@ -72,7 +72,7 @@ fn_install_server_files_steamcmd(){
 	counter="0"
 	while [ "${counter}" == "0" ]||[ "${exitcode}" != "0" ]; do
 		counter=$((counter+1))
-		cd "${steamcmddir}"
+		cd "${steamcmddir}" || exit
 		if [ "${counter}" -le "10" ]; then
 			# Attempt 1-4: Standard attempt.
 			# Attempt 5-6: Validate attempt.

+ 1 - 1
lgsm/functions/install_squad_license.sh

@@ -23,4 +23,4 @@ echo ""
 fn_sleep_time
 echo "The Squad server license can be changed by editing ${servercfgdir}/License.cfg."
 fn_script_log_info "The Squad server license can be changed by editing ${selfname}."
-echo ""
+echo ""

+ 2 - 2
lgsm/functions/logs.sh

@@ -28,7 +28,7 @@ if [ "${status}" != "0" ]&&[ "${function_selfname}" == "command_start.sh" ]&&[ -
 fi
 
 # Log manager will start the cleanup if it finds logs older than "${logdays}".
-if [ $(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l) -ne "0" ]; then
+if [ "$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l)" -ne "0" ]; then
 	fn_print_dots "Starting"
 	# Set common logs directories
 	commonlogs="${systemdir}/logs"
@@ -81,7 +81,7 @@ if [ $(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l) -ne "0" ]; th
 			find "${sourcemodlogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \;
 		fi
 		# Garry's Mod logfiles.
-		if [ "${gamename}" == "Garry's Mod" ]; then
+		if [ "${shortname}" == "gmod" ]; then
 			# ULX logfiles.
 			if [ -d "${ulxlogdir}" ]; then
 				find "${ulxlogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}"

+ 1 - 1
lgsm/functions/mods_core.sh

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

+ 1 - 1
lgsm/functions/query_gamedig.sh

@@ -10,7 +10,7 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ];
 
 		if [ "${engine}" == "idtech3_ql" ]; then
 			local engine="quakelive"
-		elif [ "${gamename}" == "Killing Floor 2" ]; then
+		elif [ "${shortname}" == "kf2" ]; then
 			local engine="unreal4"
 		fi
 

+ 1 - 1
linuxgsm.sh

@@ -151,7 +151,7 @@ fn_install_menu_bash() {
 	while read -r line || [[ -n "${line}" ]]; do
 		var=$(echo "${line}" | awk -F "," '{print $2 " - " $3}')
 		menu_options+=( "${var}" )
-	done <  ${options}
+	done < "${options}"
 	menu_options+=( "Cancel" )
 	select option in "${menu_options[@]}"; do
 		if [ -n "${option}" ]&&[ "${option}" != "Cancel" ]; then

+ 1 - 1
tests/tests_fctrserver.sh

@@ -162,7 +162,7 @@ fn_install_menu_bash() {
 	while read -r line || [[ -n "${line}" ]]; do
 		var=$(echo "${line}" | awk -F "," '{print $2 " - " $3}')
 		menu_options+=( "${var}" )
-	done <  ${options}
+	done < "${options}"
 	menu_options+=( "Cancel" )
 	select option in "${menu_options[@]}"; do
 		if [ -n "${option}" ]&&[ "${option}" != "Cancel" ]; then

+ 1 - 1
tests/tests_jc2server.sh

@@ -160,7 +160,7 @@ fn_install_menu_bash() {
 	while read -r line || [[ -n "${line}" ]]; do
 		var=$(echo "${line}" | awk -F "," '{print $2 " - " $3}')
 		menu_options+=( "${var}" )
-	done <  ${options}
+	done < "${options}"
 	menu_options+=( "Cancel" )
 	select option in "${menu_options[@]}"; do
 		if [ -n "${option}" ]&&[ "${option}" != "Cancel" ]; then

+ 1 - 1
tests/tests_mcserver.sh

@@ -160,7 +160,7 @@ fn_install_menu_bash() {
 	while read -r line || [[ -n "${line}" ]]; do
 		var=$(echo "${line}" | awk -F "," '{print $2 " - " $3}')
 		menu_options+=( "${var}" )
-	done <  ${options}
+	done < "${options}"
 	menu_options+=( "Cancel" )
 	select option in "${menu_options[@]}"; do
 		if [ -n "${option}" ]&&[ "${option}" != "Cancel" ]; then

+ 1 - 1
tests/tests_ts3server.sh

@@ -160,7 +160,7 @@ fn_install_menu_bash() {
 	while read -r line || [[ -n "${line}" ]]; do
 		var=$(echo "${line}" | awk -F "," '{print $2 " - " $3}')
 		menu_options+=( "${var}" )
-	done <  ${options}
+	done < "${options}"
 	menu_options+=( "Cancel" )
 	select option in "${menu_options[@]}"; do
 		if [ -n "${option}" ]&&[ "${option}" != "Cancel" ]; then

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно