diff --git a/lgsm/functions/command_console.sh b/lgsm/functions/command_console.sh index ea0c4af93..02040d5c5 100644 --- a/lgsm/functions/command_console.sh +++ b/lgsm/functions/command_console.sh @@ -4,7 +4,7 @@ # Website: https://linuxgsm.com # Description: Gives access to the server tmux console. -fn_commandname(){} +fn_commandname(){ commandname="CONSOLE" commandaction="Access console" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index c2abc0ba0..b90f8a6f5 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -5,9 +5,12 @@ # Website: https://linuxgsm.com # Description: Displays server information. -commandname="DETAILS" -commandaction="Viewing details" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="DETAILS" + commandaction="Viewing details" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname # Run checks and gathers details to display. check.sh diff --git a/lgsm/functions/command_dev_clear_functions.sh b/lgsm/functions/command_dev_clear_functions.sh index 0c2faa375..935ebb4ef 100644 --- a/lgsm/functions/command_dev_clear_functions.sh +++ b/lgsm/functions/command_dev_clear_functions.sh @@ -4,9 +4,12 @@ # Website: https://linuxgsm.com # Description: Deletes the contents of the functions dir. -commandname="DEV-CLEAR-MODULES" -commandaction="Clearing modules" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="DEV-CLEAR-MODULES" + commandaction="Clearing modules" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname echo -e "=================================" echo -e "Clear Functions" diff --git a/lgsm/functions/command_dev_debug.sh b/lgsm/functions/command_dev_debug.sh index 962b01e7f..4a076df9e 100644 --- a/lgsm/functions/command_dev_debug.sh +++ b/lgsm/functions/command_dev_debug.sh @@ -4,9 +4,12 @@ # Website: https://linuxgsm.com # Description: Dev only: Enables debugging log to be saved to dev-debug.log. -commandname="DEV-DEBUG" -commandaction="Developer debug" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="DEV-DEBUG" + commandaction="Developer debug" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname 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 04f37d696..089aa9af3 100644 --- a/lgsm/functions/command_dev_detect_deps.sh +++ b/lgsm/functions/command_dev_detect_deps.sh @@ -4,9 +4,12 @@ # Website: https://linuxgsm.com # Description: Detects dependencies the server binary requires. -commandname="DEV-DETECT-DEPS" -commandaction="Developer detect deps" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="DEV-DETECT-DEPS" + commandaction="Developer detect deps" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname echo -e "=================================" echo -e "Dependencies Checker" diff --git a/lgsm/functions/command_dev_detect_glibc.sh b/lgsm/functions/command_dev_detect_glibc.sh index 2289bb818..c2feae0c9 100644 --- a/lgsm/functions/command_dev_detect_glibc.sh +++ b/lgsm/functions/command_dev_detect_glibc.sh @@ -5,9 +5,12 @@ # Description: Automatically detects the version of GLIBC that is required. # Can check a file or directory recursively. -commandname="DEV-DETECT-GLIBC" -commandaction="Developer detect glibc" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="DEV-DETECT-GLIBC" + commandaction="Developer detect glibc" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname echo -e "=================================" echo -e "glibc Requirements Checker" diff --git a/lgsm/functions/command_dev_detect_ldd.sh b/lgsm/functions/command_dev_detect_ldd.sh index 850845179..60766cce5 100644 --- a/lgsm/functions/command_dev_detect_ldd.sh +++ b/lgsm/functions/command_dev_detect_ldd.sh @@ -5,9 +5,12 @@ # Description: Automatically detects required deps using ldd. # Can check a file or directory recursively. -commandname="DEV-DETECT-LDD" -commandaction="Developer detect ldd" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="DEV-DETECT-LDD" + commandaction="Developer detect ldd" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname echo -e "=================================" echo -e "Shared Object dependencies Checker" diff --git a/lgsm/functions/command_dev_query_raw.sh b/lgsm/functions/command_dev_query_raw.sh index 22ed232ec..00005c22c 100644 --- a/lgsm/functions/command_dev_query_raw.sh +++ b/lgsm/functions/command_dev_query_raw.sh @@ -4,9 +4,12 @@ # Website: https://linuxgsm.com # Description: Raw gamedig output of the server. -commandname="DEV-QUERY-RAW" -commandaction="Developer query raw" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="DEV-QUERY-RAW" + commandaction="Developer query raw" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname check.sh info_config.sh diff --git a/lgsm/functions/command_donate.sh b/lgsm/functions/command_donate.sh index 9bb7f2faf..0483e4aa1 100644 --- a/lgsm/functions/command_donate.sh +++ b/lgsm/functions/command_donate.sh @@ -4,9 +4,12 @@ # Website: https://linuxgsm.com # Description: Shows ways to donate. -commandname="DONATE" -commandaction="Donate" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="DONATE" + commandaction="Donate" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname fn_print_ascii_logo echo -e "${lightyellow}Support LinuxGSM${default}" diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index f6a5897db..623596b08 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -5,9 +5,12 @@ # Website: https://linuxgsm.com # Description: Creates a FastDL directory. -commandname="FASTDL" -commandaction="Fastdl" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="FASTDL" + commandaction="Fastdl" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname check.sh diff --git a/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh index 90b40c0e4..a4a049878 100644 --- a/lgsm/functions/command_install.sh +++ b/lgsm/functions/command_install.sh @@ -6,9 +6,9 @@ # Description: Overall function for the installer. fn_commandname(){ -commandname="INSTALL" -commandaction="Installing" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + commandname="INSTALL" + commandaction="Installing" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" } fn_commandname diff --git a/lgsm/functions/command_install_resources_mta.sh b/lgsm/functions/command_install_resources_mta.sh index 053982e0b..4c641dcef 100644 --- a/lgsm/functions/command_install_resources_mta.sh +++ b/lgsm/functions/command_install_resources_mta.sh @@ -4,9 +4,12 @@ # Website: https://linuxgsm.com # Description: Installs the default resources for Multi Theft Auto. -commandname="DEFAULT-RESOURCES" -commandaction="Default Resources" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="DEFAULT-RESOURCES" + commandaction="Default Resources" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname fn_install_resources(){ echo -e "" diff --git a/lgsm/functions/command_mods_install.sh b/lgsm/functions/command_mods_install.sh index d3c517461..48bf116b3 100644 --- a/lgsm/functions/command_mods_install.sh +++ b/lgsm/functions/command_mods_install.sh @@ -5,9 +5,12 @@ # Website: https://linuxgsm.com # Description: List and installs available mods along with mods_list.sh and mods_core.sh. -commandname="MODS-INSTALL" -commandaction="Installing mods" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="MODS-INSTALL" + commandaction="Installing mods" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname check.sh mods_core.sh diff --git a/lgsm/functions/command_mods_remove.sh b/lgsm/functions/command_mods_remove.sh index 35fd41d5f..3e67fa867 100644 --- a/lgsm/functions/command_mods_remove.sh +++ b/lgsm/functions/command_mods_remove.sh @@ -5,9 +5,12 @@ # Website: https://linuxgsm.com # Description: Uninstall mods along with mods_list.sh and mods_core.sh. -commandname="MODS-REMOVE" -commandaction="Removing mods" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="MODS-REMOVE" + commandaction="Removing mods" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname check.sh mods_core.sh diff --git a/lgsm/functions/command_mods_update.sh b/lgsm/functions/command_mods_update.sh index 165b4ea98..d6cd15e70 100644 --- a/lgsm/functions/command_mods_update.sh +++ b/lgsm/functions/command_mods_update.sh @@ -5,9 +5,12 @@ # Website: https://linuxgsm.com # Description: Updates installed mods along with mods_list.sh and mods_core.sh. -commandname="MODS-UPDATE" -commandaction="Updating mods" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="MODS-UPDATE" + commandaction="Updating mods" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname check.sh mods_core.sh diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index 691fd5f7c..8d4ce1e2e 100644 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -6,9 +6,12 @@ # Description: Monitors server by checking for running processes # then passes to gamedig and gsquery. -commandname="MONITOR" -commandaction="Monitoring" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="MONITOR" + commandaction="Monitoring" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname fn_monitor_check_lockfile(){ # Monitor does not run it lockfile is not found. diff --git a/lgsm/functions/command_postdetails.sh b/lgsm/functions/command_postdetails.sh index a0afa2905..0d40b6a0b 100644 --- a/lgsm/functions/command_postdetails.sh +++ b/lgsm/functions/command_postdetails.sh @@ -5,9 +5,12 @@ # Website: https://linuxgsm.com # Description: Strips sensitive information out of Details output -commandname="POST-DETAILS" -commandaction="Posting details" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="POST-DETAILS" + commandaction="Posting details" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname # Set posttarget to the appropriately-defined post destination. diff --git a/lgsm/functions/command_restart.sh b/lgsm/functions/command_restart.sh index 3ccfcbe3d..47fa163a8 100644 --- a/lgsm/functions/command_restart.sh +++ b/lgsm/functions/command_restart.sh @@ -5,9 +5,9 @@ # Description: Restarts the server. fn_commandname(){ -commandname="MODS-INSTALL" -commandaction="Restarting" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + commandname="MODS-INSTALL" + commandaction="Restarting" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" } fn_commandname diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index e9ff0734d..c78bcc158 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Starts the server. -fn_commandname(){} +fn_commandname(){ commandname="START" commandaction="Starting" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index 6ea4f4d7a..085f9996a 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -5,9 +5,12 @@ # Website: https://linuxgsm.com # Description: Stops the server. -commandname="STOP" -commandaction="Stopping" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="STOP" + commandaction="Stopping" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname # Attempts graceful shutdown by sending 'CTRL+c'. fn_stop_graceful_ctrlc(){ diff --git a/lgsm/functions/command_test_alert.sh b/lgsm/functions/command_test_alert.sh index 5d1c11885..969c648ca 100644 --- a/lgsm/functions/command_test_alert.sh +++ b/lgsm/functions/command_test_alert.sh @@ -4,9 +4,12 @@ # Website: https://linuxgsm.com # Description: Sends a test alert. -commandname="TEST-ALERT" -commandaction="Sending Alert" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="TEST-ALERT" + commandaction="Sending Alert" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname fn_print_dots "${servername}" check.sh diff --git a/lgsm/functions/command_ts3_server_pass.sh b/lgsm/functions/command_ts3_server_pass.sh index 8ff799e6e..2f80d003f 100644 --- a/lgsm/functions/command_ts3_server_pass.sh +++ b/lgsm/functions/command_ts3_server_pass.sh @@ -5,9 +5,12 @@ # Website: https://linuxgsm.com # Description: Changes TS3 serveradmin password. -commandname="CHANGE-PASSWORD" -commandaction="Changing password" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="CHANGE-PASSWORD" + commandaction="Changing password" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname fn_serveradmin_password_prompt(){ fn_print_header diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh index a430ae425..b6254937a 100644 --- a/lgsm/functions/command_update.sh +++ b/lgsm/functions/command_update.sh @@ -4,7 +4,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of servers. -fn_commandname(){} +fn_commandname(){ commandname="UPDATE" commandaction="Updating" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/functions/command_update_linuxgsm.sh b/lgsm/functions/command_update_linuxgsm.sh index c32bf321f..e4028cf18 100644 --- a/lgsm/functions/command_update_linuxgsm.sh +++ b/lgsm/functions/command_update_linuxgsm.sh @@ -4,9 +4,12 @@ # Website: https://linuxgsm.com # Description: Deletes the functions dir to allow re-downloading of functions from GitHub. -commandname="UPDATE-LGSM" -commandaction="Updating LinuxGSM" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="UPDATE-LGSM" + commandaction="Updating LinuxGSM" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname check.sh diff --git a/lgsm/functions/command_validate.sh b/lgsm/functions/command_validate.sh index 423756834..a00fb99ce 100644 --- a/lgsm/functions/command_validate.sh +++ b/lgsm/functions/command_validate.sh @@ -5,9 +5,9 @@ # Description: Runs a server validation. fn_commandname(){ -commandname="VALIDATE" -commandaction="Validating" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + commandname="VALIDATE" + commandaction="Validating" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" } fn_commandname diff --git a/lgsm/functions/command_wipe.sh b/lgsm/functions/command_wipe.sh index 880776f99..99c9a1ab6 100644 --- a/lgsm/functions/command_wipe.sh +++ b/lgsm/functions/command_wipe.sh @@ -6,9 +6,9 @@ # Description: Wipes server data, useful after updates for some games like Rust fn_commandname(){ -commandname="WIPE" -commandaction="Wiping" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + commandname="WIPE" + commandaction="Wiping" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" } fn_commandname diff --git a/lgsm/functions/compress_unreal2_maps.sh b/lgsm/functions/compress_unreal2_maps.sh index 3580c20c9..e08dd666f 100644 --- a/lgsm/functions/compress_unreal2_maps.sh +++ b/lgsm/functions/compress_unreal2_maps.sh @@ -4,9 +4,12 @@ # Website: https://linuxgsm.com # Description: Compresses unreal maps. -commandname="MAP-COMPRESSOR" -commandaction="Compressing maps" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="MAP-COMPRESSOR" + commandaction="Compressing maps" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname check.sh fn_print_header diff --git a/lgsm/functions/compress_ut99_maps.sh b/lgsm/functions/compress_ut99_maps.sh index 677f5aaa2..e475c466b 100644 --- a/lgsm/functions/compress_ut99_maps.sh +++ b/lgsm/functions/compress_ut99_maps.sh @@ -4,9 +4,12 @@ # Website: https://linuxgsm.com # Description: Compresses unreal maps. -commandname="MAP-COMPRESSOR" -commandaction="Compressing maps" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_commandname(){ + commandname="MAP-COMPRESSOR" + commandaction="Compressing maps" + functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +} +fn_commandname check.sh fn_print_header