From a139cf38a6d740c6c4245ad9c22c38487257da6a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 2 Sep 2021 23:07:13 +0100 Subject: [PATCH] renamed function to module also renamed donate to sponsor --- lgsm/functions/README.md | 4 +- lgsm/functions/alert.sh | 4 +- lgsm/functions/alert_discord.sh | 2 +- 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_rocketchat.sh | 2 +- lgsm/functions/alert_slack.sh | 2 +- lgsm/functions/alert_telegram.sh | 2 +- lgsm/functions/check.sh | 4 +- lgsm/functions/check_config.sh | 2 +- lgsm/functions/check_deps.sh | 2 +- lgsm/functions/check_executable.sh | 2 +- lgsm/functions/check_glibc.sh | 2 +- lgsm/functions/check_ip.sh | 2 +- lgsm/functions/check_last_update.sh | 2 +- lgsm/functions/check_logs.sh | 2 +- lgsm/functions/check_permissions.sh | 18 +- lgsm/functions/check_root.sh | 2 +- lgsm/functions/check_status.sh | 2 +- lgsm/functions/check_steamcmd.sh | 2 +- lgsm/functions/check_system_dir.sh | 2 +- lgsm/functions/check_system_requirements.sh | 2 +- lgsm/functions/check_tmuxception.sh | 2 +- lgsm/functions/check_version.sh | 2 +- lgsm/functions/command_backup.sh | 2 +- lgsm/functions/command_check_update.sh | 2 +- lgsm/functions/command_console.sh | 2 +- lgsm/functions/command_debug.sh | 2 +- lgsm/functions/command_details.sh | 2 +- ...ctions.sh => command_dev_clear_modules.sh} | 10 +- 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 | 8 +- lgsm/functions/command_fastdl.sh | 2 +- lgsm/functions/command_install.sh | 4 +- .../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 | 8 +- lgsm/functions/command_postdetails.sh | 4 +- lgsm/functions/command_restart.sh | 2 +- lgsm/functions/command_send.sh | 2 +- lgsm/functions/command_skeleton.sh | 2 +- .../{command_donate.sh => command_sponsor.sh} | 12 +- 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_linuxgsm.sh | 48 +- 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 | 32 +- lgsm/functions/core_exit.sh | 18 +- lgsm/functions/core_functions.sh | 806 ------------------ lgsm/functions/core_getopt.sh | 12 +- lgsm/functions/core_github.sh | 6 +- lgsm/functions/core_legacy.sh | 2 +- lgsm/functions/core_logs.sh | 2 +- lgsm/functions/core_messages.sh | 2 +- lgsm/functions/core_modules.sh | 806 ++++++++++++++++++ lgsm/functions/core_steamcmd.sh | 4 +- lgsm/functions/core_trap.sh | 2 +- lgsm/functions/fix.sh | 6 +- lgsm/functions/fix_ark.sh | 2 +- lgsm/functions/fix_arma3.sh | 2 +- lgsm/functions/fix_av.sh | 2 +- lgsm/functions/fix_bo.sh | 2 +- lgsm/functions/fix_cmw.sh | 2 +- lgsm/functions/fix_csgo.sh | 2 +- lgsm/functions/fix_dst.sh | 2 +- lgsm/functions/fix_hw.sh | 2 +- lgsm/functions/fix_ins.sh | 2 +- lgsm/functions/fix_kf.sh | 2 +- lgsm/functions/fix_kf2.sh | 2 +- lgsm/functions/fix_lo.sh | 4 +- lgsm/functions/fix_mcb.sh | 2 +- lgsm/functions/fix_mta.sh | 2 +- lgsm/functions/fix_nmrih.sh | 2 +- lgsm/functions/fix_onset.sh | 2 +- lgsm/functions/fix_ro.sh | 2 +- lgsm/functions/fix_rust.sh | 2 +- lgsm/functions/fix_rw.sh | 2 +- lgsm/functions/fix_samp.sh | 2 +- lgsm/functions/fix_sdtd.sh | 2 +- lgsm/functions/fix_sfc.sh | 2 +- lgsm/functions/fix_sof2.sh | 2 +- lgsm/functions/fix_squad.sh | 2 +- lgsm/functions/fix_st.sh | 2 +- lgsm/functions/fix_steamcmd.sh | 2 +- lgsm/functions/fix_terraria.sh | 2 +- lgsm/functions/fix_tf2.sh | 2 +- lgsm/functions/fix_ts3.sh | 2 +- lgsm/functions/fix_unt.sh | 2 +- lgsm/functions/fix_ut.sh | 2 +- lgsm/functions/fix_ut2k4.sh | 2 +- lgsm/functions/fix_ut3.sh | 2 +- lgsm/functions/fix_vh.sh | 4 +- lgsm/functions/fix_wurm.sh | 2 +- lgsm/functions/fix_zmr.sh | 2 +- lgsm/functions/info_distro.sh | 2 +- lgsm/functions/info_game.sh | 2 +- lgsm/functions/info_messages.sh | 2 +- lgsm/functions/info_stats.sh | 2 +- lgsm/functions/install_complete.sh | 2 +- lgsm/functions/install_config.sh | 2 +- lgsm/functions/install_dst_token.sh | 2 +- lgsm/functions/install_eula.sh | 2 +- lgsm/functions/install_factorio_save.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_stats.sh | 2 +- lgsm/functions/install_steamcmd.sh | 2 +- lgsm/functions/install_ts3db.sh | 2 +- lgsm/functions/install_ut2k4_key.sh | 2 +- lgsm/functions/mods_core.sh | 4 +- lgsm/functions/mods_list.sh | 2 +- lgsm/functions/query_gamedig.sh | 2 +- lgsm/functions/query_gsquery.py | 2 +- lgsm/functions/update_factorio.sh | 2 +- lgsm/functions/update_jediknight2.sh | 2 +- lgsm/functions/update_minecraft.sh | 2 +- lgsm/functions/update_minecraft_bedrock.sh | 2 +- lgsm/functions/update_mta.sh | 2 +- lgsm/functions/update_mumble.sh | 2 +- lgsm/functions/update_papermc.sh | 4 +- lgsm/functions/update_steamcmd.sh | 2 +- lgsm/functions/update_ts3.sh | 2 +- lgsm/functions/update_vintagestory.sh | 2 +- tests/tests_fctrserver.sh | 90 +- tests/tests_jc2server.sh | 104 +-- tests/tests_mcserver.sh | 90 +- tests/tests_ts3server.sh | 90 +- 147 files changed, 1222 insertions(+), 1222 deletions(-) rename lgsm/functions/{command_dev_clear_functions.sh => command_dev_clear_modules.sh} (63%) mode change 100755 => 100644 rename lgsm/functions/{command_donate.sh => command_sponsor.sh} (70%) mode change 100755 => 100644 delete mode 100755 lgsm/functions/core_functions.sh create mode 100644 lgsm/functions/core_modules.sh diff --git a/lgsm/functions/README.md b/lgsm/functions/README.md index c1c823fac..105bde439 100755 --- a/lgsm/functions/README.md +++ b/lgsm/functions/README.md @@ -3,10 +3,10 @@ These modules are scripts that are called upon by the primary script linuxgsm.sh ## Module Names -Modules have been named to give an idea of what the function does. +Modules have been named to give an idea of what the module does. * core: Essential modules that will always run first. -* command: Primary command function. +* command: Primary command module. * check: Runs checks that will either halt on or fix an issue. * dev: development modules. * fix: Applies a game server specific fix. diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index 782c6e9a4..eefa08058 100755 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -3,9 +3,9 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Overall function for managing alerts. +# Description: Overall module for managing alerts. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Generates alert log of the details at the time of the alert. # Used with email alerts. diff --git a/lgsm/functions/alert_discord.sh b/lgsm/functions/alert_discord.sh index 1d047b60b..4f28ccdf7 100755 --- a/lgsm/functions/alert_discord.sh +++ b/lgsm/functions/alert_discord.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Sends Discord alert. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if ! command -v jq > /dev/null; then fn_print_fail_nl "Sending Discord alert: jq is missing." diff --git a/lgsm/functions/alert_email.sh b/lgsm/functions/alert_email.sh index ad90e880f..e2cf5f123 100755 --- a/lgsm/functions/alert_email.sh +++ b/lgsm/functions/alert_email.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Sends email alert. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_dots "Sending Email alert: ${email}" fn_sleep_time diff --git a/lgsm/functions/alert_ifttt.sh b/lgsm/functions/alert_ifttt.sh index 7f76cfeca..e58c0854a 100755 --- a/lgsm/functions/alert_ifttt.sh +++ b/lgsm/functions/alert_ifttt.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Sends IFTTT alert. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" json=$(cat < /dev/null; then fn_print_fail_nl "Sending Rocketchat alert: jq is missing." diff --git a/lgsm/functions/alert_slack.sh b/lgsm/functions/alert_slack.sh index 625b1967e..34d512d24 100755 --- a/lgsm/functions/alert_slack.sh +++ b/lgsm/functions/alert_slack.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Sends Slack alert. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if ! command -v jq > /dev/null; then fn_print_fail_nl "Sending Slack alert: jq is missing." diff --git a/lgsm/functions/alert_telegram.sh b/lgsm/functions/alert_telegram.sh index 056f11ae0..9dc3969ec 100755 --- a/lgsm/functions/alert_telegram.sh +++ b/lgsm/functions/alert_telegram.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Sends Telegram Messenger alert. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" json=$(cat </dev/null | grep -Ecx "^${sessionname}") diff --git a/lgsm/functions/check_steamcmd.sh b/lgsm/functions/check_steamcmd.sh index 030cbbf03..0ee0a0908 100755 --- a/lgsm/functions/check_steamcmd.sh +++ b/lgsm/functions/check_steamcmd.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Checks if SteamCMD is installed correctly. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # init steamcmd functions core_steamcmd.sh diff --git a/lgsm/functions/check_system_dir.sh b/lgsm/functions/check_system_dir.sh index 0a732d6d1..9f0f5f092 100755 --- a/lgsm/functions/check_system_dir.sh +++ b/lgsm/functions/check_system_dir.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Checks if systemdir/serverfiles is accessible. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "${commandname}" != "VALIDATE" ]; then checkdir="${serverfiles}" diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/functions/check_system_requirements.sh index cc72288fb..07027adf5 100755 --- a/lgsm/functions/check_system_requirements.sh +++ b/lgsm/functions/check_system_requirements.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Checks RAM requirements. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" info_distro.sh diff --git a/lgsm/functions/check_tmuxception.sh b/lgsm/functions/check_tmuxception.sh index e11b55861..74fbf254f 100755 --- a/lgsm/functions/check_tmuxception.sh +++ b/lgsm/functions/check_tmuxception.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Checks if run from tmux or screen. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_check_is_in_tmux(){ if [ "${TMUX}" ]; then diff --git a/lgsm/functions/check_version.sh b/lgsm/functions/check_version.sh index a0f3d4435..bcd6c4a5b 100755 --- a/lgsm/functions/check_version.sh +++ b/lgsm/functions/check_version.sh @@ -6,7 +6,7 @@ # Description: Will run update-lgsm if gameserver.sh and modules version does not match # this will allow gameserver.sh to update - useful for multi instance servers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ -n "${modulesversion}" ]&&[ -n "${version}" ]&&[ "${version}" != "${modulesversion}" ]; then exitbypass=1 diff --git a/lgsm/functions/command_backup.sh b/lgsm/functions/command_backup.sh index adce957c9..3b72f408d 100644 --- a/lgsm/functions/command_backup.sh +++ b/lgsm/functions/command_backup.sh @@ -7,7 +7,7 @@ commandname="BACKUP" commandaction="Backing up" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/functions/command_check_update.sh b/lgsm/functions/command_check_update.sh index 9648dd49e..b9083bf4c 100755 --- a/lgsm/functions/command_check_update.sh +++ b/lgsm/functions/command_check_update.sh @@ -7,7 +7,7 @@ commandname="CHECK-UPDATE" commandaction="check for Update" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_print_dots "" diff --git a/lgsm/functions/command_console.sh b/lgsm/functions/command_console.sh index 5b84789e6..e95f2d0e5 100755 --- a/lgsm/functions/command_console.sh +++ b/lgsm/functions/command_console.sh @@ -7,7 +7,7 @@ commandname="CONSOLE" commandaction="Access console" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh index a9cceebdb..5f15e15ce 100755 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/functions/command_debug.sh @@ -7,7 +7,7 @@ commandname="DEBUG" commandaction="Debuging" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set # Trap to remove lockfile on quit. diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 2daeeb2f7..ff5a735ed 100755 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -7,7 +7,7 @@ commandname="DETAILS" commandaction="Viewing details" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set # Run checks and gathers details to display. diff --git a/lgsm/functions/command_dev_clear_functions.sh b/lgsm/functions/command_dev_clear_modules.sh old mode 100755 new mode 100644 similarity index 63% rename from lgsm/functions/command_dev_clear_functions.sh rename to lgsm/functions/command_dev_clear_modules.sh index 87c77515d..a60e7cf85 --- a/lgsm/functions/command_dev_clear_functions.sh +++ b/lgsm/functions/command_dev_clear_modules.sh @@ -1,21 +1,21 @@ #!/bin/bash -# LinuxGSM command_dev_clear_functions.sh module +# LinuxGSM command_dev_clear_modules.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Deletes the contents of the functions dir. +# Description: Deletes the contents of the modules dir. commandname="DEV-CLEAR-MODULES" commandaction="Clearing modules" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set echo -e "=================================" echo -e "Clear Functions" echo -e "=================================" echo -e "" -if fn_prompt_yn "Do you want to delete all functions?" Y; then - rm -rfv "${functionsdir:?}/"* +if fn_prompt_yn "Do you want to delete all modules?" Y; then + rm -rfv "${modulesdir:?}/"* rm -rfv "${configdirdefault:?}/"* fn_script_log_info "Cleared modules directory" fn_script_log_info "Cleared default config directory" diff --git a/lgsm/functions/command_dev_debug.sh b/lgsm/functions/command_dev_debug.sh index 957709898..a5f47f7d3 100755 --- a/lgsm/functions/command_dev_debug.sh +++ b/lgsm/functions/command_dev_debug.sh @@ -7,7 +7,7 @@ commandname="DEV-DEBUG" commandaction="Developer debug" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_reset if [ -f "${rootdir}/.dev-debug" ]; then diff --git a/lgsm/functions/command_dev_detect_deps.sh b/lgsm/functions/command_dev_detect_deps.sh index 976bf94dc..847ce341c 100755 --- a/lgsm/functions/command_dev_detect_deps.sh +++ b/lgsm/functions/command_dev_detect_deps.sh @@ -7,7 +7,7 @@ commandname="DEV-DETECT-DEPS" commandaction="Developer detect deps" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set echo -e "=================================" diff --git a/lgsm/functions/command_dev_detect_glibc.sh b/lgsm/functions/command_dev_detect_glibc.sh index 304d255fd..09d496a88 100755 --- a/lgsm/functions/command_dev_detect_glibc.sh +++ b/lgsm/functions/command_dev_detect_glibc.sh @@ -8,7 +8,7 @@ commandname="DEV-DETECT-GLIBC" commandaction="Developer detect glibc" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set echo -e "=================================" diff --git a/lgsm/functions/command_dev_detect_ldd.sh b/lgsm/functions/command_dev_detect_ldd.sh index 7d6e942a1..7550393d9 100755 --- a/lgsm/functions/command_dev_detect_ldd.sh +++ b/lgsm/functions/command_dev_detect_ldd.sh @@ -8,7 +8,7 @@ commandname="DEV-DETECT-LDD" commandaction="Developer detect ldd" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set echo -e "=================================" diff --git a/lgsm/functions/command_dev_query_raw.sh b/lgsm/functions/command_dev_query_raw.sh index c9123ebcb..c44b5e3bf 100755 --- a/lgsm/functions/command_dev_query_raw.sh +++ b/lgsm/functions/command_dev_query_raw.sh @@ -7,7 +7,7 @@ commandname="DEV-QUERY-RAW" commandaction="Developer query raw" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh @@ -230,10 +230,10 @@ echo -e "" for queryip in "${queryips[@]}"; do echo -e "./query_gsquery.py -a \"${queryip}\" -p \"${queryport}\" -e \"${querytype}\"" echo -e "" - if [ ! -f "${functionsdir}/query_gsquery.py" ]; then - fn_fetch_file_github "lgsm/functions" "query_gsquery.py" "${functionsdir}" "chmodx" "norun" "noforce" "nohash" + if [ ! -f "${modulesdir}/query_gsquery.py" ]; then + fn_fetch_file_github "lgsm/modules" "query_gsquery.py" "${modulesdir}" "chmodx" "norun" "noforce" "nohash" fi - "${functionsdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}" + "${modulesdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}" done echo -e "" echo -e "${lightgreen}TCP Raw Output${default}" diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index d6ab960bd..8cfb8070e 100755 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -7,7 +7,7 @@ commandname="FASTDL" commandaction="Fastdl" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh index e56890b4d..1f0f24d5b 100755 --- a/lgsm/functions/command_install.sh +++ b/lgsm/functions/command_install.sh @@ -3,11 +3,11 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Overall function for the installer. +# Description: Overall module for the installer. commandname="INSTALL" commandaction="Installing" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/functions/command_install_resources_mta.sh b/lgsm/functions/command_install_resources_mta.sh index 3a94444a3..0c7c454cd 100755 --- a/lgsm/functions/command_install_resources_mta.sh +++ b/lgsm/functions/command_install_resources_mta.sh @@ -7,7 +7,7 @@ commandname="DEFAULT-RESOURCES" commandaction="Default Resources" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_install_resources(){ diff --git a/lgsm/functions/command_mods_install.sh b/lgsm/functions/command_mods_install.sh index a5eaaf83c..576222b01 100755 --- a/lgsm/functions/command_mods_install.sh +++ b/lgsm/functions/command_mods_install.sh @@ -7,7 +7,7 @@ commandname="MODS-INSTALL" commandaction="Installing mods" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/functions/command_mods_remove.sh b/lgsm/functions/command_mods_remove.sh index 8647a21ed..6c0778f68 100755 --- a/lgsm/functions/command_mods_remove.sh +++ b/lgsm/functions/command_mods_remove.sh @@ -7,7 +7,7 @@ commandname="MODS-REMOVE" commandaction="Removing mods" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/functions/command_mods_update.sh b/lgsm/functions/command_mods_update.sh index 50bbf9d67..985bfd5d8 100755 --- a/lgsm/functions/command_mods_update.sh +++ b/lgsm/functions/command_mods_update.sh @@ -7,7 +7,7 @@ commandname="MODS-UPDATE" commandaction="Updating mods" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index 3f4e397e2..5cfcf1061 100755 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -8,7 +8,7 @@ commandname="MONITOR" commandaction="Monitoring" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_monitor_check_lockfile(){ @@ -84,10 +84,10 @@ fn_monitor_check_queryport(){ } fn_query_gsquery(){ - if [ ! -f "${functionsdir}/query_gsquery.py" ]; then - fn_fetch_file_github "lgsm/functions" "query_gsquery.py" "${functionsdir}" "chmodx" "norun" "noforce" "nohash" + if [ ! -f "${modulesdir}/query_gsquery.py" ]; then + fn_fetch_file_github "lgsm/modules" "query_gsquery.py" "${modulesdir}" "chmodx" "norun" "noforce" "nohash" fi - "${functionsdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}" > /dev/null 2>&1 + "${modulesdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}" > /dev/null 2>&1 querystatus="$?" } diff --git a/lgsm/functions/command_postdetails.sh b/lgsm/functions/command_postdetails.sh index f8b36fb61..04f999760 100755 --- a/lgsm/functions/command_postdetails.sh +++ b/lgsm/functions/command_postdetails.sh @@ -7,12 +7,12 @@ commandname="POST-DETAILS" commandaction="Posting details" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set posttarget="https://termbin.com" -# source all of the functions defined in the details command. +# source all of the modules defined in the details command. info_messages.sh fn_bad_postdetailslog() { diff --git a/lgsm/functions/command_restart.sh b/lgsm/functions/command_restart.sh index 3bf60c32c..b7bb1f3e3 100755 --- a/lgsm/functions/command_restart.sh +++ b/lgsm/functions/command_restart.sh @@ -7,7 +7,7 @@ commandname="MODS-INSTALL" commandaction="Restarting" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set info_game.sh diff --git a/lgsm/functions/command_send.sh b/lgsm/functions/command_send.sh index 4b653c0be..6315af9a3 100644 --- a/lgsm/functions/command_send.sh +++ b/lgsm/functions/command_send.sh @@ -7,7 +7,7 @@ commandname="SEND" commandaction="Send" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/functions/command_skeleton.sh b/lgsm/functions/command_skeleton.sh index 7b7d67d5f..2681e38ca 100644 --- a/lgsm/functions/command_skeleton.sh +++ b/lgsm/functions/command_skeleton.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Creates an copy of a game servers directorys. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_dots "Creating skeleton directory" check.sh diff --git a/lgsm/functions/command_donate.sh b/lgsm/functions/command_sponsor.sh old mode 100755 new mode 100644 similarity index 70% rename from lgsm/functions/command_donate.sh rename to lgsm/functions/command_sponsor.sh index f00a4d702..8f5940ff3 --- a/lgsm/functions/command_donate.sh +++ b/lgsm/functions/command_sponsor.sh @@ -1,13 +1,13 @@ #!/bin/bash -# LinuxGSM command_donate.sh module +# LinuxGSM command_sponsor.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Shows ways to donate. +# Description: Shows ways to sponsor. -commandname="DONATE" -commandaction="Donate" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +commandname="SPONSOR" +commandaction="Sponsor" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_print_ascii_logo @@ -15,7 +15,7 @@ echo -e "${lightyellow}Support LinuxGSM${default}" echo -e "=================================" echo -e "" echo -e "Been using LinuxGSM?" -echo -e "Consider donating to support development." +echo -e "Consider sponsoring to support development." echo -e "" echo -e "* ${lightblue}Patreon:${default} https://linuxgsm.com/patreon" echo -e "* ${lightblue}GitHub:${default} https://github.com/sponsors/dgibbs64" diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 58ecfcff7..9d10500e5 100755 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -7,7 +7,7 @@ commandname="START" commandaction="Starting" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_start_teamspeak3(){ diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index ef54b525c..d30ed9b10 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -7,7 +7,7 @@ commandname="STOP" commandaction="Stopping" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set # Attempts graceful shutdown by sending 'CTRL+c'. diff --git a/lgsm/functions/command_test_alert.sh b/lgsm/functions/command_test_alert.sh index 7fe61e48a..15f481391 100755 --- a/lgsm/functions/command_test_alert.sh +++ b/lgsm/functions/command_test_alert.sh @@ -7,7 +7,7 @@ commandname="TEST-ALERT" commandaction="Sending Alert" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_print_dots "${servername}" diff --git a/lgsm/functions/command_ts3_server_pass.sh b/lgsm/functions/command_ts3_server_pass.sh index 1e227f3de..00c199344 100755 --- a/lgsm/functions/command_ts3_server_pass.sh +++ b/lgsm/functions/command_ts3_server_pass.sh @@ -7,7 +7,7 @@ commandname="CHANGE-PASSWORD" commandaction="Changing password" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_serveradmin_password_prompt(){ diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh index 828c8c38d..ef6a336b4 100755 --- a/lgsm/functions/command_update.sh +++ b/lgsm/functions/command_update.sh @@ -7,7 +7,7 @@ commandname="UPDATE" commandaction="Updating" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_print_dots "" diff --git a/lgsm/functions/command_update_linuxgsm.sh b/lgsm/functions/command_update_linuxgsm.sh index 4027c1e6d..07f3bb650 100755 --- a/lgsm/functions/command_update_linuxgsm.sh +++ b/lgsm/functions/command_update_linuxgsm.sh @@ -3,11 +3,11 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Deletes the functions dir to allow re-downloading of functions from GitHub. +# Description: Deletes the modules dir to allow re-downloading of modules from GitHub. commandname="UPDATE-LGSM" commandaction="Updating LinuxGSM" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh @@ -147,55 +147,55 @@ else fi # Check and update modules. -if [ -n "${functionsdir}" ]; then - if [ -d "${functionsdir}" ]; then - cd "${functionsdir}" || exit - for functionfile in *; do +if [ -n "${modulesdir}" ]; then + if [ -d "${modulesdir}" ]; then + cd "${modulesdir}" || exit + for modulefile in *; do # check if module exists in the repo and remove if missing. # commonly used if module names change. - echo -en "checking ${remotereponame} module ${functionfile}...\c" - github_file_url_dir="lgsm/functions" + echo -en "checking ${remotereponame} module ${modulefile}...\c" + github_file_url_dir="lgsm/modules" if [ "${remotereponame}" == "GitHub" ]; then - curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null + curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}" 1>/dev/null else - curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null + curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}" 1>/dev/null fi if [ $? != 0 ]; then fn_print_error_eol_nl - fn_script_log_error "Checking ${remotereponame} module ${functionfile}" - echo -en "removing module ${functionfile}...\c" - if ! rm -f "${functionfile:?}"; then + fn_script_log_error "Checking ${remotereponame} module ${modulefile}" + echo -en "removing module ${modulefile}...\c" + if ! rm -f "${modulefile:?}"; then fn_print_fail_eol_nl - fn_script_log_fatal "Removing module ${functionfile}" + fn_script_log_fatal "Removing module ${modulefile}" core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "Removing module ${functionfile}" + fn_script_log_pass "Removing module ${modulefile}" fi else # compare file if [ "${remotereponame}" == "GitHub" ]; then - function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}")) + module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}")) else - function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}")) + module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}")) fi # results - if [ "${function_file_diff}" != "" ]; then + if [ "${module_file_diff}" != "" ]; then fn_print_update_eol_nl - fn_script_log_update "Checking ${remotereponame} module ${functionfile}" - rm -rf "${functionsdir:?}/${functionfile}" - fn_update_function + fn_script_log_update "Checking ${remotereponame} module ${modulefile}" + rm -rf "${modulesdir:?}/${modulefile}" + fn_update_module else fn_print_ok_eol_nl - fn_script_log_pass "Checking ${remotereponame} module ${functionfile}" + fn_script_log_pass "Checking ${remotereponame} module ${modulefile}" fi fi done fi fi -fn_print_ok_nl "Updating functions" -fn_script_log_pass "Updating functions" +fn_print_ok_nl "Updating modules" +fn_script_log_pass "Updating modules" core_exit.sh diff --git a/lgsm/functions/command_validate.sh b/lgsm/functions/command_validate.sh index 4c51bacb3..bf284bc51 100755 --- a/lgsm/functions/command_validate.sh +++ b/lgsm/functions/command_validate.sh @@ -7,7 +7,7 @@ commandname="VALIDATE" commandaction="Validating" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_validate(){ diff --git a/lgsm/functions/command_wipe.sh b/lgsm/functions/command_wipe.sh index d2d05defc..19835bf3c 100755 --- a/lgsm/functions/command_wipe.sh +++ b/lgsm/functions/command_wipe.sh @@ -7,7 +7,7 @@ commandname="WIPE" commandaction="Wiping" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set # Provides an exit code upon error. diff --git a/lgsm/functions/compress_unreal2_maps.sh b/lgsm/functions/compress_unreal2_maps.sh index 0c32d3c77..f67ac7010 100755 --- a/lgsm/functions/compress_unreal2_maps.sh +++ b/lgsm/functions/compress_unreal2_maps.sh @@ -7,7 +7,7 @@ commandname="MAP-COMPRESSOR" commandaction="Compressing maps" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/functions/compress_ut99_maps.sh b/lgsm/functions/compress_ut99_maps.sh index 9aa074ba9..51bbd386a 100755 --- a/lgsm/functions/compress_ut99_maps.sh +++ b/lgsm/functions/compress_ut99_maps.sh @@ -7,7 +7,7 @@ commandname="MAP-COMPRESSOR" commandaction="Compressing maps" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 9d80913a7..7694b4460 100755 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -17,7 +17,7 @@ # fn_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}" # fn_fetch_file "http://example.com/file.tar.bz2" "/some/dir" "file.tar.bz2" "chmodx" "run" "forcedl" "10cd7353aa9d758a075c600a6dd193fd" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_dl_steamcmd(){ fn_print_start_nl "${remotelocation}" @@ -358,10 +358,10 @@ fn_fetch_file(){ fi } -# GitHub file download functions. +# GitHub file download modules. # Used to simplify downloading specific files from GitHub. -# github_file_url_dir: the directory of the file in the GitHub: lgsm/functions +# github_file_url_dir: the directory of the file in the GitHub: lgsm/modules # github_file_url_name: the filename of the file to download from GitHub: core_messages.sh # githuburl: the full GitHub url @@ -397,7 +397,7 @@ fn_fetch_file_github(){ run="${5:-0}" forcedl="${6:-0}" hash="${7:-0}" - # Passes vars to the file download function. + # Passes vars to the file download module. fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}" } @@ -421,14 +421,14 @@ fn_fetch_config(){ run="norun" forcedl="noforce" hash="nohash" - # Passes vars to the file download function. + # Passes vars to the file download module. fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}" } # Fetches modules from the Git repo during first download. -fn_fetch_function(){ - github_file_url_dir="lgsm/functions" - github_file_url_name="${functionfile}" +fn_fetch_module(){ + github_file_url_dir="lgsm/modules" + github_file_url_name="${modulefile}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" @@ -439,20 +439,20 @@ fn_fetch_function(){ fi remote_fileurl_name="GitHub" remote_fileurl_backup_name="Bitbucket" - local_filedir="${functionsdir}" + local_filedir="${modulesdir}" local_filename="${github_file_url_name}" chmodx="chmodx" run="run" forcedl="noforce" hash="nohash" - # Passes vars to the file download function. + # Passes vars to the file download module. fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}" } # Fetches modules from the Git repo during update-lgsm. -fn_update_function(){ - github_file_url_dir="lgsm/functions" - github_file_url_name="${functionfile}" +fn_update_module(){ + github_file_url_dir="lgsm/modules" + github_file_url_name="${modulefile}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" @@ -463,13 +463,13 @@ fn_update_function(){ fi remote_fileurl_name="GitHub" remote_fileurl_backup_name="Bitbucket" - local_filedir="${functionsdir}" + local_filedir="${modulesdir}" local_filename="${github_file_url_name}" chmodx="chmodx" run="norun" forcedl="noforce" hash="nohash" - # Passes vars to the file download function. + # Passes vars to the file download module. fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}" } @@ -508,7 +508,7 @@ fn_dl_latest_release_github(){ fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" fn_script_log_fatal "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" else - # Fetch file from the remote location from the existing function to the ${tmpdir} for now. + # Fetch file from the remote location from the existing module to the ${tmpdir} for now. fn_fetch_file "${githubreleasedownloadlink}" "" "${githubreleasefilename}" "" "${githubreleasedownloadpath}" "${githubreleasefilename}" fi fi diff --git a/lgsm/functions/core_exit.sh b/lgsm/functions/core_exit.sh index 34379a486..ab5967a1d 100755 --- a/lgsm/functions/core_exit.sh +++ b/lgsm/functions/core_exit.sh @@ -5,14 +5,14 @@ # Website: https://linuxgsm.com # Description: Handles exiting of LinuxGSM by running and reporting an exit code. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_exit_dev_debug(){ if [ -f "${rootdir}/.dev-debug" ]; then echo -e "" - echo -e "${functionselfname} exiting with code: ${exitcode}" + echo -e "${moduleselfname} exiting with code: ${exitcode}" if [ -f "${rootdir}/dev-debug.log" ]; then - grep "functionfile=" "${rootdir}/dev-debug.log" | sed 's/functionfile=//g' > "${rootdir}/dev-debug-function-order.log" + grep "modulefile=" "${rootdir}/dev-debug.log" | sed 's/modulefile=//g' > "${rootdir}/dev-debug-module-order.log" fi fi } @@ -29,13 +29,13 @@ elif [ "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then # List LinuxGSM version in logs fn_script_log_info "LinuxGSM version: ${version}" if [ "${exitcode}" == "1" ]; then - fn_script_log_fatal "${functionselfname} exiting with code: ${exitcode}" + fn_script_log_fatal "${moduleselfname} exiting with code: ${exitcode}" elif [ "${exitcode}" == "2" ]; then - fn_script_log_error "${functionselfname} exiting with code: ${exitcode}" + fn_script_log_error "${moduleselfname} exiting with code: ${exitcode}" elif [ "${exitcode}" == "3" ]; then - fn_script_log_warn "${functionselfname} exiting with code: ${exitcode}" + fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}" else - fn_script_log_warn "${functionselfname} exiting with code: ${exitcode}" + fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}" fi fn_exit_dev_debug # remove trap. @@ -44,7 +44,7 @@ elif [ "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then elif [ "${exitcode}" ]&&[ "${exitcode}" == "0" ]; then # List LinuxGSM version in logs fn_script_log_info "LinuxGSM version: ${version}" - fn_script_log_pass "${functionselfname} exiting with code: ${exitcode}" + fn_script_log_pass "${moduleselfname} exiting with code: ${exitcode}" fn_exit_dev_debug # remove trap. trap - INT @@ -53,7 +53,7 @@ else # List LinuxGSM version in logs fn_script_log_info "LinuxGSM version: ${version}" fn_print_error "No exit code set" - fn_script_log_pass "${functionselfname} exiting with code: NOT SET" + fn_script_log_pass "${moduleselfname} exiting with code: NOT SET" fn_exit_dev_debug # remove trap. trap - INT diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh deleted file mode 100755 index dd82419a4..000000000 --- a/lgsm/functions/core_functions.sh +++ /dev/null @@ -1,806 +0,0 @@ -#!/bin/bash -# LinuxGSM core_functions.sh module -# Author: Daniel Gibbs -# Contributors: http://linuxgsm.com/contrib -# Website: https://linuxgsm.com -# Description: Defines all functions to allow download and execution of functions using fn_fetch_function. -# This function is called first before any other function. Without this file other functions will not load. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -modulesversion="v21.2.5" - -# Core - -core_dl.sh(){ -functionfile="${FUNCNAME[0]}" -if [ "$(type fn_fetch_core_dl 2>/dev/null)" ]; then - fn_fetch_core_dl "lgsm/functions" "core_dl.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" -else - fn_bootstrap_fetch_file_github "lgsm/functions" "core_dl.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" -fi -} - -core_messages.sh(){ -functionfile="${FUNCNAME[0]}" -if [ "$(type fn_fetch_core_dl 2>/dev/null)" ]; then - fn_fetch_core_dl "lgsm/functions" "core_messages.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" -else - fn_bootstrap_fetch_file_github "lgsm/functions" "core_messages.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" -fi -} - -core_legacy.sh(){ -functionfile="${FUNCNAME[0]}" -if [ "$(type fn_fetch_core_dl 2>/dev/null)" ]; then - fn_fetch_core_dl "lgsm/functions" "core_legacy.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" -else - fn_bootstrap_fetch_file_github "lgsm/functions" "core_legacy.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" -fi -} - -core_exit.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -core_getopt.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -core_trap.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -core_steamcmd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -core_github.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Commands - -command_backup.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_console.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_debug.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_details.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_donate.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_postdetails.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_test_alert.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_monitor.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_start.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_stop.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_validate.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_install.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_install_resources_mta.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_squad_license.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_mods_install.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_mods_update.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_mods_remove.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_fastdl.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_ts3_server_pass.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_restart.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_skeleton.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_wipe.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_send.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Checks - -check.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_config.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_deps.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_executable.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_glibc.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_ip.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_last_update.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_logs.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_permissions.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_root.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_status.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_steamcmd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_system_dir.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_system_requirements.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_tmuxception.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_version.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Compress - -compress_unreal2_maps.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -compress_ut99_maps.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Mods - -mods_list.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -mods_core.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Dev - -command_dev_clear_functions.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_dev_debug.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_dev_detect_deps.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_dev_detect_glibc.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_dev_detect_ldd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_dev_query_raw.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Fix - -fix.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_ark.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_av.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_arma3.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_bo.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_cmw.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_csgo.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_dst.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_hw.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_ins.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_kf.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_kf2.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_lo.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_mcb.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_mta.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_nmrih.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_onset.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_ro.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_rust.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_rw.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_sfc.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_st.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_steamcmd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_terraria.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_tf2.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_ut3.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_rust.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_samp.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_sdtd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_sof2.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_squad.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_ts3.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_ut2k4.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_ut.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_unt.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_vh.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_wurm.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_zmr.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Info - -info_distro.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -info_game.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -info_gamedig.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -info_messages.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -info_stats.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Alert - -alert.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -alert_discord.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -alert_email.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -alert_ifttt.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -alert_mailgun.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -alert_pushbullet.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -alert_pushover.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -alert_telegram.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -alert_rocketchat.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -alert_slack.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} -# Logs - -core_logs.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Query - -query_gamedig.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Update - -command_update_functions.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_update_linuxgsm.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_update.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_check_update.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -update_ts3.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -update_minecraft.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -update_minecraft_bedrock.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -update_papermc.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -update_mumble.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -update_mta.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -update_factorio.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -update_jediknight2.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -update_steamcmd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -update_vintagestory.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fn_update_functions.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# -## Installer functions -# - -fn_autoinstall(){ -autoinstall=1 -command_install.sh -} - -install_complete.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_config.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_factorio_save.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_dst_token.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_eula.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_gsquery.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_gslt.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_header.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_logs.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_retry.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_server_dir.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} -install_server_files.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_stats.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_steamcmd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_ts3.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_ts3db.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_ut2k4.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_dl_ut2k4.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_ut2k4_key.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Calls code required for legacy servers -core_legacy.sh - -# Creates tmp dir if missing -if [ ! -d "${tmpdir}" ]; then - mkdir -p "${tmpdir}" -fi - -# Creates lock dir if missing -if [ ! -d "${lockdir}" ]; then - mkdir -p "${lockdir}" -fi - -# Calls on-screen messages (bootstrap) -core_messages.sh - -#Calls file downloader (bootstrap) -core_dl.sh - -# Calls the global Ctrl-C trap -core_trap.sh diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index ea3c84f6d..f06fa52ab 100755 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: getopt arguments. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ### Define all commands here. ## User commands | Trigger commands | Description @@ -18,11 +18,11 @@ cmd_restart=( "r;restart" "command_restart.sh" "Restart the server." ) cmd_details=( "dt;details" "command_details.sh" "Display server information." ) cmd_postdetails=( "pd;postdetails" "command_postdetails.sh" "Post details to termbin.com (removing passwords)." ) cmd_backup=( "b;backup" "command_backup.sh" "Create backup archives of the server." ) -cmd_update_linuxgsm=( "ul;update-lgsm;uf;update-functions" "command_update_linuxgsm.sh" "Check and apply any LinuxGSM updates." ) +cmd_update_linuxgsm=( "ul;update-lgsm;uf;update-modules" "command_update_linuxgsm.sh" "Check and apply any LinuxGSM updates." ) cmd_test_alert=( "ta;test-alert" "command_test_alert.sh" "Send a test alert." ) cmd_monitor=( "m;monitor" "command_monitor.sh" "Check server status and restart if crashed." ) cmd_skeleton=( "sk;skeleton" "command_skeleton.sh" "Create a skeleton directory." ) -cmd_donate=( "do;donate" "command_donate.sh" "Donation options." ) +cmd_sponsor=( "do;sponsor" "command_sponsor.sh" "Donation options." ) cmd_send=( "sd;send" "command_send.sh" "Send command to game server console." ) # Console servers only. cmd_console=( "c;console" "command_console.sh" "Access server console." ) @@ -54,7 +54,7 @@ cmd_dev_detect_deps=( "dd;detect-deps" "command_dev_detect_deps.sh" "Detect requ cmd_dev_detect_glibc=( "dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect required glibc." ) cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect required dynamic dependencies." ) cmd_dev_query_raw=( "qr;query-raw" "command_dev_query_raw.sh" "The raw output of gamedig and gsquery." ) -cmd_dev_clear_functions=( "cf;clear-functions" "command_dev_clear_functions.sh" "Delete the contents of the functions dir." ) +cmd_dev_clear_modules=( "cf;clear-modules" "command_dev_clear_modules.sh" "Delete the contents of the modules dir." ) ### Set specific opt here. @@ -144,11 +144,11 @@ currentopt+=( "${cmd_install[@]}" "${cmd_auto_install[@]}" ) ## Developer commands. currentopt+=( "${cmd_dev_debug[@]}" ) if [ -f ".dev-debug" ]; then - currentopt+=( "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_clear_functions[@]}" ) + currentopt+=( "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_clear_modules[@]}" ) fi ## Donate. -currentopt+=( "${cmd_donate[@]}" ) +currentopt+=( "${cmd_sponsor[@]}" ) ### Build list of available commands. optcommands=() diff --git a/lgsm/functions/core_github.sh b/lgsm/functions/core_github.sh index 5bd4bd730..2e2c20990 100644 --- a/lgsm/functions/core_github.sh +++ b/lgsm/functions/core_github.sh @@ -1,11 +1,11 @@ #!/bin/bash -# LinuxGSM core_github.sh function +# LinuxGSM core_github.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: core function file for updates via github +# Description: core module file for updates via github -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" github_api="https://api.github.com" diff --git a/lgsm/functions/core_legacy.sh b/lgsm/functions/core_legacy.sh index 811acfbba..bda0cfbe8 100755 --- a/lgsm/functions/core_legacy.sh +++ b/lgsm/functions/core_legacy.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Code for backwards compatability with older versions of LinuxGSM. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # This is to help the transition to v20.3.0 and above legacy_versions_array=( v20.2.1 v20.2.0 v20.1.5 v20.1.4 v20.1.3 v20.1.2 v20.1.1 v20.1.0 v19.12.5 v19.12.4 v19.12.3 v19.12.2 v19.12.1 v19.12.0 ) diff --git a/lgsm/functions/core_logs.sh b/lgsm/functions/core_logs.sh index b999cb347..995099588 100755 --- a/lgsm/functions/core_logs.sh +++ b/lgsm/functions/core_logs.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Acts as a log rotator, removing old logs. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Check if logfile variable and file exist, create logfile if it doesn't exist. if [ "${consolelog}" ]; then diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh index 463f833c2..a5f71345b 100755 --- a/lgsm/functions/core_messages.sh +++ b/lgsm/functions/core_messages.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Defines on-screen messages such as [ OK ] and how script logs look. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # nl: new line: message is following by a new line. # eol: end of line: message is placed at the end of the current line. diff --git a/lgsm/functions/core_modules.sh b/lgsm/functions/core_modules.sh new file mode 100644 index 000000000..955687a09 --- /dev/null +++ b/lgsm/functions/core_modules.sh @@ -0,0 +1,806 @@ +#!/bin/bash +# LinuxGSM core_modules.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Defines all modules to allow download and execution of modules using fn_fetch_module. +# This module is called first before any other module. Without this file other modules will not load. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +modulesversion="v21.2.5" + +# Core + +core_dl.sh(){ +modulefile="${FUNCNAME[0]}" +if [ "$(type fn_fetch_core_dl 2>/dev/null)" ]; then + fn_fetch_core_dl "lgsm/modules" "core_dl.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" +else + fn_bootstrap_fetch_file_github "lgsm/modules" "core_dl.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" +fi +} + +core_messages.sh(){ +modulefile="${FUNCNAME[0]}" +if [ "$(type fn_fetch_core_dl 2>/dev/null)" ]; then + fn_fetch_core_dl "lgsm/modules" "core_messages.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" +else + fn_bootstrap_fetch_file_github "lgsm/modules" "core_messages.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" +fi +} + +core_legacy.sh(){ +modulefile="${FUNCNAME[0]}" +if [ "$(type fn_fetch_core_dl 2>/dev/null)" ]; then + fn_fetch_core_dl "lgsm/modules" "core_legacy.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" +else + fn_bootstrap_fetch_file_github "lgsm/modules" "core_legacy.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" +fi +} + +core_exit.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +core_getopt.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +core_trap.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +core_steamcmd.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +core_github.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +# Commands + +command_backup.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_console.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_debug.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_details.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_sponsor.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_postdetails.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_test_alert.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_monitor.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_start.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_stop.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_validate.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_install.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_install_resources_mta.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +install_squad_license.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_mods_install.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_mods_update.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_mods_remove.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_fastdl.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_ts3_server_pass.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_restart.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_skeleton.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_wipe.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_send.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +# Checks + +check.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +check_config.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +check_deps.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +check_executable.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +check_glibc.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +check_ip.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +check_last_update.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +check_logs.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +check_permissions.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +check_root.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +check_status.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +check_steamcmd.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +check_system_dir.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +check_system_requirements.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +check_tmuxception.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +check_version.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +# Compress + +compress_unreal2_maps.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +compress_ut99_maps.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +# Mods + +mods_list.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +mods_core.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +# Dev + +command_dev_clear_modules.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_dev_debug.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_dev_detect_deps.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_dev_detect_glibc.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_dev_detect_ldd.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_dev_query_raw.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +# Fix + +fix.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_ark.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_av.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_arma3.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_bo.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_cmw.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_csgo.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_dst.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_hw.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_ins.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_kf.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_kf2.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_lo.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_mcb.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_mta.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_nmrih.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_onset.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_ro.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_rust.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_rw.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_sfc.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_st.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_steamcmd.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_terraria.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_tf2.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_ut3.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_rust.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_samp.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_sdtd.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_sof2.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_squad.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_ts3.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_ut2k4.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_ut.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_unt.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_vh.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_wurm.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fix_zmr.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +# Info + +info_distro.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +info_game.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +info_gamedig.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +info_messages.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +info_stats.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +# Alert + +alert.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +alert_discord.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +alert_email.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +alert_ifttt.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +alert_mailgun.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +alert_pushbullet.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +alert_pushover.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +alert_telegram.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +alert_rocketchat.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +alert_slack.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} +# Logs + +core_logs.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +# Query + +query_gamedig.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +# Update + +command_update_modules.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_update_linuxgsm.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_update.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +command_check_update.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +update_ts3.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +update_minecraft.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +update_minecraft_bedrock.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +update_papermc.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +update_mumble.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +update_mta.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +update_factorio.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +update_jediknight2.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +update_steamcmd.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +update_vintagestory.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +fn_update_modules.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +# +## Installer modules +# + +fn_autoinstall(){ +autoinstall=1 +command_install.sh +} + +install_complete.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +install_config.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +install_factorio_save.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +install_dst_token.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +install_eula.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +install_gsquery.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +install_gslt.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +install_header.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +install_logs.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +install_retry.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +install_server_dir.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} +install_server_files.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +install_stats.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +install_steamcmd.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +install_ts3.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +install_ts3db.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +install_ut2k4.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +install_dl_ut2k4.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +install_ut2k4_key.sh(){ +modulefile="${FUNCNAME[0]}" +fn_fetch_module +} + +# Calls code required for legacy servers +core_legacy.sh + +# Creates tmp dir if missing +if [ ! -d "${tmpdir}" ]; then + mkdir -p "${tmpdir}" +fi + +# Creates lock dir if missing +if [ ! -d "${lockdir}" ]; then + mkdir -p "${lockdir}" +fi + +# Calls on-screen messages (bootstrap) +core_messages.sh + +#Calls file downloader (bootstrap) +core_dl.sh + +# Calls the global Ctrl-C trap +core_trap.sh diff --git a/lgsm/functions/core_steamcmd.sh b/lgsm/functions/core_steamcmd.sh index 5fbd5db9f..8dae3d877 100755 --- a/lgsm/functions/core_steamcmd.sh +++ b/lgsm/functions/core_steamcmd.sh @@ -3,9 +3,9 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Core functions for SteamCMD +# Description: Core modules for SteamCMD -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_steamcmd(){ if [ "${shortname}" == "ark" ]&&[ "${installsteamcmd}" == "1" ]; then diff --git a/lgsm/functions/core_trap.sh b/lgsm/functions/core_trap.sh index a3eaf5675..9b2bc04eb 100755 --- a/lgsm/functions/core_trap.sh +++ b/lgsm/functions/core_trap.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles CTRL-C trap to give an exit code. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_exit_trap(){ if [ -z "${exitcode}" ]; then diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index b5cbcc77a..425a8a973 100755 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -3,10 +3,10 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Overall function for managing fixes. -# Runs functions that will fix an issue. +# Description: Overall module for managing fixes. +# Runs modules that will fix an issue. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Messages that are displayed for some fixes. fn_fix_msg_start(){ diff --git a/lgsm/functions/fix_ark.sh b/lgsm/functions/fix_ark.sh index da0097cab..026dceb57 100755 --- a/lgsm/functions/fix_ark.sh +++ b/lgsm/functions/fix_ark.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with ARK: Survival Evolved. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # removes mulitple appworkshop_346110.acf if found. steamappsfilewc="$(find "${HOME}" -name appworkshop_346110.acf | wc -l)" diff --git a/lgsm/functions/fix_arma3.sh b/lgsm/functions/fix_arma3.sh index bdd85af71..21bdcedec 100755 --- a/lgsm/functions/fix_arma3.sh +++ b/lgsm/functions/fix_arma3.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves an issue with ARMA3. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: 20150 Segmentation fault (core dumped) error. if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3" ]||[ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3 - Other Profiles" ]; then diff --git a/lgsm/functions/fix_av.sh b/lgsm/functions/fix_av.sh index f34a01c37..97eecc087 100755 --- a/lgsm/functions/fix_av.sh +++ b/lgsm/functions/fix_av.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves startup issue with Avorion -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" diff --git a/lgsm/functions/fix_bo.sh b/lgsm/functions/fix_bo.sh index 453691874..3e09a880f 100644 --- a/lgsm/functions/fix_bo.sh +++ b/lgsm/functions/fix_bo.sh @@ -5,6 +5,6 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Ballistic Overkill. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/BODS_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_cmw.sh b/lgsm/functions/fix_cmw.sh index 192f483e8..6b8f1caa8 100755 --- a/lgsm/functions/fix_cmw.sh +++ b/lgsm/functions/fix_cmw.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves the issue of the not starting server on linux -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -f "${executabledir}/steam_appid.txt" ]; then fixname="steam_appid.txt" diff --git a/lgsm/functions/fix_csgo.sh b/lgsm/functions/fix_csgo.sh index be59c42ec..312fb445d 100755 --- a/lgsm/functions/fix_csgo.sh +++ b/lgsm/functions/fix_csgo.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with CS:GO. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(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 49fce22e3..b2b966d00 100755 --- a/lgsm/functions/fix_dst.sh +++ b/lgsm/functions/fix_dst.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Don't Starve Together. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(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_hw.sh b/lgsm/functions/fix_hw.sh index af06924db..6a92a5c04 100755 --- a/lgsm/functions/fix_hw.sh +++ b/lgsm/functions/fix_hw.sh @@ -5,6 +5,6 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Hurtworld. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/Hurtworld_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_ins.sh b/lgsm/functions/fix_ins.sh index 21a979c4c..21bea123a 100755 --- a/lgsm/functions/fix_ins.sh +++ b/lgsm/functions/fix_ins.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Insurgency. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: ./srcds_linux: error while loading shared libraries: libtier0.so: cannot open shared object file: No such file or directory. diff --git a/lgsm/functions/fix_kf.sh b/lgsm/functions/fix_kf.sh index e749a2d27..3cfb8fd84 100755 --- a/lgsm/functions/fix_kf.sh +++ b/lgsm/functions/fix_kf.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Killing Floor. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "Applying WebAdmin ROOst.css fix." echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" diff --git a/lgsm/functions/fix_kf2.sh b/lgsm/functions/fix_kf2.sh index b680a9937..7be311b4f 100755 --- a/lgsm/functions/fix_kf2.sh +++ b/lgsm/functions/fix_kf2.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Killing Floor 2. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" startparameters="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\"" diff --git a/lgsm/functions/fix_lo.sh b/lgsm/functions/fix_lo.sh index 466d6abd0..50c9b4d6a 100644 --- a/lgsm/functions/fix_lo.sh +++ b/lgsm/functions/fix_lo.sh @@ -1,10 +1,10 @@ #!/bin/bash -# LinuxGSM fix_lo.sh function +# LinuxGSM fix_lo.sh module # Author: Daniel Gibbs # Website: https://linuxgsm.com # Description: Resolves installation issue with Last Oasis -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" local APPID_FILE=${executabledir}/steam_appid.txt if [ ! -f "${APPID_FILE}" ]; then diff --git a/lgsm/functions/fix_mcb.sh b/lgsm/functions/fix_mcb.sh index 4768a40cf..828225e72 100755 --- a/lgsm/functions/fix_mcb.sh +++ b/lgsm/functions/fix_mcb.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves possible startup issue with Minecraft Bedrock. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # official docs state that the server should be started with: LD_LIBRARY_PATH=. ./bedrock_server export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" diff --git a/lgsm/functions/fix_mta.sh b/lgsm/functions/fix_mta.sh index 2c92e8d12..21292d7f3 100755 --- a/lgsm/functions/fix_mta.sh +++ b/lgsm/functions/fix_mta.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Installs the libmysqlclient for database functions on the server. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -f "${lgsmdir}/lib/libmysqlclient.so.16" ]; then fixname="libmysqlclient16" diff --git a/lgsm/functions/fix_nmrih.sh b/lgsm/functions/fix_nmrih.sh index 4bb70c6f9..83a5ad412 100755 --- a/lgsm/functions/fix_nmrih.sh +++ b/lgsm/functions/fix_nmrih.sh @@ -6,7 +6,7 @@ # Description: Create symlinks for renamed No More Room In Hell serverfiles. # Solution from Steam Community post: https://steamcommunity.com/app/224260/discussions/2/1732089092441769414/ -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ln -s "${serverfiles}/bin/vphysics_srv.so" "${serverfiles}/bin/vphysics.so" ln -s "${serverfiles}/bin/studiorender_srv.so" "${serverfiles}/bin/studiorender.so" diff --git a/lgsm/functions/fix_onset.sh b/lgsm/functions/fix_onset.sh index c444c1ae9..466fc2ae6 100755 --- a/lgsm/functions/fix_onset.sh +++ b/lgsm/functions/fix_onset.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Onset. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" diff --git a/lgsm/functions/fix_ro.sh b/lgsm/functions/fix_ro.sh index 895c7c2da..5dd1d3fb8 100755 --- a/lgsm/functions/fix_ro.sh +++ b/lgsm/functions/fix_ro.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Red Orchestra. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "Applying WebAdmin ROOst.css fix." echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" diff --git a/lgsm/functions/fix_rust.sh b/lgsm/functions/fix_rust.sh index 4488377a3..09adac660 100755 --- a/lgsm/functions/fix_rust.sh +++ b/lgsm/functions/fix_rust.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves startup issue with Rust. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: [Raknet] Server Shutting Down (Shutting Down). export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/RustDedicated_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_rw.sh b/lgsm/functions/fix_rw.sh index aef41a703..2cc631122 100755 --- a/lgsm/functions/fix_rw.sh +++ b/lgsm/functions/fix_rw.sh @@ -5,6 +5,6 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Rising World. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" diff --git a/lgsm/functions/fix_samp.sh b/lgsm/functions/fix_samp.sh index 7a62bd4d1..bb9b260c0 100644 --- a/lgsm/functions/fix_samp.sh +++ b/lgsm/functions/fix_samp.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves issue that the default rcon password is not changed -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ -f "${servercfgfullpath}" ]; then # check if default password is set "changeme" diff --git a/lgsm/functions/fix_sdtd.sh b/lgsm/functions/fix_sdtd.sh index e93db7970..e46f7db8c 100755 --- a/lgsm/functions/fix_sdtd.sh +++ b/lgsm/functions/fix_sdtd.sh @@ -5,6 +5,6 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with 7 Days to Die. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}/7DaysToDieServer_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_sfc.sh b/lgsm/functions/fix_sfc.sh index 51b95b9d5..891b71803 100755 --- a/lgsm/functions/fix_sfc.sh +++ b/lgsm/functions/fix_sfc.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Source Forts Classic. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -f "${serverfiles}/bin/datacache.so" ]; then ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so" diff --git a/lgsm/functions/fix_sof2.sh b/lgsm/functions/fix_sof2.sh index 002f42952..43d943cb1 100755 --- a/lgsm/functions/fix_sof2.sh +++ b/lgsm/functions/fix_sof2.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Soldier of Fortune 2. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: error while loading shared libraries: libcxa.so.1 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" diff --git a/lgsm/functions/fix_squad.sh b/lgsm/functions/fix_squad.sh index b1ba1fde2..5233b7a7f 100644 --- a/lgsm/functions/fix_squad.sh +++ b/lgsm/functions/fix_squad.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Squad. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # As the server base dir changed for the game, we need to migrate the default config from the old to the new location oldservercfg="${serverfiles}/Squad/ServerConfig/${servercfg}" diff --git a/lgsm/functions/fix_st.sh b/lgsm/functions/fix_st.sh index b9fb5b084..44066bb37 100644 --- a/lgsm/functions/fix_st.sh +++ b/lgsm/functions/fix_st.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves startup issue with Stationeers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: [Raknet] Server Shutting Down (Shutting Down). export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/rocketstation_DedicatedServer_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_steamcmd.sh b/lgsm/functions/fix_steamcmd.sh index 5fb151bad..a9c41fc36 100755 --- a/lgsm/functions/fix_steamcmd.sh +++ b/lgsm/functions/fix_steamcmd.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues related to SteamCMD. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # function to simplify the steamclient.so fix # example diff --git a/lgsm/functions/fix_terraria.sh b/lgsm/functions/fix_terraria.sh index 7758fdad9..7e5aa67e2 100755 --- a/lgsm/functions/fix_terraria.sh +++ b/lgsm/functions/fix_terraria.sh @@ -5,6 +5,6 @@ # Website: https://linuxgsm.com # Description: Resolves an issue with Terraria. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export TERM=xterm diff --git a/lgsm/functions/fix_tf2.sh b/lgsm/functions/fix_tf2.sh index 27b35a0d2..7a1aa0d23 100755 --- a/lgsm/functions/fix_tf2.sh +++ b/lgsm/functions/fix_tf2.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Team Fortress 2. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: Team Fortress 2 Segmentation fault for Red-Hat Distros #2062. if [ -f "/etc/redhat-release" ]&&[ ! -f "${serverfiles}/bin/libcurl-gnutls.so.4" ]; then diff --git a/lgsm/functions/fix_ts3.sh b/lgsm/functions/fix_ts3.sh index 021f03764..dc456ab6a 100755 --- a/lgsm/functions/fix_ts3.sh +++ b/lgsm/functions/fix_ts3.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Teamspeak 3. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: makes libmariadb2 available #1924. if [ ! -f "${serverfiles}/libmariadb.so.2" ]; then diff --git a/lgsm/functions/fix_unt.sh b/lgsm/functions/fix_unt.sh index eae2e6313..77253bd85 100755 --- a/lgsm/functions/fix_unt.sh +++ b/lgsm/functions/fix_unt.sh @@ -5,6 +5,6 @@ # Website: https://linuxgsm.com # Description: Resolves startup issue with Unturned. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/Unturned_Headless_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_ut.sh b/lgsm/functions/fix_ut.sh index 2e6686a8d..aa958e86d 100755 --- a/lgsm/functions/fix_ut.sh +++ b/lgsm/functions/fix_ut.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Unreal Tournament. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" #Set Binary Executable echo -e "chmod +x ${executabledir}/${executable}" diff --git a/lgsm/functions/fix_ut2k4.sh b/lgsm/functions/fix_ut2k4.sh index 49610e4b6..0a3b89b33 100755 --- a/lgsm/functions/fix_ut2k4.sh +++ b/lgsm/functions/fix_ut2k4.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Unreal Tournament 2004. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "applying WebAdmin ut2003.css fix." echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" diff --git a/lgsm/functions/fix_ut3.sh b/lgsm/functions/fix_ut3.sh index 6bd26a53a..4958537f2 100755 --- a/lgsm/functions/fix_ut3.sh +++ b/lgsm/functions/fix_ut3.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Unreal Tournament 3. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" startparameters="server VCTF-Suspense?Game=UTGameContent.UTVehicleCTFGame_Content?bIsDedicated=true?bIsLanMatch=false?bUsesStats=false?bShouldAdvertise=false?PureServer=1?bAllowJoinInProgress=true?ConfigSubDir=${selfname} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}" diff --git a/lgsm/functions/fix_vh.sh b/lgsm/functions/fix_vh.sh index 551bd878f..18f4d2658 100755 --- a/lgsm/functions/fix_vh.sh +++ b/lgsm/functions/fix_vh.sh @@ -1,9 +1,9 @@ #!/bin/bash -# LinuxGSM fix_rust.sh function +# LinuxGSM fix_rust.sh module # Author: Alasdair Haig # Website: https://linuxgsm.com # Description: Resolves startup issue with Valheim -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH diff --git a/lgsm/functions/fix_wurm.sh b/lgsm/functions/fix_wurm.sh index aba24d382..1536df2e7 100755 --- a/lgsm/functions/fix_wurm.sh +++ b/lgsm/functions/fix_wurm.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Wurm Unlimited. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # First run requires start with no parms. # After first run new dirs are created. diff --git a/lgsm/functions/fix_zmr.sh b/lgsm/functions/fix_zmr.sh index 491c36638..56f055fc3 100755 --- a/lgsm/functions/fix_zmr.sh +++ b/lgsm/functions/fix_zmr.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Zombie Master: Reborn. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -f "${serverfiles}/bin/datacache.so" ]; then ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so" diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index fdfc076ab..de4c18d77 100755 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -6,7 +6,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. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ### Game Server pid if [ "${status}" == "1" ]; then diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 2c3c52584..b4ee01bec 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Gathers various game server information. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(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_messages.sh b/lgsm/functions/info_messages.sh index f68d12e4f..6445903b5 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Defines server info messages for details and alerts. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Separator is different for details. fn_messages_separator(){ diff --git a/lgsm/functions/info_stats.sh b/lgsm/functions/info_stats.sh index 211208717..3afbc90ba 100755 --- a/lgsm/functions/info_stats.sh +++ b/lgsm/functions/info_stats.sh @@ -6,7 +6,7 @@ # Description: Collect optional Stats sent to LinuxGSM project. # Uses Google analytics. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" info_distro.sh diff --git a/lgsm/functions/install_complete.sh b/lgsm/functions/install_complete.sh index ad258b224..58189a4be 100755 --- a/lgsm/functions/install_complete.sh +++ b/lgsm/functions/install_complete.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Prints installation completion message and hints. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "=================================" diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 9b5ef01cd..b3285c8e3 100755 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Creates default server configs. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(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 50bc7ed97..43db58fab 100755 --- a/lgsm/functions/install_dst_token.sh +++ b/lgsm/functions/install_dst_token.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Configures Don't Starve Together cluster with given token. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}Enter ${gamename} Cluster Token${default}" diff --git a/lgsm/functions/install_eula.sh b/lgsm/functions/install_eula.sh index d7c0b0b7a..a67c81fe7 100755 --- a/lgsm/functions/install_eula.sh +++ b/lgsm/functions/install_eula.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Gets user to accept the EULA. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "${shortname}" == "ts3" ]; then eulaurl="https://www.teamspeak.com/en/privacy-and-terms" diff --git a/lgsm/functions/install_factorio_save.sh b/lgsm/functions/install_factorio_save.sh index f5fdb8a04..c86ee2f37 100755 --- a/lgsm/functions/install_factorio_save.sh +++ b/lgsm/functions/install_factorio_save.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Creates the initial save file for Factorio. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}Creating initial Factorio savefile${default}" diff --git a/lgsm/functions/install_gslt.sh b/lgsm/functions/install_gslt.sh index a8f8065c2..9e93f4cfa 100755 --- a/lgsm/functions/install_gslt.sh +++ b/lgsm/functions/install_gslt.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Configures GSLT. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}Game Server Login Token${default}" diff --git a/lgsm/functions/install_header.sh b/lgsm/functions/install_header.sh index 4cf067f8f..b52e116e7 100755 --- a/lgsm/functions/install_header.sh +++ b/lgsm/functions/install_header.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Prints installation header. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" clear fn_print_ascii_logo diff --git a/lgsm/functions/install_logs.sh b/lgsm/functions/install_logs.sh index 57a41500c..4ae06570e 100755 --- a/lgsm/functions/install_logs.sh +++ b/lgsm/functions/install_logs.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Creates log directories. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "${checklogs}" != "1" ]; then echo -e "" diff --git a/lgsm/functions/install_mta_resources.sh b/lgsm/functions/install_mta_resources.sh index 011ad9b71..bafdbdbf1 100755 --- a/lgsm/functions/install_mta_resources.sh +++ b/lgsm/functions/install_mta_resources.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Installs the libmysqlclient for database functions on the server and optionally installs default resources required to run the server. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_information_nl "${gamename} will not function without resources!" echo -e " * install default resources using ./${selfname} install-default-resources" diff --git a/lgsm/functions/install_retry.sh b/lgsm/functions/install_retry.sh index 080f864a2..e07f150e0 100755 --- a/lgsm/functions/install_retry.sh +++ b/lgsm/functions/install_retry.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Asks for installation retry after failure. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if fn_prompt_yn "Retry install?" Y; then command_install.sh; core_exit.sh diff --git a/lgsm/functions/install_server_dir.sh b/lgsm/functions/install_server_dir.sh index 9e75fb488..fe168b5ff 100755 --- a/lgsm/functions/install_server_dir.sh +++ b/lgsm/functions/install_server_dir.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Creates the server directory. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}Server Directory${default}" diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index b6b9f5240..effa72be5 100755 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Installs server files. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_server_files(){ if [ "${shortname}" == "ahl" ]; then diff --git a/lgsm/functions/install_squad_license.sh b/lgsm/functions/install_squad_license.sh index 181646e85..58053e134 100755 --- a/lgsm/functions/install_squad_license.sh +++ b/lgsm/functions/install_squad_license.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Configures the Squad server's license. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}Squad Server License${default}" diff --git a/lgsm/functions/install_stats.sh b/lgsm/functions/install_stats.sh index d3b45b40b..8c65c007c 100755 --- a/lgsm/functions/install_stats.sh +++ b/lgsm/functions/install_stats.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Enabled LinuxGSM Stats. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}LinuxGSM Stats${default}" diff --git a/lgsm/functions/install_steamcmd.sh b/lgsm/functions/install_steamcmd.sh index b1e64a42c..8eeb2de53 100755 --- a/lgsm/functions/install_steamcmd.sh +++ b/lgsm/functions/install_steamcmd.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Downloads SteamCMD on install. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}Installing SteamCMD${default}" diff --git a/lgsm/functions/install_ts3db.sh b/lgsm/functions/install_ts3db.sh index 07ab7a111..08c6b5e7d 100755 --- a/lgsm/functions/install_ts3db.sh +++ b/lgsm/functions/install_ts3db.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Installs the database server MariaDB for TeamSpeak 3. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_ts3db_mariadb(){ if [ ! -f "${serverfiles}/libts3db_mariadb.so" ]; then diff --git a/lgsm/functions/install_ut2k4_key.sh b/lgsm/functions/install_ut2k4_key.sh index 124052d05..c09c4590c 100755 --- a/lgsm/functions/install_ut2k4_key.sh +++ b/lgsm/functions/install_ut2k4_key.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Activates ut2k4 server with given key. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}Enter ${gamename} CD Key${default}" diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh index 7e46f7977..f20bd2013 100755 --- a/lgsm/functions/mods_core.sh +++ b/lgsm/functions/mods_core.sh @@ -3,9 +3,9 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Core functions for mods list/install/update/remove +# Description: Core modules for mods list/install/update/remove -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(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 3863dfe47..2607dc70d 100755 --- a/lgsm/functions/mods_list.sh +++ b/lgsm/functions/mods_list.sh @@ -8,7 +8,7 @@ # Usage: Then add this array to the mods_global_array. # Usage: If needed, you can scrape the download URL first. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(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/query_gamedig.sh b/lgsm/functions/query_gamedig.sh index 32b70aac2..2dd65d655 100755 --- a/lgsm/functions/query_gamedig.sh +++ b/lgsm/functions/query_gamedig.sh @@ -6,7 +6,7 @@ # Description: Querys a gameserver using node-gamedig. # https://github.com/sonicsnes/node-gamedig -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Check if gamedig and jq are installed. if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; then diff --git a/lgsm/functions/query_gsquery.py b/lgsm/functions/query_gsquery.py index 6c21b1a89..fc861e141 100755 --- a/lgsm/functions/query_gsquery.py +++ b/lgsm/functions/query_gsquery.py @@ -1,6 +1,6 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- -# LinuxGSM query_gsquery.py function +# LinuxGSM query_gsquery.py module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com diff --git a/lgsm/functions/update_factorio.sh b/lgsm/functions/update_factorio.sh index 47ccefe1b..dffcff10e 100644 --- a/lgsm/functions/update_factorio.sh +++ b/lgsm/functions/update_factorio.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of Factorio servers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_factorio_dl(){ fn_fetch_file "https://factorio.com/get-download/${downloadbranch}/headless/${factorioarch}" "" "" "" "${tmpdir}" "factorio_headless_${factorioarch}-${remotebuild}.tar.xz" "" "norun" "noforce" "nohash" diff --git a/lgsm/functions/update_jediknight2.sh b/lgsm/functions/update_jediknight2.sh index 3a3c40f14..fbf384aff 100644 --- a/lgsm/functions/update_jediknight2.sh +++ b/lgsm/functions/update_jediknight2.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of jk2 servers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_jk2_dl(){ fn_fetch_file "https://github.com/mvdevs/jk2mv/releases/download/${remotebuild}/jk2mv-v${remotebuild}-dedicated.zip" "" "" "" "${tmpdir}" "jk2mv-${remotebuild}-dedicated.zip" "" "norun" "noforce" "nohash" diff --git a/lgsm/functions/update_minecraft.sh b/lgsm/functions/update_minecraft.sh index 63a2fd51c..33f836a2b 100644 --- a/lgsm/functions/update_minecraft.sh +++ b/lgsm/functions/update_minecraft.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of Minecraft servers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_minecraft_dl(){ # Generate link to version manifest json. diff --git a/lgsm/functions/update_minecraft_bedrock.sh b/lgsm/functions/update_minecraft_bedrock.sh index f4054ae00..19daff374 100644 --- a/lgsm/functions/update_minecraft_bedrock.sh +++ b/lgsm/functions/update_minecraft_bedrock.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of Minecraft Bedrock servers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" #random number for userAgent randnum=$((1 + RANDOM % 5000)) diff --git a/lgsm/functions/update_mta.sh b/lgsm/functions/update_mta.sh index f49e54910..6093881e9 100644 --- a/lgsm/functions/update_mta.sh +++ b/lgsm/functions/update_mta.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of Multi Theft Auto servers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_mta_dl(){ fn_fetch_file "http://linux.mtasa.com/dl/multitheftauto_linux_x64.tar.gz" "" "" "" "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "" "norun" "noforce" "nohash" diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh index 8a54e7df2..b6a1cf4d9 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of Mumble servers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_mumble_dl(){ fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${remotebuild}/murmur-static_${mumblearch}-${remotebuild}.tar.bz2" "" "" "" "${tmpdir}" "murmur-static_${mumblearch}-${remotebuild}.tar.bz2" "" "norun" "noforce" "nohash" diff --git a/lgsm/functions/update_papermc.sh b/lgsm/functions/update_papermc.sh index 2e669d93d..66ff57f2d 100644 --- a/lgsm/functions/update_papermc.sh +++ b/lgsm/functions/update_papermc.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM update_papermc.sh function +# LinuxGSM update_papermc.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com @@ -7,7 +7,7 @@ local commandname="UPDATE" local commandaction="Update" -local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +local module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_papermc_dl(){ # get build info diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh index 85bacb899..d7873998f 100644 --- a/lgsm/functions/update_steamcmd.sh +++ b/lgsm/functions/update_steamcmd.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating using SteamCMD. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # init steamcmd functions core_steamcmd.sh diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh index 782a138d1..a49dd8f4c 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/functions/update_ts3.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of Teamspeak 3 servers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_ts3_dl(){ if [ "${ts3arch}" == "amd64" ]; then diff --git a/lgsm/functions/update_vintagestory.sh b/lgsm/functions/update_vintagestory.sh index b2231c66e..207ee2fbf 100755 --- a/lgsm/functions/update_vintagestory.sh +++ b/lgsm/functions/update_vintagestory.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of Vintage Story servers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_vs_dl(){ # get version info for download diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index ef62e9724..14d9b1c6a 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -32,7 +32,7 @@ logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" -functionsdir="${lgsmdir}/functions" +modulesdir="${lgsmdir}/modules" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" lockdir="${lgsmdir}/lock" @@ -51,20 +51,20 @@ if [ -z "${TRAVIS}" ]; then fi travistest="1" ## GitHub Branch Select -# Allows for the use of different function files +# Allows for the use of different module files # from a different repo and/or branch. githubuser="GameServerManagers" githubrepo="LinuxGSM" githubbranch="${TRAVIS_BRANCH}" -# Core function that is required first. -core_functions.sh(){ - functionfile="${FUNCNAME[0]}" - fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" +# Core module that is required first. +core_modules.sh(){ + modulefile="${FUNCNAME[0]}" + fn_bootstrap_fetch_file_github "lgsm/modules" "core_modules.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" } # Bootstrap -# Fetches the core functions required before passed off to core_dl.sh. +# Fetches the core modules required before passed off to core_dl.sh. fn_bootstrap_fetch_file(){ remote_fileurl="${1}" remote_fileurl_backup="${2}" @@ -183,7 +183,7 @@ fn_bootstrap_fetch_file_github(){ run="${5:-0}" forcedl="${6:-0}" md5="${7:-0}" - # Passes vars to the file download function. + # Passes vars to the file download module. fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } @@ -325,11 +325,11 @@ if [ "$(whoami)" == "root" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 fi - elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then + elif [ ! -f "${modulesdir}/core_modules.sh" ]||[ ! -f "${modulesdir}/check_root.sh" ]||[ ! -f "${modulesdir}/core_messages.sh" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 else - core_functions.sh + core_modules.sh check_root.sh fi fi @@ -375,7 +375,7 @@ if [ "${shortname}" == "core" ]; then # LinuxGSM server mode. else - core_functions.sh + core_modules.sh if [ "${shortname}" != "core-dep" ]; then # Load LinuxGSM configs. # These are required to get all the default variables for the specific server. @@ -396,8 +396,8 @@ else echo -e "OK" fi else - function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") - if [ "${function_file_diff}" != "" ]; then + module_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${module_file_diff}" != "" ]; then fn_print_warn_nl "_default.cfg has been altered. reloading config." echo -en "copying _default.cfg...\c" cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" @@ -613,7 +613,7 @@ echo -e "8.4 - dev - query-raw" echo -e "" echo -e "9.0 - Donate" -echo -e "9.1 - donate" +echo -e "9.1 - sponsor" echo -e "" echo -e "0.0 - Pre-test Tasks" @@ -634,7 +634,7 @@ echo -e "" ) echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "0.2 - Enable dev-debug" @@ -651,7 +651,7 @@ echo -e "" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.0 - Pre-install tests" @@ -679,7 +679,7 @@ fi echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.2 - getopt" @@ -697,7 +697,7 @@ echo -e "" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.3 - getopt with incorrect args" @@ -716,7 +716,7 @@ getopt="abc123" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "2.0 - Installation" @@ -737,7 +737,7 @@ echo -e "Command: ./${gameservername} auto-install" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.0 - Start/Stop/Restart Tests" @@ -760,7 +760,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.2 - start - online" @@ -779,7 +779,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.3 - start - updateonstart" @@ -798,7 +798,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.4 - stop" @@ -817,7 +817,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.5 - stop - offline" @@ -836,7 +836,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.6 - restart" @@ -855,7 +855,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.7 - restart - offline" @@ -874,7 +874,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.0 - Update Tests" @@ -897,7 +897,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.2 - update-lgsm" @@ -917,7 +917,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.0 - Monitor Tests" @@ -944,7 +944,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.2 - monitor - offline - with lockfile" @@ -967,7 +967,7 @@ echo "${port}" >> "${lockdir}/${selfname}.lock" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.3 - monitor - offline - no lockfile" @@ -986,7 +986,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.4 - test-alert" @@ -1005,7 +1005,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "6.0 - Details Tests" @@ -1028,7 +1028,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "6.2 - postdetails" @@ -1047,7 +1047,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "7.0 - Backup Tests" @@ -1066,7 +1066,7 @@ echo -e "test de-activated until issue #1839 fixed" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.0 - Development Tools Tests" @@ -1089,7 +1089,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.2 - dev - detect ldd" @@ -1108,7 +1108,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.3 - dev - detect deps" @@ -1127,7 +1127,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.4 - dev - query-raw" @@ -1146,7 +1146,7 @@ fn_setstatus fn_test_result_na echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" @@ -1154,23 +1154,23 @@ echo -e "9.0 - Donate" echo -e "==================================================================" echo -e "" -echo -e "9.1 - donate" +echo -e "9.1 - sponsor" echo -e "=================================" echo -e "Description:" -echo -e "donate." -echo -e "Command: ./${gameservername} donate" +echo -e "sponsor." +echo -e "Command: ./${gameservername} sponsor" requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x - command_donate.sh + command_sponsor.sh ) fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "=================================" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 474d45f06..65a49fda7 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -32,7 +32,7 @@ logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" -functionsdir="${lgsmdir}/functions" +modulesdir="${lgsmdir}/modules" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" lockdir="${lgsmdir}/lock" @@ -52,20 +52,20 @@ fi travistest="1" ## GitHub Branch Select -# Allows for the use of different function files +# Allows for the use of different module files # from a different repo and/or branch. githubuser="GameServerManagers" githubrepo="LinuxGSM" githubbranch="${TRAVIS_BRANCH}" -# Core function that is required first. -core_functions.sh(){ - functionfile="${FUNCNAME[0]}" - fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" +# Core module that is required first. +core_modules.sh(){ + modulefile="${FUNCNAME[0]}" + fn_bootstrap_fetch_file_github "lgsm/modules" "core_modules.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" } # Bootstrap -# Fetches the core functions required before passed off to core_dl.sh. +# Fetches the core modules required before passed off to core_dl.sh. fn_bootstrap_fetch_file(){ remote_fileurl="${1}" remote_fileurl_backup="${2}" @@ -184,7 +184,7 @@ fn_bootstrap_fetch_file_github(){ run="${5:-0}" forcedl="${6:-0}" md5="${7:-0}" - # Passes vars to the file download function. + # Passes vars to the file download module. fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } @@ -326,11 +326,11 @@ if [ "$(whoami)" == "root" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 fi - elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then + elif [ ! -f "${modulesdir}/core_modules.sh" ]||[ ! -f "${modulesdir}/check_root.sh" ]||[ ! -f "${modulesdir}/core_messages.sh" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 else - core_functions.sh + core_modules.sh check_root.sh fi fi @@ -376,7 +376,7 @@ if [ "${shortname}" == "core" ]; then # LinuxGSM server mode. else - core_functions.sh + core_modules.sh if [ "${shortname}" != "core-dep" ]; then # Load LinuxGSM configs. # These are required to get all the default variables for the specific server. @@ -397,8 +397,8 @@ else echo -e "OK" fi else - function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") - if [ "${function_file_diff}" != "" ]; then + module_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${module_file_diff}" != "" ]; then fn_print_warn_nl "_default.cfg has been altered. reloading config." echo -en "copying _default.cfg...\c" cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" @@ -619,7 +619,7 @@ echo -e "8.3 - dev - detect deps" echo -e "8.4 - dev - query-raw" echo -e "" echo -e "9.0 - Donate" -echo -e "9.1 - donate" +echo -e "9.1 - sponsor" echo -e "" echo -e "0.0 - Pre-test Tasks" echo -e "==================================================================" @@ -639,7 +639,7 @@ echo -e "" ) echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "0.2 - Enable dev-debug" @@ -656,7 +656,7 @@ echo -e "" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.0 - Pre-install tests" @@ -684,7 +684,7 @@ fi echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.2 - getopt" @@ -702,7 +702,7 @@ echo -e "" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.3 - getopt with incorrect args" @@ -721,7 +721,7 @@ getopt="abc123" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "2.0 - Installation" @@ -742,7 +742,7 @@ echo -e "Command: ./${gameservername} auto-install" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.0 - Start/Stop/Restart Tests" @@ -765,7 +765,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.2 - start - online" @@ -784,7 +784,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.3 - start - updateonstart" @@ -803,7 +803,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.4 - stop" @@ -822,7 +822,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.5 - stop - offline" @@ -841,7 +841,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.6 - restart" @@ -860,7 +860,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.7 - restart - offline" @@ -879,7 +879,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.0 - Update Tests" @@ -902,7 +902,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.2 - update - change buildid" @@ -923,7 +923,7 @@ sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.3 - update - change buildid - online" @@ -944,7 +944,7 @@ sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.4 - update - remove appmanifest file" @@ -965,7 +965,7 @@ rm --verbose "${serverfiles:?}/steamapps/appmanifest_${appid}.acf" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.5 - force-update" @@ -984,7 +984,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.6 - force-update - online" @@ -1003,7 +1003,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.7 - validate" @@ -1022,7 +1022,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.8 - validate - online" @@ -1042,7 +1042,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.9 - update-lgsm" @@ -1062,7 +1062,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "Inserting IP address" @@ -1103,7 +1103,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.2 - monitor - offline - with lockfile" @@ -1126,7 +1126,7 @@ echo "${port}" >> "${lockdir}/${selfname}.lock" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.3 - monitor - offline - no lockfile" @@ -1145,7 +1145,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.4 - test-alert" @@ -1166,7 +1166,7 @@ sed -i 's/[0-9]\+/0/' "${servercfgfullpath}" fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" fn_print_info_nl "Re-generating ${servercfg}." @@ -1194,7 +1194,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "6.2 - postdetails" @@ -1213,7 +1213,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "7.0 - Backup Tests" @@ -1232,7 +1232,7 @@ echo -e "test de-activated until issue #1839 fixed" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.0 - Development Tools Tests" @@ -1255,7 +1255,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.2 - dev - detect ldd" @@ -1274,7 +1274,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.3 - dev - detect deps" @@ -1293,7 +1293,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.4 - dev - query-raw" @@ -1312,30 +1312,30 @@ fn_setstatus fn_test_result_na echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "9.0 - Donate" echo -e "==================================================================" echo -e "" -echo -e "9.1 - donate" +echo -e "9.1 - sponsor" echo -e "=================================" echo -e "Description:" -echo -e "donate." -echo -e "Command: ./${gameservername} donate" +echo -e "sponsor." +echo -e "Command: ./${gameservername} sponsor" requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x - command_donate.sh + command_sponsor.sh ) fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "=================================" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index b6d6217cd..e063d3741 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -32,7 +32,7 @@ logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" -functionsdir="${lgsmdir}/functions" +modulesdir="${lgsmdir}/modules" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" lockdir="${lgsmdir}/lock" @@ -52,20 +52,20 @@ fi travistest="1" ## GitHub Branch Select -# Allows for the use of different function files +# Allows for the use of different module files # from a different repo and/or branch. githubuser="GameServerManagers" githubrepo="LinuxGSM" githubbranch="${TRAVIS_BRANCH}" -# Core function that is required first. -core_functions.sh(){ - functionfile="${FUNCNAME[0]}" - fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" +# Core module that is required first. +core_modules.sh(){ + modulefile="${FUNCNAME[0]}" + fn_bootstrap_fetch_file_github "lgsm/modules" "core_modules.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" } # Bootstrap -# Fetches the core functions required before passed off to core_dl.sh. +# Fetches the core modules required before passed off to core_dl.sh. fn_bootstrap_fetch_file(){ remote_fileurl="${1}" remote_fileurl_backup="${2}" @@ -184,7 +184,7 @@ fn_bootstrap_fetch_file_github(){ run="${5:-0}" forcedl="${6:-0}" md5="${7:-0}" - # Passes vars to the file download function. + # Passes vars to the file download module. fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } @@ -326,11 +326,11 @@ if [ "$(whoami)" == "root" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 fi - elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then + elif [ ! -f "${modulesdir}/core_modules.sh" ]||[ ! -f "${modulesdir}/check_root.sh" ]||[ ! -f "${modulesdir}/core_messages.sh" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 else - core_functions.sh + core_modules.sh check_root.sh fi fi @@ -376,7 +376,7 @@ if [ "${shortname}" == "core" ]; then # LinuxGSM server mode. else - core_functions.sh + core_modules.sh if [ "${shortname}" != "core-dep" ]; then # Load LinuxGSM configs. # These are required to get all the default variables for the specific server. @@ -397,8 +397,8 @@ else echo -e "OK" fi else - function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") - if [ "${function_file_diff}" != "" ]; then + module_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${module_file_diff}" != "" ]; then fn_print_warn_nl "_default.cfg has been altered. reloading config." echo -en "copying _default.cfg...\c" cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" @@ -612,7 +612,7 @@ echo -e "8.3 - dev - detect deps" echo -e "8.4 - dev - query-raw" echo -e "" echo -e "9.0 - Donate" -echo -e "9.1 - donate" +echo -e "9.1 - sponsor" echo -e "" echo -e "0.0 - Pre-test Tasks" @@ -633,7 +633,7 @@ echo -e "" ) echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "0.2 - Enable dev-debug" @@ -650,7 +650,7 @@ echo -e "" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.0 - Pre-install tests" @@ -678,7 +678,7 @@ fi echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.2 - getopt" @@ -696,7 +696,7 @@ echo -e "" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.3 - getopt with incorrect args" @@ -715,7 +715,7 @@ getopt="abc123" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "2.0 - Installation" @@ -736,7 +736,7 @@ echo -e "Command: ./${gameservername} auto-install" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.0 - Start/Stop/Restart Tests" @@ -759,7 +759,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.2 - start - online" @@ -778,7 +778,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.3 - start - updateonstart" @@ -797,7 +797,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "30s Pause" echo -e "=================================" @@ -825,7 +825,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.5 - stop - offline" @@ -844,7 +844,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.6 - restart" @@ -863,7 +863,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.7 - restart - offline" @@ -882,7 +882,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.0 - Update Tests" @@ -905,7 +905,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.2 - update-lgsm" @@ -925,7 +925,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "Inserting IP address" @@ -976,7 +976,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.2 - monitor - offline - with lockfile" @@ -999,7 +999,7 @@ echo "${port}" >> "${lockdir}/${selfname}.lock" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.3 - monitor - offline - no lockfile" @@ -1018,7 +1018,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.4 - test-alert" @@ -1037,7 +1037,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "6.0 - Details Tests" @@ -1060,7 +1060,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "6.2 - postdetails" @@ -1079,7 +1079,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "7.0 - Backup Tests" @@ -1098,7 +1098,7 @@ echo -e "test de-activated until issue #1839 fixed" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.0 - Development Tools Tests" @@ -1121,7 +1121,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.2 - dev - detect ldd" @@ -1140,7 +1140,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.3 - dev - detect deps" @@ -1159,7 +1159,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "Inserting IP address" @@ -1192,30 +1192,30 @@ fn_setstatus fn_test_result_na echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "9.0 - Donate" echo -e "==================================================================" echo -e "" -echo -e "9.1 - donate" +echo -e "9.1 - sponsor" echo -e "=================================" echo -e "Description:" -echo -e "donate." -echo -e "Command: ./${gameservername} donate" +echo -e "sponsor." +echo -e "Command: ./${gameservername} sponsor" requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x - command_donate.sh + command_sponsor.sh ) fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "=================================" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 6d2b5d95f..30bb9b33f 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -32,7 +32,7 @@ logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" -functionsdir="${lgsmdir}/functions" +modulesdir="${lgsmdir}/modules" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" lockdir="${lgsmdir}/lock" @@ -52,20 +52,20 @@ fi travistest="1" ## GitHub Branch Select -# Allows for the use of different function files +# Allows for the use of different module files # from a different repo and/or branch. githubuser="GameServerManagers" githubrepo="LinuxGSM" githubbranch="${TRAVIS_BRANCH}" -# Core function that is required first. -core_functions.sh(){ - functionfile="${FUNCNAME[0]}" - fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" +# Core module that is required first. +core_modules.sh(){ + modulefile="${FUNCNAME[0]}" + fn_bootstrap_fetch_file_github "lgsm/modules" "core_modules.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" } # Bootstrap -# Fetches the core functions required before passed off to core_dl.sh. +# Fetches the core modules required before passed off to core_dl.sh. fn_bootstrap_fetch_file(){ remote_fileurl="${1}" remote_fileurl_backup="${2}" @@ -184,7 +184,7 @@ fn_bootstrap_fetch_file_github(){ run="${5:-0}" forcedl="${6:-0}" md5="${7:-0}" - # Passes vars to the file download function. + # Passes vars to the file download module. fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } @@ -326,11 +326,11 @@ if [ "$(whoami)" == "root" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 fi - elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then + elif [ ! -f "${modulesdir}/core_modules.sh" ]||[ ! -f "${modulesdir}/check_root.sh" ]||[ ! -f "${modulesdir}/core_messages.sh" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 else - core_functions.sh + core_modules.sh check_root.sh fi fi @@ -376,7 +376,7 @@ if [ "${shortname}" == "core" ]; then # LinuxGSM server mode. else - core_functions.sh + core_modules.sh if [ "${shortname}" != "core-dep" ]; then # Load LinuxGSM configs. # These are required to get all the default variables for the specific server. @@ -397,8 +397,8 @@ else echo -e "OK" fi else - function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") - if [ "${function_file_diff}" != "" ]; then + module_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${module_file_diff}" != "" ]; then fn_print_warn_nl "_default.cfg has been altered. reloading config." echo -en "copying _default.cfg...\c" cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" @@ -613,7 +613,7 @@ echo -e "8.3 - dev - detect deps" echo -e "8.4 - dev - query-raw" echo -e "" echo -e "9.0 - Donate" -echo -e "9.1 - donate" +echo -e "9.1 - sponsor" echo -e "" echo -e "0.0 - Pre-test Tasks" echo -e "==================================================================" @@ -633,7 +633,7 @@ echo -e "" ) echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "0.2 - Enable dev-debug" @@ -650,7 +650,7 @@ echo -e "" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.0 - Pre-install tests" @@ -678,7 +678,7 @@ fi echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.2 - getopt" @@ -696,7 +696,7 @@ echo -e "" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.3 - getopt with incorrect args" @@ -715,7 +715,7 @@ getopt="abc123" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "2.0 - Installation" @@ -736,7 +736,7 @@ echo -e "Command: ./${gameservername} auto-install" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.0 - Start/Stop/Restart Tests" @@ -759,7 +759,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.2 - start - online" @@ -778,7 +778,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.3 - start - updateonstart" @@ -797,7 +797,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.4 - stop" @@ -816,7 +816,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.5 - stop - offline" @@ -835,7 +835,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.6 - restart" @@ -854,7 +854,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.7 - restart - offline" @@ -873,7 +873,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.0 - Update Tests" @@ -896,7 +896,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.2 - update-lgsm" @@ -916,7 +916,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.0 - Monitor Tests" @@ -943,7 +943,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.2 - monitor - offline - with lockfile" @@ -966,7 +966,7 @@ echo "${port}" >> "${lockdir}/${selfname}.lock" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.3 - monitor - offline - no lockfile" @@ -985,7 +985,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.4 - test-alert" @@ -1004,7 +1004,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "6.0 - Details Tests" @@ -1027,7 +1027,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "6.2 - postdetails" @@ -1046,7 +1046,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "7.0 - Backup Tests" @@ -1065,7 +1065,7 @@ echo -e "test de-activated until issue #1839 fixed" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.0 - Development Tools Tests" @@ -1088,7 +1088,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.2 - dev - detect ldd" @@ -1107,7 +1107,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.3 - dev - detect deps" @@ -1126,7 +1126,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.4 - dev - query-raw" @@ -1145,30 +1145,30 @@ fn_setstatus fn_test_result_na echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "9.0 - Donate" echo -e "==================================================================" echo -e "" -echo -e "9.1 - donate" +echo -e "9.1 - sponsor" echo -e "=================================" echo -e "Description:" -echo -e "donate." -echo -e "Command: ./${gameservername} donate" +echo -e "sponsor." +echo -e "Command: ./${gameservername} sponsor" requiredstatus="STARTED" fn_setstatus ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x - command_donate.sh + command_sponsor.sh ) fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "================================="