浏览代码

feat(log): refactor log handling (#2859)

* standardise module identifiers
* renamed logs.sh to core_logs.sh
* improve stats log
* remove local
* functionselfname rename
Daniel Gibbs 6 年之前
父节点
当前提交
66bf5e059e
共有 100 个文件被更改,包括 290 次插入352 次删除
  1. 21 22
      lgsm/functions/alert.sh
  2. 1 3
      lgsm/functions/alert_discord.sh
  3. 1 3
      lgsm/functions/alert_email.sh
  4. 1 3
      lgsm/functions/alert_ifttt.sh
  5. 1 3
      lgsm/functions/alert_mailgun.sh
  6. 1 3
      lgsm/functions/alert_pushbullet.sh
  7. 1 3
      lgsm/functions/alert_pushover.sh
  8. 1 3
      lgsm/functions/alert_slack.sh
  9. 1 3
      lgsm/functions/alert_telegram.sh
  10. 22 22
      lgsm/functions/check.sh
  11. 1 2
      lgsm/functions/check_config.sh
  12. 8 8
      lgsm/functions/check_deps.sh
  13. 1 2
      lgsm/functions/check_executable.sh
  14. 1 1
      lgsm/functions/check_glibc.sh
  15. 7 7
      lgsm/functions/check_ip.sh
  16. 2 0
      lgsm/functions/check_last_update.sh
  17. 1 2
      lgsm/functions/check_logs.sh
  18. 2 2
      lgsm/functions/check_permissions.sh
  19. 2 3
      lgsm/functions/check_root.sh
  20. 1 2
      lgsm/functions/check_status.sh
  21. 5 5
      lgsm/functions/check_steamcmd.sh
  22. 2 3
      lgsm/functions/check_system_dir.sh
  23. 1 2
      lgsm/functions/check_system_requirements.sh
  24. 1 1
      lgsm/functions/check_tmuxception.sh
  25. 3 3
      lgsm/functions/command_backup.sh
  26. 3 3
      lgsm/functions/command_console.sh
  27. 3 3
      lgsm/functions/command_debug.sh
  28. 3 3
      lgsm/functions/command_details.sh
  29. 6 0
      lgsm/functions/command_dev_clear_functions.sh
  30. 3 3
      lgsm/functions/command_dev_debug.sh
  31. 6 6
      lgsm/functions/command_dev_detect_deps.sh
  32. 4 4
      lgsm/functions/command_dev_detect_glibc.sh
  33. 3 3
      lgsm/functions/command_dev_detect_ldd.sh
  34. 3 3
      lgsm/functions/command_dev_query_raw.sh
  35. 3 3
      lgsm/functions/command_donate.sh
  36. 4 4
      lgsm/functions/command_fastdl.sh
  37. 3 3
      lgsm/functions/command_install.sh
  38. 3 3
      lgsm/functions/command_install_resources_mta.sh
  39. 3 3
      lgsm/functions/command_mods_install.sh
  40. 3 3
      lgsm/functions/command_mods_remove.sh
  41. 3 3
      lgsm/functions/command_mods_update.sh
  42. 12 11
      lgsm/functions/command_monitor.sh
  43. 16 18
      lgsm/functions/command_postdetails.sh
  44. 3 3
      lgsm/functions/command_restart.sh
  45. 4 4
      lgsm/functions/command_start.sh
  46. 3 3
      lgsm/functions/command_stop.sh
  47. 3 3
      lgsm/functions/command_test_alert.sh
  48. 3 3
      lgsm/functions/command_ts3_server_pass.sh
  49. 4 4
      lgsm/functions/command_update.sh
  50. 0 13
      lgsm/functions/command_update_functions.sh
  51. 3 3
      lgsm/functions/command_update_linuxgsm.sh
  52. 3 3
      lgsm/functions/command_validate.sh
  53. 3 3
      lgsm/functions/command_wipe.sh
  54. 3 2
      lgsm/functions/compress_unreal2_maps.sh
  55. 3 2
      lgsm/functions/compress_ut99_maps.sh
  56. 2 4
      lgsm/functions/core_dl.sh
  57. 9 7
      lgsm/functions/core_exit.sh
  58. 3 1
      lgsm/functions/core_functions.sh
  59. 1 1
      lgsm/functions/core_getopt.sh
  60. 2 0
      lgsm/functions/core_legacy.sh
  61. 3 4
      lgsm/functions/core_logs.sh
  62. 14 12
      lgsm/functions/core_messages.sh
  63. 2 0
      lgsm/functions/core_trap.sh
  64. 3 4
      lgsm/functions/fix.sh
  65. 2 0
      lgsm/functions/fix_ark.sh
  66. 1 3
      lgsm/functions/fix_arma3.sh
  67. 1 2
      lgsm/functions/fix_av.sh
  68. 1 3
      lgsm/functions/fix_csgo.sh
  69. 1 3
      lgsm/functions/fix_dst.sh
  70. 1 2
      lgsm/functions/fix_ges.sh
  71. 2 0
      lgsm/functions/fix_hw.sh
  72. 2 3
      lgsm/functions/fix_ins.sh
  73. 1 3
      lgsm/functions/fix_kf.sh
  74. 1 3
      lgsm/functions/fix_kf2.sh
  75. 1 2
      lgsm/functions/fix_mcb.sh
  76. 1 3
      lgsm/functions/fix_mta.sh
  77. 1 2
      lgsm/functions/fix_nmrih.sh
  78. 1 3
      lgsm/functions/fix_onset.sh
  79. 1 3
      lgsm/functions/fix_ro.sh
  80. 1 2
      lgsm/functions/fix_rust.sh
  81. 1 2
      lgsm/functions/fix_rw.sh
  82. 1 2
      lgsm/functions/fix_sdtd.sh
  83. 1 3
      lgsm/functions/fix_sfc.sh
  84. 1 3
      lgsm/functions/fix_sof2.sh
  85. 1 3
      lgsm/functions/fix_ss3.sh
  86. 1 3
      lgsm/functions/fix_steamcmd.sh
  87. 1 3
      lgsm/functions/fix_terraria.sh
  88. 1 3
      lgsm/functions/fix_tf2.sh
  89. 1 3
      lgsm/functions/fix_ts3.sh
  90. 2 0
      lgsm/functions/fix_tu.sh
  91. 1 2
      lgsm/functions/fix_unt.sh
  92. 1 3
      lgsm/functions/fix_ut.sh
  93. 1 3
      lgsm/functions/fix_ut2k4.sh
  94. 1 3
      lgsm/functions/fix_ut3.sh
  95. 1 2
      lgsm/functions/fix_wurm.sh
  96. 1 3
      lgsm/functions/fix_zmr.sh
  97. 1 1
      lgsm/functions/info_config.sh
  98. 1 1
      lgsm/functions/info_distro.sh
  99. 4 2
      lgsm/functions/info_messages.sh
  100. 1 1
      lgsm/functions/info_parms.sh

+ 21 - 22
lgsm/functions/alert.sh

@@ -4,8 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Overall function for managing alerts.
 
-local modulename="ALERT"
-local commandaction="Alert"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_alert_log(){
 	info_distro.sh
@@ -100,23 +99,23 @@ fn_alert_log
 if [ "${postalert}" == "on" ]&&[ -n "${postalert}" ]; then
 	exitbypass=1
 	command_postdetails.sh
-elif [ "${postalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ "${postalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_warn_nl "More Info not enabled"
 	fn_script_log_warn "More Info alerts not enabled"
-elif [ -z "${posttarget}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ -z "${posttarget}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_error_nl "posttarget not set"
 	fn_script_error "posttarget not set"
-elif [ -z "${postdays}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ -z "${postdays}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_error_nl "postdays not set"
 	fn_script_error "postdays not set"
 fi
 
 if [ "${discordalert}" == "on" ]&&[ -n "${discordalert}" ]; then
 	alert_discord.sh
-elif [ "${discordalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ "${discordalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_warn_nl "Discord alerts not enabled"
 	fn_script_log_warn "Discord alerts not enabled"
-elif [ -z "${discordtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ -z "${discordtoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_error_nl "Discord token not set"
 	echo -e "* https://docs.linuxgsm.com/alerts/discord"
 	fn_script_error "Discord token not set"
@@ -124,20 +123,20 @@ fi
 
 if [ "${emailalert}" == "on" ]&&[ -n "${email}" ]; then
 	alert_email.sh
-elif [ "${emailalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ "${emailalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_warn_nl "Email alerts not enabled"
 	fn_script_log_warn "Email alerts not enabled"
-elif [ -z "${email}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ -z "${email}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_error_nl "Email not set"
 	fn_script_log_error "Email not set"
 fi
 
 if [ "${iftttalert}" == "on" ]&&[ -n "${iftttalert}" ]; then
 	alert_ifttt.sh
-elif [ "${iftttalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ "${iftttalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_warn_nl "IFTTT alerts not enabled"
 	fn_script_log_warn "IFTTT alerts not enabled"
-elif [ -z "${ifttttoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ -z "${ifttttoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_error_nl "IFTTT token not set"
 	echo -e "* https://docs.linuxgsm.com/alerts/ifttt"
 	fn_script_error "IFTTT token not set"
@@ -145,10 +144,10 @@ fi
 
 if [ "${mailgunalert}" == "on" ]&&[ -n "${mailgunalert}" ]; then
 	alert_mailgun.sh
-elif [ "${mailgunalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ "${mailgunalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_warn_nl "Mailgun alerts not enabled"
 	fn_script_log_warn "Mailgun alerts not enabled"
-elif [ -z "${mailguntoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ -z "${mailguntoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_error_nl "Mailgun token not set"
 	echo -e "* https://docs.linuxgsm.com/alerts/mailgun"
 	fn_script_error "Mailgun token not set"
@@ -156,10 +155,10 @@ fi
 
 if [ "${pushbulletalert}" == "on" ]&&[ -n "${pushbullettoken}" ]; then
 	alert_pushbullet.sh
-elif [ "${pushbulletalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ "${pushbulletalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_warn_nl "Pushbullet alerts not enabled"
 	fn_script_log_warn "Pushbullet alerts not enabled"
-elif [ -z "${pushbullettoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ -z "${pushbullettoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_error_nl "Pushbullet token not set"
 	echo -e "* https://docs.linuxgsm.com/alerts/pushbullet"
 	fn_script_error "Pushbullet token not set"
@@ -167,10 +166,10 @@ fi
 
 if [ "${pushoveralert}" == "on" ]&&[ -n "${pushoveralert}" ]; then
 	alert_pushover.sh
-elif [ "${pushoveralert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ "${pushoveralert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_warn_nl "Pushover alerts not enabled"
 	fn_script_log_warn "Pushover alerts not enabled"
-elif [ -z "${pushovertoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ -z "${pushovertoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_error_nl "Pushover token not set"
 	echo -e "* https://docs.linuxgsm.com/alerts/pushover"
 	fn_script_error "Pushover token not set"
@@ -178,14 +177,14 @@ fi
 
 if [ "${telegramalert}" == "on" ]&&[ -n "${telegramtoken}" ]; then
 	alert_telegram.sh
-elif [ "${telegramalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ "${telegramalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_warn_nl "Telegram Messages not enabled"
 	fn_script_log_warn "Telegram Messages not enabled"
-elif [ -z "${telegramtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ -z "${telegramtoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_error_nl "Telegram token not set."
 	echo -e "* https://docs.linuxgsm.com/alerts/telegram"
 	fn_script_error "Telegram token not set."
-elif [ -z "${telegramchatid}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ -z "${telegramchatid}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_error_nl "Telegram chat id not set."
 	echo -e "* https://docs.linuxgsm.com/alerts/telegram"
 	fn_script_error "Telegram chat id not set."
@@ -193,10 +192,10 @@ fi
 
 if [ "${slackalert}" == "on" ]&&[ -n "${slackalert}" ]; then
 	alert_slack.sh
-elif [ "${slackalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ "${slackalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_warn_nl "Slack alerts not enabled"
 	fn_script_log_warn "Slack alerts not enabled"
-elif [ -z "${slacktoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then
+elif [ -z "${slacktoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
 	fn_print_error_nl "Slack token not set"
 	echo -e "* https://docs.linuxgsm.com/alerts/slack"
 	fn_script_error "Slack token not set"

+ 1 - 3
lgsm/functions/alert_discord.sh

@@ -5,9 +5,7 @@
 # Website: https://linuxgsm.com
 # Description: Sends Discord alert.
 
-local modulename="ALERT"
-local commandaction="Alert"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if ! command -v jq > /dev/null; then
 	fn_print_fail_nl "Sending Discord alert: jq is missing."

+ 1 - 3
lgsm/functions/alert_email.sh

@@ -4,9 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Sends email alert.
 
-local modulename="ALERT"
-local commandaction="Alert"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_print_dots "Sending Email alert: ${email}"
 fn_sleep_time

+ 1 - 3
lgsm/functions/alert_ifttt.sh

@@ -4,9 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Sends IFTTT alert.
 
-local modulename="ALERT"
-local commandaction="Alert"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 json=$(cat <<EOF
 {

+ 1 - 3
lgsm/functions/alert_mailgun.sh

@@ -4,9 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Sends Mailgun Email alert.
 
-local modulename="ALERT"
-local commandaction="Alert"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_print_dots "Sending Email alert: Mailgun: ${email}"
 

+ 1 - 3
lgsm/functions/alert_pushbullet.sh

@@ -4,9 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Sends Pushbullet Messenger alert.
 
-local modulename="ALERT"
-local commandaction="Alert"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 json=$(cat <<EOF
 {

+ 1 - 3
lgsm/functions/alert_pushover.sh

@@ -4,9 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Sends Pushover alert.
 
-local modulename="ALERT"
-local commandaction="Alert"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_print_dots "Sending Pushover alert"
 

+ 1 - 3
lgsm/functions/alert_slack.sh

@@ -4,9 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Sends Slack alert.
 
-local modulename="ALERT"
-local commandaction="Alert"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if ! command -v jq > /dev/null; then
 	fn_print_fail_nl "Sending Slack alert: jq is missing."

+ 1 - 3
lgsm/functions/alert_telegram.sh

@@ -4,9 +4,7 @@
 # Website: https://bytegaming.de
 # Description: Sends Telegram Messenger alert.
 
-local modulename="ALERT"
-local commandaction="Alert"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 json=$(cat <<EOF
 {

+ 22 - 22
lgsm/functions/check.sh

@@ -5,101 +5,101 @@
 # Description: Overall function for managing checks.
 # Runs checks that will either halt on or fix an issue.
 
-local modulename="CHECK"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Every command that requires checks just references check.sh.
 # check.sh selects which checks to run by using arrays.
 
-if [ "${userinput}" != "install" ]&&[ "${userinput}" != "auto-install" ]&&[ "${userinput}" != "i" ]&&[ "${userinput}" != "ai" ]; then
+if [ "${commandname}" != "INSTALL" ]; then
 	check_root.sh
 fi
 
 check_tmuxception.sh
 
 if [ "$(whoami)" != "root" ]; then
-	if [ "${function_selfname}" != "command_monitor.sh" ]; then
+	if [ "${commandname}" != "MONITOR" ]; then
 		check_permissions.sh
 	fi
 fi
 
-if [ "${function_selfname}" != "command_install.sh" ]&&[ "${function_selfname}" != "command_update_functions.sh" ]&&[ "${function_selfname}" != "command_update_linuxgsm.sh" ]&&[ "${function_selfname}" != "command_details.sh" ]&&[ "${function_selfname}" != "command_postdetails.sh" ]; then
+if [ "${commandname}" != "INSTALL" ]&&[ "${commandname}" != "UPDATE-LGSM" ]&&[ "${commandname}" != "DETAILS" ]&&[ "${commandname}" != "POST-DETAILS" ]; then
 	check_system_dir.sh
 fi
 
-local allowed_commands_array=( command_start.sh command_debug.sh )
+allowed_commands_array=( START DEBUG )
 for allowed_command in "${allowed_commands_array[@]}"
 do
-	if [ "${allowed_command}" == "${function_selfname}" ]; then
+	if [ "${allowed_command}" == "${commandname}" ]; then
 		check_executable.sh
 	fi
 done
 
 if [ "$(whoami)" != "root" ]; then
-	local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh )
+	allowed_commands_array=( DEBUG START INSTALL )
 	for allowed_command in "${allowed_commands_array[@]}"
 	do
-		if [ "${allowed_command}" == "${function_selfname}" ]; then
+		if [ "${allowed_command}" == "${commandname}" ]; then
 			check_glibc.sh
 		fi
 	done
 fi
 
-local allowed_commands_array=( command_backup.sh command_console.sh command_debug.sh command_details.sh command_unreal2_maps.sh command_fastdl.sh command_mods_install.sh command_mods_remove.sh command_mods_update.sh command_monitor.sh command_postdetails.sh command_restart.sh command_start.sh command_stop.sh command_test_alert.sh command_ts3_server_pass.sh command_update.sh command_update_functions.sh command_validate.sh command_wipe.sh command_unreal2_maps.sh command_ut99maps.sh)
+allowed_commands_array=( BACKUP CONSOLE DEBUG DETAILS MAP-COMPRESSOR FASTDL MODS-INSTALL MODS-REMOVE MODS-UPDATE MONITOR POST-DETAILS RESTART START STOP TEST-ALERT CHANGE-PASSWORD UPDATE UPDATE-LGSM VALIDATE WIPW )
 for allowed_command in "${allowed_commands_array[@]}"
 do
-	if [ "${allowed_command}" == "${function_selfname}" ]; then
+	if [ "${allowed_command}" == "${commandname}" ]; then
 		check_logs.sh
 	fi
 done
 
-local allowed_commands_array=( command_debug.sh command_start.sh command_stop.sh )
+allowed_commands_array=( DEBUG START STOP )
 for allowed_command in "${allowed_commands_array[@]}"
 do
-	if [ "${allowed_command}" == "${function_selfname}" ]; then
+	if [ "${allowed_command}" == "${commandname}" ]; then
 		check_deps.sh
 	fi
 done
 
-local allowed_commands_array=( command_console.sh command_debug.sh command_monitor.sh command_start.sh command_stop.sh )
+allowed_commands_array=( CONSOLE DEBUG MONITOR START STOP )
 for allowed_command in "${allowed_commands_array[@]}"
 do
-	if [ "${allowed_command}" == "${function_selfname}" ]; then
+	if [ "${allowed_command}" == "${commandname}" ]; then
 		check_config.sh
 	fi
 done
 
-local allowed_commands_array=( command_debug.sh command_details.sh command_postdetails.sh command_monitor.sh command_start.sh command_stop.sh command_dev_query_raw.sh )
+allowed_commands_array=( DEBUG DETAILS POST_DETAILS MONITOR START STOP DEV-QUERY-RAW )
 for allowed_command in "${allowed_commands_array[@]}"
 do
-	if [ "${allowed_command}" == "${function_selfname}" ]; then
+	if [ "${allowed_command}" == "${commandname}" ]; then
 		if [ -z "${installflag}" ]; then
 			check_ip.sh
 		fi
 	fi
 done
 
-local allowed_commands_array=( update_steamcmd.sh command_debug.sh command_start.sh command_validate.sh )
+allowed_commands_array=( DEBUG START VALIDATE )
 for allowed_command in "${allowed_commands_array[@]}"
 do
-	if [ "${allowed_command}" == "${function_selfname}" ]; then
+	if [ "${allowed_command}" == "${commandname}" ]; then
 		if [ "${appid}" ]; then
 			check_steamcmd.sh
 		fi
 	fi
 done
 
-local allowed_commands_array=( command_details.sh command_monitor.sh command_start.sh command_stop.sh command_ts3_server_pass.sh command_update.sh command_details.sh command_validate.sh )
+allowed_commands_array=( DETAILS MONITOR START STOP CHANGE-PASSWORD UPDATE VALIDATE )
 for allowed_command in "${allowed_commands_array[@]}"
 do
-	if [ "${allowed_command}" == "${function_selfname}" ]; then
+	if [ "${allowed_command}" == "${commandname}" ]; then
 		check_status.sh
 	fi
 done
 
-local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh )
+allowed_commands_array=( DEBUG START INSTALL )
 for allowed_command in "${allowed_commands_array[@]}"
 do
-	if [ "${allowed_command}" == "${function_selfname}" ]; then
+	if [ "${allowed_command}" == "${commandname}" ]; then
 		check_system_requirements.sh
 	fi
 done

+ 1 - 2
lgsm/functions/check_config.sh

@@ -4,8 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Checks if the server config is missing and warns the user if needed.
 
-local modulename="CHECK"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if [ ! -f "${servercfgfullpath}" ]; then
 	if [ "${shortname}" != "hw" ]&&[ "${shortname}" != "ut3" ]&&[ "${shortname}" != "kf2" ]; then

+ 8 - 8
lgsm/functions/check_deps.sh

@@ -4,7 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Checks if required dependencies are installed for LinuxGSM.
 
-local modulename="CHECK"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_install_mono_repo(){
 	if [ "${monostatus}" != "0" ]; then
@@ -171,14 +171,14 @@ if [ "${javacheck}" == "1" ]; then
 	if [ "${depstatus}" == "0" ]; then
 		# If dependency is found.
 		missingdep=0
-		if [ "${function_selfname}" == "command_install.sh" ]; then
+		if [ "${commandname}" == "INSTALL" ]; then
 			echo -e "${green}${deptocheck}${default}"
 			fn_sleep_time
 		fi
 	else
 		# If dependency is not found.
 		missingdep=1
-		if [ "${function_selfname}" == "command_install.sh" ]; then
+		if [ "${commandname}" == "INSTALL" ]; then
 			echo -e "${red}${deptocheck}${default}"
 			fn_sleep_time
 		fi
@@ -272,7 +272,7 @@ fn_found_missing_deps(){
 				fi
 				if [ "${steamcmdfail}" ]; then
 					echo -e ""
-					if [ "${function_selfname}" == "command_install.sh" ]; then
+					if [ "${commandname}" == "INSTALL" ]; then
 						fn_print_failure_nl "Missing dependencies required to run SteamCMD."
 						fn_script_log_fatal "Missing dependencies required to run SteamCMD."
 						core_exit.sh
@@ -298,7 +298,7 @@ fn_found_missing_deps(){
 			fi
 			if [ "${steamcmdfail}" ]; then
 				echo -e ""
-				if [ "${function_selfname}" == "command_install.sh" ]; then
+				if [ "${commandname}" == "INSTALL" ]; then
 					fn_print_failure_nl "Missing dependencies required to run SteamCMD."
 					fn_script_log_fatal "Missing dependencies required to run SteamCMD."
 					core_exit.sh
@@ -309,11 +309,11 @@ fn_found_missing_deps(){
 			fi
 			echo -e ""
 		fi
-		if [ "${function_selfname}" == "command_install.sh" ]; then
+		if [ "${commandname}" == "INSTALL" ]; then
 			sleep 5
 		fi
 	else
-		if [ "${function_selfname}" == "command_install.sh" ]; then
+		if [ "${commandname}" == "INSTALL" ]; then
 			fn_print_information_nl "Required dependencies already installed."
 			fn_script_log_info "Required dependencies already installed."
 		fi
@@ -550,7 +550,7 @@ fn_deps_build_redhat(){
 	fn_check_loop
 }
 
-if [ "${function_selfname}" == "command_install.sh" ]; then
+if [ "${commandname}" == "INSTALL" ]; then
 	if [ "$(whoami)" == "root" ]; then
 		echo -e ""
 		echo -e "${lightyellow}Checking Dependencies as root${default}"

+ 1 - 2
lgsm/functions/check_executable.sh

@@ -4,8 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Checks if server executable exists.
 
-local modulename="CHECK"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Check if executable exists
 if [ ! -f "${executabledir}/${execname}" ]; then

+ 1 - 1
lgsm/functions/check_glibc.sh

@@ -4,7 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Checks if the server has the correct Glibc version.
 
-local modulename="CHECK"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 info_distro.sh
 

+ 7 - 7
lgsm/functions/check_ip.sh

@@ -5,7 +5,7 @@
 # Description: Automatically identifies the server interface IP.
 # If multiple interfaces are detected the user will need to manually set using ip="0.0.0.0".
 
-local modulename="CHECK"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if [ "${travistest}" != "1" ]; then
 	if [ ! -f "/bin/ip" ]; then
@@ -23,10 +23,10 @@ if [ "${travistest}" != "1" ]; then
 		fn_print_dots "Check IP"
 		# Multiple interfaces.
 		if [ "${getipwc}" -ge "2" ]; then
-			if [ "${function_selfname}" == "command_details.sh" ]; then
-			    fn_print_warn "Check IP: Multiple IP addresses found."
+			if [ "${commandname}" == "details" ]; then
+				fn_print_warn "Check IP: Multiple IP addresses found."
 			else
-			    fn_print_fail "Check IP: Multiple IP addresses found."
+				fn_print_fail "Check IP: Multiple IP addresses found."
 			fi
 			echo -en "\n"
 			# IP is set within game config.
@@ -55,7 +55,7 @@ if [ "${travistest}" != "1" ]; then
 			echo -en "https://linuxgsm.com/network-interfaces\n"
 			echo -en ""
 			# Do not exit for details and postdetails commands.
-			if [ "${function_selfname}" != "command_details.sh" ]||[ "${function_selfname}" != "command_postdetails.sh" ]; then
+			if [ "${commandname}" != "DETAILS" ]||[ "${commandname}" != "POST-DETAILS" ]; then
 				fn_script_log_fatal "https://linuxgsm.com/network-interfaces\n"
 				core_exit.sh
 			else
@@ -76,8 +76,8 @@ if [ "${travistest}" != "1" ]; then
 			fn_script_log_fatal "IP address not set in game config."
 			fn_script_log_fatal "Specify the IP you want to bind within: ${servercfgfullpath}."
 			fn_script_log_fatal "https://linuxgsm.com/network-interfaces\n"
-			if [ "${function_selfname}" != "command_details.sh" ]; then
-			    core_exit.sh
+			if [ "${commandname}" != "DETAILS" ]; then
+				core_exit.sh
 			fi
 		else
 			fn_print_info_nl "Check IP: ${getip}"

+ 2 - 0
lgsm/functions/check_last_update.sh

@@ -5,6 +5,8 @@
 # Description: Checks lock file to see when last update happened.
 # Will reboot server if instance not rebooted since update.
 
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+
 if [ -f "${lockdir}/${selfname}-laststart.lock" ]; then
 	laststart=$(cat "${lockdir}/${selfname}-laststart.lock")
 fi

+ 1 - 2
lgsm/functions/check_logs.sh

@@ -4,8 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Checks if log files exist.
 
-local modulename="CHECK"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_check_logs(){
 	fn_print_dots "Checking for log files"

+ 2 - 2
lgsm/functions/check_permissions.sh

@@ -5,7 +5,7 @@
 # Website: https://linuxgsm.com
 # Description: Checks ownership & permissions of scripts, files and directories.
 
-local modulename="CHECK"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_check_ownership(){
 	if [ -f "${rootdir}/${selfname}" ]; then
@@ -229,7 +229,7 @@ fn_sys_perm_error_process(){
 if [ "$(whoami)" != "root" ]; then
 	fn_check_ownership
 	fn_check_permissions
-	if [ "${function_selfname}" == "command_start.sh" ]; then
+	if [ "${commandname}" == "START" ]; then
 		fn_sys_perm_error_process
 	fi
 fi

+ 2 - 3
lgsm/functions/check_root.sh

@@ -4,11 +4,10 @@
 # Website: https://linuxgsm.com
 # Description: Checks if the user tried to run the script as root.
 
-local modulename="CHECK"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if [ "$(whoami)" = "root" ]; then
-	if [ "${function_selfname}" != "command_install.sh" ]; then
+	if [ "${commandname}" != "INSTALL" ]; then
 		fn_print_fail_nl "Do NOT run this script as root!"
 		if [ -d "${lgsmlogdir}" ]; then
 			fn_script_log_fatal "${selfname} attempted to run as root."

+ 1 - 2
lgsm/functions/check_status.sh

@@ -5,7 +5,6 @@
 # Website: https://linuxgsm.com
 # Description: Checks the process status of the server. Either online or offline.
 
-local modulename="CHECK"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 status=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | grep -Ecx "^${selfname}")

+ 5 - 5
lgsm/functions/check_steamcmd.sh

@@ -4,7 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Checks if SteamCMD is installed correctly.
 
-local modulename="CHECK"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_install_steamcmd(){
 	if [ ${shortname} == "ark" ]&&[ "${installsteamcmd}" == "1" ]; then
@@ -50,14 +50,14 @@ fn_check_steamcmd(){
 	# Checks if SteamCMD exists when starting or updating a server.
 	# Only install if steamcmd package is missing or steamcmd dir is missing.
 	if [ ! -f "${steamcmddir}/steamcmd.sh" ]&&[ -z "$(command -v steamcmd 2>/dev/null)" ]; then
-		if [ "${function_selfname}" == "command_install.sh" ]; then
+		if [ "${commandname}" == "INSTALL" ]; then
 			fn_install_steamcmd
 		else
 			fn_print_warn_nl "SteamCMD is missing"
 			fn_script_log_warn "SteamCMD is missing"
 			fn_install_steamcmd
 		fi
-	elif [ "${function_selfname}" == "command_install.sh" ]; then
+	elif [ "${commandname}" == "INSTALL" ]; then
 		fn_print_information "SteamCMD is already installed..."
 		fn_print_ok_eol_nl
 	fi
@@ -110,14 +110,14 @@ fn_check_steamcmd_ark(){
 	# to allow ark mods to work
 	if [ ! -f "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamcmd.sh" ]; then
 		installsteamcmd=1
-		if [ "${function_selfname}" == "command_install.sh" ]; then
+		if [ "${commandname}" == "INSTALL" ]; then
 			fn_install_steamcmd
 		else
 			fn_print_warn_nl "ARK mods SteamCMD is missing"
 			fn_script_log_warn "ARK mods SteamCMD is missing"
 			fn_install_steamcmd
 		fi
-	elif [ "${function_selfname}" == "command_install.sh" ]; then
+	elif [ "${commandname}" == "INSTALL" ]; then
 		fn_print_information "ARK mods SteamCMD is already installed..."
 		fn_print_ok_eol_nl
 	fi

+ 2 - 3
lgsm/functions/check_system_dir.sh

@@ -4,10 +4,9 @@
 # Website: https://linuxgsm.com
 # Description: Checks if systemdir/serverfiles is accessible.
 
-local modulename="CHECK"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
-if [ "${function_selfname}" != "command_validate.sh" ]; then
+if [ "${commandname}" != "VALIDATE" ]; then
 	checkdir="${serverfiles}"
 else
 	checkdir="${systemdir}"

+ 1 - 2
lgsm/functions/check_system_requirements.sh

@@ -5,8 +5,7 @@
 # Website: https://linuxgsm.com
 # Description: Checks RAM requirements
 
-local modulename="CHECK"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 info_distro.sh
 

+ 1 - 1
lgsm/functions/check_tmuxception.sh

@@ -5,7 +5,7 @@
 # Website: https://linuxgsm.com
 # Description: Checks if run from tmux or screen
 
-local modulename="CHECK"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_check_is_in_tmux(){
   if [ "${TMUX}" ]; then

+ 3 - 3
lgsm/functions/command_backup.sh

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

+ 3 - 3
lgsm/functions/command_console.sh

@@ -4,9 +4,9 @@
 # Website: https://linuxgsm.com
 # Description: Gives access to the server tmux console.
 
-local modulename="CONSOLE"
-local commandaction="Console"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="CONSOLE"
+commandaction="Access console"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 fn_print_header

+ 3 - 3
lgsm/functions/command_debug.sh

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

+ 3 - 3
lgsm/functions/command_details.sh

@@ -5,9 +5,9 @@
 # Website: https://linuxgsm.com
 # Description: Displays server information.
 
-local modulename="DETAILS"
-local commandaction="Details"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="DETAILS"
+commandaction="Viewing details"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Run checks and gathers details to display.
 check.sh

+ 6 - 0
lgsm/functions/command_dev_clear_functions.sh

@@ -4,6 +4,10 @@
 # Website: https://linuxgsm.com
 # Description: Deletes the contents of the functions dir.
 
+commandname="DEV-CLEAR-MODULES"
+commandaction="Clearing modules"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+
 echo -e "================================="
 echo -e "Clear Functions"
 echo -e "================================="
@@ -11,6 +15,8 @@ echo -e ""
 if fn_prompt_yn "Do you want to delete all functions?" Y; then
 	rm -rfv "${functionsdir:?}/"*
 	rm -rfv "${configdirdefault:?}/"*
+	fn_script_log_info "Cleared modules directory"
+	fn_script_log_info "Cleared default config directory"
 fi
 
 core_exit.sh

+ 3 - 3
lgsm/functions/command_dev_debug.sh

@@ -4,9 +4,9 @@
 # Website: https://linuxgsm.com
 # Description: Dev only: Enables debugging log to be saved to dev-debug.log.
 
-local modulename="DEV-DEBUG"
-local commandaction="Dev Debug"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="DEV-DEBUG"
+commandaction="Developer debug"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if [ -f "${rootdir}/.dev-debug" ]; then
 	rm "${rootdir:?}/.dev-debug"

+ 6 - 6
lgsm/functions/command_dev_detect_deps.sh

@@ -4,9 +4,9 @@
 # Website: https://linuxgsm.com
 # Description: Detects dependencies the server binary requires.
 
-local modulename="DETECT-DEPS"
-local commandaction="Detect Deps"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="DEV-DETECT-DEPS"
+commandaction="Developer detect deps"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 echo -e "================================="
 echo -e "Dependencies Checker"
@@ -40,7 +40,7 @@ touch "${tmpdir}/.depdetect_debian_list"
 
 while read -r lib; do
 	echo -e "${lib}"
-	local libs_array=( libm.so.6 libc.so.6 libtcmalloc_minimal.so.4 libpthread.so.0 libdl.so.2 libnsl.so.1 libgcc_s.so.1 librt.so.1 ld-linux.so.2 libdbus-glib-1.so.2 libgio-2.0.so.0 libglib-2.0.so.0 libGL.so.1 libgobject-2.0.so.0 libnm-glib.so.4 libnm-util.so.2 )
+	libs_array=( libm.so.6 libc.so.6 libtcmalloc_minimal.so.4 libpthread.so.0 libdl.so.2 libnsl.so.1 libgcc_s.so.1 librt.so.1 ld-linux.so.2 libdbus-glib-1.so.2 libgio-2.0.so.0 libglib-2.0.so.0 libGL.so.1 libgobject-2.0.so.0 libnm-glib.so.4 libnm-util.so.2 )
 	for lib_file in "${libs_array[@]}"
 	do
 		if [ "${lib}" == "${lib_file}" ]; then
@@ -51,7 +51,7 @@ while read -r lib; do
 		fi
 	done
 
-	local libs_array=( libawt.so libjava.so libjli.so libjvm.so libnet.so libnio.so libverify.so )
+	libs_array=( libawt.so libjava.so libjli.so libjvm.so libnet.so libnio.so libverify.so )
 	for lib_file in "${libs_array[@]}"
 	do
 		if [ "${lib}" == "${lib_file}" ]; then
@@ -62,7 +62,7 @@ while read -r lib; do
 		fi
 	done
 
-	local libs_array=( libtier0.so libtier0_srv.so libvstdlib_srv.so Core.so libvstdlib.so libtier0_s.so Editor.so Engine.so liblua.so libsteam_api.so ld-linux-x86-64.so.2 libPhysX3_x86.so libPhysX3Common_x86.so libPhysX3Cooking_x86.so)
+	libs_array=( libtier0.so libtier0_srv.so libvstdlib_srv.so Core.so libvstdlib.so libtier0_s.so Editor.so Engine.so liblua.so libsteam_api.so ld-linux-x86-64.so.2 libPhysX3_x86.so libPhysX3Common_x86.so libPhysX3Cooking_x86.so)
 	for lib_file in "${libs_array[@]}"
 	do
 		# Known shared libs what dont requires dependencies.

+ 4 - 4
lgsm/functions/command_dev_detect_glibc.sh

@@ -5,9 +5,9 @@
 # Description: Automatically detects the version of GLIBC that is required.
 # Can check a file or directory recursively.
 
-local modulename="DETECT-GLIBC"
-local commandaction="Detect Glibc"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="DEV-DETECT-GLIBC"
+commandaction="Developer detect glibc"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 echo -e "================================="
 echo -e "glibc Requirements Checker"
@@ -33,7 +33,7 @@ fi
 echo -e ""
 
 
-local glibc_check_dir_array=( steamcmddir serverfiles )
+glibc_check_dir_array=( steamcmddir serverfiles )
 for glibc_check_var in "${glibc_check_dir_array[@]}"
 do
 	if [ "${glibc_check_var}" == "serverfiles" ]; then

+ 3 - 3
lgsm/functions/command_dev_detect_ldd.sh

@@ -5,9 +5,9 @@
 # Description: Automatically detects required deps using ldd.
 # Can check a file or directory recursively.
 
-local modulename="DETECT-LDD"
-local commandaction="Detect LDD"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="DEV-DETECT-LDD"
+commandaction="Developer detect ldd"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 echo -e "================================="
 echo -e "Shared Object dependencies Checker"

+ 3 - 3
lgsm/functions/command_dev_query_raw.sh

@@ -4,9 +4,9 @@
 # Website: https://linuxgsm.com
 # Description: Raw gamedig output of the server.
 
-local modulename="QUERY-RAW"
-local commandaction="Query Raw"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="DEV-QUERY-RAW"
+commandaction="Developer query raw"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 info_config.sh

+ 3 - 3
lgsm/functions/command_donate.sh

@@ -4,9 +4,9 @@
 # Website: https://linuxgsm.com
 # Description: Shows ways to donate.
 
-local modulename="CONSOLE"
-local commandaction="Console"
-local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")
+commandname="DONATE"
+commandaction="Donate"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_print_ascii_logo
 echo -e "${lightyellow}Support LinuxGSM${default}"

+ 4 - 4
lgsm/functions/command_fastdl.sh

@@ -5,9 +5,9 @@
 # Website: https://linuxgsm.com
 # Description: Creates a FastDL directory.
 
-local modulename="FASTDL"
-local commandaction="FastDL"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="FASTDL"
+commandaction="Fastdl"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 
@@ -135,7 +135,7 @@ fn_human_readable_file_size(){
 			local factor="${item%:*}"
 			local abbrev="${item#*:}"
 			if [[ "${bytes}" -ge "${factor}" ]]; then
-				local size=$(bc -l <<< "${bytes} / ${factor}")
+				size=$(bc -l <<< "${bytes} / ${factor}")
 				printf "%.*f %s\n" "${precision}" "${size}" "${abbrev}"
 				break
 			fi

+ 3 - 3
lgsm/functions/command_install.sh

@@ -5,9 +5,9 @@
 # Website: https://linuxgsm.com
 # Description: Overall function for the installer.
 
-local modulename="INSTALL"
-local commandaction="Install"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="INSTALL"
+commandaction="Installing"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 if [ "$(whoami)" = "root" ]; then

+ 3 - 3
lgsm/functions/command_install_resources_mta.sh

@@ -4,9 +4,9 @@
 # Website: https://linuxgsm.com
 # Description: Installs the default resources for Multi Theft Auto.
 
-local modulename="DEFAULT_RESOURCES"
-local commandaction="Default Resources"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="DEFAULT-RESOURCES"
+commandaction="Default Resources"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_install_resources(){
 	echo -e ""

+ 3 - 3
lgsm/functions/command_mods_install.sh

@@ -5,9 +5,9 @@
 # Website: https://linuxgsm.com
 # Description: List and installs available mods along with mods_list.sh and mods_core.sh.
 
-local modulename="MODS"
-local commandaction="addons/mods"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="MODS-INSTALL"
+commandaction="Installing mods"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 mods_core.sh

+ 3 - 3
lgsm/functions/command_mods_remove.sh

@@ -5,9 +5,9 @@
 # Website: https://linuxgsm.com
 # Description: Uninstall mods along with mods_list.sh and mods_core.sh.
 
-local modulename="MODS"
-local commandaction="Mods Remove"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="MODS-REMOVE"
+commandaction="Removing mods"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 mods_core.sh

+ 3 - 3
lgsm/functions/command_mods_update.sh

@@ -5,9 +5,9 @@
 # Website: https://linuxgsm.com
 # Description: Updates installed mods along with mods_list.sh and mods_core.sh.
 
-local modulename="MODS"
-local commandaction="Mods Update"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="MODS-UPDATE"
+commandaction="Updating mods"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 mods_core.sh

+ 12 - 11
lgsm/functions/command_monitor.sh

@@ -6,9 +6,9 @@
 # Description: Monitors server by checking for running processes
 # then passes to gamedig and gsquery.
 
-local modulename="MONITOR"
-local commandaction="Monitor"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="MONITOR"
+commandaction="Monitoring"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_monitor_check_lockfile(){
 	# Monitor does not run it lockfile is not found.
@@ -141,11 +141,7 @@ for queryattempt in {1..5}; do
 		fn_script_log_pass "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt}: OK"
 		fn_sleep_time
 		monitorpass=1
-		# send LinuxGSM stats if monitor is OK.
-		if [ "${stats}" == "on" ]||[ "${stats}" == "y" ]; then
-			info_stats.sh
-		fi
-    if [ "${querystatus}" == "0" ]; then
+		if [ "${querystatus}" == "0" ]; then
 			# Add query data to log.
 			if [ "${gdname}" ]; then
 				fn_script_log_info "Server name: ${gdname}"
@@ -154,14 +150,19 @@ for queryattempt in {1..5}; do
 				fn_script_log_info "Players: ${gdplayers}/${gdmaxplayers}"
 			fi
 			if [ "${gdbots}" ]; then
-                fn_script_log_info "Bots: ${gdbots}"
-            fi
+				fn_script_log_info "Bots: ${gdbots}"
+			fi
 			if [ "${gdmap}" ]; then
 				fn_script_log_info "Map: ${gdmap}"
 			fi
 			if [ "${gdgamemode}" ]; then
 				fn_script_log_info "Game Mode: ${gdgamemode}"
 			fi
+
+			# send LinuxGSM stats if monitor is OK.
+			if [ "${stats}" == "on" ]||[ "${stats}" == "y" ]; then
+				info_stats.sh
+			fi
 		fi
 		core_exit.sh
 	else
@@ -239,7 +240,7 @@ fn_monitor_loop(){
 
 monitorflag=1
 check.sh
-logs.sh
+core_logs.sh
 info_config.sh
 info_parms.sh
 

+ 16 - 18
lgsm/functions/command_postdetails.sh

@@ -5,9 +5,9 @@
 # Website: https://linuxgsm.com
 # Description: Strips sensitive information out of Details output
 
-local modulename="POSTDETAILS"
-local commandaction="Postdetails"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="POST-DETAILS"
+commandaction="Posting details"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Set posttarget to the appropriately-defined post destination.
 
@@ -74,14 +74,13 @@ else
 		fn_info_message_ports
 		fn_info_message_select_engine
 		fn_info_message_statusbottom
-	} | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${postdetailslog}" > /dev/null 2>&1
+	} | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | tee -a "${postdetailslog}" > /dev/null 2>&1
 fi
-
+# Pastebin
 if [ "${posttarget}" == "http://pastebin.com" ] ; then
 	fn_print_dots "pastbin.com for ${postexpire}"
 	# grab the return from 'value' from an initial visit to pastebin.
-	csrftoken=$(curl -s "${posttarget}" |
-					sed -n 's/^.*input type="hidden" name="csrf_token_post" value="\(.*\)".*$/\1/p')
+	csrftoken=$(curl -s "${posttarget}" | sed -n 's/^.*input type="hidden" name="csrf_token_post" value="\(.*\)".*$/\1/p')
 	#
 	# Use the csrftoken to then post the content.
 	#
@@ -94,9 +93,9 @@ if [ "${posttarget}" == "http://pastebin.com" ] ; then
 
 	 # Output the resulting link.
 	fn_print_ok_nl "pastbin.com for ${postexpire}"
+	fn_script_log_pass "pastbin.com for ${postexpire}"
 	pdurl="${posttarget}${link}"
-	echo -e ""
-	echo -e "  Please share the following url for support: ${pdurl}"
+# Hastebin
 elif [ "${posttarget}" == "https://hastebin.com" ] ; then
 	fn_print_dots "hastebin.com"
 	# hastebin is a bit simpler.  If successful, the returned result
@@ -104,21 +103,20 @@ elif [ "${posttarget}" == "https://hastebin.com" ] ; then
 	# we need in "key".  TODO - error handling. -CedarLUG
 	link=$(curl -H "HTTP_X_REQUESTED_WITH:XMLHttpRequest" -s -d "$(<${postdetailslog})" "${posttarget}/documents" | cut -d\" -f4)
 	fn_print_ok_nl "hastebin.com for ${postexpire}"
+	fn_script_log_pass "hastebin.com for ${postexpire}"
 	pdurl="${posttarget}/${link}"
-	echo -e ""
-	echo -e "Please share the following url for support: ${pdurl}"
+# Termbin
 elif [ "${posttarget}" == "https://termbin.com" ] ; then
 	fn_print_dots "termbin.com"
 	link=$(cat "${postdetailslog}" | nc termbin.com 9999 | tr -d '\n\0')
-	fn_print_ok_nl "termbin.com"
+	fn_print_ok_nl "termbin.com for 30D"
+	fn_script_log_pass "termbin.com for 30D"
 	pdurl="${link}"
-	echo -e ""
-	echo -e "Please share the following url for support: "
-	echo -e "${pdurl}"
-else
-	 fn_print_warn_nl "Review output in: ${postdetailslog}"
-	 core_exit.sh
 fi
+echo -e ""
+echo -e "Please share the following url for support: "
+echo -e "${pdurl}"
+fn_script_log_info "${pdurl}"
 
 if [ -z "${exitbypass}" ]; then
 	core_exit.sh

+ 3 - 3
lgsm/functions/command_restart.sh

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

+ 4 - 4
lgsm/functions/command_start.sh

@@ -5,9 +5,9 @@
 # Website: https://linuxgsm.com
 # Description: Starts the server.
 
-local modulename="START"
-local commandaction="Starting"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="START"
+commandaction="Starting"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_start_teamspeak3(){
 	if [ ! -f "${servercfgfullpath}" ]; then
@@ -183,7 +183,7 @@ if [ -z "${fixbypass}" ]; then
 	fix.sh
 fi
 info_config.sh
-logs.sh
+core_logs.sh
 
 # Will check for updates is updateonstart is yes.
 if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateonstart}" == "on" ]; then

+ 3 - 3
lgsm/functions/command_stop.sh

@@ -5,9 +5,9 @@
 # Website: https://linuxgsm.com
 # Description: Stops the server.
 
-local modulename="STOP"
-local commandaction="Stopping"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="STOP"
+commandaction="Stopping"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Attempts graceful shutdown by sending 'CTRL+c'.
 fn_stop_graceful_ctrlc(){

+ 3 - 3
lgsm/functions/command_test_alert.sh

@@ -4,9 +4,9 @@
 # Website: https://linuxgsm.com
 # Description: Sends a test alert.
 
-local modulename="ALERT"
-local commandaction="Alert"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="TEST-ALERT"
+commandaction="Sending Alert"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_print_dots "${servername}"
 check.sh

+ 3 - 3
lgsm/functions/command_ts3_server_pass.sh

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

+ 4 - 4
lgsm/functions/command_update.sh

@@ -4,13 +4,13 @@
 # Website: https://linuxgsm.com
 # Description: Handles updating of servers.
 
-local modulename="UPDATE"
-local commandaction="Update"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="UPDATE"
+commandaction="Updating"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_print_dots ""
 check.sh
-logs.sh
+core_logs.sh
 check_last_update.sh
 
 if [ "${shortname}" == "ts3" ]; then

+ 0 - 13
lgsm/functions/command_update_functions.sh

@@ -1,13 +0,0 @@
-#!/bin/bash
-# LinuxGSM command_update_functions.sh function
-# Author: Daniel Gibbs
-# Website: https://linuxgsm.com
-# Description: Deletes the functions dir to allow re-downloading of functions from GitHub.
-# Legacy Command
-
-command_update_linuxgsm.sh(){
-functionfile="${FUNCNAME[0]}"
-fn_fetch_function
-}
-
-command_update_linuxgsm.sh

+ 3 - 3
lgsm/functions/command_update_linuxgsm.sh

@@ -4,9 +4,9 @@
 # Website: https://linuxgsm.com
 # Description: Deletes the functions dir to allow re-downloading of functions from GitHub.
 
-local modulename="UPDATE LINUXGSM"
-local commandaction="Update LinuxGSM"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="UPDATE-LGSM"
+commandaction="Updating LinuxGSM"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_print_dots "Updating LinuxGSM"
 check.sh

+ 3 - 3
lgsm/functions/command_validate.sh

@@ -4,9 +4,9 @@
 # Website: https://linuxgsm.com
 # Description: Runs a server validation.
 
-local modulename="VALIDATE"
-local commandaction="Validate"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="VALIDATE"
+commandaction="Validating"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_validate(){
 	fn_script_log_warn "Validating server: SteamCMD: Validate might overwrite some customised files"

+ 3 - 3
lgsm/functions/command_wipe.sh

@@ -5,9 +5,9 @@
 # Website: https://linuxgsm.com
 # Description: Wipes server data, useful after updates for some games like Rust
 
-local modulename="WIPE"
-local commandaction="Wipe"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="WIPE"
+commandaction="Wiping"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 fn_print_header

+ 3 - 2
lgsm/functions/compress_unreal2_maps.sh

@@ -4,8 +4,9 @@
 # Website: https://linuxgsm.com
 # Description: Compresses unreal maps.
 
-local commandaction="Unreal Map Compressor"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="MAP-COMPRESSOR"
+commandaction="Compressing maps"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 fn_print_header

+ 3 - 2
lgsm/functions/compress_ut99_maps.sh

@@ -4,8 +4,9 @@
 # Website: https://linuxgsm.com
 # Description: Compresses unreal maps.
 
-local commandaction="Unreal Map Compressor"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+commandname="MAP-COMPRESSOR"
+commandaction="Compressing maps"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 fn_print_header

+ 2 - 4
lgsm/functions/core_dl.sh

@@ -17,9 +17,7 @@
 # fn_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}"
 # fn_fetch_file "http://example.com/file.tar.bz2" "/some/dir" "file.tar.bz2" "chmodx" "run" "forcedl" "10cd7353aa9d758a075c600a6dd193fd"
 
-local modulename="DOWNLOAD"
-local commandaction="Download"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Emptys contents of the LinuxGSM tmpdir.
 fn_clear_tmp(){
@@ -42,7 +40,7 @@ fn_dl_md5(){
 	if [ "${md5}" != "0" ]&&[ "${md5}" != "nomd5" ]; then
 		echo -en "verifying ${local_filename} with MD5..."
 		fn_sleep_time
-		local md5sumcmd=$(md5sum "${local_filedir}/${local_filename}"|awk '{print $1;}')
+		md5sumcmd=$(md5sum "${local_filedir}/${local_filename}"|awk '{print $1;}')
 		if [ "${md5sumcmd}" != "${md5}" ]; then
 			fn_print_fail_eol_nl
 			echo -e "${local_filename} returned MD5 checksum: ${md5sumcmd}"

+ 9 - 7
lgsm/functions/core_exit.sh

@@ -4,10 +4,12 @@
 # Website: https://linuxgsm.com
 # Description: Handles exiting of LinuxGSM by running and reporting an exit code.
 
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+
 fn_exit_dev_debug(){
 	if [ -f "${rootdir}/.dev-debug" ]; then
 		echo -e ""
-		echo -e "${function_selfname} exiting with code: ${exitcode}"
+		echo -e "${functionselfname} exiting with code: ${exitcode}"
 		if [ -f "${rootdir}/dev-debug.log" ]; then
 			grep "functionfile=" "${rootdir}/dev-debug.log" | sed 's/functionfile=//g' > "${rootdir}/dev-debug-function-order.log"
 		fi
@@ -26,13 +28,13 @@ elif [ "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then
 	# List LinuxGSM version in logs
 	fn_script_log_info "LinuxGSM version: ${version}"
 	if [ "${exitcode}" == "1" ]; then
-		fn_script_log_fatal "${function_selfname} exiting with code: ${exitcode}"
+		fn_script_log_fatal "${functionselfname} exiting with code: ${exitcode}"
 	elif [ "${exitcode}" == "2" ]; then
-		fn_script_log_error "${function_selfname} exiting with code: ${exitcode}"
+		fn_script_log_error "${functionselfname} exiting with code: ${exitcode}"
 	elif [ "${exitcode}" == "3" ]; then
-		fn_script_log_warn "${function_selfname} exiting with code: ${exitcode}"
+		fn_script_log_warn "${functionselfname} exiting with code: ${exitcode}"
 	else
-		fn_script_log_warn "${function_selfname} exiting with code: ${exitcode}"
+		fn_script_log_warn "${functionselfname} exiting with code: ${exitcode}"
 	fi
 	fn_exit_dev_debug
 	# remove trap.
@@ -41,7 +43,7 @@ elif [ "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then
 elif [ "${exitcode}" ]&&[ "${exitcode}" == "0" ]; then
 	# List LinuxGSM version in logs
 	fn_script_log_info "LinuxGSM version: ${version}"
-	fn_script_log_pass "${function_selfname} exiting with code: ${exitcode}"
+	fn_script_log_pass "${functionselfname} exiting with code: ${exitcode}"
 	fn_exit_dev_debug
 	# remove trap.
 	trap - INT
@@ -50,7 +52,7 @@ else
 	# List LinuxGSM version in logs
 	fn_script_log_info "LinuxGSM version: ${version}"
 	fn_print_error "No exit code set"
-	fn_script_log_pass "${function_selfname} exiting with code: NOT SET"
+	fn_script_log_pass "${functionselfname} exiting with code: NOT SET"
 	fn_exit_dev_debug
 	# remove trap.
 	trap - INT

+ 3 - 1
lgsm/functions/core_functions.sh

@@ -5,6 +5,8 @@
 # Description: Defines all functions to allow download and execution of functions using fn_fetch_function.
 # This function is called first before any other function. Without this file other functions will not load.
 
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+
 # Core
 
 core_dl.sh(){
@@ -541,7 +543,7 @@ fn_fetch_function
 }
 # Logs
 
-logs.sh(){
+core_logs.sh(){
 functionfile="${FUNCNAME[0]}"
 fn_fetch_function
 }

+ 1 - 1
lgsm/functions/core_getopt.sh

@@ -4,7 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: getopt arguments.
 
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 ### Define all commands here.
 ## User commands | Trigger commands | Description

+ 2 - 0
lgsm/functions/core_legacy.sh

@@ -4,6 +4,8 @@
 # Website: https://linuxgsm.com
 # Description: Code for backwards compatability with older versions of LinuxGSM.
 
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+
 if [ -z "${serverfiles}" ]; then
 	legacymode=1
 	serverfiles="${filesdir}"

+ 3 - 4
lgsm/functions/logs.sh → lgsm/functions/core_logs.sh

@@ -1,12 +1,11 @@
 #!/bin/bash
-# LinuxGSM logs.sh function
+# LinuxGSM core_logs.sh function
 # Author: Daniel Gibbs
 # Contributor: UltimateByte
 # Website: https://linuxgsm.com
 # Description: Acts as a log rotator, removing old logs.
 
-local modulename="LOGS"
-local commandaction="Log-Manager"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Check if logfile variable and file exist, create logfile if it doesn't exist.
 if [ "${consolelog}" ]; then
@@ -17,7 +16,7 @@ fi
 
 # For games not displaying a console, and having logs into their game directory.
 check_status.sh
-if [ "${status}" != "0" ]&&[ "${function_selfname}" == "command_start.sh" ]&&[ -n "${gamelogfile}" ]; then
+if [ "${status}" != "0" ]&&[ "${commandname}" == "START" ]&&[ -n "${gamelogfile}" ]; then
 	if [ "$(find "${systemdir}" -name "gamelog*.log")" ]; then
 		fn_print_info "Moving game logs to ${gamelogdir}"
 		fn_script_log_info "Moving game logs to ${gamelogdir}"

+ 14 - 12
lgsm/functions/core_messages.sh

@@ -5,6 +5,8 @@
 # Website: https://linuxgsm.com
 # Description: Defines on-screen messages such as [  OK  ] and how script logs look.
 
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+
 # nl: new line: message is following by a new line.
 # eol: end of line: message is placed at the end of the current line.
 fn_ansi_loader(){
@@ -46,8 +48,8 @@ fn_sleep_time(){
 ## Feb 28 14:56:58 ut99-server: Monitor:
 fn_script_log(){
 	if [ -d "${lgsmlogdir}" ]; then
-		if [ "${modulename}" ]; then
-			echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${modulename}: ${1}" >> "${lgsmlog}"
+		if [ -n "${commandname}" ]; then
+			echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: ${1}" >> "${lgsmlog}"
 		else
 			echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${1}" >> "${lgsmlog}"
 		fi
@@ -58,8 +60,8 @@ fn_script_log(){
 fn_script_log_pass(){
 	if [ -d "${lgsmlogdir}" ]; then
 
-		if [ "${modulename}" ]; then
-			echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${modulename}: PASS: ${1}" >> "${lgsmlog}"
+		if [ -n "${commandname}" ]; then
+			echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: PASS: ${1}" >> "${lgsmlog}"
 		else
 			echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: PASS: ${1}" >> "${lgsmlog}"
 		fi
@@ -70,8 +72,8 @@ fn_script_log_pass(){
 ## Feb 28 14:56:58 ut99-server: Monitor: FATAL:
 fn_script_log_fatal(){
 	if [ -d "${lgsmlogdir}" ]; then
-		if [ "${modulename}" ]; then
-			echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${modulename}: FATAL: ${1}" >> "${lgsmlog}"
+		if [ -n "${commandname}" ]; then
+			echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: FATAL: ${1}" >> "${lgsmlog}"
 		else
 			echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: FATAL: ${1}" >> "${lgsmlog}"
 		fi
@@ -82,8 +84,8 @@ fn_script_log_fatal(){
 ## Feb 28 14:56:58 ut99-server: Monitor: ERROR:
 fn_script_log_error(){
 	if [ -d "${lgsmlogdir}" ]; then
-		if [ "${modulename}" ]; then
-			echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${modulename}: ERROR: ${1}" >> "${lgsmlog}"
+		if [ -n "${commandname}" ]; then
+			echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: ERROR: ${1}" >> "${lgsmlog}"
 		else
 			echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ERROR: ${1}" >> "${lgsmlog}"
 		fi
@@ -94,8 +96,8 @@ fn_script_log_error(){
 ## Feb 28 14:56:58 ut99-server: Monitor: WARN:
 fn_script_log_warn(){
 	if [ -d "${lgsmlogdir}" ]; then
-		if [ "${modulename}" ]; then
-			echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${modulename}: WARN: ${1}" >> "${lgsmlog}"
+		if [ -n "${commandname}" ]; then
+			echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: WARN: ${1}" >> "${lgsmlog}"
 		else
 			echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: WARN: ${1}" >> "${lgsmlog}"
 		fi
@@ -106,8 +108,8 @@ fn_script_log_warn(){
 ## Feb 28 14:56:58 ut99-server: Monitor: INFO:
 fn_script_log_info(){
 	if [ -d "${lgsmlogdir}" ]; then
-		if [ "${modulename}" ]; then
-			echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${modulename}: INFO: ${1}" >> "${lgsmlog}"
+		if [ -n "${commandname}" ]; then
+			echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: INFO: ${1}" >> "${lgsmlog}"
 		else
 			echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: INFO: ${1}" >> "${lgsmlog}"
 		fi

+ 2 - 0
lgsm/functions/core_trap.sh

@@ -4,6 +4,8 @@
 # Website: https://linuxgsm.com
 # Description: Handles CTRL-C trap to give an exit code.
 
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+
 fn_exit_trap(){
 	echo -e ""
 	core_exit.sh

+ 3 - 4
lgsm/functions/fix.sh

@@ -5,8 +5,7 @@
 # Description: Overall function for managing fixes.
 # Runs functions that will fix an issue.
 
-local modulename="FIX"
-local commandaction="Fix"
+functionselfname="$(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 [ "${function_selfname}" != "command_install.sh" ]&&[ -z "${fixbypass}" ]; then
+if [ "${commandname}" != "INSTALL" ]&&[ -z "${fixbypass}" ]; then
 	if [ "${appid}" ]; then
 		fix_steamcmd.sh
 	fi
@@ -89,7 +88,7 @@ if [ "${function_selfname}" != "command_install.sh" ]&&[ -z "${fixbypass}" ]; th
 fi
 
 # Fixes that are run on install only.
-if [ "${function_selfname}" == "command_install.sh" ]; then
+if [ "${commandname}" == "INSTALL" ]; then
 		if [ "${shortname}" == "av" ]||[ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "onset" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then
 			echo -e ""
 			echo -e "Applying Post-Install Fixes"

+ 2 - 0
lgsm/functions/fix_ark.sh

@@ -4,6 +4,8 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with ARK: Survival Evolved.
 
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+
 # removes mulitple appworkshop_346110.acf if found.
 steamappsfilewc=$(find ${HOME} -name appworkshop_346110.acf | wc -l)
 if [ "${steamappsfilewc}" -gt "1" ]; then

+ 1 - 3
lgsm/functions/fix_arma3.sh

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

+ 1 - 2
lgsm/functions/fix_av.sh

@@ -4,8 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Resolves startup issue with Avorion
 
-local commandname="FIX"
-local commandaction="Fix"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64"
 

+ 1 - 3
lgsm/functions/fix_csgo.sh

@@ -4,9 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with CS:GO.
 
-local modulename="FIX"
-local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Fixes: server not always creating steam_appid.txt file.
 if [ ! -f "${serverfiles}/steam_appid.txt" ]; then

+ 1 - 3
lgsm/functions/fix_dst.sh

@@ -4,9 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with Don't Starve Together.
 
-local modulename="FIX"
-local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(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.

+ 1 - 2
lgsm/functions/fix_ges.sh

@@ -4,8 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with GoldenEye: Source.
 
-local modulename="FIX"
-local commandaction="Fix"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Fixes: MALLOC_CHECK_ needing to be set to 0.
 export MALLOC_CHECK_=0

+ 2 - 0
lgsm/functions/fix_hw.sh

@@ -4,6 +4,8 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with Hurtworld.
 
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+
 if [ "${shortname}" == "hw" ]; then
 	# Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
 	if [ ! -f "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" ]; then

+ 2 - 3
lgsm/functions/fix_ins.sh

@@ -4,8 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with Insurgency.
 
-local modulename="FIX"
-local commandaction="Fix"
+functionselfname="$(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.
 
@@ -13,7 +12,7 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/bin"
 
 # Fixes: issue #529 - gamemode not passed to debug or start.
 
-if [ "${function_selfname}" == "command_debug.sh" ]; then
+if [ "${commandname}" == "DEBUG" ]; then
 	defaultmap="\"${defaultmap}\""
 else
 	defaultmap="\\\"${defaultmap}\\\""

+ 1 - 3
lgsm/functions/fix_kf.sh

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

+ 1 - 3
lgsm/functions/fix_kf2.sh

@@ -4,9 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with Killing Floor 2.
 
-local modulename="FIX"
-local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_parms(){
 parms="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\""

+ 1 - 2
lgsm/functions/fix_mcb.sh

@@ -4,8 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Resolves possible startup issue with Minecraft Bedrock.
 
-local modulename="FIX"
-local commandaction="Fix"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # official docs state that the server should be started with: LD_LIBRARY_PATH=. ./bedrock_server
 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}"

+ 1 - 3
lgsm/functions/fix_mta.sh

@@ -5,9 +5,7 @@
 # Website: https://linuxgsm.com
 # Description: Installs the libmysqlclient for database functions on the server.
 
-local modulename="FIX"
-local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if [ ! -f "${lgsmdir}/lib/libmysqlclient.so.16" ]; then
 	fixname="libmysqlclient16"

+ 1 - 2
lgsm/functions/fix_nmrih.sh

@@ -4,8 +4,7 @@
 # Description: Create symlinks for renamed No More Room In Hell serverfiles.
 # Solution from Steam Community post: https://steamcommunity.com/app/224260/discussions/2/1732089092441769414/
 
-local modulename="FIX"
-local commandaction="Fix"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 ln -s "${serverfiles}/bin/vphysics_srv.so" "${serverfiles}/bin/vphysics.so"
 ln -s "${serverfiles}/bin/studiorender_srv.so" "${serverfiles}/bin/studiorender.so"

+ 1 - 3
lgsm/functions/fix_onset.sh

@@ -4,9 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with Onset.
 
-local modulename="FIX"
-local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}"
 

+ 1 - 3
lgsm/functions/fix_ro.sh

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

+ 1 - 2
lgsm/functions/fix_rust.sh

@@ -4,8 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Resolves startup issue with Rust.
 
-local modulename="FIX"
-local commandaction="Fix"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Fixes: [Raknet] Server Shutting Down (Shutting Down).
 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${systemdir}/RustDedicated_Data/Plugins/x86_64"

+ 1 - 2
lgsm/functions/fix_rw.sh

@@ -4,7 +4,6 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with Rising World.
 
-local modulename="FIX"
-local commandaction="Fix"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64"

+ 1 - 2
lgsm/functions/fix_sdtd.sh

@@ -4,7 +4,6 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with 7 Days to Die.
 
-local modulename="FIX"
-local commandaction="Fix"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}"

+ 1 - 3
lgsm/functions/fix_sfc.sh

@@ -4,9 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with Source Forts Classic.
 
-local modulename="FIX"
-local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if [ ! -f "${serverfiles}/bin/datacache.so" ]; then
 	ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so"

+ 1 - 3
lgsm/functions/fix_sof2.sh

@@ -4,8 +4,6 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with Soldier of Fortune 2.
 
-local modulename="FIX"
-local commandaction="Fix"
-
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 # Fixes: error while loading shared libraries: libcxa.so.1
 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}"

+ 1 - 3
lgsm/functions/fix_ss3.sh

@@ -4,9 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with Serious Sam 3.
 
-local modulename="FIX"
-local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Fixes: https://steamcommunity.com/app/41070/discussions/0/353916981477716386/
 if [ ! -f "${serverfiles}/Bin/steamclient.so" ]||[ "$(diff "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/Bin/steamclient.so" 2>/dev/null)" ]; then

+ 1 - 3
lgsm/functions/fix_steamcmd.sh

@@ -4,9 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues related to SteamCMD.
 
-local modulename="FIX"
-local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Helps fix: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so.
 if [ ! -f "${HOME}/.steam/sdk64/steamclient.so" ]; then

+ 1 - 3
lgsm/functions/fix_terraria.sh

@@ -4,8 +4,6 @@
 # Website: https://linuxgsm.com
 # Description: Resolves an issue with Terraria.
 
-local modulename="FIX"
-local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 export TERM=xterm

+ 1 - 3
lgsm/functions/fix_tf2.sh

@@ -4,9 +4,7 @@
 # Website: https://github.com/vectorsigma
 # Description: Resolves various issues with Team Fortress 2.
 
-local modulename="FIX"
-local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Fixes: Team Fortress 2 Segmentation fault for Red-Hat Distros #2062.
 if [ -f "/etc/redhat-release" ]&&[ ! -f "${serverfiles}/bin/libcurl-gnutls.so.4" ]; then

+ 1 - 3
lgsm/functions/fix_ts3.sh

@@ -4,9 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with Teamspeak 3.
 
-local modulename="FIX"
-local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Fixes: makes libmariadb2 available #1924.
 if [ ! -f "${serverfiles}/libmariadb.so.2" ]; then

+ 2 - 0
lgsm/functions/fix_tu.sh

@@ -4,6 +4,8 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with Tower Unite.
 
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+
 if [ "${shortname}" == "tu" ]; then
 	# Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
 	if [ ! -f "${executabledir}/steamclient.so" ]; then

+ 1 - 2
lgsm/functions/fix_unt.sh

@@ -4,8 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Resolves startup issue with Unturned.
 
-local modulename="FIX"
-local commandaction="Fix"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # steamclient.so: cannot open shared object file: No such file or directory
 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64"

+ 1 - 3
lgsm/functions/fix_ut.sh

@@ -4,9 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with Unreal Tournament.
 
-local modulename="FIX"
-local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 #Set Binary Executable
 echo -e "chmod +x ${executabledir}/${executable}"

+ 1 - 3
lgsm/functions/fix_ut2k4.sh

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

+ 1 - 3
lgsm/functions/fix_ut3.sh

@@ -4,9 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with Unreal Tournament 3.
 
-local modulename="FIX"
-local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_parms(){
 parms="server VCTF-Suspense?Game=UTGameContent.UTVehicleCTFGame_Content?bIsDedicated=true?bIsLanMatch=false?bUsesStats=false?bShouldAdvertise=false?PureServer=1?bAllowJoinInProgress=true?ConfigSubDir=${selfname} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}"

+ 1 - 2
lgsm/functions/fix_wurm.sh

@@ -4,8 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with Wurm Unlimited.
 
-local modulename="FIX"
-local commandaction="Fix"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Copies steamclient.so to correct location.
 if [ ! -f "${serverfiles}/nativelibs" ]; then

+ 1 - 3
lgsm/functions/fix_zmr.sh

@@ -4,9 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Resolves various issues with Zombie Master: Reborn.
 
-local modulename="FIX"
-local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if [ ! -f "${serverfiles}/bin/datacache.so" ]; then
 	ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so"

+ 1 - 1
lgsm/functions/info_config.sh

@@ -5,7 +5,7 @@
 # Website: https://linuxgsm.com
 # Description: Gets specific details from config files.
 
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(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 function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 ### Game Server pid
 if [ "${status}" == "1" ]; then

+ 4 - 2
lgsm/functions/info_messages.sh

@@ -4,6 +4,8 @@
 # Website: https://linuxgsm.com
 # Description: Defines server info messages for details and alerts.
 
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+
 # Standard Details
 # This applies to all engines
 
@@ -1507,7 +1509,7 @@ fn_info_message_select_engine(){
 
 # Separator is different for details
 fn_messages_separator(){
-	if [ "${function_selfname}" == "command_details.sh" ]; then
+	if [ "${commandname}" == "details" ]; then
 		printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 	else
 		echo -e "================================="
@@ -1516,7 +1518,7 @@ fn_messages_separator(){
 
 # Removes the passwords form all but details
 fn_info_message_password_strip(){
-	if [ "${function_selfname}" != "command_details.sh" ]; then
+	if [ "${commandname}" != "DETAILS" ]; then
 		if [ "${serverpassword}" ]; then
 			serverpassword="********"
 		fi

+ 1 - 1
lgsm/functions/info_parms.sh

@@ -4,7 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: If specific parms are not set then this will be displayed in details.
 
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 ## Examples of filtering to get info from config files
 # sed 's/foo//g' - remove foo

部分文件因为文件数量过多而无法显示