From 21512494fa7b8b84a97c185c73634c485ef256a9 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 8 Jul 2016 19:53:47 +0100 Subject: [PATCH] module name has been split now named commandname and command action command name is used in logs command action is used on-screen. Also alterations to function_selfname now called just selfname --- functions/command_update_functions.sh | 2 +- lgsm/functions/alert.sh | 14 +++++++------ lgsm/functions/alert_email.sh | 5 +++-- lgsm/functions/alert_pushbullet.sh | 5 +++-- lgsm/functions/check.sh | 23 ++++++++++++---------- lgsm/functions/check_config.sh | 5 +++-- lgsm/functions/check_deps.sh | 14 +++++++------ lgsm/functions/check_glibc.sh | 8 +++++--- lgsm/functions/check_ip.sh | 5 +++-- lgsm/functions/check_logs.sh | 5 +++-- lgsm/functions/check_permissions.sh | 5 +++-- lgsm/functions/check_root.sh | 5 +++-- lgsm/functions/check_status.sh | 5 +++-- lgsm/functions/check_steamcmd.sh | 12 ++++++----- lgsm/functions/check_system_dir.sh | 5 +++-- lgsm/functions/check_tmux.sh | 5 +++-- lgsm/functions/command_backup.sh | 5 +++-- lgsm/functions/command_console.sh | 5 +++-- lgsm/functions/command_debug.sh | 5 +++-- lgsm/functions/command_details.sh | 5 +++-- lgsm/functions/command_dev_debug.sh | 5 +++-- lgsm/functions/command_dev_detect_deps.sh | 5 +++-- lgsm/functions/command_fastdl.sh | 5 +++-- lgsm/functions/command_install.sh | 5 +++-- lgsm/functions/command_monitor.sh | 5 +++-- lgsm/functions/command_restart.sh | 5 +++-- lgsm/functions/command_start.sh | 5 +++-- lgsm/functions/command_stop.sh | 5 +++-- lgsm/functions/command_test_alert.sh | 5 +++-- lgsm/functions/command_ts3_server_pass.sh | 5 +++-- lgsm/functions/command_update.sh | 5 +++-- lgsm/functions/command_update_functions.sh | 4 ++-- lgsm/functions/command_validate.sh | 5 +++-- lgsm/functions/compress_unreal2_maps.sh | 4 ++-- lgsm/functions/compress_ut99_maps.sh | 4 ++-- lgsm/functions/core_dl.sh | 3 ++- lgsm/functions/core_exit.sh | 12 +++++------ lgsm/functions/fix.sh | 3 ++- lgsm/functions/fix_arma3.sh | 3 ++- lgsm/functions/fix_csgo.sh | 4 ++++ lgsm/functions/fix_dst.sh | 3 ++- lgsm/functions/fix_glibc.sh | 3 ++- lgsm/functions/fix_ins.sh | 3 ++- lgsm/functions/fix_kf.sh | 3 ++- lgsm/functions/fix_ro.sh | 3 ++- lgsm/functions/fix_steamcmd.sh | 3 ++- lgsm/functions/fix_ut2k4.sh | 3 ++- lgsm/functions/fix_ut99.sh | 3 ++- lgsm/functions/install_complete.sh | 3 ++- lgsm/functions/install_config.sh | 5 +++-- lgsm/functions/install_gslt.sh | 5 +++-- lgsm/functions/install_gsquery.sh | 5 +++-- lgsm/functions/install_header.sh | 5 +++-- lgsm/functions/install_logs.sh | 5 +++-- lgsm/functions/install_retry.sh | 5 +++-- lgsm/functions/install_server_dir.sh | 5 +++-- lgsm/functions/install_server_files.sh | 5 +++-- lgsm/functions/install_steamcmd.sh | 5 +++-- lgsm/functions/install_ts3.sh | 5 +++-- lgsm/functions/install_ts3db.sh | 5 +++-- lgsm/functions/install_ut2k4_key.sh | 5 +++-- lgsm/functions/logs.sh | 8 +++++--- lgsm/functions/monitor_gsquery.sh | 5 +++-- lgsm/functions/update_check.sh | 5 +++-- lgsm/functions/update_dl.sh | 5 +++-- lgsm/functions/update_steamcmd.sh | 5 +++-- lgsm/functions/update_ts3.sh | 3 ++- 67 files changed, 215 insertions(+), 143 deletions(-) diff --git a/functions/command_update_functions.sh b/functions/command_update_functions.sh index 0c35eb1f0..31b9672b7 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. -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local 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.sh b/lgsm/functions/alert.sh index 6b12cd5fc..6c84a883d 100644 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -4,8 +4,10 @@ # Website: https://gameservermanagers.com # Description: Overall function for managing alerts. -local modulename="Alert" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="ALERT" +local commandaction="Alert" +# Cannot have selfname as breaks the function. +#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_alert_test(){ fn_script_log_info "Sending test alert" @@ -43,20 +45,20 @@ fi if [ "${emailnotification}" == "on" ]||[ "${emailalert}" == "on" ]&&[ -n "${email}" ]; then alert_email.sh -elif [ "${emailnotification}" != "on" ]||[ "${emailalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then +elif [ "${emailnotification}" != "on" ]||[ "${emailalert}" != "on" ]&&[ "${selfname}" == "command_test_alert.sh" ]; then fn_print_info_nl "Email alerts not enabled" fn_script_log_info "Email alerts not enabled" -elif [ -z "${email}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then +elif [ -z "${email}" ]&&[ "${selfname}" == "command_test_alert.sh" ]; then fn_print_fail_nl "Email not set" fn_script_log "Email not set" fi if [ "${pushbulletalert}" == "on" ]&&[ -n "${pushbullettoken}" ]; then alert_pushbullet.sh -elif [ "${pushbulletalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then +elif [ "${pushbulletalert}" != "on" ]&&[ "${selfname}" == "command_test_alert.sh" ]; then fn_print_info_nl "Pushbullet alerts not enabled" fn_script_log_info "Pushbullet alerts not enabled" -elif [ -z "${pushbullettoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then +elif [ -z "${pushbullettoken}" ]&&[ "${selfname}" == "command_test_alert.sh" ]; then fn_print_fail_nl "Pushbullet token not set" fn_script_log_warn "Pushbullet token not set" fi \ No newline at end of file diff --git a/lgsm/functions/alert_email.sh b/lgsm/functions/alert_email.sh index 98003ec3c..7f7bf63f6 100644 --- a/lgsm/functions/alert_email.sh +++ b/lgsm/functions/alert_email.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Sends email alert if monitor picks up a failure. -local modulename="Alert" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="ALERT" +local commandaction="Alert" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_details_email(){ # diff --git a/lgsm/functions/alert_pushbullet.sh b/lgsm/functions/alert_pushbullet.sh index 5aa342601..2b2bca093 100644 --- a/lgsm/functions/alert_pushbullet.sh +++ b/lgsm/functions/alert_pushbullet.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: alerts using pushbullet. -local modulename="Alert" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="ALERT" +local commandaction="Alert" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_print_dots "Sending Pushbullet alert" sleep 1 diff --git a/lgsm/functions/check.sh b/lgsm/functions/check.sh index 7c8da154c..a674bcd49 100644 --- a/lgsm/functions/check.sh +++ b/lgsm/functions/check.sh @@ -6,7 +6,10 @@ # Description: Overall function for managing checks. # Runs checks that will either halt on or fix an issue. -local modulename="Checking" +local commandnane="CHECK" +local commandaction="Checking" +# Cannot have selfname as breaks the function. +#local selfname="$(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 @@ -14,14 +17,14 @@ local modulename="Checking" check_root.sh check_permissions.sh -if [ "${function_selfname}" != "command_install.sh" ] && [ "${function_selfname}" != "command_update_functions.sh" ]; then +if [ "${selfname}" != "command_install.sh" ] && [ "${selfname}" != "command_update_functions.sh" ]; then check_system_dir.sh fi local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh ) for allowed_command in "${allowed_commands_array[@]}" do - if [ "${allowed_command}" == "${function_selfname}" ]; then + if [ "${allowed_command}" == "${selfname}" ]; then check_glibc.sh fi done @@ -29,7 +32,7 @@ done local allowed_commands_array=( command_backup.sh command_console.sh command_debug.sh command_details.sh command_unreal2_maps.sh command_ut99_maps.sh command_monitor.sh command_start.sh command_stop.sh update_check.sh command_validate.sh command_update_functions.sh command_email_test.sh ) for allowed_command in "${allowed_commands_array[@]}" do - if [ "${allowed_command}" == "${function_selfname}" ]; then + if [ "${allowed_command}" == "${selfname}" ]; then check_logs.sh fi done @@ -37,7 +40,7 @@ done local allowed_commands_array=( command_debug.sh command_start.sh command_stop.sh ) for allowed_command in "${allowed_commands_array[@]}" do - if [ "${allowed_command}" == "${function_selfname}" ]; then + if [ "${allowed_command}" == "${selfname}" ]; then check_deps.sh fi done @@ -45,7 +48,7 @@ done local allowed_commands_array=( command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh ) for allowed_command in "${allowed_commands_array[@]}" do - if [ "${allowed_command}" == "${function_selfname}" ]; then + if [ "${allowed_command}" == "${selfname}" ]; then check_ip.sh fi done @@ -53,7 +56,7 @@ done local allowed_commands_array=( update_check.sh command_debug.sh command_start.sh command_validate.sh ) for allowed_command in "${allowed_commands_array[@]}" do - if [ "${allowed_command}" == "${function_selfname}" ]; then + if [ "${allowed_command}" == "${selfname}" ]; then if [ -n "${appid}" ]; then check_steamcmd.sh fi @@ -63,7 +66,7 @@ done local allowed_commands_array=( command_console.sh command_start.sh ) for allowed_command in "${allowed_commands_array[@]}" do - if [ "${allowed_command}" == "${function_selfname}" ]; then + if [ "${allowed_command}" == "${selfname}" ]; then check_tmux.sh fi done @@ -71,7 +74,7 @@ done local allowed_commands_array=( command_console.sh command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh ) for allowed_command in "${allowed_commands_array[@]}" do - if [ "${allowed_command}" == "${function_selfname}" ]; then + if [ "${allowed_command}" == "${selfname}" ]; then check_config.sh fi done @@ -79,7 +82,7 @@ done local allowed_commands_array=( command_details.sh command_monitor.sh command_start.sh command_stop.sh command_ts3_server_pass.sh update_check.sh command_details.sh command_validate.sh ) for allowed_command in "${allowed_commands_array[@]}" do - if [ "${allowed_command}" == "${function_selfname}" ]; then + if [ "${allowed_command}" == "${selfname}" ]; then check_status.sh fi done diff --git a/lgsm/functions/check_config.sh b/lgsm/functions/check_config.sh index 2324210a5..7efa1c46c 100644 --- a/lgsm/functions/check_config.sh +++ b/lgsm/functions/check_config.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: If server config missing warn user. -local modulename="Checking" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="CHECK" +local commandaction="Checking" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" if [ ! -e "${servercfgfullpath}" ]; then if [ "${gamename}" != "Hurtworld" ]; then diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 4fb5a0822..eae0df5b5 100644 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -4,8 +4,10 @@ # Website: https://gameservermanagers.com # Description: Checks that the requires dependencies are installed for LGSM. -local modulename="Checking" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="CHECK" +local commandaction="Checking" +# Cannot have selfname as breaks the function. +#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_deps_detector(){ # Checks if dependency is missing @@ -18,14 +20,14 @@ fn_deps_detector(){ fi if [ "${depstatus}" == "0" ]; then missingdep=0 - if [ "${function_selfname}" == "command_install.sh" ]; then + if [ "${selfname}" == "command_install.sh" ]; then echo -e "\e[0;32m${deptocheck}\e[0m" sleep 0.5 fi else # if missing dependency is found missingdep=1 - if [ "${function_selfname}" == "command_install.sh" ]; then + if [ "${selfname}" == "command_install.sh" ]; then echo -e "\e[0;31m${deptocheck}\e[0m" sleep 0.5 fi @@ -97,7 +99,7 @@ fn_found_missing_deps(){ fi echo "" fi - if [ "${function_selfname}" == "command_install.sh" ]; then + if [ "${selfname}" == "command_install.sh" ]; then sleep 5 fi fi @@ -116,7 +118,7 @@ fn_check_loop(){ info_distro.sh -if [ "${function_selfname}" == "command_install.sh" ]; then +if [ "${selfname}" == "command_install.sh" ]; then echo "" echo "Checking Dependecies" echo "=================================" diff --git a/lgsm/functions/check_glibc.sh b/lgsm/functions/check_glibc.sh index e1239d281..6d7f3a307 100644 --- a/lgsm/functions/check_glibc.sh +++ b/lgsm/functions/check_glibc.sh @@ -4,8 +4,10 @@ # Website: https://gameservermanagers.com # Description: Checks if server has correct glibc or has a fix available. -local modulename="Checking" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="CHECK" +local commandaction="Checking" +# Cannot have selfname as breaks the function. +#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" info_glibc.sh info_distro.sh @@ -18,7 +20,7 @@ elif [ "${glibcrequired}" == "UNKNOWN" ]; then echo -e " * glibc installed: ${glibcversion}" elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then if [ "${glibcfix}" == "yes" ]; then - if [ "${function_selfname}" != "command_install.sh" ]; then + if [ "${selfname}" != "command_install.sh" ]; then fn_print_info_nl "Glibc fix: \e[0;32mUsing Glibc fix\e[0m" echo -e " * glibc required: \e[0;31m${glibcrequired}\e[0m" echo -e " * glibc installed: ${glibcversion}" diff --git a/lgsm/functions/check_ip.sh b/lgsm/functions/check_ip.sh index 438bb880c..12c94758f 100644 --- a/lgsm/functions/check_ip.sh +++ b/lgsm/functions/check_ip.sh @@ -5,8 +5,9 @@ # Description: Automatically identifies the server interface IP. # If multiple interfaces are detected the user will need to manualy set using ip="0.0.0.0". -local modulename="Checking" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="CHECK" +local commandaction="Checking" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" if [ "${gamename}" != "Teamspeak 3" ]; then if [ ! -f "/bin/ip" ]; then diff --git a/lgsm/functions/check_logs.sh b/lgsm/functions/check_logs.sh index 2e7a1b6bd..d4bea2b5a 100644 --- a/lgsm/functions/check_logs.sh +++ b/lgsm/functions/check_logs.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Checks that log files exist on server start -local modulename="Checking" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="CHECK" +local commandaction="Checking" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" # Create dir's for the script and console logs if [ ! -d "${scriptlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${gamename}" != "Teamspeak 3" ]; then diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh index 013846515..bb440615f 100644 --- a/lgsm/functions/check_permissions.sh +++ b/lgsm/functions/check_permissions.sh @@ -5,8 +5,9 @@ # Website: https://gameservermanagers.com # Description: Checks script, files and folders ownership and permissions. -local modulename="Checking" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="CHECK" +local commandaction="Checking" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" # Useful variables currentuser="$(whoami)" diff --git a/lgsm/functions/check_root.sh b/lgsm/functions/check_root.sh index 37d3a6710..eb64ddb1f 100644 --- a/lgsm/functions/check_root.sh +++ b/lgsm/functions/check_root.sh @@ -3,8 +3,9 @@ # Author: Daniel Gibbs # Website: https://gameservermanagers.com -local modulename="Checking" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="CHECK" +local commandaction="Checking" +local 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 355ce9dd6..41072261d 100644 --- a/lgsm/functions/check_status.sh +++ b/lgsm/functions/check_status.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Checks the proccess status of the server. Either online or offline. -local modulename="Checking" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="CHECK" +local commandaction="Checking" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" if [ "${gamename}" == "Teamspeak 3" ]; then # 1: Server is running diff --git a/lgsm/functions/check_steamcmd.sh b/lgsm/functions/check_steamcmd.sh index 57f1f5343..01049a5aa 100644 --- a/lgsm/functions/check_steamcmd.sh +++ b/lgsm/functions/check_steamcmd.sh @@ -4,8 +4,10 @@ # Website: https://gameservermanagers.com # Description: Checks SteamCMD is installed and correct. -local modulename="Checking" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="CHECK" +local commandaction="Checking" +# Cannot have selfname as breaks the function. +#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_install_steamcmd(){ if [ ! -d "${steamcmddir}" ]; then @@ -44,7 +46,7 @@ fn_check_steamcmd_sh(){ # Installs if missing. steamcmddir="${rootdir}/steamcmd" if [ ! -f "${steamcmddir}/steamcmd.sh" ]; then - if [ "${function_selfname}" == "command_install.sh" ]; then + if [ "${selfname}" == "command_install.sh" ]; then fn_install_steamcmd else fn_print_warn_nl "SteamCMD is missing" @@ -52,14 +54,14 @@ fn_check_steamcmd_sh(){ sleep 1 fn_install_steamcmd fi - elif [ "${function_selfname}" == "command_install.sh" ]; then + elif [ "${selfname}" == "command_install.sh" ]; then fn_print_infomation "SteamCMD is already installed..." fn_print_ok_eol_nl fi } fn_check_steamcmd_guard(){ - if [ "${function_selfname}" == "command_update.sh" ]||[ "${function_selfname}" == "command_validate.sh" ]; then + if [ "${selfname}" == "command_update.sh" ]||[ "${selfname}" == "command_validate.sh" ]; then # Checks that steamcmd is working correctly and will prompt Steam Guard if required. "${steamcmddir}"/steamcmd.sh +login "${steamuser}" "${steampass}" +quit if [ $? -ne 0 ]; then diff --git a/lgsm/functions/check_system_dir.sh b/lgsm/functions/check_system_dir.sh index b4eb92559..be737d05a 100644 --- a/lgsm/functions/check_system_dir.sh +++ b/lgsm/functions/check_system_dir.sh @@ -3,8 +3,9 @@ # Author: Daniel Gibbs # Website: https://gameservermanagers.com -local modulename="Checking" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="CHECK" +local commandaction="Checking" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" if [ ! -d "${systemdir}" ]; then fn_print_fail_nl "Cannot access ${systemdir}: No such directory" diff --git a/lgsm/functions/check_tmux.sh b/lgsm/functions/check_tmux.sh index 63ddf80c4..5b2fa51d9 100644 --- a/lgsm/functions/check_tmux.sh +++ b/lgsm/functions/check_tmux.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Checks if tmux is installed as too many users do not RTFM or know how to use Google. -local modulename="Checking" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="CHECK" +local commandaction="Checking" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" if [ "$(command -v tmux)" ]||[ "$(which tmux >/dev/null 2>&1)" ]||[ -f "/usr/bin/tmux" ]||[ -f "/bin/tmux" ]; then : diff --git a/lgsm/functions/command_backup.sh b/lgsm/functions/command_backup.sh index a71ee8339..cc651c920 100644 --- a/lgsm/functions/command_backup.sh +++ b/lgsm/functions/command_backup.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Creates a .tar.gz file in the backup directory. -local modulename="Backup" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="BACKUP" +local commandaction="Backup" +local 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 b7d9a10d6..301bb4c07 100644 --- a/lgsm/functions/command_console.sh +++ b/lgsm/functions/command_console.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Gives access to the server tmux console. -local modulename="Console" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="CONSOLE" +local commandaction="Console" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" check.sh echo "" diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh index d81166245..4bd35c56c 100644 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/functions/command_debug.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Runs the server without tmux. Runs direct from the terminal. -local modulename="Debug" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="DEBUG" +local commandaction="Debug" +local 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 4cdad4d4a..3a740b68a 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Displays server infomation. -local modulename="Details" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="DETAILS" +local commandaction="Details" +local 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 abfd9795f..81548309c 100644 --- a/lgsm/functions/command_dev_debug.sh +++ b/lgsm/functions/command_dev_debug.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Dev only: enables debuging log to be saved to dev-debug.log. -local modulename="Dev Debug" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="DEV-DEBUG" +local commandaction="Dev-Debug" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" if [ -f ".dev-debug" ]; then diff --git a/lgsm/functions/command_dev_detect_deps.sh b/lgsm/functions/command_dev_detect_deps.sh index 2dca148ef..ab8e4a43d 100644 --- a/lgsm/functions/command_dev_detect_deps.sh +++ b/lgsm/functions/command_dev_detect_deps.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Detects dependencies the server binary requires. -local modulename="Deps Detect" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="DEPS-DETECT" +local commandaction="Deps-Detect" +local 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 de00c8902..5c5eed3dc 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -5,8 +5,9 @@ # Website: https://gameservermanagers.com # Description: Creates a FastDL folder -local modulename="FastDL" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="FASTDL" +local commandaction="FastDL" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" check.sh diff --git a/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh index 87ddac2c3..b57a22a42 100644 --- a/lgsm/functions/command_install.sh +++ b/lgsm/functions/command_install.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Overall function for the installer. -local modulename="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="INSTALL" +local commandaction="Install" +local 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 354ba8a64..5860c08b6 100644 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -5,8 +5,9 @@ # Description: Monitors server by checking for running proccesses # then passes to monitor_gsquery.sh. -local modulename="Monitor" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="MONITOR" +local commandaction="Monitor" +local 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 528737f7d..67a35c449 100644 --- a/lgsm/functions/command_restart.sh +++ b/lgsm/functions/command_restart.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Starts the server. -local modulename="Restarting" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="RESTART" +local commandaction="Restarting" +local 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 c7882ae44..991aa435c 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Starts the server. -local modulename="Starting" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="START" +local commandaction="Starting" +local 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 8ff3c2859..5cb3cb5f1 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Stops the server. -local modulename="Stopping" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="STOP" +local commandaction="Stopping" +local 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 2fe73ee31..98e4d1cf6 100644 --- a/lgsm/functions/command_test_alert.sh +++ b/lgsm/functions/command_test_alert.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Sends a test email alert. -local modulename="Alert" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="ALERT" +local commandaction="Alert" +local 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 6386b8f08..0419bf181 100644 --- a/lgsm/functions/command_ts3_server_pass.sh +++ b/lgsm/functions/command_ts3_server_pass.sh @@ -5,8 +5,9 @@ # Website: https://gameservermanagers.com # Description: Changes TS3 serveradmin password -local modulename="TS3 Change Password" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="TS3-CHANGE-PASS" +local commandaction="TS3 Change Password" +local 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 6bc1c75c4..b9ecb82dc 100644 --- a/lgsm/functions/command_update.sh +++ b/lgsm/functions/command_update.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Handles updating of servers. -local modulename="Update" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="UPDATE" +local commandaction="Update" +local 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 c6136446e..329bab64d 100644 --- a/lgsm/functions/command_update_functions.sh +++ b/lgsm/functions/command_update_functions.sh @@ -4,8 +4,8 @@ # Website: https://gameservermanagers.com # Description: Deletes the functions dir to allow re-downloading of functions from GitHub. -local modulename="Update LGSM" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandaction="Update LGSM" +local 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 ca9bbcfee..09bfb6e8a 100644 --- a/lgsm/functions/command_validate.sh +++ b/lgsm/functions/command_validate.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Runs a server validation. -local modulename="Validate" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="VALIDATE" +local commandaction="Validate" +local 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 3fa752867..415e82c24 100644 --- a/lgsm/functions/compress_unreal2_maps.sh +++ b/lgsm/functions/compress_unreal2_maps.sh @@ -4,8 +4,8 @@ # Website: https://gameservermanagers.com # Description: compresses unreal maps -local modulename="Unreal Map Compressor" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandaction="Unreal Map Compressor" +local 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 f5414125d..a6ce63495 100644 --- a/lgsm/functions/compress_ut99_maps.sh +++ b/lgsm/functions/compress_ut99_maps.sh @@ -4,8 +4,8 @@ # Website: https://gameservermanagers.com # Description: compresses unreal maps -local modulename="Unreal Map Compressor" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandaction="Unreal Map Compressor" +local 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 71321fad2..569bb5f9d 100644 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -16,7 +16,8 @@ # fn_fetch_file "${fileurl}" "${filedir}" "${filename}" "${executecmd}" "${run}" "${force}" "${md5}" # fn_fetch_file "http://example.com/file.tar.bz2" "/some/dir" "file.tar.bz2" "executecmd" "run" "force" "10cd7353aa9d758a075c600a6dd193fd" -local modulename="Download" +local commandnane="DOWNLOAD" +local commandaction="Download" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_dl_md5(){ diff --git a/lgsm/functions/core_exit.sh b/lgsm/functions/core_exit.sh index 3211b095f..7e0a704aa 100644 --- a/lgsm/functions/core_exit.sh +++ b/lgsm/functions/core_exit.sh @@ -7,19 +7,19 @@ fn_exit_dev_debug(){ if [ -f "${rootdir}/.dev-debug" ]; then echo "" - echo "${function_selfname} exiting with code: ${exitcode}" + echo "${selfname} exiting with code: ${exitcode}" fi } if [ -n "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then if [ "${exitcode}" == "1" ]; then - fn_script_log_fatal "${function_selfname} exiting with code: ${exitcode}" + fn_script_log_fatal "${selfname} exiting with code: ${exitcode}" elif [ "${exitcode}" == "2" ]; then - fn_script_log_error "${function_selfname} exiting with code: ${exitcode}" + fn_script_log_error "${selfname} exiting with code: ${exitcode}" elif [ "${exitcode}" == "3" ]; then - fn_script_log_warn "${function_selfname} exiting with code: ${exitcode}" + fn_script_log_warn "${selfname} exiting with code: ${exitcode}" else - fn_script_log_warn "${function_selfname} exiting with code: ${exitcode}" + fn_script_log_warn "${selfname} exiting with code: ${exitcode}" fi fn_exit_dev_debug # remove trap. @@ -29,7 +29,7 @@ elif [ -n "${exitbypass}" ]; then unset exitbypass else exitcode=0 - fn_script_log_pass "${function_selfname} exiting with code: ${exitcode}" + fn_script_log_pass "${selfname} exiting with code: ${exitcode}" fn_exit_dev_debug # remove trap. trap - INT diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index c70087065..7ab5ba4c7 100644 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -5,7 +5,8 @@ # Description: Overall function for managing fixes. # Runs functions that will fix an issue. -local modulename="Fix" +local commandnane="FIX" +local commandaction="Fix" # Cannot have selfname as breaks if statements. #local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" diff --git a/lgsm/functions/fix_arma3.sh b/lgsm/functions/fix_arma3.sh index 5c66d2fd0..adf3fcfc6 100644 --- a/lgsm/functions/fix_arma3.sh +++ b/lgsm/functions/fix_arma3.sh @@ -4,7 +4,8 @@ # Website: https://gameservermanagers.com # Description: Resolves an issue with ARMA3. -local modulename="Fix" +local commandnane="FIX" +local commandaction="Fix" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" # Fixes: 20150 Segmentation fault (core dumped) error. diff --git a/lgsm/functions/fix_csgo.sh b/lgsm/functions/fix_csgo.sh index a2a75bed6..acca65918 100644 --- a/lgsm/functions/fix_csgo.sh +++ b/lgsm/functions/fix_csgo.sh @@ -4,6 +4,10 @@ # Website: https://gameservermanagers.com # Description: Resolves various issues with csgo. +local commandnane="FIX" +local commandaction="Fix" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" + # Fixes: server not always creating steam_appid.txt file. if [ ! -f "${filesdir}/steam_appid.txt" ]; then fixname="730 steam_appid.txt" diff --git a/lgsm/functions/fix_dst.sh b/lgsm/functions/fix_dst.sh index 31f77e416..99d4a65f0 100644 --- a/lgsm/functions/fix_dst.sh +++ b/lgsm/functions/fix_dst.sh @@ -4,7 +4,8 @@ # Website: https://gameservermanagers.com # Description: Resolves various issues with Dont Starve together. -local modulename="Fix" +local commandnane="FIX" +local commandaction="Fix" local 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) diff --git a/lgsm/functions/fix_glibc.sh b/lgsm/functions/fix_glibc.sh index d1e0ab89f..34811136f 100644 --- a/lgsm/functions/fix_glibc.sh +++ b/lgsm/functions/fix_glibc.sh @@ -4,7 +4,8 @@ # Website: https://gameservermanagers.com # Description: Downloads required glibc files and applys teh glibc fix if required -local modulename="Fix" +local commandnane="FIX" +local commandaction="Fix" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local libstdc_servers_array=( "ARMA 3" "Blade Symphony" "Garry's Mod" "Just Cause 2" ) diff --git a/lgsm/functions/fix_ins.sh b/lgsm/functions/fix_ins.sh index 5b6061fef..210662964 100644 --- a/lgsm/functions/fix_ins.sh +++ b/lgsm/functions/fix_ins.sh @@ -4,7 +4,8 @@ # Website: https://gameservermanagers.com # Description: Resolves various issues with Insurgency. -local modulename="Fix" +local commandnane="FIX" +local commandaction="Fix" # Cannot have selfname as breaks if statement. #local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" diff --git a/lgsm/functions/fix_kf.sh b/lgsm/functions/fix_kf.sh index 048fa839d..3730c0ef8 100644 --- a/lgsm/functions/fix_kf.sh +++ b/lgsm/functions/fix_kf.sh @@ -4,7 +4,8 @@ # Website: https://gameservermanagers.com # Description: Resolves various issues with Killing Floor. -local modulename="Fix" +local commandnane="FIX" +local commandaction="Fix" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" echo "Applying WebAdmin ROOst.css fix." diff --git a/lgsm/functions/fix_ro.sh b/lgsm/functions/fix_ro.sh index 8e3f6ccbd..c17f7e06e 100644 --- a/lgsm/functions/fix_ro.sh +++ b/lgsm/functions/fix_ro.sh @@ -4,7 +4,8 @@ # Website: https://gameservermanagers.com # Description: Resolves various issues with Red Orchestra. -local modulename="Fix" +local commandnane="FIX" +local commandaction="Fix" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" echo "Applying WebAdmin ROOst.css fix." diff --git a/lgsm/functions/fix_steamcmd.sh b/lgsm/functions/fix_steamcmd.sh index 00d871d10..62f048a73 100644 --- a/lgsm/functions/fix_steamcmd.sh +++ b/lgsm/functions/fix_steamcmd.sh @@ -4,7 +4,8 @@ # Website: https://gameservermanagers.com # Description: Resolves various issues related to steamCMD. -local modulename="Fix" +local commandnane="FIX" +local commandaction="Fix" local 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. diff --git a/lgsm/functions/fix_ut2k4.sh b/lgsm/functions/fix_ut2k4.sh index 3f82407ba..1cec482e0 100644 --- a/lgsm/functions/fix_ut2k4.sh +++ b/lgsm/functions/fix_ut2k4.sh @@ -4,7 +4,8 @@ # Website: https://gameservermanagers.com # Description: Resolves various issues with Unreal Tournament 2004. -local modulename="Fix" +local commandnane="FIX" +local commandaction="Fix" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" echo "applying WebAdmin ut2003.css fix." diff --git a/lgsm/functions/fix_ut99.sh b/lgsm/functions/fix_ut99.sh index b956e6536..2bca9c8ba 100644 --- a/lgsm/functions/fix_ut99.sh +++ b/lgsm/functions/fix_ut99.sh @@ -4,7 +4,8 @@ # Website: https://gameservermanagers.com # Description: Resolves various issues with Unreal Tournament 99. -local modulename="Fix" +local commandnane="FIX" +local commandaction="Fix" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" echo "${servercfgfullpath}" diff --git a/lgsm/functions/install_complete.sh b/lgsm/functions/install_complete.sh index 92c9e5082..ae492f826 100644 --- a/lgsm/functions/install_complete.sh +++ b/lgsm/functions/install_complete.sh @@ -3,7 +3,8 @@ # Author: Daniel Gibbs # Website: https://gameservermanagers.com -local modulename="Install" +local commandnane="INSTALL" +local commandaction="Install" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" if [ "${gamename}" == "Don't Starve Together" ]; then diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index f5b207e8f..908e5bf7d 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -3,8 +3,9 @@ # Author: Daniel Gibbs # Website: https://gameservermanagers.com -local modulename="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="INSTALL" +local commandaction="Install" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_defaultconfig(){ echo "creating ${servercfg} config file." diff --git a/lgsm/functions/install_gslt.sh b/lgsm/functions/install_gslt.sh index 823deee11..5637f6990 100644 --- a/lgsm/functions/install_gslt.sh +++ b/lgsm/functions/install_gslt.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Configures GSLT. -local modulename="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="INSTALL" +local commandaction="Install" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" echo "" echo "Game Server Login Token" diff --git a/lgsm/functions/install_gsquery.sh b/lgsm/functions/install_gsquery.sh index 710a6080a..19344c6d3 100644 --- a/lgsm/functions/install_gsquery.sh +++ b/lgsm/functions/install_gsquery.sh @@ -3,8 +3,9 @@ # Author: Daniel Gibbs # Website: https://gameservermanagers.com -local modulename="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="INSTALL" +local commandaction="Install" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_dlgsquery(){ cd "${functionsdir}" diff --git a/lgsm/functions/install_header.sh b/lgsm/functions/install_header.sh index b5a817e95..55a9e6481 100644 --- a/lgsm/functions/install_header.sh +++ b/lgsm/functions/install_header.sh @@ -3,8 +3,9 @@ # Author: Daniel Gibbs # Website: https://gameservermanagers.com -local modulename="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="INSTALL" +local commandaction="Install" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" clear echo "=================================" diff --git a/lgsm/functions/install_logs.sh b/lgsm/functions/install_logs.sh index 14ecf4c31..e486f1619 100644 --- a/lgsm/functions/install_logs.sh +++ b/lgsm/functions/install_logs.sh @@ -3,8 +3,9 @@ # Author: Daniel Gibbs # Website: https://gameservermanagers.com -local modulename="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="INSTALL" +local commandaction="Install" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" if [ "${checklogs}" != "1" ]; then echo "" diff --git a/lgsm/functions/install_retry.sh b/lgsm/functions/install_retry.sh index c56898898..3f1bdf26c 100644 --- a/lgsm/functions/install_retry.sh +++ b/lgsm/functions/install_retry.sh @@ -3,8 +3,9 @@ # Author: Daniel Gibbs # Website: https://gameservermanagers.com -local modulename="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="INSTALL" +local commandaction="Install" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" while true; do read -e -i "y" -p "Retry install? [Y/n]" yn diff --git a/lgsm/functions/install_server_dir.sh b/lgsm/functions/install_server_dir.sh index c2c6b36eb..a6b37d7e2 100644 --- a/lgsm/functions/install_server_dir.sh +++ b/lgsm/functions/install_server_dir.sh @@ -3,8 +3,9 @@ # Author: Daniel Gibbs # Website: https://gameservermanagers.com -local modulename="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="INSTALL" +local commandaction="Install" +local 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 f37390277..5ccac8390 100644 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -3,8 +3,9 @@ # Author: Daniel Gibbs # Website: https://gameservermanagers.com -local modulename="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="INSTALL" +local commandaction="Install" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_install_server_files(){ if [ "${gamename}" == "Unreal Tournament 99" ]; then diff --git a/lgsm/functions/install_steamcmd.sh b/lgsm/functions/install_steamcmd.sh index a5951c046..5956d1beb 100644 --- a/lgsm/functions/install_steamcmd.sh +++ b/lgsm/functions/install_steamcmd.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Downloads SteamCMD on install. -local modulename="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="INSTALL" +local commandaction="Install" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" echo "" echo "Installing SteamCMD" diff --git a/lgsm/functions/install_ts3.sh b/lgsm/functions/install_ts3.sh index 3a6eab039..3f136f802 100644 --- a/lgsm/functions/install_ts3.sh +++ b/lgsm/functions/install_ts3.sh @@ -3,8 +3,9 @@ # Author: Daniel Gibbs # Website: https://gameservermanagers.com -local modulename="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="INSTALL" +local commandaction="Install" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" info_distro.sh # Gets the teamspeak server architecture diff --git a/lgsm/functions/install_ts3db.sh b/lgsm/functions/install_ts3db.sh index cc7f0da9d..9ce622504 100644 --- a/lgsm/functions/install_ts3db.sh +++ b/lgsm/functions/install_ts3db.sh @@ -4,8 +4,9 @@ # Contributor: PhilPhonic # Website: https://gameservermanagers.com -local modulename="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="INSTALL" +local commandaction="Install" +local 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 2fe62b3c6..a41c2b688 100644 --- a/lgsm/functions/install_ut2k4_key.sh +++ b/lgsm/functions/install_ut2k4_key.sh @@ -3,8 +3,9 @@ # Author: Daniel Gibbs # Website: https://gameservermanagers.com -local modulename="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="INSTALL" +local commandaction="Install" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" echo "" echo "Enter ${gamename} CD Key" diff --git a/lgsm/functions/logs.sh b/lgsm/functions/logs.sh index cfbd28beb..23306525e 100644 --- a/lgsm/functions/logs.sh +++ b/lgsm/functions/logs.sh @@ -5,8 +5,10 @@ # Website: https://gameservermanagers.com # Description: Acts as a log rotater, removing old logs. -local modulename="Log Manager" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="LOGS" +local commandaction="Log-Manager" +# Cannot have selfname as breaks the function. +#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" # Check if logfile variable and file exist, create logfile if it doesn't exist if [ -n "${consolelog}" ]; then @@ -16,7 +18,7 @@ if [ -n "${consolelog}" ]; then fi # For games not displaying a console, and having logs into their game folder -if [ "${function_selfname}" == "command_start.sh" ] && [ -n "${gamelogfile}" ]; then +if [ "${selfname}" == "command_start.sh" ] && [ -n "${gamelogfile}" ]; then if [ -n "$(find "${systemdir}" -name "gamelog*.log")" ]; then fn_print_info "Moving game logs to ${gamelogdir}" fn_script_log_info "Moving game logs to ${gamelogdir}" diff --git a/lgsm/functions/monitor_gsquery.sh b/lgsm/functions/monitor_gsquery.sh index 80070bf35..d770397a3 100644 --- a/lgsm/functions/monitor_gsquery.sh +++ b/lgsm/functions/monitor_gsquery.sh @@ -5,8 +5,9 @@ # Description: uses gsquery.py to query the server port. # Detects if the server has frozen with the proccess still running. -local modulename="Monitor" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="MONITOR" +local commandaction="Monitor" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" # Forces legecy servers to use gsquery if [ -z "${gsquery}" ]; then diff --git a/lgsm/functions/update_check.sh b/lgsm/functions/update_check.sh index 6a6efb77e..584a3901f 100644 --- a/lgsm/functions/update_check.sh +++ b/lgsm/functions/update_check.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Checks if a server update is available. -local modulename="Update" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="UPDATE" +local commandaction="Update" +local 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 29b67a8ff..c8e5ac967 100644 --- a/lgsm/functions/update_dl.sh +++ b/lgsm/functions/update_dl.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description: Runs a server update. -local modulename="Update" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="UPDATE" +local commandaction="Update" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_steamcmd_dl(){ cd "${rootdir}" diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh index 6dfd0ddc1..61981e7c9 100644 --- a/lgsm/functions/update_steamcmd.sh +++ b/lgsm/functions/update_steamcmd.sh @@ -4,8 +4,9 @@ # Website: https://gameservermanagers.com # Description:Handles updating using steamCMD. -local modulename="Update" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +local commandnane="UPDATE" +local commandaction="Update" +local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_update_steamcmd_dl(){ diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh index 752269217..ac2d4805c 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/functions/update_ts3.sh @@ -4,7 +4,8 @@ # Website: https://gameservermanagers.com # Description:Handles updating of teamspeak 3 servers. -local modulename="Update" +local commandnane="UPDATE" +local commandaction="Update" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_update_ts3_dl(){