From b013b20aa865cfc6822f875fc3b1f526e9dca205 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 7 Jul 2016 22:18:08 +0100 Subject: [PATCH] function_selfname is now local --- functions/command_update_functions.sh | 2 +- lgsm/functions/alert_pushbullet.sh | 2 +- lgsm/functions/command_backup.sh | 2 +- lgsm/functions/command_console.sh | 3 +-- 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_fastdl.sh | 2 +- lgsm/functions/command_install.sh | 2 +- lgsm/functions/command_monitor.sh | 2 +- lgsm/functions/command_restart.sh | 2 +- lgsm/functions/command_start.sh | 2 +- 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_functions.sh | 2 +- lgsm/functions/command_validate.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/update_check.sh | 2 +- lgsm/functions/update_dl.sh | 2 +- lgsm/functions/update_ts3.sh | 2 +- 26 files changed, 26 insertions(+), 27 deletions(-) diff --git a/functions/command_update_functions.sh b/functions/command_update_functions.sh index d97bdc4e8..0c35eb1f0 100644 --- a/functions/command_update_functions.sh +++ b/functions/command_update_functions.sh @@ -6,7 +6,7 @@ lgsm_version="210516" # Description: Deletes the functions dir to allow re-downloading of functions from GitHub. -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" check.sh fn_print_dots "Updating functions" fn_script_log "Updating functions" diff --git a/lgsm/functions/alert_pushbullet.sh b/lgsm/functions/alert_pushbullet.sh index cc85be8d4..ae35b8f4a 100644 --- a/lgsm/functions/alert_pushbullet.sh +++ b/lgsm/functions/alert_pushbullet.sh @@ -7,7 +7,7 @@ lgsm_version="210516" # Description: alerts using pushbullet. local modulename="Alert" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_print_dots "Sending Pushbullet alert" sleep 1 diff --git a/lgsm/functions/command_backup.sh b/lgsm/functions/command_backup.sh index a9f8f74eb..713a931c8 100644 --- a/lgsm/functions/command_backup.sh +++ b/lgsm/functions/command_backup.sh @@ -7,7 +7,7 @@ lgsm_version="210516" # Description: Creates a .tar.gz file in the backup directory. local modulename="Backup" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" check.sh info_distro.sh diff --git a/lgsm/functions/command_console.sh b/lgsm/functions/command_console.sh index 3d3873f0d..54adb8443 100644 --- a/lgsm/functions/command_console.sh +++ b/lgsm/functions/command_console.sh @@ -7,7 +7,7 @@ lgsm_version="210516" # Description: Gives access to the server tmux console. local modulename="Console" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" check.sh echo "" @@ -45,7 +45,6 @@ else * ) echo "Please answer yes or no.";; esac done - function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fi core_exit.sh diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh index 8adb7fb86..94bca69ba 100644 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/functions/command_debug.sh @@ -7,7 +7,7 @@ lgsm_version="210516" # Description: Runs the server without tmux. Runs direct from the terminal. local modulename="Debug" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" # Trap to remove lockfile on quit. fn_lockfile_trap(){ diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index e1a7e2ee7..4cf92c14c 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -6,7 +6,7 @@ lgsm_version="190616" # Description: Displays server infomation. -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" # Standard Details # This applies to all engines diff --git a/lgsm/functions/command_dev_debug.sh b/lgsm/functions/command_dev_debug.sh index fe704d146..4ff0f7eb9 100644 --- a/lgsm/functions/command_dev_debug.sh +++ b/lgsm/functions/command_dev_debug.sh @@ -6,7 +6,7 @@ lgsm_version="210516" # Description: Dev only: enables debuging log to be saved to dev-debug.log. -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" if [ -f ".dev-debug" ]; then rm .dev-debug diff --git a/lgsm/functions/command_dev_detect_deps.sh b/lgsm/functions/command_dev_detect_deps.sh index a80fdb4c9..0db640a5a 100644 --- a/lgsm/functions/command_dev_detect_deps.sh +++ b/lgsm/functions/command_dev_detect_deps.sh @@ -7,7 +7,7 @@ lgsm_version="210516" # Description: Detects dependencies the server binary requires. local modulename="Backup" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" check.sh cd "${executabledir}" diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index f771cea95..7d84aaba8 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -8,7 +8,7 @@ lgsm_version="060616" # Description: Creates a FastDL folder local modulename="FastDL" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local 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 c9619e210..cdd7cd564 100644 --- a/lgsm/functions/command_install.sh +++ b/lgsm/functions/command_install.sh @@ -7,7 +7,7 @@ lgsm_version="210516" # Description: Overall function for the installer. local modulename="Install" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" check.sh install_header.sh diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index 076016146..aa6ff3868 100644 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -8,7 +8,7 @@ lgsm_version="210516" # then passes to monitor_gsquery.sh. local modulename="Monitor" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_monitor_check_lockfile(){ # Monitor does not run it lockfile is not found diff --git a/lgsm/functions/command_restart.sh b/lgsm/functions/command_restart.sh index 23a9d6e60..6a08c2e97 100644 --- a/lgsm/functions/command_restart.sh +++ b/lgsm/functions/command_restart.sh @@ -7,7 +7,7 @@ lgsm_version="210516" # Description: Starts the server. local modulename="Restarting" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" exitbypass=1 info_config.sh diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 9dbdca200..29b6d4db6 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -7,7 +7,7 @@ lgsm_version="210516" # Description: Starts the server. local modulename="Starting" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_start_teamspeak3(){ if [ ! -e "${servercfgfullpath}" ]; then diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index 13c2a6b98..cee5bca36 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -7,7 +7,7 @@ lgsm_version="050616" # Description: Stops the server. local modulename="Stopping" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" # Attempts Graceful of source using rcon 'quit' command. fn_stop_graceful_source(){ diff --git a/lgsm/functions/command_test_alert.sh b/lgsm/functions/command_test_alert.sh index c1c105a01..ea477fadb 100644 --- a/lgsm/functions/command_test_alert.sh +++ b/lgsm/functions/command_test_alert.sh @@ -7,7 +7,7 @@ lgsm_version="210516" # Description: Sends a test email alert. local modulename="Alert" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" check.sh info_config.sh diff --git a/lgsm/functions/command_ts3_server_pass.sh b/lgsm/functions/command_ts3_server_pass.sh index 2ec6d52d8..43892b8e8 100644 --- a/lgsm/functions/command_ts3_server_pass.sh +++ b/lgsm/functions/command_ts3_server_pass.sh @@ -8,7 +8,7 @@ lgsm_version="210516" # Description: Changes TS3 serveradmin password local modulename="Change password" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_serveradmin_password_prompt(){ diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh index 9612651bb..551e8cb7c 100644 --- a/lgsm/functions/command_update.sh +++ b/lgsm/functions/command_update.sh @@ -7,7 +7,7 @@ lgsm_version="210516" # Description:Hangles updating of servers. local modulename="Update" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" check.sh diff --git a/lgsm/functions/command_update_functions.sh b/lgsm/functions/command_update_functions.sh index 8d10b8207..28fb96f30 100644 --- a/lgsm/functions/command_update_functions.sh +++ b/lgsm/functions/command_update_functions.sh @@ -7,7 +7,7 @@ lgsm_version="210516" # Description: Deletes the functions dir to allow re-downloading of functions from GitHub. local modulename="Updating LGSM" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" check.sh fn_print_dots "Updating functions" fn_script_log_info "Updating functions" diff --git a/lgsm/functions/command_validate.sh b/lgsm/functions/command_validate.sh index 3f0b8e289..a5d1aaebb 100644 --- a/lgsm/functions/command_validate.sh +++ b/lgsm/functions/command_validate.sh @@ -7,7 +7,7 @@ lgsm_version="210516" # Description: Runs a server validation. local modulename="Validate" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_validation(){ fn_print_warn_nl "Validating may overwrite some customised files." diff --git a/lgsm/functions/compress_unreal2_maps.sh b/lgsm/functions/compress_unreal2_maps.sh index 1952dbcad..7cf6f1c45 100644 --- a/lgsm/functions/compress_unreal2_maps.sh +++ b/lgsm/functions/compress_unreal2_maps.sh @@ -4,7 +4,7 @@ # Website: https://gameservermanagers.com lgsm_version="210516" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" check.sh clear diff --git a/lgsm/functions/compress_ut99_maps.sh b/lgsm/functions/compress_ut99_maps.sh index ac52a9e4e..5c1d8c656 100644 --- a/lgsm/functions/compress_ut99_maps.sh +++ b/lgsm/functions/compress_ut99_maps.sh @@ -4,7 +4,7 @@ # Website: https://gameservermanagers.com lgsm_version="210516" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" check.sh clear diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index d0208552c..3743a68f0 100644 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -19,7 +19,7 @@ lgsm_version="210516" # fn_fetch_file "http://example.com/file.tar.bz2" "/some/dir" "file.tar.bz2" "executecmd" "run" "force" "10cd7353aa9d758a075c600a6dd193fd" local modulename="Download" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local 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 cac791262..0542b307e 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -6,7 +6,7 @@ lgsm_version="210516" # Description: getopt arguments. -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_getopt_generic(){ case "${getopt}" in diff --git a/lgsm/functions/update_check.sh b/lgsm/functions/update_check.sh index 3bddacd65..ac05d7ae4 100644 --- a/lgsm/functions/update_check.sh +++ b/lgsm/functions/update_check.sh @@ -7,7 +7,7 @@ lgsm_version="210516" # Description: Checks if a server update is available. local modulename="Update" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" ### SteamCMD Update Checker ### diff --git a/lgsm/functions/update_dl.sh b/lgsm/functions/update_dl.sh index 02437aa00..047d80aec 100644 --- a/lgsm/functions/update_dl.sh +++ b/lgsm/functions/update_dl.sh @@ -7,7 +7,7 @@ lgsm_version="210516" # Description: Runs a server update. local modulename="Update" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_steamcmd_dl(){ cd "${rootdir}" diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh index e661bcb9b..92665bd99 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/functions/update_ts3.sh @@ -7,7 +7,7 @@ lgsm_version="210516" # Description:Handles updating of teamspeak 3 servers. local modulename="Update" -function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_update_ts3_dl(){ fn_fetch_file "http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" "${lgsmdir}/tmp" "teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2"