From 062ca4236ce589779f4a6672ecbf0815ecba143f Mon Sep 17 00:00:00 2001
From: Daniel Gibbs <me@danielgibbs.co.uk>
Date: Wed, 18 Jul 2018 19:07:09 +0100
Subject: [PATCH]  SC2168: 'local' is only valid in functions.

---
 lgsm/functions/alert_email.sh                   | 2 +-
 lgsm/functions/alert_ifttt.sh                   | 2 +-
 lgsm/functions/alert_mailgun.sh                 | 2 +-
 lgsm/functions/alert_pushbullet.sh              | 2 +-
 lgsm/functions/alert_pushover.sh                | 2 +-
 lgsm/functions/alert_telegram.sh                | 2 +-
 lgsm/functions/check_config.sh                  | 2 +-
 lgsm/functions/check_executable.sh              | 2 +-
 lgsm/functions/check_ip.sh                      | 2 +-
 lgsm/functions/check_logs.sh                    | 2 +-
 lgsm/functions/check_root.sh                    | 2 +-
 lgsm/functions/check_status.sh                  | 2 +-
 lgsm/functions/check_system_dir.sh              | 2 +-
 lgsm/functions/check_system_requirements.sh     | 2 +-
 lgsm/functions/command_backup.sh                | 2 +-
 lgsm/functions/command_console.sh               | 2 +-
 lgsm/functions/command_debug.sh                 | 2 +-
 lgsm/functions/command_details.sh               | 2 +-
 lgsm/functions/command_dev_debug.sh             | 2 +-
 lgsm/functions/command_dev_detect_deps.sh       | 2 +-
 lgsm/functions/command_dev_detect_glibc.sh      | 2 +-
 lgsm/functions/command_dev_detect_ldd.sh        | 2 +-
 lgsm/functions/command_dev_query_raw.sh         | 2 +-
 lgsm/functions/command_fastdl.sh                | 2 +-
 lgsm/functions/command_install.sh               | 2 +-
 lgsm/functions/command_install_resources_mta.sh | 2 +-
 lgsm/functions/command_mods_install.sh          | 2 +-
 lgsm/functions/command_mods_remove.sh           | 2 +-
 lgsm/functions/command_mods_update.sh           | 2 +-
 lgsm/functions/command_monitor.sh               | 2 +-
 lgsm/functions/command_postdetails.sh           | 2 +-
 lgsm/functions/command_restart.sh               | 2 +-
 lgsm/functions/command_start.sh                 | 4 ++--
 lgsm/functions/command_stop.sh                  | 2 +-
 lgsm/functions/command_test_alert.sh            | 2 +-
 lgsm/functions/command_ts3_server_pass.sh       | 2 +-
 lgsm/functions/command_update.sh                | 2 +-
 lgsm/functions/command_update_linuxgsm.sh       | 2 +-
 lgsm/functions/command_validate.sh              | 2 +-
 lgsm/functions/command_wipe.sh                  | 2 +-
 lgsm/functions/compress_unreal2_maps.sh         | 2 +-
 lgsm/functions/compress_ut99_maps.sh            | 2 +-
 lgsm/functions/core_dl.sh                       | 2 +-
 lgsm/functions/core_getopt.sh                   | 2 +-
 lgsm/functions/fix_arma3.sh                     | 2 +-
 lgsm/functions/fix_csgo.sh                      | 2 +-
 lgsm/functions/fix_dst.sh                       | 2 +-
 lgsm/functions/fix_glibc.sh                     | 2 +-
 lgsm/functions/fix_kf.sh                        | 2 +-
 lgsm/functions/fix_kf2.sh                       | 2 +-
 lgsm/functions/fix_mta.sh                       | 2 +-
 lgsm/functions/fix_ro.sh                        | 2 +-
 lgsm/functions/fix_ss3.sh                       | 2 +-
 lgsm/functions/fix_steamcmd.sh                  | 2 +-
 lgsm/functions/fix_ut.sh                        | 2 +-
 lgsm/functions/fix_ut2k4.sh                     | 2 +-
 lgsm/functions/fix_ut3.sh                       | 2 +-
 lgsm/functions/info_config.sh                   | 2 +-
 lgsm/functions/info_distro.sh                   | 2 +-
 lgsm/functions/info_glibc.sh                    | 2 +-
 lgsm/functions/info_parms.sh                    | 2 +-
 lgsm/functions/install_complete.sh              | 2 +-
 lgsm/functions/install_config.sh                | 2 +-
 lgsm/functions/install_dst_token.sh             | 2 +-
 lgsm/functions/install_gslt.sh                  | 2 +-
 lgsm/functions/install_header.sh                | 2 +-
 lgsm/functions/install_logs.sh                  | 2 +-
 lgsm/functions/install_mta_resources.sh         | 2 +-
 lgsm/functions/install_retry.sh                 | 2 +-
 lgsm/functions/install_server_dir.sh            | 2 +-
 lgsm/functions/install_server_files.sh          | 2 +-
 lgsm/functions/install_squad_license.sh         | 2 +-
 lgsm/functions/install_ts3db.sh                 | 2 +-
 lgsm/functions/install_ut2k4_key.sh             | 2 +-
 lgsm/functions/mods_core.sh                     | 2 +-
 lgsm/functions/mods_list.sh                     | 2 +-
 lgsm/functions/update_factorio.sh               | 2 +-
 lgsm/functions/update_minecraft.sh              | 2 +-
 lgsm/functions/update_mta.sh                    | 2 +-
 lgsm/functions/update_mumble.sh                 | 2 +-
 lgsm/functions/update_steamcmd.sh               | 2 +-
 lgsm/functions/update_ts3.sh                    | 2 +-
 82 files changed, 83 insertions(+), 83 deletions(-)

diff --git a/lgsm/functions/alert_email.sh b/lgsm/functions/alert_email.sh
index d3db30319..c7c09b5e4 100644
--- a/lgsm/functions/alert_email.sh
+++ b/lgsm/functions/alert_email.sh
@@ -6,7 +6,7 @@
 
 local commandname="ALERT"
 local commandaction="Alert"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_print_dots "Sending Email alert: ${email}"
 sleep 0.5
diff --git a/lgsm/functions/alert_ifttt.sh b/lgsm/functions/alert_ifttt.sh
index 07c99dda6..bf94cb8a3 100644
--- a/lgsm/functions/alert_ifttt.sh
+++ b/lgsm/functions/alert_ifttt.sh
@@ -6,7 +6,7 @@
 
 local commandname="ALERT"
 local commandaction="Alert"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 json=$(cat <<EOF
 {
diff --git a/lgsm/functions/alert_mailgun.sh b/lgsm/functions/alert_mailgun.sh
index ac46e03d7..5c38bf940 100644
--- a/lgsm/functions/alert_mailgun.sh
+++ b/lgsm/functions/alert_mailgun.sh
@@ -6,7 +6,7 @@
 
 local commandname="ALERT"
 local commandaction="Alert"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_print_dots "Sending Email alert: Mailgun: ${email}"
 sleep 0.5
diff --git a/lgsm/functions/alert_pushbullet.sh b/lgsm/functions/alert_pushbullet.sh
index aebef54ab..724b86199 100644
--- a/lgsm/functions/alert_pushbullet.sh
+++ b/lgsm/functions/alert_pushbullet.sh
@@ -6,7 +6,7 @@
 
 local commandname="ALERT"
 local commandaction="Alert"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 json=$(cat <<EOF
 {
diff --git a/lgsm/functions/alert_pushover.sh b/lgsm/functions/alert_pushover.sh
index 9d09d1e90..f5ef92365 100644
--- a/lgsm/functions/alert_pushover.sh
+++ b/lgsm/functions/alert_pushover.sh
@@ -6,7 +6,7 @@
 
 local commandname="ALERT"
 local commandaction="Alert"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_print_dots "Sending Pushover alert"
 sleep 0.5
diff --git a/lgsm/functions/alert_telegram.sh b/lgsm/functions/alert_telegram.sh
index cf14aafc3..14ab8fb28 100644
--- a/lgsm/functions/alert_telegram.sh
+++ b/lgsm/functions/alert_telegram.sh
@@ -6,7 +6,7 @@
 
 local commandname="ALERT"
 local commandaction="Alert"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 json=$(cat <<EOF
 {
diff --git a/lgsm/functions/check_config.sh b/lgsm/functions/check_config.sh
index d7bc5ae92..14556029b 100644
--- a/lgsm/functions/check_config.sh
+++ b/lgsm/functions/check_config.sh
@@ -5,7 +5,7 @@
 # Description: Checks if the server config is missing and warns the user if needed.
 
 local commandname="CHECK"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if [ ! -e "${servercfgfullpath}" ]; then
 	if [ "${gamename}" != "Hurtworld" ]&&[ "${shortname}" != "ut3" ]&&[ "${shortname}" != "kf2" ]; then
diff --git a/lgsm/functions/check_executable.sh b/lgsm/functions/check_executable.sh
index db9ca411a..11e7b7172 100644
--- a/lgsm/functions/check_executable.sh
+++ b/lgsm/functions/check_executable.sh
@@ -5,7 +5,7 @@
 # Description: Checks if executable exists.
 
 local commandname="CHECK"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Check if executable exists
 if [ ! -f "${executabledir}/${execname}" ]; then
diff --git a/lgsm/functions/check_ip.sh b/lgsm/functions/check_ip.sh
index 507a1a51a..d061d04db 100644
--- a/lgsm/functions/check_ip.sh
+++ b/lgsm/functions/check_ip.sh
@@ -6,7 +6,7 @@
 # If multiple interfaces are detected the user will need to manually set using ip="0.0.0.0".
 
 local commandname="CHECK"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travistest}" != "1" ]; then
 	if [ ! -f "/bin/ip" ]; then
diff --git a/lgsm/functions/check_logs.sh b/lgsm/functions/check_logs.sh
index b842c0de6..9a05b0b64 100644
--- a/lgsm/functions/check_logs.sh
+++ b/lgsm/functions/check_logs.sh
@@ -5,7 +5,7 @@
 # Description: Checks if log files exist.
 
 local commandname="CHECK"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_check_logs(){
 	fn_print_dots "Checking for log files"
diff --git a/lgsm/functions/check_root.sh b/lgsm/functions/check_root.sh
index a58782515..f30804163 100644
--- a/lgsm/functions/check_root.sh
+++ b/lgsm/functions/check_root.sh
@@ -5,7 +5,7 @@
 # Description: Checks if the user tried to run the script as root.
 
 local commandname="CHECK"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if [ "$(whoami)" = "root" ]; then
 	fn_print_fail_nl "Do NOT run this script as root!"
diff --git a/lgsm/functions/check_status.sh b/lgsm/functions/check_status.sh
index 4fb1bfa31..bfa651237 100644
--- a/lgsm/functions/check_status.sh
+++ b/lgsm/functions/check_status.sh
@@ -6,7 +6,7 @@
 # Description: Checks the process status of the server. Either online or offline.
 
 local commandname="CHECK"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if [ "${gamename}" == "TeamSpeak 3" ]; then
 	# 1: Server is running
diff --git a/lgsm/functions/check_system_dir.sh b/lgsm/functions/check_system_dir.sh
index 0a10b15ac..04648f6eb 100644
--- a/lgsm/functions/check_system_dir.sh
+++ b/lgsm/functions/check_system_dir.sh
@@ -5,7 +5,7 @@
 # Description: Checks if systemdir/serverfiles is accessible.
 
 local commandname="CHECK"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if [ "${function_selfname}" != "command_validate.sh" ]; then
 	checkdir="${serverfiles}"
diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/functions/check_system_requirements.sh
index e0a3dbd01..f5882607a 100644
--- a/lgsm/functions/check_system_requirements.sh
+++ b/lgsm/functions/check_system_requirements.sh
@@ -6,7 +6,7 @@
 # Description: Checks RAM requirements
 
 local commandname="CHECK"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 info_distro.sh
 
diff --git a/lgsm/functions/command_backup.sh b/lgsm/functions/command_backup.sh
index b2df4be6d..58bd366ac 100644
--- a/lgsm/functions/command_backup.sh
+++ b/lgsm/functions/command_backup.sh
@@ -7,7 +7,7 @@
 
 local commandname="BACKUP"
 local commandaction="Backup"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 
diff --git a/lgsm/functions/command_console.sh b/lgsm/functions/command_console.sh
index e7d9a6ac9..b0c05774e 100644
--- a/lgsm/functions/command_console.sh
+++ b/lgsm/functions/command_console.sh
@@ -6,7 +6,7 @@
 
 local commandname="CONSOLE"
 local commandaction="Console"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 fn_print_header
diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh
index 270d23e5f..46bdfdb3b 100644
--- a/lgsm/functions/command_debug.sh
+++ b/lgsm/functions/command_debug.sh
@@ -6,7 +6,7 @@
 
 local commandname="DEBUG"
 local commandaction="Debug"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Trap to remove lockfile on quit.
 fn_lockfile_trap(){
diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh
index 3474ae3ac..869eb3f60 100644
--- a/lgsm/functions/command_details.sh
+++ b/lgsm/functions/command_details.sh
@@ -7,7 +7,7 @@
 
 local commandname="DETAILS"
 local commandaction="Details"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Run checks and gathers details to display.
 check.sh
diff --git a/lgsm/functions/command_dev_debug.sh b/lgsm/functions/command_dev_debug.sh
index 7c831681a..d594112d0 100644
--- a/lgsm/functions/command_dev_debug.sh
+++ b/lgsm/functions/command_dev_debug.sh
@@ -6,7 +6,7 @@
 
 local commandname="DEV-DEBUG"
 local commandaction="Dev-Debug"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if [ -f "${rootdir}/.dev-debug" ]; then
 	rm "${rootdir}/.dev-debug"
diff --git a/lgsm/functions/command_dev_detect_deps.sh b/lgsm/functions/command_dev_detect_deps.sh
index 8f3949b37..d1d68af8d 100644
--- a/lgsm/functions/command_dev_detect_deps.sh
+++ b/lgsm/functions/command_dev_detect_deps.sh
@@ -6,7 +6,7 @@
 
 local commandname="DETECT-DEPS"
 local commandaction="Detect-Deps"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 echo "================================="
 echo "Dependencies Checker"
diff --git a/lgsm/functions/command_dev_detect_glibc.sh b/lgsm/functions/command_dev_detect_glibc.sh
index d28846402..904305a17 100644
--- a/lgsm/functions/command_dev_detect_glibc.sh
+++ b/lgsm/functions/command_dev_detect_glibc.sh
@@ -7,7 +7,7 @@
 
 local commandname="DETECT-GLIBC"
 local commandaction="Detect-Glibc"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 echo "================================="
 echo "GLIBC Requirements Checker"
diff --git a/lgsm/functions/command_dev_detect_ldd.sh b/lgsm/functions/command_dev_detect_ldd.sh
index 95898c4e4..d44e0a508 100644
--- a/lgsm/functions/command_dev_detect_ldd.sh
+++ b/lgsm/functions/command_dev_detect_ldd.sh
@@ -7,7 +7,7 @@
 
 local commandname="DETECT-LDD"
 local commandaction="Detect-LDD"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 echo "================================="
 echo "Shared Object dependencies Checker"
diff --git a/lgsm/functions/command_dev_query_raw.sh b/lgsm/functions/command_dev_query_raw.sh
index ad4ed7a42..df33bc3b0 100644
--- a/lgsm/functions/command_dev_query_raw.sh
+++ b/lgsm/functions/command_dev_query_raw.sh
@@ -6,7 +6,7 @@
 
 local commandname="QUERY-RAW"
 local commandaction="QUERY-RAW"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 echo "================================="
 echo "Gamedig Raw Output"
diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh
index 630778e59..45e7ba3d6 100644
--- a/lgsm/functions/command_fastdl.sh
+++ b/lgsm/functions/command_fastdl.sh
@@ -7,7 +7,7 @@
 
 local commandname="FASTDL"
 local commandaction="FastDL"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 
diff --git a/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh
index 275055a5b..819361815 100644
--- a/lgsm/functions/command_install.sh
+++ b/lgsm/functions/command_install.sh
@@ -7,7 +7,7 @@
 
 local commandname="INSTALL"
 local commandaction="Install"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 install_header.sh
diff --git a/lgsm/functions/command_install_resources_mta.sh b/lgsm/functions/command_install_resources_mta.sh
index 7e7c4bb10..37066e712 100644
--- a/lgsm/functions/command_install_resources_mta.sh
+++ b/lgsm/functions/command_install_resources_mta.sh
@@ -6,7 +6,7 @@
 
 local commandname="DEFAULT_RESOURCES"
 local commandaction="Default Resources"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_install_resources(){
 	echo ""
diff --git a/lgsm/functions/command_mods_install.sh b/lgsm/functions/command_mods_install.sh
index b26bb9e06..208c193a4 100644
--- a/lgsm/functions/command_mods_install.sh
+++ b/lgsm/functions/command_mods_install.sh
@@ -7,7 +7,7 @@
 
 local commandname="MODS"
 local commandaction="addons/mods"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 mods_core.sh
diff --git a/lgsm/functions/command_mods_remove.sh b/lgsm/functions/command_mods_remove.sh
index 4ecdacfed..63a88f91d 100644
--- a/lgsm/functions/command_mods_remove.sh
+++ b/lgsm/functions/command_mods_remove.sh
@@ -7,7 +7,7 @@
 
 local commandname="MODS"
 local commandaction="addons/mods"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 mods_core.sh
diff --git a/lgsm/functions/command_mods_update.sh b/lgsm/functions/command_mods_update.sh
index b80e4416e..70d48e1c7 100644
--- a/lgsm/functions/command_mods_update.sh
+++ b/lgsm/functions/command_mods_update.sh
@@ -7,7 +7,7 @@
 
 local commandname="MODS"
 local commandaction="Mods Update"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 mods_core.sh
diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh
index 1febd053a..46abcd67f 100644
--- a/lgsm/functions/command_monitor.sh
+++ b/lgsm/functions/command_monitor.sh
@@ -8,7 +8,7 @@
 
 local commandname="MONITOR"
 local commandaction="Monitor"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_monitor_loop(){
 # Will query up to 5 times every 15 seconds.
diff --git a/lgsm/functions/command_postdetails.sh b/lgsm/functions/command_postdetails.sh
index 0ef39ce54..05eebe612 100644
--- a/lgsm/functions/command_postdetails.sh
+++ b/lgsm/functions/command_postdetails.sh
@@ -7,7 +7,7 @@
 
 local commandname="postdetails"
 local commandaction="Postdetails"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Set posttarget to the appropriately-defined post destination.
 
diff --git a/lgsm/functions/command_restart.sh b/lgsm/functions/command_restart.sh
index db8678bb5..2c98db434 100644
--- a/lgsm/functions/command_restart.sh
+++ b/lgsm/functions/command_restart.sh
@@ -6,7 +6,7 @@
 
 local commandname="RESTART"
 local commandaction="Restarting"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 info_config.sh
 exitbypass=1
diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh
index 208910942..1498b079b 100644
--- a/lgsm/functions/command_start.sh
+++ b/lgsm/functions/command_start.sh
@@ -7,7 +7,7 @@
 
 local commandname="START"
 local commandaction="Starting"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_start_teamspeak3(){
 	if [ ! -e "${servercfgfullpath}" ]; then
@@ -155,7 +155,7 @@ sleep 0.5
 			echo ""
 			echo "Fix"
 			echo "================================="
-				if [ ! $(grep "tty:" /etc/group|grep "$(whoami)") ]; then
+				if [ ! $(grep "tty:" /etc/group | grep "$(whoami)") ]; then
 					echo "$(whoami) is not part of the tty group."
 					fn_script_log_info "$(whoami) is not part of the tty group."
 					group=$(grep tty /etc/group)
diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh
index 7b8ce1597..c0ff0f214 100644
--- a/lgsm/functions/command_stop.sh
+++ b/lgsm/functions/command_stop.sh
@@ -7,7 +7,7 @@
 
 local commandname="STOP"
 local commandaction="Stopping"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Attempts graceful shutdown by sending the 'CTRL+c'.
 fn_stop_graceful_ctrlc(){
diff --git a/lgsm/functions/command_test_alert.sh b/lgsm/functions/command_test_alert.sh
index ff5084696..aea032b6c 100644
--- a/lgsm/functions/command_test_alert.sh
+++ b/lgsm/functions/command_test_alert.sh
@@ -6,7 +6,7 @@
 
 local commandname="ALERT"
 local commandaction="Alert"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_print_dots "${servername}"
 sleep 0.5
diff --git a/lgsm/functions/command_ts3_server_pass.sh b/lgsm/functions/command_ts3_server_pass.sh
index cbd3ad9ae..4c80a4b3a 100644
--- a/lgsm/functions/command_ts3_server_pass.sh
+++ b/lgsm/functions/command_ts3_server_pass.sh
@@ -7,7 +7,7 @@
 
 local commandname="TS3-CHANGE-PASS"
 local commandaction="ServerAdmin Password Change"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_serveradmin_password_prompt(){
 	fn_print_header
diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh
index de180118a..2ef955807 100644
--- a/lgsm/functions/command_update.sh
+++ b/lgsm/functions/command_update.sh
@@ -6,7 +6,7 @@
 
 local commandname="UPDATE"
 local commandaction="Update"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_print_dots ""
 sleep 0.5
diff --git a/lgsm/functions/command_update_linuxgsm.sh b/lgsm/functions/command_update_linuxgsm.sh
index 77e5ddc49..db323e812 100644
--- a/lgsm/functions/command_update_linuxgsm.sh
+++ b/lgsm/functions/command_update_linuxgsm.sh
@@ -6,7 +6,7 @@
 
 local commandname="UPDATE LinuxGSM"
 local commandaction="Update LinuxGSM"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_print_dots "Updating LinuxGSM"
 sleep 0.5
diff --git a/lgsm/functions/command_validate.sh b/lgsm/functions/command_validate.sh
index 78fd28f38..0b53c70b6 100644
--- a/lgsm/functions/command_validate.sh
+++ b/lgsm/functions/command_validate.sh
@@ -6,7 +6,7 @@
 
 local commandname="VALIDATE"
 local commandaction="Validate"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_validation(){
 	echo ""
diff --git a/lgsm/functions/command_wipe.sh b/lgsm/functions/command_wipe.sh
index 7e38cf1ab..7fce8f776 100644
--- a/lgsm/functions/command_wipe.sh
+++ b/lgsm/functions/command_wipe.sh
@@ -7,7 +7,7 @@
 
 local commandname="WIPE"
 local commandaction="data wipe"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 fn_print_header
diff --git a/lgsm/functions/compress_unreal2_maps.sh b/lgsm/functions/compress_unreal2_maps.sh
index 856bc5086..51594111c 100644
--- a/lgsm/functions/compress_unreal2_maps.sh
+++ b/lgsm/functions/compress_unreal2_maps.sh
@@ -5,7 +5,7 @@
 # Description: Compresses unreal maps.
 
 local commandaction="Unreal Map Compressor"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 fn_print_header
diff --git a/lgsm/functions/compress_ut99_maps.sh b/lgsm/functions/compress_ut99_maps.sh
index 0832ae997..d45e3a73f 100644
--- a/lgsm/functions/compress_ut99_maps.sh
+++ b/lgsm/functions/compress_ut99_maps.sh
@@ -5,7 +5,7 @@
 # Description: Compresses unreal maps.
 
 local commandaction="Unreal Map Compressor"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 fn_print_header
diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh
index ea23b8c7e..32afc8ed3 100644
--- a/lgsm/functions/core_dl.sh
+++ b/lgsm/functions/core_dl.sh
@@ -19,7 +19,7 @@
 
 local commandname="DOWNLOAD"
 local commandaction="Download"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_dl_md5(){
 	# Runs MD5 Check if available
diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh
index d88d25d2b..ba09bead0 100644
--- a/lgsm/functions/core_getopt.sh
+++ b/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]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 ### Define all commands here ###
 ## User commands | Trigger commands | Description
diff --git a/lgsm/functions/fix_arma3.sh b/lgsm/functions/fix_arma3.sh
index 06e54f7cd..d5473f61a 100644
--- a/lgsm/functions/fix_arma3.sh
+++ b/lgsm/functions/fix_arma3.sh
@@ -6,7 +6,7 @@
 
 local commandname="FIX"
 local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+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
diff --git a/lgsm/functions/fix_csgo.sh b/lgsm/functions/fix_csgo.sh
index f51b405ff..a969fbb07 100644
--- a/lgsm/functions/fix_csgo.sh
+++ b/lgsm/functions/fix_csgo.sh
@@ -6,7 +6,7 @@
 
 local commandname="FIX"
 local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Fixes: server not always creating steam_appid.txt file.
 if [ ! -f "${serverfiles}/steam_appid.txt" ]; then
diff --git a/lgsm/functions/fix_dst.sh b/lgsm/functions/fix_dst.sh
index 80c397442..ef8d45150 100644
--- a/lgsm/functions/fix_dst.sh
+++ b/lgsm/functions/fix_dst.sh
@@ -6,7 +6,7 @@
 
 local commandname="FIX"
 local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+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.
diff --git a/lgsm/functions/fix_glibc.sh b/lgsm/functions/fix_glibc.sh
index b5da964de..bf727323d 100644
--- a/lgsm/functions/fix_glibc.sh
+++ b/lgsm/functions/fix_glibc.sh
@@ -6,7 +6,7 @@
 
 local commandname="FIX"
 local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 ## i386
 
diff --git a/lgsm/functions/fix_kf.sh b/lgsm/functions/fix_kf.sh
index ad96678ef..78f00d28f 100644
--- a/lgsm/functions/fix_kf.sh
+++ b/lgsm/functions/fix_kf.sh
@@ -6,7 +6,7 @@
 
 local commandname="FIX"
 local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+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"
diff --git a/lgsm/functions/fix_kf2.sh b/lgsm/functions/fix_kf2.sh
index 02940bf07..f421745be 100644
--- a/lgsm/functions/fix_kf2.sh
+++ b/lgsm/functions/fix_kf2.sh
@@ -6,7 +6,7 @@
 
 local commandname="FIX"
 local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_parms(){
 parms="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\""
diff --git a/lgsm/functions/fix_mta.sh b/lgsm/functions/fix_mta.sh
index f16064a96..212dacaaa 100644
--- a/lgsm/functions/fix_mta.sh
+++ b/lgsm/functions/fix_mta.sh
@@ -6,7 +6,7 @@
 # Description: Installs the libmysqlclient for database functions on the server
 local commandname="FIX"
 local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if [ ! -f "${lgsmdir}/lib/libmysqlclient.so.16" ]; then
 	fixname="libmysqlclient16"
diff --git a/lgsm/functions/fix_ro.sh b/lgsm/functions/fix_ro.sh
index 0b4f41f15..57f88016d 100644
--- a/lgsm/functions/fix_ro.sh
+++ b/lgsm/functions/fix_ro.sh
@@ -6,7 +6,7 @@
 
 local commandname="FIX"
 local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+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"
diff --git a/lgsm/functions/fix_ss3.sh b/lgsm/functions/fix_ss3.sh
index 3ebbc3910..7f0b873c5 100644
--- a/lgsm/functions/fix_ss3.sh
+++ b/lgsm/functions/fix_ss3.sh
@@ -6,7 +6,7 @@
 
 local commandname="FIX"
 local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Fixes https://steamcommunity.com/app/41070/discussions/0/353916981477716386/
 if [ "$(diff "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/Bin/steamclient.so" >/dev/null)" ]; then
diff --git a/lgsm/functions/fix_steamcmd.sh b/lgsm/functions/fix_steamcmd.sh
index 3a63b1505..47be4c8bf 100644
--- a/lgsm/functions/fix_steamcmd.sh
+++ b/lgsm/functions/fix_steamcmd.sh
@@ -6,7 +6,7 @@
 
 local commandname="FIX"
 local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+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
diff --git a/lgsm/functions/fix_ut.sh b/lgsm/functions/fix_ut.sh
index aaaad40cb..2007fd131 100644
--- a/lgsm/functions/fix_ut.sh
+++ b/lgsm/functions/fix_ut.sh
@@ -6,7 +6,7 @@
 
 local commandname="FIX"
 local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 #Set Binary Executable
 echo "chmod +x ${executabledir}/${executable}"
diff --git a/lgsm/functions/fix_ut2k4.sh b/lgsm/functions/fix_ut2k4.sh
index b29b312c3..88f73d9fb 100644
--- a/lgsm/functions/fix_ut2k4.sh
+++ b/lgsm/functions/fix_ut2k4.sh
@@ -6,7 +6,7 @@
 
 local commandname="FIX"
 local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+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"
diff --git a/lgsm/functions/fix_ut3.sh b/lgsm/functions/fix_ut3.sh
index 217140432..113aeba99 100644
--- a/lgsm/functions/fix_ut3.sh
+++ b/lgsm/functions/fix_ut3.sh
@@ -6,7 +6,7 @@
 
 local commandname="FIX"
 local commandaction="Fix"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(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=${servicename} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}"
diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh
index b9ef232ff..4efad1a9e 100644
--- a/lgsm/functions/info_config.sh
+++ b/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]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 ## Examples of filtering to get info from config files
 # sed 's/foo//g' - remove foo
diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh
index f8434ef1e..cd3f4b6ee 100644
--- a/lgsm/functions/info_distro.sh
+++ b/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]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 ### Distro information
 
diff --git a/lgsm/functions/info_glibc.sh b/lgsm/functions/info_glibc.sh
index 6d2ca4f20..f04148c49 100644
--- a/lgsm/functions/info_glibc.sh
+++ b/lgsm/functions/info_glibc.sh
@@ -4,7 +4,7 @@
 # Website: https://linuxgsm.com
 # Description: Stores details on servers Glibc requirements.
 
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if [ "${gamename}" == "ARK: Survival Evolved" ]; then
 	glibcrequired="2.15"
diff --git a/lgsm/functions/info_parms.sh b/lgsm/functions/info_parms.sh
index f1ecf21f7..1047cae2b 100644
--- a/lgsm/functions/info_parms.sh
+++ b/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]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 ## Examples of filtering to get info from config files
 # sed 's/foo//g' - remove foo
diff --git a/lgsm/functions/install_complete.sh b/lgsm/functions/install_complete.sh
index 9712a6bc8..da99725ba 100644
--- a/lgsm/functions/install_complete.sh
+++ b/lgsm/functions/install_complete.sh
@@ -6,7 +6,7 @@
 
 local commandname="INSTALL"
 local commandaction="Install"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 echo "================================="
 echo "Install Complete!"
diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh
index 28f8a954d..5320d5de9 100644
--- a/lgsm/functions/install_config.sh
+++ b/lgsm/functions/install_config.sh
@@ -6,7 +6,7 @@
 
 local commandname="INSTALL"
 local commandaction="Install"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Checks if server cfg dir exists, creates it if it doesn't
 fn_check_cfgdir(){
diff --git a/lgsm/functions/install_dst_token.sh b/lgsm/functions/install_dst_token.sh
index 11a4c3679..5cc7993d3 100644
--- a/lgsm/functions/install_dst_token.sh
+++ b/lgsm/functions/install_dst_token.sh
@@ -6,7 +6,7 @@
 
 local commandname="INSTALL"
 local commandaction="Install"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 echo ""
 echo "Enter ${gamename} Cluster Token"
diff --git a/lgsm/functions/install_gslt.sh b/lgsm/functions/install_gslt.sh
index ab1ea7dca..67b72515c 100644
--- a/lgsm/functions/install_gslt.sh
+++ b/lgsm/functions/install_gslt.sh
@@ -6,7 +6,7 @@
 
 local commandname="INSTALL"
 local commandaction="Install"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 echo ""
 echo "Game Server Login Token"
diff --git a/lgsm/functions/install_header.sh b/lgsm/functions/install_header.sh
index cae416547..56fd34705 100644
--- a/lgsm/functions/install_header.sh
+++ b/lgsm/functions/install_header.sh
@@ -6,7 +6,7 @@
 
 local commandname="INSTALL"
 local commandaction="Install"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 clear
 echo "================================="
diff --git a/lgsm/functions/install_logs.sh b/lgsm/functions/install_logs.sh
index acd6a6917..4ee3541c2 100644
--- a/lgsm/functions/install_logs.sh
+++ b/lgsm/functions/install_logs.sh
@@ -6,7 +6,7 @@
 
 local commandname="INSTALL"
 local commandaction="Install"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if [ "${checklogs}" != "1" ]; then
 	echo ""
diff --git a/lgsm/functions/install_mta_resources.sh b/lgsm/functions/install_mta_resources.sh
index b4ff2bece..cb6a77f6f 100644
--- a/lgsm/functions/install_mta_resources.sh
+++ b/lgsm/functions/install_mta_resources.sh
@@ -7,7 +7,7 @@
 
 local commandname="INSTALL"
 local commandaction="Install"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_print_information_nl "${gamename} will not function without resources!"
 echo "	* install default resources using ./${selfname} install-default-resources"
diff --git a/lgsm/functions/install_retry.sh b/lgsm/functions/install_retry.sh
index e2918c268..96df1759c 100644
--- a/lgsm/functions/install_retry.sh
+++ b/lgsm/functions/install_retry.sh
@@ -6,7 +6,7 @@
 
 local commandname="INSTALL"
 local commandaction="Install"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 if fn_prompt_yn "Retry install?" Y; then
 	command_install.sh; exit
diff --git a/lgsm/functions/install_server_dir.sh b/lgsm/functions/install_server_dir.sh
index abb8f6fb0..64485a889 100644
--- a/lgsm/functions/install_server_dir.sh
+++ b/lgsm/functions/install_server_dir.sh
@@ -6,7 +6,7 @@
 
 local commandname="INSTALL"
 local commandaction="Install"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 echo ""
 echo "Server Directory"
diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh
index 31a2ece03..0508c2793 100644
--- a/lgsm/functions/install_server_files.sh
+++ b/lgsm/functions/install_server_files.sh
@@ -6,7 +6,7 @@
 
 local commandname="INSTALL"
 local commandaction="Install"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_install_server_files(){
 	if [ "${gamename}" == "Battlefield: 1942" ]; then
diff --git a/lgsm/functions/install_squad_license.sh b/lgsm/functions/install_squad_license.sh
index 3b0711309..87124ee3e 100644
--- a/lgsm/functions/install_squad_license.sh
+++ b/lgsm/functions/install_squad_license.sh
@@ -6,7 +6,7 @@
 
 local commandname="INSTALL"
 local commandaction="Install"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 echo ""
 echo "Squad Server License"
diff --git a/lgsm/functions/install_ts3db.sh b/lgsm/functions/install_ts3db.sh
index 701b8c5ad..83ec249b9 100644
--- a/lgsm/functions/install_ts3db.sh
+++ b/lgsm/functions/install_ts3db.sh
@@ -7,7 +7,7 @@
 
 local commandname="INSTALL"
 local commandaction="Install"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_install_ts3db_mariadb(){
 	echo ""
diff --git a/lgsm/functions/install_ut2k4_key.sh b/lgsm/functions/install_ut2k4_key.sh
index f1e840462..bbe6af936 100644
--- a/lgsm/functions/install_ut2k4_key.sh
+++ b/lgsm/functions/install_ut2k4_key.sh
@@ -6,7 +6,7 @@
 
 local commandname="INSTALL"
 local commandaction="Install"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 echo ""
 echo "Enter ${gamename} CD Key"
diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh
index c53ad7c96..5d7bd7730 100644
--- a/lgsm/functions/mods_core.sh
+++ b/lgsm/functions/mods_core.sh
@@ -7,7 +7,7 @@
 
 local commandname="MODS"
 local commandaction="addons/mods"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Files and Directories
 modsdir="${lgsmdir}/mods"
diff --git a/lgsm/functions/mods_list.sh b/lgsm/functions/mods_list.sh
index 659878d28..01d10e8be 100644
--- a/lgsm/functions/mods_list.sh
+++ b/lgsm/functions/mods_list.sh
@@ -10,7 +10,7 @@
 
 local commandname="MODS"
 local commandaction="List Mods"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 # Get a proper URL for mods that don't provide a good one (optional)
 fn_script_log_info "Retrieving latest mods URLs"
diff --git a/lgsm/functions/update_factorio.sh b/lgsm/functions/update_factorio.sh
index ca70396e8..5e83ddda1 100644
--- a/lgsm/functions/update_factorio.sh
+++ b/lgsm/functions/update_factorio.sh
@@ -7,7 +7,7 @@
 
 local commandname="UPDATE"
 local commandaction="Update"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_update_factorio_dl(){
 	fn_fetch_file "https://www.factorio.com/get-download/${availablebuild}/headless/${factorioarch}" "${tmpdir}" "factorio_headless_${factorioarch}-${availablebuild}.tar.gz"
diff --git a/lgsm/functions/update_minecraft.sh b/lgsm/functions/update_minecraft.sh
index 88ee6cebc..ae19061cf 100644
--- a/lgsm/functions/update_minecraft.sh
+++ b/lgsm/functions/update_minecraft.sh
@@ -6,7 +6,7 @@
 
 local commandname="UPDATE"
 local commandaction="Update"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_update_dl(){
 	fn_fetch_file "https://s3.amazonaws.com/Minecraft.Download/versions/${availablebuild}/minecraft_server.${availablebuild}.jar" "${tmpdir}" "minecraft_server.${availablebuild}.jar"
diff --git a/lgsm/functions/update_mta.sh b/lgsm/functions/update_mta.sh
index 1a4bb4419..a6cbb872c 100644
--- a/lgsm/functions/update_mta.sh
+++ b/lgsm/functions/update_mta.sh
@@ -6,7 +6,7 @@
 
 local commandname="UPDATE"
 local commandaction="Update"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_update_mta_dl(){
 	fn_fetch_file "http://linux.mtasa.com/dl/${numversion}/multitheftauto_linux_x64-${fullversion}.tar.gz" "${tmpdir}" "multitheftauto_linux_x64-${fullversion}.tar.gz"
diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh
index 3ad1c1a47..2c783f211 100644
--- a/lgsm/functions/update_mumble.sh
+++ b/lgsm/functions/update_mumble.sh
@@ -7,7 +7,7 @@
 
 local commandname="UPDATE"
 local commandaction="Update"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 fn_update_mumble_dl(){
 	fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${availablebuild}/murmur-static_${mumblearch}-${availablebuild}.tar.bz2" "${tmpdir}" "murmur-static_${mumblearch}-${availablebuild}.tar.bz2"
diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh
index b60adbc53..55b6b6e79 100644
--- a/lgsm/functions/update_steamcmd.sh
+++ b/lgsm/functions/update_steamcmd.sh
@@ -6,7 +6,7 @@
 
 local commandname="UPDATE"
 local commandaction="Update"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 
 check.sh
 
diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh
index 596979348..3a1382c2f 100644
--- a/lgsm/functions/update_ts3.sh
+++ b/lgsm/functions/update_ts3.sh
@@ -6,7 +6,7 @@
 
 local commandname="UPDATE"
 local commandaction="Update"
-local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
+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" "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2"