Daniel Gibbs 10 лет назад
Родитель
Сommit
46941def99
73 измененных файлов с 174 добавлено и 191 удалено
  1. 1 1
      functions/command_update_functions.sh
  2. 5 7
      lgsm/functions/alert.sh
  3. 3 3
      lgsm/functions/alert_email.sh
  4. 2 2
      lgsm/functions/alert_pushbullet.sh
  5. 11 13
      lgsm/functions/check.sh
  6. 2 2
      lgsm/functions/check_config.sh
  7. 5 7
      lgsm/functions/check_deps.sh
  8. 2 4
      lgsm/functions/check_glibc.sh
  9. 2 2
      lgsm/functions/check_ip.sh
  10. 2 2
      lgsm/functions/check_logs.sh
  11. 8 10
      lgsm/functions/check_permissions.sh
  12. 2 2
      lgsm/functions/check_root.sh
  13. 3 3
      lgsm/functions/check_status.sh
  14. 4 6
      lgsm/functions/check_steamcmd.sh
  15. 2 2
      lgsm/functions/check_system_dir.sh
  16. 2 2
      lgsm/functions/check_tmux.sh
  17. 2 2
      lgsm/functions/command_backup.sh
  18. 4 4
      lgsm/functions/command_console.sh
  19. 2 2
      lgsm/functions/command_debug.sh
  20. 2 2
      lgsm/functions/command_details.sh
  21. 3 3
      lgsm/functions/command_dev_debug.sh
  22. 3 3
      lgsm/functions/command_dev_detect_deps.sh
  23. 3 3
      lgsm/functions/command_fastdl.sh
  24. 3 3
      lgsm/functions/command_install.sh
  25. 2 2
      lgsm/functions/command_monitor.sh
  26. 2 2
      lgsm/functions/command_restart.sh
  27. 2 2
      lgsm/functions/command_start.sh
  28. 2 2
      lgsm/functions/command_stop.sh
  29. 2 2
      lgsm/functions/command_test_alert.sh
  30. 2 2
      lgsm/functions/command_ts3_server_pass.sh
  31. 2 2
      lgsm/functions/command_update.sh
  32. 1 1
      lgsm/functions/command_update_functions.sh
  33. 2 2
      lgsm/functions/command_validate.sh
  34. 1 1
      lgsm/functions/compress_unreal2_maps.sh
  35. 1 1
      lgsm/functions/compress_ut99_maps.sh
  36. 2 2
      lgsm/functions/core_dl.sh
  37. 6 6
      lgsm/functions/core_exit.sh
  38. 1 1
      lgsm/functions/core_getopt.sh
  39. 1 1
      lgsm/functions/core_messages.sh
  40. 4 5
      lgsm/functions/fix.sh
  41. 2 2
      lgsm/functions/fix_arma3.sh
  42. 2 2
      lgsm/functions/fix_csgo.sh
  43. 2 2
      lgsm/functions/fix_dst.sh
  44. 2 2
      lgsm/functions/fix_glibc.sh
  45. 2 4
      lgsm/functions/fix_ins.sh
  46. 2 2
      lgsm/functions/fix_kf.sh
  47. 2 2
      lgsm/functions/fix_ro.sh
  48. 2 2
      lgsm/functions/fix_steamcmd.sh
  49. 2 2
      lgsm/functions/fix_ut2k4.sh
  50. 2 2
      lgsm/functions/fix_ut99.sh
  51. 1 1
      lgsm/functions/fn_functions
  52. 1 1
      lgsm/functions/fn_getopt
  53. 1 1
      lgsm/functions/fn_update_functions
  54. 1 1
      lgsm/functions/info_config.sh
  55. 1 1
      lgsm/functions/info_distro.sh
  56. 1 1
      lgsm/functions/info_glibc.sh
  57. 1 1
      lgsm/functions/info_parms.sh
  58. 2 2
      lgsm/functions/install_complete.sh
  59. 2 2
      lgsm/functions/install_config.sh
  60. 2 2
      lgsm/functions/install_gslt.sh
  61. 2 2
      lgsm/functions/install_gsquery.sh
  62. 2 2
      lgsm/functions/install_header.sh
  63. 2 2
      lgsm/functions/install_logs.sh
  64. 2 2
      lgsm/functions/install_retry.sh
  65. 3 3
      lgsm/functions/install_server_dir.sh
  66. 2 2
      lgsm/functions/install_server_files.sh
  67. 2 2
      lgsm/functions/install_steamcmd.sh
  68. 3 3
      lgsm/functions/install_ts3db.sh
  69. 2 2
      lgsm/functions/install_ut2k4_key.sh
  70. 2 4
      lgsm/functions/logs.sh
  71. 2 2
      lgsm/functions/monitor_gsquery.sh
  72. 3 3
      lgsm/functions/update_steamcmd.sh
  73. 3 3
      lgsm/functions/update_ts3.sh

+ 1 - 1
functions/command_update_functions.sh

@@ -6,7 +6,7 @@ lgsm_version="210516"
 
 # Description: Deletes the functions dir to allow re-downloading of functions from GitHub.
 
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 check.sh
 fn_print_dots "Updating functions"
 fn_script_log "Updating functions"

+ 5 - 7
lgsm/functions/alert.sh

@@ -4,10 +4,8 @@
 # Website: https://gameservermanagers.com
 # Description: Overall function for managing alerts.
 
-local commandnane="ALERT"
+local commandname="ALERT"
 local commandaction="Alert"
-# Cannot have selfname as breaks the function.
-#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 fn_alert_test(){
 	fn_script_log_info "Sending test alert"
@@ -45,20 +43,20 @@ fi
 
 if [ "${emailnotification}" == "on" ]||[ "${emailalert}" == "on" ]&&[ -n "${email}" ]; then
 	alert_email.sh
-elif [ "${emailnotification}" != "on" ]||[ "${emailalert}" != "on" ]&&[ "${selfname}" == "command_test_alert.sh" ]; then
+elif [ "${emailnotification}" != "on" ]||[ "${emailalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 	fn_print_warn_nl "Email alerts not enabled"
 	fn_script_log_warn "Email alerts not enabled"
-elif [ -z "${email}" ]&&[ "${selfname}" == "command_test_alert.sh" ]; then
+elif [ -z "${email}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 	fn_print_error_nl "Email not set"
 	fn_script_log_error "Email not set"
 fi
 
 if [ "${pushbulletalert}" == "on" ]&&[ -n "${pushbullettoken}" ]; then
 	alert_pushbullet.sh
-elif [ "${pushbulletalert}" != "on" ]&&[ "${selfname}" == "command_test_alert.sh" ]; then
+elif [ "${pushbulletalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 	fn_print_warn_nl "Pushbullet alerts not enabled"
 	fn_script_log_warn "Pushbullet alerts not enabled"
-elif [ -z "${pushbullettoken}" ]&&[ "${selfname}" == "command_test_alert.sh" ]; then
+elif [ -z "${pushbullettoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
 	fn_print_error_nl "Pushbullet token not set"
 	fn_script_error_warn "Pushbullet token not set"
 fi

+ 3 - 3
lgsm/functions/alert_email.sh

@@ -1,12 +1,12 @@
 #!/bin/bash
-# LGSM email.sh function
+# LGSM alert_email.sh function
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 # Description: Sends email alert if monitor picks up a failure.
 
-local commandnane="ALERT"
+local commandname="ALERT"
 local commandaction="Alert"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 fn_details_email(){
 	#

+ 2 - 2
lgsm/functions/alert_pushbullet.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: alerts using pushbullet.
 
-local commandnane="ALERT"
+local commandname="ALERT"
 local commandaction="Alert"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 fn_print_dots "Sending Pushbullet alert"
 sleep 1

+ 11 - 13
lgsm/functions/check.sh

@@ -1,14 +1,12 @@
 #!/bin/bash
-# LGSM fn_check function
+# LGSM check.sh function
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 
 # Description: Overall function for managing checks.
 # Runs checks that will either halt on or fix an issue.
 
-local commandnane="CHECK"
-# Cannot have selfname as breaks the function.
-#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local commandname="CHECK"
 
 # Every command that requires checks just references check.sh
 # check.sh selects which checks to run by using arrays
@@ -16,14 +14,14 @@ local commandnane="CHECK"
 check_root.sh
 check_permissions.sh
 
-if [ "${selfname}" != "command_install.sh" ] && [ "${selfname}" != "command_update_functions.sh" ]; then
+if [ "${function_selfname}" != "command_install.sh" ] && [ "${function_selfname}" != "command_update_functions.sh" ]; then
 	check_system_dir.sh
 fi
 
 local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh )
 for allowed_command in "${allowed_commands_array[@]}"
 do
-	if [ "${allowed_command}" == "${selfname}" ]; then
+	if [ "${allowed_command}" == "${function_selfname}" ]; then
 		check_glibc.sh
 	fi
 done
@@ -31,7 +29,7 @@ done
 local allowed_commands_array=( command_backup.sh command_console.sh command_debug.sh command_details.sh command_unreal2_maps.sh command_ut99_maps.sh command_monitor.sh command_start.sh command_stop.sh update_check.sh command_validate.sh command_update_functions.sh command_email_test.sh )
 for allowed_command in "${allowed_commands_array[@]}"
 do
-	if [ "${allowed_command}" == "${selfname}" ]; then
+	if [ "${allowed_command}" == "${function_selfname}" ]; then
 		check_logs.sh
 	fi
 done
@@ -39,7 +37,7 @@ done
 local allowed_commands_array=( command_debug.sh command_start.sh command_stop.sh )
 for allowed_command in "${allowed_commands_array[@]}"
 do
-	if [ "${allowed_command}" == "${selfname}" ]; then
+	if [ "${allowed_command}" == "${function_selfname}" ]; then
 		check_deps.sh
 	fi
 done
@@ -47,7 +45,7 @@ done
 local allowed_commands_array=( command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh )
 for allowed_command in "${allowed_commands_array[@]}"
 do
-	if [ "${allowed_command}" == "${selfname}" ]; then
+	if [ "${allowed_command}" == "${function_selfname}" ]; then
 		check_ip.sh
 	fi
 done
@@ -55,7 +53,7 @@ done
 local allowed_commands_array=( update_check.sh command_debug.sh command_start.sh command_validate.sh )
 for allowed_command in "${allowed_commands_array[@]}"
 do
-	if [ "${allowed_command}" == "${selfname}" ]; then
+	if [ "${allowed_command}" == "${function_selfname}" ]; then
 		if [ -n "${appid}" ]; then
 			check_steamcmd.sh
 		fi
@@ -65,7 +63,7 @@ done
 local allowed_commands_array=( command_console.sh command_start.sh )
 for allowed_command in "${allowed_commands_array[@]}"
 do
-	if [ "${allowed_command}" == "${selfname}" ]; then
+	if [ "${allowed_command}" == "${function_selfname}" ]; then
 		check_tmux.sh
 	fi
 done
@@ -73,7 +71,7 @@ done
 local allowed_commands_array=( command_console.sh command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh )
 for allowed_command in "${allowed_commands_array[@]}"
 do
-	if [ "${allowed_command}" == "${selfname}" ]; then
+	if [ "${allowed_command}" == "${function_selfname}" ]; then
 		check_config.sh
 	fi
 done
@@ -81,7 +79,7 @@ done
 local allowed_commands_array=( command_details.sh command_monitor.sh command_start.sh command_stop.sh command_ts3_server_pass.sh update_check.sh command_details.sh command_validate.sh )
 for allowed_command in "${allowed_commands_array[@]}"
 do
-	if [ "${allowed_command}" == "${selfname}" ]; then
+	if [ "${allowed_command}" == "${function_selfname}" ]; then
 		check_status.sh
 	fi
 done

+ 2 - 2
lgsm/functions/check_config.sh

@@ -4,8 +4,8 @@
 # Website: https://gameservermanagers.com
 # Description: If server config missing warn user.
 
-local commandnane="CHECK"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local commandname="CHECK"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 if [ ! -e "${servercfgfullpath}" ]; then
 	if [ "${gamename}" != "Hurtworld" ]; then

+ 5 - 7
lgsm/functions/check_deps.sh

@@ -4,9 +4,7 @@
 # Website: https://gameservermanagers.com
 # Description: Checks that the requires dependencies are installed for LGSM.
 
-local commandnane="CHECK"
-# Cannot have selfname as breaks the function.
-#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local commandname="CHECK"
 
 fn_deps_detector(){
 	# Checks if dependency is missing
@@ -19,14 +17,14 @@ fn_deps_detector(){
 	fi
 	if [ "${depstatus}" == "0" ]; then
 		missingdep=0
-		if [ "${selfname}" == "command_install.sh" ]; then
+		if [ "${function_selfname}" == "command_install.sh" ]; then
 			echo -e "${green}${deptocheck}${default}"
 			sleep 0.5
 		fi
 	else
 		# if missing dependency is found
 		missingdep=1
-		if [ "${selfname}" == "command_install.sh" ]; then
+		if [ "${function_selfname}" == "command_install.sh" ]; then
 			echo -e "${red}${deptocheck}${default}"
 			sleep 0.5
 		fi
@@ -104,7 +102,7 @@ fn_found_missing_deps(){
 			fi
 			echo ""
 		fi
-		if [ "${selfname}" == "command_install.sh" ]; then
+		if [ "${function_selfname}" == "command_install.sh" ]; then
 			sleep 5
 		fi
 	fi
@@ -123,7 +121,7 @@ fn_check_loop(){
 
 info_distro.sh
 
-if [ "${selfname}" == "command_install.sh" ]; then
+if [ "${function_selfname}" == "command_install.sh" ]; then
 	echo ""
 	echo "Checking Dependecies"
 	echo "================================="

+ 2 - 4
lgsm/functions/check_glibc.sh

@@ -4,9 +4,7 @@
 # Website: https://gameservermanagers.com
 # Description: Checks if server has correct glibc or has a fix available.
 
-local commandnane="CHECK"
-# Cannot have selfname as breaks the function.
-#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local commandname="CHECK"
 
 info_glibc.sh
 info_distro.sh
@@ -21,7 +19,7 @@ elif [ "${glibcrequired}" == "UNKNOWN" ]; then
 		echo -e "	* glibc installed: ${glibcversion}"
 elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then
 	if [ "${glibcfix}" == "yes" ]; then
-		if [ "${selfname}" != "command_install.sh" ]; then
+		if [ "${function_selfname}" != "command_install.sh" ]; then
 			fn_print_dots "Glibc fix"
 			sleep 0.5
 			fn_print_info_nl "Glibc fix: ${green}Using Glibc fix${default}"

+ 2 - 2
lgsm/functions/check_ip.sh

@@ -5,8 +5,8 @@
 # Description: Automatically identifies the server interface IP.
 # If multiple interfaces are detected the user will need to manualy set using ip="0.0.0.0".
 
-local commandnane="CHECK"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local commandname="CHECK"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 if [ "${gamename}" != "Teamspeak 3" ]; then
 	if [ ! -f "/bin/ip" ]; then

+ 2 - 2
lgsm/functions/check_logs.sh

@@ -4,8 +4,8 @@
 # Website: https://gameservermanagers.com
 # Description: Checks that log files exist on server start
 
-local commandnane="CHECK"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local commandname="CHECK"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 # Create dir's for the script and console logs
 if [ ! -d "${scriptlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${gamename}" != "Teamspeak 3" ]; then

+ 8 - 10
lgsm/functions/check_permissions.sh

@@ -5,9 +5,7 @@
 # Website: https://gameservermanagers.com
 # Description: Checks script, files and folders ownership and permissions.
 
-local commandnane="CHECK"
-# Cannot have selfname as breaks the function.
-#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local commandname="CHECK"
 
 # Useful variables
 currentuser="$(whoami)"
@@ -17,12 +15,12 @@ conclusionpermissionerror="0"
 
 fn_check_ownership(){
 	# Check script ownership
-	#if [ ! -O "${scriptfullpath}" ] && [ ! -G "${scriptfullpath}" ]; then
-	#	fn_print_fail_nl "Oops ! Ownership issue..."
-	#	echo "	* Current - ${currentuser} - user or its group(s) - ${currentgroups} - does not own \"${selfname}\""
-	#	echo "	* To check the owner and allowed groups, run ls -l \"${selfname}\""
-	#	exit 1
-	#fi
+	if [ ! -O "${scriptfullpath}" ] && [ ! -G "${scriptfullpath}" ]; then
+		fn_print_fail_nl "Oops ! Ownership issue..."
+		echo "	* Current - ${currentuser} - user or its group(s) - ${currentgroups} - does not own \"${selfname}\""
+		echo "	* To check the owner and allowed groups, run ls -l \"${selfname}\""
+		exit 1
+	fi
 
 	# Check rootdir ownership
 	if [ ! -O "${rootdir}" ] && [ ! -G "${rootdir}" ]; then
@@ -98,4 +96,4 @@ fn_check_permissions_conclusion(){
 
 fn_check_ownership
 fn_check_permissions
-fn_check_permissions_conclusion
+fn_check_permissions_conclusion

+ 2 - 2
lgsm/functions/check_root.sh

@@ -3,8 +3,8 @@
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 
-local commandnane="CHECK"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local commandname="CHECK"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 if [ $(whoami) = "root" ]; then
 	fn_print_fail_nl "Do NOT run this script as root!"

+ 3 - 3
lgsm/functions/check_status.sh

@@ -1,11 +1,11 @@
 #!/bin/bash
-# LGSM check_status function
+# LGSM check_status.sh function
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 # Description: Checks the proccess status of the server. Either online or offline.
 
-local commandnane="CHECK"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local commandname="CHECK"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 if [ "${gamename}" == "Teamspeak 3" ]; then
 	# 1: Server is running

+ 4 - 6
lgsm/functions/check_steamcmd.sh

@@ -4,9 +4,7 @@
 # Website: https://gameservermanagers.com
 # Description: Checks SteamCMD is installed and correct.
 
-local commandnane="CHECK"
-# Cannot have selfname as breaks the function.
-#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local commandname="CHECK"
 
 fn_install_steamcmd(){
 	if [ ! -d "${steamcmddir}" ]; then
@@ -45,7 +43,7 @@ fn_check_steamcmd_sh(){
 	# Installs if missing.
 	steamcmddir="${rootdir}/steamcmd"
 	if [ ! -f "${steamcmddir}/steamcmd.sh" ]; then
-		if [ "${selfname}" == "command_install.sh" ]; then
+		if [ "${function_selfname}" == "command_install.sh" ]; then
 			fn_install_steamcmd
 		else
 			fn_print_error_nl "SteamCMD is missing"
@@ -53,14 +51,14 @@ fn_check_steamcmd_sh(){
 			sleep 1
 			fn_install_steamcmd
 		fi
-	elif [ "${selfname}" == "command_install.sh" ]; then
+	elif [ "${function_selfname}" == "command_install.sh" ]; then
 		fn_print_infomation "SteamCMD is already installed..."
 		fn_print_ok_eol_nl
 	fi
 }
 
 fn_check_steamcmd_guard(){
-	if [ "${selfname}" == "command_update.sh" ]||[ "${selfname}" == "command_validate.sh" ]; then
+	if [ "${function_selfname}" == "command_update.sh" ]||[ "${function_selfname}" == "command_validate.sh" ]; then
 		# Checks that steamcmd is working correctly and will prompt Steam Guard if required.
 		"${steamcmddir}"/steamcmd.sh +login "${steamuser}" "${steampass}" +quit
 		if [ $? -ne 0 ]; then

+ 2 - 2
lgsm/functions/check_system_dir.sh

@@ -3,8 +3,8 @@
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 
-local commandnane="CHECK"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local commandname="CHECK"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 if [ ! -d "${systemdir}" ]; then
 	fn_print_fail_nl "Cannot access ${systemdir}: No such directory"

+ 2 - 2
lgsm/functions/check_tmux.sh

@@ -4,8 +4,8 @@
 # Website: https://gameservermanagers.com
 # Description: Checks if tmux is installed as too many users do not RTFM or know how to use Google.
 
-local commandnane="CHECK"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local commandname="CHECK"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 if [ "$(command -v tmux)" ]||[ "$(which tmux >/dev/null 2>&1)" ]||[ -f "/usr/bin/tmux" ]||[ -f "/bin/tmux" ]; then
 	:

+ 2 - 2
lgsm/functions/command_backup.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Creates a .tar.gz file in the backup directory.
 
-local commandnane="BACKUP"
+local commandname="BACKUP"
 local commandaction="Backup"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 check.sh
 info_distro.sh

+ 4 - 4
lgsm/functions/command_console.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Gives access to the server tmux console.
 
-local commandnane="CONSOLE"
+local commandname="CONSOLE"
 local commandaction="Console"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 check.sh
 echo ""
@@ -29,11 +29,11 @@ sleep 1
 check_status.sh
 if [ "${status}" != "0" ]; then
 	fn_print_ok_nl "Accessing console"
-	fn_script_log_info "Console accessed"
+	fn_script_log_pass "Console accessed"
 	sleep 1
 	tmux attach-session -t ${servicename}
 	fn_print_ok_nl "Closing console"
-	fn_script_log_info "Console closed"
+	fn_script_log_pass "Console closed"
 else
 	fn_print_error_nl "Server not running"
 	fn_script_log_error "Failed to access: Server not running"

+ 2 - 2
lgsm/functions/command_debug.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Runs the server without tmux. Runs direct from the terminal.
 
-local commandnane="DEBUG"
+local commandname="DEBUG"
 local commandaction="Debug"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 # Trap to remove lockfile on quit.
 fn_lockfile_trap(){

+ 2 - 2
lgsm/functions/command_details.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Displays server infomation.
 
-local commandnane="DETAILS"
+local commandname="DETAILS"
 local commandaction="Details"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 # Standard Details
 # This applies to all engines

+ 3 - 3
lgsm/functions/command_dev_debug.sh

@@ -1,12 +1,12 @@
 #!/bin/bash
-# LGSM dev_debug.sh function
+# LGSM command_dev_debug.sh function
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 # Description: Dev only: enables debuging log to be saved to dev-debug.log.
 
-local commandnane="DEV-DEBUG"
+local commandname="DEV-DEBUG"
 local commandaction="Dev-Debug"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 
 if [ -f ".dev-debug" ]; then

+ 3 - 3
lgsm/functions/command_dev_detect_deps.sh

@@ -1,12 +1,12 @@
 #!/bin/bash
-# LGSM fn_dep_detect function
+# LGSM command_dev_detect_deps.sh function
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 # Description: Detects dependencies the server binary requires.
 
-local commandnane="DEPS-DETECT"
+local commandname="DEPS-DETECT"
 local commandaction="Deps-Detect"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 check.sh
 cd "${executabledir}"

+ 3 - 3
lgsm/functions/command_fastdl.sh

@@ -1,13 +1,13 @@
 #!/bin/bash
-# LGSM command_fastdl function
+# LGSM command_fastdl.sh function
 # Author: Daniel Gibbs
 # Contributor: UltimateByte
 # Website: https://gameservermanagers.com
 # Description: Creates a FastDL folder
 
-local commandnane="FASTDL"
+local commandname="FASTDL"
 local commandaction="FastDL"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 check.sh
 

+ 3 - 3
lgsm/functions/command_install.sh

@@ -1,12 +1,12 @@
 #!/bin/bash
-# LGSM fn_install function
+# LGSM command_install.sh function
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 # Description: Overall function for the installer.
 
-local commandnane="INSTALL"
+local commandname="INSTALL"
 local commandaction="Install"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 check.sh
 install_header.sh

+ 2 - 2
lgsm/functions/command_monitor.sh

@@ -5,9 +5,9 @@
 # Description: Monitors server by checking for running proccesses
 # then passes to monitor_gsquery.sh.
 
-local commandnane="MONITOR"
+local commandname="MONITOR"
 local commandaction="Monitor"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 fn_monitor_check_lockfile(){
 	# Monitor does not run it lockfile is not found

+ 2 - 2
lgsm/functions/command_restart.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Starts the server.
 
-local commandnane="RESTART"
+local commandname="RESTART"
 local commandaction="Restarting"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 info_config.sh
 exitbypass=1

+ 2 - 2
lgsm/functions/command_start.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Starts the server.
 
-local commandnane="START"
+local commandname="START"
 local commandaction="Starting"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 fn_start_teamspeak3(){
 	if [ ! -e "${servercfgfullpath}" ]; then

+ 2 - 2
lgsm/functions/command_stop.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Stops the server.
 
-local commandnane="STOP"
+local commandname="STOP"
 local commandaction="Stopping"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 # Attempts Graceful of source using rcon 'quit' command.
 fn_stop_graceful_source(){

+ 2 - 2
lgsm/functions/command_test_alert.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Sends a test email alert.
 
-local commandnane="ALERT"
+local commandname="ALERT"
 local commandaction="Alert"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 fn_print_dots "${servername}"
 sleep 1

+ 2 - 2
lgsm/functions/command_ts3_server_pass.sh

@@ -5,9 +5,9 @@
 # Website: https://gameservermanagers.com
 # Description: Changes TS3 serveradmin password
 
-local commandnane="TS3-CHANGE-PASS"
+local commandname="TS3-CHANGE-PASS"
 local commandaction="TS3 Change Password"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 
 fn_serveradmin_password_prompt(){

+ 2 - 2
lgsm/functions/command_update.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Handles updating of servers.
 
-local commandnane="UPDATE"
+local commandname="UPDATE"
 local commandaction="Update"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 fn_print_dots ""
 sleep 0.5

+ 1 - 1
lgsm/functions/command_update_functions.sh

@@ -5,7 +5,7 @@
 # Description: Deletes the functions dir to allow re-downloading of functions from GitHub.
 
 local commandaction="Update LGSM"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 fn_print_dots "Updating functions"
 sleep 1

+ 2 - 2
lgsm/functions/command_validate.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Runs a server validation.
 
-local commandnane="VALIDATE"
+local commandname="VALIDATE"
 local commandaction="Validate"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 fn_validation(){
 	echo -e "	* Validating may overwrite some customised files."

+ 1 - 1
lgsm/functions/compress_unreal2_maps.sh

@@ -5,7 +5,7 @@
 # Description: compresses unreal maps
 
 local commandaction="Unreal Map Compressor"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 check.sh
 clear

+ 1 - 1
lgsm/functions/compress_ut99_maps.sh

@@ -5,7 +5,7 @@
 # Description: compresses unreal maps
 
 local commandaction="Unreal Map Compressor"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 check.sh
 clear

+ 2 - 2
lgsm/functions/core_dl.sh

@@ -16,9 +16,9 @@
 # fn_fetch_file "${fileurl}" "${filedir}" "${filename}" "${executecmd}" "${run}" "${force}" "${md5}"
 # fn_fetch_file "http://example.com/file.tar.bz2" "/some/dir" "file.tar.bz2" "executecmd" "run" "force" "10cd7353aa9d758a075c600a6dd193fd"
 
-local commandnane="DOWNLOAD"
+local commandname="DOWNLOAD"
 local commandaction="Download"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 fn_dl_md5(){
 	# Runs MD5 Check if available

+ 6 - 6
lgsm/functions/core_exit.sh

@@ -7,7 +7,7 @@
 fn_exit_dev_debug(){
 	if [ -f "${rootdir}/.dev-debug" ]; then
 		echo ""
-		echo "${selfname} exiting with code: ${exitcode}"
+		echo "${function_selfname} exiting with code: ${exitcode}"
 	fi
 }
 
@@ -15,13 +15,13 @@ if [ -n "${exitbypass}" ]; then
 	unset exitbypass
 elif [ -n "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then
 	if [ "${exitcode}" == "1" ]; then
-		fn_script_log_fatal "${selfname} exiting with code: ${exitcode}"
+		fn_script_log_fatal "${function_selfname} exiting with code: ${exitcode}"
 	elif [ "${exitcode}" == "2" ]; then
-		fn_script_log_error "${selfname} exiting with code: ${exitcode}"
+		fn_script_log_error "${function_selfname} exiting with code: ${exitcode}"
 	elif [ "${exitcode}" == "3" ]; then
-		fn_script_log_warn "${selfname} exiting with code: ${exitcode}"
+		fn_script_log_warn "${function_selfname} exiting with code: ${exitcode}"
 	else
-		fn_script_log_warn "${selfname} exiting with code: ${exitcode}"
+		fn_script_log_warn "${function_selfname} exiting with code: ${exitcode}"
 	fi
 	fn_exit_dev_debug
 	# remove trap.
@@ -29,7 +29,7 @@ elif [ -n "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then
 	exit ${exitcode}
 else
 	exitcode=0
-	fn_script_log_pass "${selfname} exiting with code: ${exitcode}"
+	fn_script_log_pass "${function_selfname} exiting with code: ${exitcode}"
 	fn_exit_dev_debug
 	# remove trap.
 	trap - INT

+ 1 - 1
lgsm/functions/core_getopt.sh

@@ -4,7 +4,7 @@
 # Website: https://gameservermanagers.com
 # Description: getopt arguments.
 
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 fn_getopt_generic(){
 case "${getopt}" in

+ 1 - 1
lgsm/functions/core_messages.sh

@@ -1,5 +1,5 @@
 #!/bin/bash
-# LGSM fn_messages function
+# LGSM core_messages.sh function
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 # Description: Defines on-screen messages such as [  OK  ] and how script logs look.

+ 4 - 5
lgsm/functions/fix.sh

@@ -5,10 +5,9 @@
 # Description: Overall function for managing fixes.
 # Runs functions that will fix an issue.
 
-local commandnane="FIX"
+local commandname="FIX"
 local commandaction="Fix"
-# Cannot have selfname as breaks if statements.
-#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 # Messages that are displayed for some fixes
 fn_fix_msg_start(){
@@ -32,7 +31,7 @@ fn_fix_msg_end(){
 
 
 # Fixes that are run on start
-if [ "${selfname}" != "command_install.sh" ]; then
+if [ "${function_selfname}" != "command_install.sh" ]; then
 	if [ -n "${appid}" ]; then
 		fix_steamcmd.sh
 	fi
@@ -53,7 +52,7 @@ if [ "${selfname}" != "command_install.sh" ]; then
 fi
 
 # Fixes that are run on install only.
-if [ "${selfname}" == "command_install.sh" ]; then
+if [ "${function_selfname}" == "command_install.sh" ]; then
 	if [ "${gamename}" == "Killing Floor" ]; then
 		echo ""
 		echo "Applying ${gamename} Server Fixes"

+ 2 - 2
lgsm/functions/fix_arma3.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Resolves an issue with ARMA3.
 
-local commandnane="FIX"
+local commandname="FIX"
 local commandaction="Fix"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 # Fixes: 20150 Segmentation fault (core dumped) error.
 if [ ! -d "${HOME}/.local/share/Arma 3" ]||[ ! -d "${HOME}/.local/share/Arma 3 - Other Profiles" ]; then

+ 2 - 2
lgsm/functions/fix_csgo.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Resolves various issues with csgo.
 
-local commandnane="FIX"
+local commandname="FIX"
 local commandaction="Fix"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 # Fixes: server not always creating steam_appid.txt file.
 if [ ! -f "${filesdir}/steam_appid.txt" ]; then

+ 2 - 2
lgsm/functions/fix_dst.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Resolves various issues with Dont Starve together.
 
-local commandnane="FIX"
+local commandname="FIX"
 local commandaction="Fix"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 # Fixes: ./dontstarve_dedicated_server_nullrenderer: ./lib32/libcurl-gnutls.so.4: no version information available (required by ./dontstarve_dedicated_server_nullrenderer)
 # Issue only occures on CentOS as libcurl-gnutls.so.4 is called libcurl.so.4 on CentOS.

+ 2 - 2
lgsm/functions/fix_glibc.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Downloads required glibc files and applys teh glibc fix if required
 
-local commandnane="FIX"
+local commandname="FIX"
 local commandaction="Fix"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 local libstdc_servers_array=( "ARMA 3" "Blade Symphony" "Garry's Mod" "Just Cause 2" )
 for libstdc_server in "${libstdc_servers_array[@]}"

+ 2 - 4
lgsm/functions/fix_ins.sh

@@ -4,10 +4,8 @@
 # Website: https://gameservermanagers.com
 # Description: Resolves various issues with Insurgency.
 
-local commandnane="FIX"
+local commandname="FIX"
 local commandaction="Fix"
-# Cannot have selfname as breaks if statement.
-#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 # Fixes: ./srcds_linux: error while loading shared libraries: libtier0.so: cannot open shared object file: No such file or directory.
 
@@ -15,7 +13,7 @@ export LD_LIBRARY_PATH=${filesdir}:${filesdir}/bin:${LD_LIBRARY_PATH}
 
 # Fixes: issue #529 - gamemode not passed to debug or start.
 
-if [ "${selfname}" == "command_debug.sh" ]; then
+if [ "${function_selfname}" == "command_debug.sh" ]; then
 	defaultmap="\"${defaultmap}\""
 else
 	defaultmap="\\\"${defaultmap}\\\""

+ 2 - 2
lgsm/functions/fix_kf.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Resolves various issues with Killing Floor.
 
-local commandnane="FIX"
+local commandname="FIX"
 local commandaction="Fix"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 echo "Applying WebAdmin ROOst.css fix."
 echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13"

+ 2 - 2
lgsm/functions/fix_ro.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Resolves various issues with Red Orchestra.
 
-local commandnane="FIX"
+local commandname="FIX"
 local commandaction="Fix"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 echo "Applying WebAdmin ROOst.css fix."
 echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13"

+ 2 - 2
lgsm/functions/fix_steamcmd.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Resolves various issues related to steamCMD.
 
-local commandnane="FIX"
+local commandname="FIX"
 local commandaction="Fix"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so.
 if [ ! -f "${HOME}/.steam/sdk32/steamclient.so" ]; then

+ 2 - 2
lgsm/functions/fix_ut2k4.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Resolves various issues with Unreal Tournament 2004.
 
-local commandnane="FIX"
+local commandname="FIX"
 local commandaction="Fix"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 echo "applying WebAdmin ut2003.css fix."
 echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13"

+ 2 - 2
lgsm/functions/fix_ut99.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Resolves various issues with Unreal Tournament 99.
 
-local commandnane="FIX"
+local commandname="FIX"
 local commandaction="Fix"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 echo "${servercfgfullpath}"
 echo "enabling UdpServerUplink."

+ 1 - 1
lgsm/functions/fn_functions

@@ -1,5 +1,5 @@
 #!/bin/bash
-# LGSM core_functions.sh function
+# LGSM fn_functions function
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 lgsm_version="210516"

+ 1 - 1
lgsm/functions/fn_getopt

@@ -1,5 +1,5 @@
 #!/bin/bash
-# LGSM core_getopt.sh function
+# LGSM fn_getopt function
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 lgsm_version="210516"

+ 1 - 1
lgsm/functions/fn_update_functions

@@ -1,5 +1,5 @@
 #!/bin/bash
-# LGSM fn_update_functions.sh function
+# LGSM fn_update_functions function
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 lgsm_version="210516"

+ 1 - 1
lgsm/functions/info_config.sh

@@ -4,7 +4,7 @@
 # Website: https://gameservermanagers.com
 # Description: Gets specific details from config files.
 
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 ## Examples of filtering to get info from config files
 # sed 's/foo//g' - remove foo

+ 1 - 1
lgsm/functions/info_distro.sh

@@ -5,7 +5,7 @@
 # Description: Variables providing useful info on the Operating System such as disk and performace info.
 # Used for command_details.sh, command_debug.sh and alert.sh.
 
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 ### Distro infomation
 

+ 1 - 1
lgsm/functions/info_glibc.sh

@@ -4,7 +4,7 @@
 # Website: https://gameservermanagers.com
 # Description: stores details on servers Glibc requirements.
 
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 if [ "${gamename}" == "Blade Symphony" ]; then
 	glibcrequired="2.15"

+ 1 - 1
lgsm/functions/info_parms.sh

@@ -4,7 +4,7 @@
 # Website: https://gameservermanagers.com
 # Description: Gets specific details from server parameters.
 
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 ## Examples of filtering to get info from config files
 # sed 's/foo//g' - remove foo

+ 2 - 2
lgsm/functions/install_complete.sh

@@ -3,9 +3,9 @@
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 
-local commandnane="INSTALL"
+local commandname="INSTALL"
 local commandaction="Install"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 if [ "${gamename}" == "Don't Starve Together" ]; then
   echo ""

+ 2 - 2
lgsm/functions/install_config.sh

@@ -3,9 +3,9 @@
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 
-local commandnane="INSTALL"
+local commandname="INSTALL"
 local commandaction="Install"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 fn_defaultconfig(){
 	echo "creating ${servercfg} config file."

+ 2 - 2
lgsm/functions/install_gslt.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Configures GSLT.
 
-local commandnane="INSTALL"
+local commandname="INSTALL"
 local commandaction="Install"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 echo ""
 echo "Game Server Login Token"

+ 2 - 2
lgsm/functions/install_gsquery.sh

@@ -3,9 +3,9 @@
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 
-local commandnane="INSTALL"
+local commandname="INSTALL"
 local commandaction="Install"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 fn_dlgsquery(){
 	cd "${functionsdir}"

+ 2 - 2
lgsm/functions/install_header.sh

@@ -3,9 +3,9 @@
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 
-local commandnane="INSTALL"
+local commandname="INSTALL"
 local commandaction="Install"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 clear
 echo "================================="

+ 2 - 2
lgsm/functions/install_logs.sh

@@ -3,9 +3,9 @@
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 
-local commandnane="INSTALL"
+local commandname="INSTALL"
 local commandaction="Install"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 if [ "${checklogs}" != "1" ]; then
 	echo ""

+ 2 - 2
lgsm/functions/install_retry.sh

@@ -3,9 +3,9 @@
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 
-local commandnane="INSTALL"
+local commandname="INSTALL"
 local commandaction="Install"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 while true; do
 	read -e -i "y" -p "Retry install? [Y/n]" yn

+ 3 - 3
lgsm/functions/install_server_dir.sh

@@ -1,11 +1,11 @@
 #!/bin/bash
-# LGSM install_serverdir.sh function
+# LGSM install_server_dir.sh function
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 
-local commandnane="INSTALL"
+local commandname="INSTALL"
 local commandaction="Install"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 echo ""
 echo "Server Directory"

+ 2 - 2
lgsm/functions/install_server_files.sh

@@ -3,9 +3,9 @@
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 
-local commandnane="INSTALL"
+local commandname="INSTALL"
 local commandaction="Install"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 fn_install_server_files(){
 	if [ "${gamename}" == "Unreal Tournament 99" ]; then

+ 2 - 2
lgsm/functions/install_steamcmd.sh

@@ -4,9 +4,9 @@
 # Website: https://gameservermanagers.com
 # Description: Downloads SteamCMD on install.
 
-local commandnane="INSTALL"
+local commandname="INSTALL"
 local commandaction="Install"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 echo ""
 echo "Installing SteamCMD"

+ 3 - 3
lgsm/functions/install_ts3db.sh

@@ -1,12 +1,12 @@
 #!/bin/bash
-# LGSM fn_install_ts3_mariadb function
+# LGSM install_ts3db.sh function
 # Author: Daniel Gibbs
 # Contributor: PhilPhonic
 # Website: https://gameservermanagers.com
 
-local commandnane="INSTALL"
+local commandname="INSTALL"
 local commandaction="Install"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 fn_install_ts3db_mariadb(){
 	echo ""

+ 2 - 2
lgsm/functions/install_ut2k4_key.sh

@@ -3,9 +3,9 @@
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 
-local commandnane="INSTALL"
+local commandname="INSTALL"
 local commandaction="Install"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 echo ""
 echo "Enter ${gamename} CD Key"

+ 2 - 4
lgsm/functions/logs.sh

@@ -5,10 +5,8 @@
 # Website: https://gameservermanagers.com
 # Description: Acts as a log rotater, removing old logs.
 
-local commandnane="LOGS"
+local commandname="LOGS"
 local commandaction="Log-Manager"
-# Cannot have selfname as breaks the function.
-#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 # Check if logfile variable and file exist, create logfile if it doesn't exist
 if [ -n "${consolelog}" ]; then
@@ -18,7 +16,7 @@ if [ -n "${consolelog}" ]; then
 fi
 
 # For games not displaying a console, and having logs into their game folder
-if [ "${selfname}" == "command_start.sh" ] && [ -n "${gamelogfile}" ]; then
+if [ "${function_selfname}" == "command_start.sh" ] && [ -n "${gamelogfile}" ]; then
 	if [ -n "$(find "${systemdir}" -name "gamelog*.log")" ]; then
 		fn_print_info "Moving game logs to ${gamelogdir}"
 		fn_script_log_info "Moving game logs to ${gamelogdir}"

+ 2 - 2
lgsm/functions/monitor_gsquery.sh

@@ -5,9 +5,9 @@
 # Description: uses gsquery.py to query the server port.
 # Detects if the server has frozen with the proccess still running.
 
-local commandnane="MONITOR"
+local commandname="MONITOR"
 local commandaction="Monitor"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 # Forces legecy servers to use gsquery
 if [ -z "${gsquery}" ]; then

+ 3 - 3
lgsm/functions/update_steamcmd.sh

@@ -1,12 +1,12 @@
 #!/bin/bash
-# LGSM commanf_update.sh function
+# LGSM command_update.sh function
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 # Description:Handles updating using steamCMD.
 
-local commandnane="UPDATE"
+local commandname="UPDATE"
 local commandaction="Update"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 fn_update_steamcmd_dl(){
 

+ 3 - 3
lgsm/functions/update_ts3.sh

@@ -1,12 +1,12 @@
 #!/bin/bash
-# LGSM commanf_update.sh function
+# LGSM command_update.sh function
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
 # Description:Handles updating of teamspeak 3 servers.
 
-local commandnane="UPDATE"
+local commandname="UPDATE"
 local commandaction="Update"
-local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 fn_update_ts3_dl(){
 	fn_fetch_file "http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" "${lgsmdir}/tmp" "teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2"