From ee20e18be320a9fd5d1b9c5611404809d108bf00 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 11 Dec 2024 22:29:17 +0000 Subject: [PATCH 001/132] feat: User interface refactor (#4716) * refactor: improve log directory creation - Changed the variable `checklogs` from being set to `1` to being set to `true`. - Improved the logic for creating log directories and files. - Added more informative console output for each step of the process. - Refactored code to use conditional statements instead of nested if statements. - Removed unnecessary print statements. This commit improves the way log directories are created and handles cases where logs already exist. It also provides clearer console output during the process. * refactor: improve console output formatting - Added color support for console output using tput commands - Updated print functions to display formatted messages with colors and bold text * refactor: improve console log creation The code in `install_logs.sh` has been refactored to improve the creation of the console log. The commit removes unnecessary whitespace and updates the echo statement to provide a more concise output. * a * refactor: improve log directory creation messages - Changed the format of log directory creation messages to include parentheses around the directory path. - Updated the messages in `install_logs.sh` file to reflect this change. * refactor: improve log directory symlink creation The code has been refactored to improve the creation of symlinks for game log directories. The commit removes unnecessary echo statements and updates the output format to provide clearer information about the created symlinks. * feat: create server directory - Updated the script to create a server directory - Removed unnecessary check for existing server directory * refactor: improve console output for fetching files The commit refactors the code in `install_server_dir.sh` and `linuxgsm.sh` to improve the console output when fetching files. The message now includes more descriptive information about the file being fetched, such as the source URL and local filename. Additionally, the success message has been updated to include brackets around "OK" for better readability. * refactor: improve formatting of success message The success message in the core_messages.sh file has been updated to include square brackets around "OK" for better visibility. * ui * refactor: improve console output for checking and fetching files - Updated the console output in `command_update_linuxgsm.sh` to include formatting and improved readability. - Improved the console output in `core_dl.sh` to include formatting and better indicate the progress of file fetching. * refactor: improve logging message in fn_fetch_file The logging message in the fn_fetch_file function has been improved to provide a more concise and informative output. Instead of mentioning the local filename separately, it is now included within the same line as the file URL name. This change enhances readability and clarity when fetching files. * refactor: improve console output in core_dl.sh and linuxgsm.sh - Refactored code to improve the console output in core_dl.sh and linuxgsm.sh. - Updated echo statements to provide more informative messages. - Removed unnecessary characters from the console output. * refactor: improve code readability and remove unnecessary comments The commit message summarizes the changes made to the code. In this case, the code has been refactored to improve its readability and remove unnecessary comments. * refactor: improve readability and consistency in code - Refactored echo statements to provide more informative messages. - Renamed variables for better clarity. - Removed unnecessary comments and unused code. * refactor: improve logging message in core_dl.sh The logging message in the `fn_fetch_file` function has been updated to provide a more concise and informative description of the file being fetched. * refactor(core_messages): update print functions - Updated the print functions in the core_messages.sh file to improve readability and consistency. - Replaced the use of "tputreset" with "${default}" for better code clarity. - Modified the formatting of the output messages to follow a consistent pattern. - Removed unnecessary escape sequences from the echo statements. * refactor: improve header and server directory installation messages - Updated ASCII logo formatting for better visibility. - Added emphasis to the LinuxGSM name in the header message. - Changed the contributor and sponsor links to be more descriptive. - Modified the server directory installation message to indicate if a game server already exists at the specified location. * refactor: improve log directory creation messages - Changed the log directory creation messages to include square brackets around the directory paths. - Updated the console log and game log directory creation messages to use square brackets as well. - Modified the symlink creation messages for game logs and Steam logs to also include square brackets. This commit improves the readability of the log directory creation process by adding square brackets around the relevant paths. * refactor: improve log directory creation and server directory installation - Change log directory creation message to use bold font for emphasis. - Update symlink creation message to clarify that it is creating a symlink to the game log directory. - Add a check to skip creating a symlink if it already exists for the Steam log directory. - Change server directory installation message to use bold font for emphasis. * refactor: improve log directory symlink creation This commit refactors the code in `install_logs.sh` to improve the creation of symlinks for game log directories. The commit fixes a typo in the echo statement and updates the symlink paths for both game logs and Steam logs. * feat: create serverfiles directory - Updated the message to indicate that a serverfiles directory is being created - Improved clarity and readability of the code * refactor: improve consistency and readability of print functions - Refactored the print functions in the core_messages.sh file to improve consistency and readability. - Updated the output format by adding ellipsis (...) before each status message for better visual separation. - Replaced hard-coded color codes with variables for easier maintenance. Co-authored-by: AI Assistant * refactor: improve readability of code in command_update_linuxgsm.sh - Replaced "checking" with "checking [filename]" for better clarity - Changed echo statements to use fn_print_update_eol_nl instead of fn_print_ok_eol_nl - Updated comments for better understanding of the code flow * refactor: improve logging and error handling in command_update_linuxgsm.sh - Refactored log messages for better clarity and readability. - Improved error handling by checking the return value of curl command. - Updated backup location log message to include brackets. * refactor: simplify code for checking file differences The commit simplifies the code for checking file differences in the `command_update_linuxgsm.sh` script. It replaces the function `fn_print_ok_eol_nl` with `fn_print_skip_eol_nl` to improve readability and maintainability. * refactor: improve print message in command_update_linuxgsm.sh The code change refactors the print message in the command_update_linuxgsm.sh file. Instead of printing "OK", it now prints "SKIP" to indicate that a module is being removed. This improves clarity and consistency in the script's output. * skip * refactor: improve readability and add emphasis to file names in code - Refactored code to improve readability and maintainability. - Added emphasis to file names by using italics. - Updated echo statements to reflect the changes. * feat: improve fetch file output - Updated the fetch file function in core_dl.sh and linuxgsm.sh to provide more informative output. - Replaced the parentheses with square brackets to enclose the local filename. - Added italics formatting to highlight the local filename. * feat: improve log directory creation - Updated log directory creation to include italic formatting for directory names. - Added italic formatting for script log, console log, game log, and steam log directories. - Improved serverfiles directory creation by including italic formatting for the directory name. * refactor: improve readability and consistency in code - Updated the echo statement to include formatting for script name - Added bold formatting to EULA acceptance message - Removed unnecessary line breaks and added italic formatting to EULA URL - Refactored code to remove duplicate calls to install_eula.sh * feat: add new line before Y/N prompt The commit adds a new line before the Y/N prompt in the `fn_prompt_yn` function. This improves readability and user experience. refactor: improve formatting in install_server_files.sh The commit improves the formatting in the `install_server_files.sh` file by adding bold styling to the installation header. It also adds bold styling to the separator line for better visual separation. These changes enhance the overall appearance of the installation process. fix: correct formatting issue in install_server_files.sh The commit fixes a formatting issue in the `install_server_files.sh` file where an extra separator line was not properly formatted with bold styling. The fix ensures consistent and correct formatting throughout the script. chore: update prompt message in install_server_files.sh The commit updates a prompt message in the `install_server_files.sh` file to make it more informative and user-friendly. The updated message asks if the installation was successful, providing clearer instructions for users. refactor: remove redundant separator line in install_server_files.sh The commit removes a redundant separator line from the `install_server_files.sh` file that was causing unnecessary visual clutter. This improves code readability and simplifies the installation process. * changes * refactor: improve logging and error handling in install_config.sh - Refactored the code to use more descriptive function names. - Improved logging by using fn_print_ok_eol and fn_print_failure_eol functions. - Added error handling for copying config files, displaying failure messages if necessary. - Updated comments for better clarity. * refactor: improve logging and remove unnecessary code - Changed `fn_print_failure_eol` to `fn_print_fail_eol` for consistency. - Removed redundant log messages and sleep time. - Simplified the logic for changing hostname and rcon/admin password. - Removed warning message when config file is not found. Co-authored-by: AI Assistant * refactor: update server names in default configuration files - Updated the servername value in multiple default configuration files to "LinuxGSM" for consistency. - Refactored the code to reflect the changes made. This commit refactors the default configuration files for various game servers by updating the servername value to "LinuxGSM". This change ensures consistency across different game servers. * refactor: remove unused code and files This commit removes unused code and files from the project. The deleted files include default configuration files and test scripts that are no longer needed. * refactor: improve readability and error handling in install_config.sh - Refactored the code to improve readability by adding bold formatting to console output. - Improved error handling by using the exit status of commands instead of a separate variable. - Replaced repetitive sleep calls with fn_sleep_time function. - Updated log messages for clarity and consistency. - Added conditional checks for successful file copying and printing appropriate status messages. Co-authored-by: AI Assistant * refactor: simplify config file copying and error handling This commit simplifies the code for copying default config files from the Game-Server-Configs repository to the server's config location. It also improves error handling by printing appropriate messages and logging them. * misc changes * reword of dst config install Removed install settings as it complicates setup. The admin how has to manually setup a slave shard using configs. By default LinuxGSM will setup a Master shard. Docs will need to be updated. * refactor: improve config location listing - Renamed the function `fn_list_config_locations` to better reflect its purpose. - Updated the output messages to provide clearer information about the config locations. - Added formatting enhancements for better readability. This commit refactors the code related to listing config locations, making it more user-friendly and informative. * ui changes * refactor: improve code readability and fix typos - Refactored the code to improve readability and organization. - Fixed typos in the comments and echo statements. - Changed some echo statements to use variables for better consistency. - Updated URLs in the echo statements to be clickable links. Co-authored-by: [co-author name] * ui changes * ui changes * fix: update warning message for missing SteamCMD The commit updates the warning message in the code to indicate that SteamCMD is not installed instead of being missing. Additionally, it modifies the log message accordingly. * refactor: simplify directory creation in install_config.sh This commit simplifies the code for creating config directories in the install_config.sh file. Instead of using separate variables for each directory path, it now uses a single variable to create the necessary directories. This improves readability and reduces redundancy in the code. * feat: add installation and information for SteamCMD - Added code to install SteamCMD if it is missing or the steamcmd directory is missing. - Modified the check_steamcmd function to print a warning message if SteamCMD is not installed. - Modified the info_game_dst function to retrieve additional information from server and cluster configuration files. - Updated the installation script to display a bold header before installing SteamCMD. * refactor: improve error message in install_config.sh The commit refactors the code in `install_config.sh` to improve the error message when copying a config file. The function `fn_print_failure_eol_nl` is renamed to `fn_print_fail_eol_nl` for clarity and consistency. This change enhances the readability and maintainability of the code. * refactor: improve conditional statements in install_config.sh The code changes refactor the conditional statements in the `install_config.sh` file. Instead of checking if `${shortname}` is equal to "dst" or "arma3", it now checks if `${clustercfgdir}` or `${networkcfgdir}` are not empty, respectively. This improves readability and maintainability of the code. a * refactor: simplify config directory creation and copying The code changes simplify the logic for creating config directories and copying config files. The function `fn_check_cfgdir` now only creates the server config directory if it exists, removing unnecessary checks for other directories. Additionally, the function `fn_default_config_remote` no longer duplicates the call to `fn_check_cfgdir`. * refactor: improve variable naming and remove unnecessary code duplication The commit refactors the code in `install_config.sh` to improve variable naming and remove unnecessary code duplication. Specifically, it renames the variables for better clarity and removes redundant lines of code. refactor: improve installation and configuration process - Refactored the fix_dst.sh script to keep the shard name in server.ini consistent with the LinuxGSM config. - Updated install_config.sh to provide clearer messages during the default config download and copy processes. refactor: update shard name in server.ini The code has been refactored to update the shard name in the server.ini file. This change ensures that the shard name in the LinuxGSM config matches the one in server.ini. * feat: improve console output formatting - Added separator function to improve readability of console output. - Replaced multiple instances of manual separators with the new function. - Updated commit message to follow conventional commit standard. * refactor: remove unnecessary fn_sleep_time calls This commit removes the fn_sleep_time function calls that are no longer needed in multiple modules. The fn_sleep_time function was used to introduce a delay, but it is no longer necessary for the current implementation. * refactor: remove unused functions This commit removes a large number of unused functions from the core_functions.sh module. These functions were not being called or used anywhere in the codebase and were therefore unnecessary. Removing them helps to clean up the code and improve maintainability. * refactor: improve consistency and readability of code - Changed the color of "Missing Server Details" to bold yellow - Changed the color of "Query IP Addresses" to bold yellow - Changed the color of "Game Server Ports" to bold yellow - Changed the color of "SS Output" to bold yellow - Changed the color of "Query Port - Raw Output" to bold yellow - Changed the color of "Gamedig Raw Output" to bold yellow - Changed the color of "gsquery Raw Output" to bold yellow - Changed the color of "TCP Raw Output" to bold yellow - Changed the color of "Game Port - Raw Output" to bold yellow - Changed the color of "Steam Master Server Response" to bold yellow - Updated commit message formatting for better readability * refactor: improve code readability and efficiency in command_dev_query_raw.sh - Simplify conditionals by replacing [ -v var ] with [ -n "${var}" ] - Remove unnecessary checks for the presence of jq and gamedig - Update output headers to be more descriptive and consistent - Use italic formatting for curl command in Steam Master Server Response section * refactor: improve query output formatting The code changes refactor the query output formatting in the command_dev_query_raw.sh file. The changes include: - Adding italics to certain command outputs for better readability - Removing unnecessary echo statements - Updating comments and indentation for clarity * refactor: simplify storage information display The code in `info_messages.sh` has been refactored to improve the readability and conciseness of the storage information display. The labels for total and used space have been shortened to "Total" and "Used" respectively. * refactor: renamed fatal to fail to improve consistency - Updated the log level from "fatal" to "fail" in the alert scripts. * feat: add conditional printing of alert messages This commit adds conditional statements to only print alert messages if the corresponding alerts are turned on. This improves the readability of the output by only displaying relevant information. - Added conditionals for Discord, Email, Gotify, IFTTT, Pushbullet, Pushover, Rocketchat, Slack, and Telegram alerts - Only prints alert messages if the corresponding alerts are turned on * feat: improve console and post details commands - Updated the console command to display a link in italics to the documentation. - Updated the post details command to display the URL in italics for support. - Renamed "Donation options" to "Sponsorship options" in the sponsor command. - Added Minecraft as an example of a game with query enabled in info messages. Closes #123 * quit * update fn_bootstrap_fetch_file * ui changes * bootstrap trap * ui updates * att bootstrap fetch module * ui updates * bug * merge 2 functions * ui changes * config ui changes * installer ui changes * installer ui changes * add fn_print and fn_print_nl * remove space * add new dev command ui * bug * skip to light blue * update to light blue * reset to default * update ui changes * steamui changes * print * fix * sleep time * validate * remote location * italic url * fastdl * fn_print * fix * ui * speed up * fastdl ui * ui fix * ui fix * update some headers * header updates * minor changes * install changes * messages refactor * ui changes * bug * standardise exitcode * tidy * bug * bug * revert * updating dev ui * ui changes * bug * skip * bug * change minimum required message * fix incorrect var name * ui updates * remove ) from results * revert * ensure command action capitals are consistant * revert * revert * revert * codacy * revert * revert --------- Co-authored-by: AI Assistant Co-authored-by: AI Assistant --- .../config-lgsm/ts3server/_default.cfg | 2 +- lgsm/modules/alert_email.sh | 2 +- lgsm/modules/alert_gotify.sh | 2 +- lgsm/modules/check_deps.sh | 11 +- lgsm/modules/check_gamedig.sh | 2 + lgsm/modules/check_logs.sh | 2 +- lgsm/modules/check_system_requirements.sh | 5 +- lgsm/modules/command_backup.sh | 14 +- lgsm/modules/command_console.sh | 11 +- lgsm/modules/command_debug.sh | 13 +- lgsm/modules/command_details.sh | 2 +- lgsm/modules/command_dev_clear_modules.sh | 2 +- lgsm/modules/command_dev_debug.sh | 2 +- lgsm/modules/command_dev_detect_deps.sh | 8 +- lgsm/modules/command_dev_detect_glibc.sh | 14 +- lgsm/modules/command_dev_detect_ldd.sh | 10 +- .../command_dev_parse_distro_details.sh | 7 + .../modules/command_dev_parse_game_details.sh | 7 + lgsm/modules/command_dev_query_raw.sh | 89 ++--- lgsm/modules/command_dev_ui.sh | 110 +++++++ lgsm/modules/command_fastdl.sh | 110 +++---- lgsm/modules/command_install_resources_mta.sh | 2 +- lgsm/modules/command_mods_install.sh | 2 +- lgsm/modules/command_mods_remove.sh | 12 +- lgsm/modules/command_mods_update.sh | 2 +- lgsm/modules/command_monitor.sh | 76 ++--- lgsm/modules/command_postdetails.sh | 14 +- lgsm/modules/command_send.sh | 2 +- lgsm/modules/command_skeleton.sh | 2 +- lgsm/modules/command_sponsor.sh | 2 +- lgsm/modules/command_start.sh | 6 +- lgsm/modules/command_stop.sh | 10 +- lgsm/modules/command_ts3_server_pass.sh | 2 +- lgsm/modules/command_update_linuxgsm.sh | 75 +++-- lgsm/modules/command_validate.sh | 6 +- lgsm/modules/command_wipe.sh | 31 +- lgsm/modules/compress_unreal2_maps.sh | 2 +- lgsm/modules/compress_ut99_maps.sh | 2 +- lgsm/modules/core_dl.sh | 46 +-- lgsm/modules/core_exit.sh | 10 +- lgsm/modules/core_getopt.sh | 17 +- lgsm/modules/core_messages.sh | 306 ++++++++---------- lgsm/modules/core_modules.sh | 10 + lgsm/modules/core_steamcmd.sh | 49 +-- lgsm/modules/fix.sh | 5 +- lgsm/modules/fix_bt.sh | 2 +- lgsm/modules/fix_rust.sh | 2 +- lgsm/modules/info_distro.sh | 9 +- lgsm/modules/info_messages.sh | 44 ++- lgsm/modules/install_complete.sh | 15 +- lgsm/modules/install_config.sh | 248 ++++++-------- lgsm/modules/install_dst_token.sh | 2 +- lgsm/modules/install_eula.sh | 4 +- lgsm/modules/install_gslt.sh | 20 +- lgsm/modules/install_logs.sh | 98 +++--- lgsm/modules/install_server_dir.sh | 12 +- lgsm/modules/install_server_files.sh | 7 +- lgsm/modules/install_squad_license.sh | 2 +- lgsm/modules/install_stats.sh | 4 +- lgsm/modules/install_ts3db.sh | 4 +- lgsm/modules/install_ut2k4_key.sh | 2 +- lgsm/modules/mods_core.sh | 60 ++-- lgsm/modules/update_mcb.sh | 8 +- lgsm/modules/update_pmc.sh | 2 +- lgsm/modules/update_ut99.sh | 2 +- lgsm/modules/update_xnt.sh | 2 +- linuxgsm.sh | 102 ++++-- 67 files changed, 951 insertions(+), 816 deletions(-) create mode 100644 lgsm/modules/command_dev_ui.sh diff --git a/lgsm/config-default/config-lgsm/ts3server/_default.cfg b/lgsm/config-default/config-lgsm/ts3server/_default.cfg index d132d5c57..bacda7aaa 100644 --- a/lgsm/config-default/config-lgsm/ts3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ts3server/_default.cfg @@ -133,7 +133,7 @@ consoleinteract="no" ## Game Server Details # Do not edit gamename="TeamSpeak 3" -servername="TeamSpeak 3 Server" +servername="LinuxGSM" engine="null" glibc="2.17" diff --git a/lgsm/modules/alert_email.sh b/lgsm/modules/alert_email.sh index ca9db1bc4..aa13494d1 100644 --- a/lgsm/modules/alert_email.sh +++ b/lgsm/modules/alert_email.sh @@ -15,7 +15,7 @@ else mail -s "${alerttitle}" "${email}" < "${alertlog}" fi exitcode=$? -if [ "${exitcode}" == "0" ]; then +if [ "${exitcode}" -ne 0 ]; then fn_print_ok_nl "Sending Email alert: ${email}" fn_script_log_pass "Sending Email alert: ${email}" else diff --git a/lgsm/modules/alert_gotify.sh b/lgsm/modules/alert_gotify.sh index 724ff1d79..dcb438fb2 100644 --- a/lgsm/modules/alert_gotify.sh +++ b/lgsm/modules/alert_gotify.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Sends Gotify alert. -module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" jsoninfo=$( cat << EOF diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh index d7df071d3..95d4a6ad0 100644 --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -78,11 +78,12 @@ fn_install_mono_repo() { # Did Mono repo install correctly? if [ "${monoautoinstall}" != "1" ]; then - if [ $? != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_failure_nl "Unable to install Mono repository." fn_script_log_fail "Unable to install Mono repository." else - fn_print_complete_nl "Installing Mono repository completed." + fn_print_success_nl "Installing Mono repository completed." fn_script_log_pass "Installing Mono repository completed." fi fi @@ -226,7 +227,7 @@ fn_install_missing_deps() { else if [ "${commandname}" == "INSTALL" ]; then - fn_print_information_nl "Required dependencies already installed." + fn_print_skip2_nl "Required dependencies already installed." fn_script_log_info "Required dependencies already installed." fi fi @@ -234,7 +235,7 @@ fn_install_missing_deps() { fn_check_loop() { # Loop though required depenencies checking if they are installed. - for deptocheck in ${array_deps_required[*]}; do + for deptocheck in "${array_deps_required[@]}"; do fn_deps_detector done @@ -318,7 +319,7 @@ fn_deps_detector() { fi # If SteamCMD requirements are not met install will fail. if [ -n "${appid}" ]; then - for steamcmddeptocheck in ${array_deps_required_steamcmd[*]}; do + for steamcmddeptocheck in "${array_deps_required_steamcmd[@]}"; do if [ "${deptocheck}" != "steamcmd" ] && [ "${deptocheck}" == "${steamcmddeptocheck}" ]; then steamcmdfail=1 fi diff --git a/lgsm/modules/check_gamedig.sh b/lgsm/modules/check_gamedig.sh index 70aeea41b..0942ac42a 100644 --- a/lgsm/modules/check_gamedig.sh +++ b/lgsm/modules/check_gamedig.sh @@ -5,6 +5,8 @@ # Website: https://linuxgsm.com # Description: Installs nodejs and gamedig +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + if [ "$(command -v node)" ] && [ "$(command -v npm)" ] && [ "$(node -v | cut -d 'v' -f 2 | cut -d '.' -f 1)" -ge 16 ] && [ ! -f "${lgsmdir}/node_modules/gamedig/bin/gamedig.js" ]; then echo -e "" echo -e "${bold}${lightyellow}Installing Gamedig${default}" diff --git a/lgsm/modules/check_logs.sh b/lgsm/modules/check_logs.sh index 5e2d66c35..36fb24036 100644 --- a/lgsm/modules/check_logs.sh +++ b/lgsm/modules/check_logs.sh @@ -10,7 +10,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_check_logs() { fn_print_dots "Checking for log files" fn_print_info_nl "Checking for log files: Creating log files" - checklogs=1 + checklogs=true install_logs.sh } diff --git a/lgsm/modules/check_system_requirements.sh b/lgsm/modules/check_system_requirements.sh index 7dd0551a5..531695a6e 100644 --- a/lgsm/modules/check_system_requirements.sh +++ b/lgsm/modules/check_system_requirements.sh @@ -71,8 +71,9 @@ fi if [ "${ramrequirementgb}" ]; then if (($(echo "${physmemtotalgb} < ${ramrequirementgb}" | bc -l))); then fn_print_dots "Checking RAM" - fn_print_warn_nl "Checking RAM: ${ramrequirementgb}G required, ${physmemtotal} available" - echo "* ${gamename} server may fail to run or experience poor performance." + fn_print_warn_nl "Checking RAM: Minumum RAM requirements not met" + fn_print_nl "* ${ramrequirementgb}G is required, but only ${physmemtotal} is available." + fn_print_nl "* ${gamename} server may fail to run or experience poor performance." fn_sleep_time_5 fi fi diff --git a/lgsm/modules/command_backup.sh b/lgsm/modules/command_backup.sh index 6bbc07f02..010c60577 100644 --- a/lgsm/modules/command_backup.sh +++ b/lgsm/modules/command_backup.sh @@ -6,7 +6,7 @@ # Description: Creates a .tar.gz file in the backup directory. commandname="BACKUP" -commandaction="Backing up" +commandaction="Backup" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set @@ -115,7 +115,7 @@ fn_backup_compression() { # Tells how much will be compressed using rootdirduexbackup value from info_distro and prompt for continue. fn_print_info "A total of ${rootdirduexbackup} will be compressed." fn_script_log_info "A total of ${rootdirduexbackup} will be compressed: ${backupdir}/${backupname}.tar.gz" - fn_print_dots "Backup (${rootdirduexbackup}) ${backupname}.tar.gz, in progress..." + fn_print_dots "Backup (${rootdirduexbackup}) ${backupname}.tar.gz, in progress ..." fn_script_log_info "Backup ${rootdirduexbackup} ${backupname}.tar.gz, in progress" excludedir=$(fn_backup_relpath) @@ -127,8 +127,8 @@ fn_backup_compression() { fi tar --use-compress-program=pigz -cf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}" --exclude "${tmpdir}" ./. - local exitcode=$? - if [ "${exitcode}" != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol fn_script_log_fail "Backup in progress: FAIL" echo -e "${extractcmd}" | tee -a "${lgsmlog}" @@ -136,7 +136,7 @@ fn_backup_compression() { fn_script_log_fail "Starting backup" else fn_print_ok_eol - fn_print_ok_nl "Completed: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" + fn_print_ok_nl "Completed: ${italic}${backupname}.tar.gz${default}, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" fn_script_log_pass "Backup created: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" alert="backup" alert.sh @@ -190,7 +190,7 @@ fn_backup_prune() { fn_backup_relpath() { # Written by CedarLUG as a "realpath --relative-to" alternative in bash. # Populate an array of tokens initialized from the rootdir components. - declare -a rdirtoks=($(readlink -f "${rootdir}" | sed "s/\// /g")) + mapfile -t rdirtoks < <(readlink -f "${rootdir}" | sed "s/\// /g") if [ ${#rdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing rootdir during relative path assessment" fn_script_log_fail "Problem assessing rootdir during relative path assessment: ${rootdir}" @@ -198,7 +198,7 @@ fn_backup_relpath() { fi # Populate an array of tokens initialized from the backupdir components. - declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g")) + mapfile -t bdirtoks < <(readlink -f "${backupdir}" | sed "s/\// /g") if [ ${#bdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing backupdir during relative path assessment" fn_script_log_fail "Problem assessing backupdir during relative path assessment: ${rootdir}" diff --git a/lgsm/modules/command_console.sh b/lgsm/modules/command_console.sh index aa17e839e..6344088b3 100644 --- a/lgsm/modules/command_console.sh +++ b/lgsm/modules/command_console.sh @@ -6,13 +6,14 @@ # Description: Gives access to the server tmux console. commandname="CONSOLE" -commandaction="Access console" +commandaction="Access Console" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -check.sh fn_print_header +check.sh + if [ "${consoleverbose}" == "yes" ]; then echo -e "* Verbose output: ${lightgreen}yes${default}" elif [ "${consoleverbose}" == "no" ]; then @@ -29,10 +30,10 @@ else echo -e "* Interactive output: ${red}unknown${default}" fi echo "" -fn_print_information_nl "Press \"CTRL+b\" then \"d\" to exit console." -fn_print_warning_nl "Do NOT press CTRL+c to exit." -echo -e "* https://docs.linuxgsm.com/commands/console" +fn_print_information_nl "Press ${italic}\"CTRL+b\"${default} then ${italic}\"d\"${default} to exit console." +fn_print_warning_nl "Do ${underline}NOT${default} press CTRL+c to exit." echo -e "" +echo -e "${italic}https://docs.linuxgsm.com/commands/console${default}" if ! fn_prompt_yn "Continue?" Y; then exitcode=0 core_exit.sh diff --git a/lgsm/modules/command_debug.sh b/lgsm/modules/command_debug.sh index b5f2dabac..a5dae7615 100644 --- a/lgsm/modules/command_debug.sh +++ b/lgsm/modules/command_debug.sh @@ -6,7 +6,7 @@ # Description: Runs the server without tmux and directly from the terminal. commandname="DEBUG" -commandaction="Debuging" +commandaction="Debugging" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set @@ -24,11 +24,13 @@ fn_lockfile_trap() { core_exit.sh } +fn_print_header + check.sh fix.sh info_distro.sh info_game.sh -fn_print_header + { echo -e "${lightblue}Distro:\t\t${default}${distroname}" echo -e "${lightblue}Architecture:\t\t${default}${arch}" @@ -121,9 +123,10 @@ else eval "${preexecutable} ${executable} ${startparameters}" fi -if [ $? -ne 0 ]; then - fn_print_error_nl "Server has stopped: exit code: $?" - fn_script_log_error "Server has stopped: exit code: $?" +exitcode=$? +if [ "${exitcode}" -ne 0 ]; then + fn_print_error_nl "Server has stopped: exit code: ${exitcode}" + fn_script_log_error "Server has stopped: exit code: ${exitcode}" fn_print_error_nl "Press ENTER to exit debug mode" read -r else diff --git a/lgsm/modules/command_details.sh b/lgsm/modules/command_details.sh index 2800e5123..8de2ddeb5 100644 --- a/lgsm/modules/command_details.sh +++ b/lgsm/modules/command_details.sh @@ -6,7 +6,7 @@ # Description: Displays server information. commandname="DETAILS" -commandaction="Viewing details" +commandaction="Display Details" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set diff --git a/lgsm/modules/command_dev_clear_modules.sh b/lgsm/modules/command_dev_clear_modules.sh index e2e80164f..d6196ba74 100644 --- a/lgsm/modules/command_dev_clear_modules.sh +++ b/lgsm/modules/command_dev_clear_modules.sh @@ -6,7 +6,7 @@ # Description: Deletes the contents of the modules dir. commandname="DEV-CLEAR-MODULES" -commandaction="Clearing modules" +commandaction="Clear Modules" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set diff --git a/lgsm/modules/command_dev_debug.sh b/lgsm/modules/command_dev_debug.sh index 3226fc186..2b13b8c41 100644 --- a/lgsm/modules/command_dev_debug.sh +++ b/lgsm/modules/command_dev_debug.sh @@ -6,7 +6,7 @@ # Description: Dev only: Enables debugging log to be saved to dev-debug.log. commandname="DEV-DEBUG" -commandaction="Developer debug" +commandaction="Developer Debug" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_reset diff --git a/lgsm/modules/command_dev_detect_deps.sh b/lgsm/modules/command_dev_detect_deps.sh index fead2c285..fca15f075 100644 --- a/lgsm/modules/command_dev_detect_deps.sh +++ b/lgsm/modules/command_dev_detect_deps.sh @@ -6,13 +6,11 @@ # Description: Detects dependencies the server binary requires. commandname="DEV-DETECT-DEPS" -commandaction="Developer detect deps" +commandaction="Dependency Checker" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -echo -e "" -echo -e "${bold}Dependencies Checker${default}" -fn_messages_separator +fn_print_header echo -e "Checking directory: " echo -e "${serverfiles}" if [ "$(command -v eu-readelf 2> /dev/null)" ]; then @@ -186,7 +184,7 @@ echo -e "${bold}Required Dependencies${default}" fn_messages_separator echo -e "${executable}" echo -e "" -echo -e "CentOS" +echo -e "${bold}CentOS" fn_messages_separator cat "${tmpdir}/.depdetect_centos_line" echo -e "" diff --git a/lgsm/modules/command_dev_detect_glibc.sh b/lgsm/modules/command_dev_detect_glibc.sh index 6326cf5cb..20398bd47 100644 --- a/lgsm/modules/command_dev_detect_glibc.sh +++ b/lgsm/modules/command_dev_detect_glibc.sh @@ -7,13 +7,11 @@ # Can check a file or directory recursively. commandname="DEV-DETECT-GLIBC" -commandaction="Developer detect glibc" +commandaction="Detect Glibc Requirements" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -fn_messages_separator -echo -e "glibc Requirements Checker" -fn_messages_separator +fn_print_header if [ ! "$(command -v objdump 2> /dev/null)" ]; then fn_print_failure_nl "objdump is missing" @@ -48,17 +46,17 @@ for glibc_check_var in "${glibc_check_dir_array[@]}"; do glibc_check_files=$(find "${glibc_check_dir}" | wc -l) find "${glibc_check_dir}" -type f -print0 \ | while IFS= read -r -d $'\0' line; do - glibcversion=$(objdump -T "${line}" 2> /dev/null | grep -oP "GLIBC[^ ]+" | grep -v GLIBCXX | sort | uniq | sort -r --version-sort | head -n 1) + glibcversion=$(objdump -T "${line}" 2> /dev/null | grep -oP "GLIBC[^ ]+" | grep -v GLIBCXX | sort | uniq | sort -r --version-sort | head -n 1 | sed 's/)$//') if [ "${glibcversion}" ]; then echo -e "${glibcversion}: ${line}" >> "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" fi - objdump -T "${line}" 2> /dev/null | grep -oP "GLIBC[^ ]+" >> "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" + objdump -T "${line}" 2> /dev/null | grep -oP "GLIBC[^ ]+" | sed 's/)$//' >> "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" echo -n "${i} / ${glibc_check_files}" $'\r' ((i++)) done echo -e "" echo -e "" - echo -e "${glibc_check_name} glibc Requirements" + fn_print_nl "${bold}${lightyellow}${glibc_check_name} glibc Requirements" fn_messages_separator if [ -f "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" ]; then echo -e "Required glibc" @@ -80,7 +78,7 @@ for glibc_check_var in "${glibc_check_dir_array[@]}"; do fi done echo -e "" -echo -e "Final glibc Requirement" +fn_print_nl "${bold}${lightyellow}Final glibc Requirement" fn_messages_separator if [ -f "${tmpdir}/detect_glibc_highest.tmp" ]; then cat "${tmpdir}/detect_glibc_highest.tmp" | sort | uniq | sort -r --version-sort | head -1 diff --git a/lgsm/modules/command_dev_detect_ldd.sh b/lgsm/modules/command_dev_detect_ldd.sh index 9d0bf5148..62db24da0 100644 --- a/lgsm/modules/command_dev_detect_ldd.sh +++ b/lgsm/modules/command_dev_detect_ldd.sh @@ -7,13 +7,11 @@ # Can check a file or directory recursively. commandname="DEV-DETECT-LDD" -commandaction="Developer detect ldd" +commandaction="Shared Object Dependencies Checker" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -fn_messages_separator -echo -e "Shared Object dependencies Checker" -fn_messages_separator +fn_print_header if [ -z "${serverfiles}" ]; then dir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") @@ -46,12 +44,12 @@ find "${serverfiles}" -type f -print0 \ done echo -e "" echo -e "" -echo -e "All" +fn_print_nl "${bold}${lightyellow}All${default}" fn_messages_separator cat "${tmpdir}/detect_ldd.tmp" echo -e "" -echo -e "Not Found" +fn_print_nl "${bold}${lightyellow}Not Found${default}" fn_messages_separator cat "${tmpdir}/detect_ldd_not_found.tmp" diff --git a/lgsm/modules/command_dev_parse_distro_details.sh b/lgsm/modules/command_dev_parse_distro_details.sh index f80c909ad..dfb68ba2b 100644 --- a/lgsm/modules/command_dev_parse_distro_details.sh +++ b/lgsm/modules/command_dev_parse_distro_details.sh @@ -5,6 +5,13 @@ # Website: https://linuxgsm.com # Description: Display parsed distro details. +commandname="DEV-PARSE-DISTRO-DETAILS" +commandaction="Parse Distro Details" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_header + check_ip.sh check_status.sh info_distro.sh diff --git a/lgsm/modules/command_dev_parse_game_details.sh b/lgsm/modules/command_dev_parse_game_details.sh index 87284904c..7c0767eea 100644 --- a/lgsm/modules/command_dev_parse_game_details.sh +++ b/lgsm/modules/command_dev_parse_game_details.sh @@ -5,6 +5,13 @@ # Website: https://linuxgsm.com # Description: Display parsed gameserver details. +commandname="DEV-PARSE-GAME-DETAILS" +commandaction="Parse Game Details" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_header + if [ -f "config" ]; then servercfgfullpath="config" fi diff --git a/lgsm/modules/command_dev_query_raw.sh b/lgsm/modules/command_dev_query_raw.sh index 345298941..ea42599f9 100644 --- a/lgsm/modules/command_dev_query_raw.sh +++ b/lgsm/modules/command_dev_query_raw.sh @@ -6,10 +6,12 @@ # Description: Raw gamedig output of the server. commandname="DEV-QUERY-RAW" -commandaction="Developer query raw" +commandaction="Developer Query Raw" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set +fn_print_header + check.sh info_game.sh info_distro.sh @@ -26,24 +28,24 @@ echo -e "Telnet IP: ${telnetip}" echo -e "Display IP: ${displayip}" echo -e "" -echo -e "${lightgreen}Query IP Addresses${default}" +echo -e "${bold}${lightyellow}Query IP Addresses${default}" fn_messages_separator echo -e "" for queryip in "${queryips[@]}"; do echo -e "${queryip}" done echo -e "" -echo -e "${lightgreen}Game Server Ports${default}" +echo -e "${bold}${lightyellow}Game Server Ports${default}" fn_messages_separator { echo -e "${lightblue}Port Name \tPort Number \tStatus \tTCP \tUDP${default}" - if [ -v port ]; then + if [ -n "${port}" ]; then echo -e "Game: \t${port} \t$(ss -tupl | grep -c "${port}") \t$(ss -tupl | grep "${port}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${port}" | grep udp | awk '{ print $2 }')" else echo -e "Game:" fi if [ "${shortname}" == "pvr" ]; then - if [ -v port401 ]; then + if [ -n "${port401}" ]; then echo -e "Game+400: \t${port401} \t$(ss -tupl | grep -c "${port401}") \t$(ss -tupl | grep "${port401}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${port401}" | grep udp | awk '{ print $2 }')" else echo -e "Game+400:" @@ -51,140 +53,140 @@ fn_messages_separator fi if [ "${shortname}" == "mcb" ]; then - if [ -v portipv6 ]; then + if [ -n "${portipv6}" ]; then echo -e "Game ipv6: \t${portipv6} \t$(ss -tupl | grep -c "${portipv6}") \t$(ss -tupl | grep "${portipv6}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${portipv6}" | grep udp | awk '{ print $2 }')" else echo -e "Game ipv6:" fi fi - if [ -v queryport ]; then + if [ -n "${queryport}" ]; then echo -e "Query: \t${queryport} \t$(ss -tupl | grep -c "${queryport}") \t$(ss -tupl | grep "${queryport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${queryport}" | grep udp | awk '{ print $2 }')" else echo -e "Query:" fi - if [ -v apiport ]; then + if [ -n "${apiport}" ]; then echo -e "Game: \t${apiport} \t$(ss -tupl | grep -c "${apiport}") \t$(ss -tupl | grep "${apiport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${apiport}" | grep udp | awk '{ print $2 }')" else echo -e "API:" fi - if [ -v appport ]; then + if [ -n "${appport}" ]; then echo -e "App: \t${appport} \t$(ss -tupl | grep -c "${appport}") \t$(ss -tupl | grep "${appport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${appport}" | grep udp | awk '{ print $2 }')" else echo -e "App:" fi - if [ -v battleeyeport ]; then + if [ -n "${battleeyeport}" ]; then echo -e "BattleEye: \t${battleeyeport} \t$(ss -tupl | grep -c "${battleeyeport}") \t$(ss -tupl | grep "${battleeyeport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${battleeyeport}" | grep udp | awk '{ print $2 }')" else echo -e "BattleEye:" fi - if [ -v beaconport ]; then + if [ -n "${beaconport}" ]; then echo -e "Beacon: \t${beaconport} \t$(ss -tupl | grep -c "${beaconport}") \t$(ss -tupl | grep "${beaconport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${beaconport}" | grep udp | awk '{ print $2 }')" else echo -e "Beacon:" fi - if [ -v clientport ]; then + if [ -n "${clientport}" ]; then echo -e "Client: \t${clientport} \t$(ss -tupl | grep -c "${clientport}") \t$(ss -tupl | grep "${clientport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${clientport}" | grep udp | awk '{ print $2 }')" else echo -e "Client:" fi - if [ -v fileport ]; then + if [ -n "${fileport}" ]; then echo -e "File: \t${fileport} \t$(ss -tupl | grep -c "${fileport}") \t$(ss -tupl | grep "${fileport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${fileport}" | grep udp | awk '{ print $2 }')" else echo -e "File:" fi - if [ -v httpport ]; then + if [ -n "${httpport}" ]; then echo -e "HTTP: \t${httpport} \t$(ss -tupl | grep -c "${httpport}") \t$(ss -tupl | grep "${httpport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${httpport}" | grep udp | awk '{ print $2 }')" else echo -e "HTTP:" fi - if [ -v httpqueryport ]; then + if [ -n "${httpqueryport}" ]; then echo -e "HTTP Query: \t${httpqueryport} \t$(ss -tupl | grep -c "${httpqueryport}") \t$(ss -tupl | grep" ${httpqueryport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${httpqueryport}" | grep udp | awk '{ print $2 }')" else echo -e "HTTP Query:" fi - if [ -v httpport ]; then + if [ -n "${httpport}" ]; then echo -e "Web Interface: \t${httpport} \t$(ss -tupl | grep -c "${httpport}") \t$(ss -tupl | grep "${httpport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${httpport}" | grep udp | awk '{ print $2 }')" else echo -e "Web Interface:" fi - if [ -v masterport ]; then + if [ -n "${masterport}" ]; then echo -e "Game: Master: \t${masterport} \t$(ss -tupl | grep -c "${masterport}") \t$(ss -tupl | grep "${masterport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${masterport}" | grep udp | awk '{ print $2 }')" else echo -e "Game: Master:" fi - if [ -v rawport ]; then + if [ -n "${rawport}" ]; then echo -e "RAW UDP Socket: \t${rawport} \t$(ss -tupl | grep -c "${rawport}") \t$(ss -tupl | grep "${rawport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${rawport}" | grep udp | awk '{ print $2 }')" else echo -e "RAW UDP Socket:" fi - if [ -v rconport ]; then + if [ -n "${rconport}" ]; then echo -e "RCON: \t${rconport} \t$(ss -tupl | grep -c "${rconport}") \t$(ss -tupl | grep "${rconport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${rconport}" | grep udp | awk '{ print $2 }')" else echo -e "RCON:" fi - if [ -v steamport ]; then + if [ -n "${steamport}" ]; then echo -e "Steam: \t${steamport} \t$(ss -tupl | grep -c "${steamport}") \t$(ss -tupl | grep "${steamport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${steamport}" | grep udp | awk '{ print $2 }')" else echo -e "Steam:" fi - if [ -v steamworksport ]; then + if [ -n "${steamworksport}" ]; then echo -e "Steamworks P2P: \t${steamworksport} \t$(ss -tupl | grep -c "${steamworksport}") \t$(ss -tupl | grep "${steamworksport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${steamworksport}" | grep udp | awk '{ print $2 }')" else echo -e "Steamworks P2P:" fi - if [ -v steamauthport ]; then + if [ -n "${steamauthport}" ]; then echo -e "Steam: Auth: \t${steamauthport} \t$(ss -tupl | grep -c "${steamauthport}") \t$(ss -tupl | grep "${steamauthport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${steamauthport}" | grep udp | awk '{ print $2 }')" else echo -e "Steam: Auth:" fi - if [ -v telnetport ]; then + if [ -n "${telnetport}" ]; then echo -e "Telnet: \t${telnetport} \t$(ss -tupl | grep -c "${telnetport}") \t$(ss -tupl | grep "${telnetport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${telnetport}" | grep udp | awk '{ print $2 }')" else echo -e "Telnet:" fi - if [ -v statsport ]; then + if [ -n "${statsport}" ]; then echo -e "Stats: \t${battleeyeport} \t$(ss -tupl | grep -c "${statsport}") \t$(ss -tupl | grep "${statsport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${statsport}" | grep udp | awk '{ print $2 }')" else echo -e "Stats:" fi - if [ -v sourcetvport ]; then + if [ -n "${sourcetvport}" ]; then echo -e "SourceTV: \t${sourcetvport} \t$(ss -tupl | grep -c "${sourcetvport}") \t$(ss -tupl | grep "${sourcetvport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${sourcetvport}" | grep udp | awk '{ print $2 }')" else echo -e "SourceTV:" fi - if [ -v udplinkport ]; then + if [ -n "${udplinkport}" ]; then echo -e "UDP Link: \t${udplinkport} \t$(ss -tupl | grep -c "${udplinkport}") \t$(ss -tupl | grep "${udplinkport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${udplinkport}" | grep udp | awk '{ print $2 }')" else echo -e "UDP Link:" fi - if [ -v voiceport ]; then + if [ -n "${voiceport}" ]; then echo -e "Voice: \t${voiceport} \t$(ss -tupl | grep -c "${voiceport}") \t$(ss -tupl | grep "${voiceport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${voiceport}" | grep udp | awk '{ print $2 }')" else echo -e "Voice:" fi - if [ -v voiceunusedport ]; then + if [ -n "${voiceunusedport}" ]; then echo -e "Voice (Unused): \t${voiceunusedport} \t$(ss -tupl | grep -c "${voiceunusedport}") \t$(ss -tupl | grep "${voiceunusedport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${voiceunusedport}" | grep udp | awk '{ print $2 }')" else echo -e "Voice (Unused):" @@ -192,13 +194,15 @@ fn_messages_separator } \ | column -s $'\t' -t + echo -e "" -echo -e "${lightgreen}SS Output${default}" +echo -e "${bold}${lightyellow}SS Output${default}" fn_messages_separator -fn_info_messages_ports +fn_info_message_ports eval "${portcommand}" + echo -e "" -echo -e "${lightgreen}Query Port - Raw Output${default}" +echo -e "${bold}${lightyellow}Query Port (${queryport}) - Gamedig Output${default}" fn_messages_separator echo -e "" echo -e "PORT: ${port}" @@ -210,33 +214,32 @@ echo -e "" if [ ! "$(command -v gamedig 2> /dev/null)" ] && [ ! -f "${lgsmdir}/node_modules/gamedig/bin/gamedig.js" ]; then fn_print_failure_nl "gamedig not installed" fi -if [ ! "$(command -v jq 2> /dev/null)" ]; then - fn_print_failure_nl "jq not installed" -fi for queryip in "${queryips[@]}"; do query_gamedig.sh - echo -e "${gamedigcmd}" + echo -e "${italic}${gamedigcmd}${default}" echo"" echo "${gamedigraw}" | jq done + echo -e "" -echo -e "${lightgreen}gsquery Raw Output${default}" +echo -e "${bold}${lightyellow}Query Port (${queryport}) - gsquery Output${default}" fn_messages_separator echo -e "" for queryip in "${queryips[@]}"; do - echo -e "./query_gsquery.py -a \"${queryip}\" -p \"${queryport}\" -e \"${querytype}\"" + echo -e "${italic}./query_gsquery.py -a \"${queryip}\" -p \"${queryport}\" -e \"${querytype}\"${default}" echo -e "" if [ ! -f "${modulesdir}/query_gsquery.py" ]; then fn_fetch_file_github "lgsm/modules" "query_gsquery.py" "${modulesdir}" "chmodx" "norun" "noforce" "nohash" fi "${modulesdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}" done + echo -e "" -echo -e "${lightgreen}TCP Raw Output${default}" +echo -e "${bold}${lightyellow}Query Port (${queryport}) - TCP Output${default}" fn_messages_separator echo -e "" for queryip in "${queryips[@]}"; do - echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}''" + echo -e "${italic}bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}''${default}" echo -e "" timeout 3 bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}'' querystatus="$?" @@ -248,14 +251,14 @@ for queryip in "${queryips[@]}"; do fi done echo -e "" -echo -e "${lightgreen}Game Port - Raw Output${default}" +echo -e "${bold}${lightyellow}Game Port (${port}) - TCP Output${default}" fn_messages_separator echo -e "" echo -e "${lightgreen}TCP Raw Output${default}" fn_messages_separator echo -e "" for queryip in "${queryips[@]}"; do - echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}''" + echo -e "${italic}bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}''${default}" echo -e "" timeout 3 bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}'' querystatus="$?" @@ -267,10 +270,10 @@ for queryip in "${queryips[@]}"; do fi done echo -e "" -echo -e "${lightgreen}Steam Master Server Response${default}" +echo -e "${bold}${lightyellow}Steam Master Server Response${default}" fn_messages_separator echo -e "" -echo -e "curl -m 3 -s https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${publicip}" +echo -e "${italic}curl -m 3 -s https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${publicip}${default}" echo -e "" echo -e "Response: ${displaymasterserver}" echo -e "" diff --git a/lgsm/modules/command_dev_ui.sh b/lgsm/modules/command_dev_ui.sh new file mode 100644 index 000000000..e7aa9975e --- /dev/null +++ b/lgsm/modules/command_dev_ui.sh @@ -0,0 +1,110 @@ +#!/bin/bash +# LinuxGSM command_dev_ui.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Dev only: Assist with UI development. + +commandname="DEV-DEBUG" +commandaction="Developer UI" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_header + +# Load ANSI colors +fn_ansi_loader + +fn_print_nl "" +fn_print_nl "${lightgreen}Colours${default}" +fn_messages_separator +# Print supported colors +fn_print_nl "${default}default" +fn_print_nl "${black}black${default}" +fn_print_nl "${red}red${default}" +fn_print_nl "${lightred}lightred${default}" +fn_print_nl "${green}green${default}" +fn_print_nl "${lightgreen}lightgreen${default}" +fn_print_nl "${yellow}yellow${default}" +fn_print_nl "${lightyellow}lightyellow${default}" +fn_print_nl "${blue}blue${default}" +fn_print_nl "${lightblue}lightblue${default}" +fn_print_nl "${magenta}magenta${default}" +fn_print_nl "${lightmagenta}lightmagenta${default}" +fn_print_nl "${cyan}cyan${default}" +fn_print_nl "${lightcyan}lightcyan${default}" +fn_print_nl "${darkgrey}darkgrey${default}" +fn_print_nl "${lightgrey}lightgrey${default}" +fn_print_nl "${white}white${default}" +fn_print_nl "${bold}bold${default}" +fn_print_nl "${dim}dim${default}" +fn_print_nl "${italic}italic${default}" +fn_print_nl "${underline}underline${default}" +fn_print_nl "${reverse}reverse${default}" + +fn_print_nl "" +fn_print_nl "${lightgreen}Non Interactive UI Status Messages${default}" +fn_messages_separator +fn_print_nl "" +fn_print_nl "Print Message" +fn_print_nl "" +fn_print_nl "${lightgreen}Status Messages${default}" +fn_messages_separator +fn_print_dots_nl "Dots" +fn_print_ok_nl "OK" +fn_print_fail_nl "Fail" +fn_print_error_nl "Error" +fn_print_warn_nl "Warn" +fn_print_info_nl "Info" +fn_print_start_nl "Start" + +fn_print_nl "" +fn_print_nl "${lightgreen}Interactive UI Status Messages${default}" +fn_messages_separator +fn_print_success_nl +fn_print_failure_nl +fn_print_error2_nl +fn_print_warning_nl +fn_print_information_nl + +fn_print_nl "" +fn_print_nl "${lightgreen}EOL Status Messages${default}" +fn_messages_separator + +fn_print "Print yes message with eol" +fn_print_yes_eol_nl +fn_print "Print no message with eol" +fn_print_no_eol_nl +fn_print "Print ok message with eol" +fn_print_ok_eol_nl +fn_print "Print fail message with eol" +fn_print_fail_eol_nl +fn_print "Print error message with eol" +fn_print_error_eol_nl +fn_print "Print warn message with eol" +fn_print_wait_eol_nl +fn_print "Print info message with eol" +fn_print_warn_eol_nl +fn_print "Print querying message with eol" +fn_print_info_eol_nl +fn_print "Print checking message with eol" +fn_print_querying_eol_nl +fn_print "Print delay message with eol" +fn_print_checking_eol_nl +fn_print "Print canceled message with eol" +fn_print_delay_eol_nl +fn_print "Print removed message with eol" +fn_print_canceled_eol_nl +fn_print "Print update message with eol" +fn_print_removed_eol_nl +fn_print "Print skip message with eol" +fn_print_update_eol_nl +fn_print "Print skip message with eol" +fn_print_skip_eol_nl + +fn_print_nl "" +fn_print_nl "${lightgreen}Restart warning${default}" +fn_messages_separator +fn_print_restart_warning + +core_exit.sh diff --git a/lgsm/modules/command_fastdl.sh b/lgsm/modules/command_fastdl.sh index 4e9378945..e3437bc1f 100644 --- a/lgsm/modules/command_fastdl.sh +++ b/lgsm/modules/command_fastdl.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Creates a FastDL directory. +# Description: Creates a Fastdl directory. commandname="FASTDL" commandaction="Fastdl" @@ -30,18 +30,18 @@ fi # Header fn_print_header -echo -e "More info: https://docs.linuxgsm.com/commands/fastdl" -echo -e "" +fn_print_nl "More info: ${italic}https://docs.linuxgsm.com/commands/fastdl" +fn_print_nl "" -# Prompts user for FastDL creation settings. -echo -e "${commandaction} setup" +# Prompts user for Fastdl creation settings. +fn_print_nl "${bold}${lightyellow}${commandaction} Setup" fn_messages_separator # Prompt for clearing old files if directory was already here. if [ -d "${fastdldir}" ]; then - fn_print_warning_nl "FastDL directory already exists." - echo -e "${fastdldir}" - echo -e "" + fn_print_warning_nl "Fastdl directory already exists." + fn_print_nl "${fastdldir}" + fn_print_nl "" if fn_prompt_yn "Overwrite existing directory?" Y; then fn_script_log_info "Overwrite existing directory: YES" else @@ -63,18 +63,18 @@ fi # Clears any fastdl directory content. fn_clear_old_fastdl() { - # Clearing old FastDL. + # Clearing old Fastdl. if [ -d "${fastdldir}" ]; then - echo -en "clearing existing FastDL directory ${fastdldir}..." + fn_print "clearing existing Fastdl directory ${fastdldir}" rm -rf "${fastdldir:?}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fail "Clearing existing FastDL directory ${fastdldir}" + fn_script_log_fail "Clearing existing Fastdl directory ${fastdldir}" core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "Clearing existing FastDL directory ${fastdldir}" + fn_script_log_pass "Clearing existing Fastdl directory ${fastdldir}" fi fi } @@ -82,10 +82,10 @@ fn_clear_old_fastdl() { fn_fastdl_dirs() { # Check and create directories. if [ ! -d "${webdir}" ]; then - echo -en "creating web directory ${webdir}..." + fn_print "creating web directory ${webdir}" mkdir -p "${webdir}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Creating web directory ${webdir}" core_exit.sh @@ -95,10 +95,10 @@ fn_fastdl_dirs() { fi fi if [ ! -d "${fastdldir}" ]; then - echo -en "creating fastdl directory ${fastdldir}..." + fn_print "creating fastdl directory ${fastdldir}" mkdir -p "${fastdldir}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Creating fastdl directory ${fastdldir}" core_exit.sh @@ -125,7 +125,7 @@ fn_human_readable_file_size() { local precision="${2}" if [[ "${bytes}" == "1" ]]; then - echo -e "1 byte" + fn_print_nl "1 byte" else for item in "${abbrevs[@]}"; do local factor="${item%:*}" @@ -145,7 +145,7 @@ fn_fastdl_preview() { if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then rm -f "${tmpdir:?}/fastdl_files_to_compress.txt" fi - echo -e "analysing required files" + fn_print_nl "analysing required files" fn_script_log_info "Analysing required files" # Garry's Mod if [ "${shortname}" == "gmod" ]; then @@ -158,13 +158,13 @@ fn_fastdl_preview() { ((fileswc++)) tput rc tput el - echo -e "gathering ${allowed_extention} : ${fileswc}..." + fn_print "gathering ${allowed_extention} : ${fileswc}" echo -e "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" done < <(find . -type f -iname "${allowed_extention}") if [ ${fileswc} != 0 ]; then fn_print_ok_eol_nl else - fn_print_info_eol_nl + fn_print_skip_eol_nl fi done # Source engine @@ -190,12 +190,12 @@ fn_fastdl_preview() { ((fileswc++)) tput rc tput el - echo -e "gathering ${directory} ${allowed_extention} : ${fileswc}..." + fn_print "gathering ${directory} ${allowed_extention} : ${fileswc}" echo -e "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" done < <(find "${systemdir}/${directory}" -type f -iname "${allowed_extention}") tput rc tput el - echo -e "gathering ${directory} ${allowed_extention} : ${fileswc}..." + fn_print "gathering ${directory} ${allowed_extention} : ${fileswc}" if [ ${fileswc} != 0 ]; then fn_print_ok_eol_nl else @@ -206,7 +206,7 @@ fn_fastdl_preview() { done fi if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then - echo -e "calculating total file size..." + fn_print_nl "calculating total file size" fn_sleep_time_1 totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt") # Calculates total file size. @@ -214,9 +214,9 @@ fn_fastdl_preview() { filesize=$(stat -c %s "${dufile}") filesizetotal=$((filesizetotal + filesize)) exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fail "Calculating total file size." + fn_script_log_fail "Calculating total file size" core_exit.sh fi done < "${tmpdir}/fastdl_files_to_compress.txt" @@ -225,8 +225,8 @@ fn_fastdl_preview() { fn_script_log_fail "Generating file list." core_exit.sh fi - echo -e "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" - fn_script_log_info "${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" + fn_print_nl "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)" + fn_script_log_info "${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)" rm -f "${tmpdir:?}/fastdl_files_to_compress.txt" if ! fn_prompt_yn "Continue?" Y; then fn_script_log "User exited" @@ -244,10 +244,10 @@ fn_fastdl_gmod() { ((fileswc++)) tput rc tput el - echo -e "copying ${allowed_extention} : ${fileswc}..." + fn_print "copying ${allowed_extention} : ${fileswc}" cp --parents "${fastdlfile}" "${fastdldir}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Copying ${fastdlfile} > ${fastdldir}" core_exit.sh @@ -259,12 +259,12 @@ fn_fastdl_gmod() { fn_print_ok_eol_nl fi done - # Correct addons directory structure for FastDL. + # Correct addons directory structure for Fastdl. if [ -d "${fastdldir}/addons" ]; then - echo -en "updating addons file structure..." + fn_print "updating addons file structure..." cp -Rf "${fastdldir}"/addons/*/* "${fastdldir}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Updating addons file structure" core_exit.sh @@ -273,11 +273,11 @@ fn_fastdl_gmod() { fn_script_log_pass "Updating addons file structure" fi # Clear addons directory in fastdl. - echo -en "clearing addons dir from fastdl dir..." + fn_print "clearing addons dir from fastdl dir..." fn_sleep_time_1 rm -rf "${fastdldir:?}/addons" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Clearing addons dir from fastdl dir" core_exit.sh @@ -288,11 +288,11 @@ fn_fastdl_gmod() { fi # Correct content that may be into a lua directory by mistake like some darkrpmodification addons. if [ -d "${fastdldir}/lua" ]; then - echo -en "correcting DarkRP files..." + fn_print "correcting DarkRP files..." fn_sleep_time_1 cp -Rf "${fastdldir}/lua/"* "${fastdldir}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Correcting DarkRP files" core_exit.sh @@ -332,8 +332,8 @@ fn_fastdl_source() { ((fileswc++)) tput rc tput el - echo -e "copying ${directory} ${allowed_extention} : ${fileswc}..." - fn_sleep_time_1 + fn_print "copying ${directory} ${allowed_extention} : ${fileswc}" + fn_sleep_time # get relative path of file in the dir tmprelfilepath="${fastdlfile#"${systemdir}/"}" copytodir="${tmprelfilepath%/*}" @@ -343,7 +343,7 @@ fn_fastdl_source() { fi cp "${fastdlfile}" "${fastdldir}/${copytodir}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Copying ${fastdlfile} > ${fastdldir}/${copytodir}" core_exit.sh @@ -361,8 +361,8 @@ fn_fastdl_source() { # Builds the fastdl directory content. fn_fastdl_build() { - # Copy all needed files for FastDL. - echo -e "copying files to ${fastdldir}" + # Copy all needed files for Fastdl. + fn_print_nl "copying files to ${fastdldir}" fn_script_log_info "Copying files to ${fastdldir}" if [ "${shortname}" == "gmod" ]; then fn_fastdl_gmod @@ -372,14 +372,14 @@ fn_fastdl_build() { fi } -# Generate lua file that will force download any file into the FastDL directory. +# Generate lua file that will force download any file into the Fastdl directory. fn_fastdl_gmod_dl_enforcer() { # Clear old lua file. if [ -f "${luafastdlfullpath}" ]; then - echo -en "removing existing download enforcer: ${luafastdlfile}..." + fn_print "removing existing download enforcer: ${luafastdlfile}" rm -f "${luafastdlfullpath:?}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Removing existing download enforcer ${luafastdlfullpath}" core_exit.sh @@ -390,14 +390,14 @@ fn_fastdl_gmod_dl_enforcer() { fi # Generate new one if user said yes. if [ "${luaresource}" == "on" ]; then - echo -en "creating new download enforcer: ${luafastdlfile}..." + fn_print "creating new download enforcer: ${luafastdlfile}" touch "${luafastdlfullpath}" # Read all filenames and put them into a lua file at the right path. while read -r line; do echo -e "resource.AddFile( \"${line}\" )" >> "${luafastdlfullpath}" done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -printf '%P\n') exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Creating new download enforcer ${luafastdlfullpath}" core_exit.sh @@ -408,21 +408,21 @@ fn_fastdl_gmod_dl_enforcer() { fi } -# Compresses FastDL files using bzip2. +# Compresses Fastdl files using bzip2. fn_fastdl_bzip2() { while read -r filetocompress; do - echo -en "\r\033[Kcompressing ${filetocompress}..." + fn_print "compressing ${filetocompress}" bzip2 -f "${filetocompress}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Compressing ${filetocompress}" core_exit.sh else + fn_print_ok_eol_nl fn_script_log_pass "Compressing ${filetocompress}" fi done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \)) - fn_print_ok_eol_nl } check.sh @@ -433,9 +433,9 @@ fn_fastdl_dirs fn_fastdl_build fn_fastdl_bzip2 # Finished message. -echo -e "FastDL files are located in:" -echo -e "${fastdldir}" -echo -e "FastDL completed" -fn_script_log_info "FastDL completed" +fn_print_nl "Fastdl files are located in:" +fn_print_nl "${fastdldir}" +fn_print_nl "Fastdl completed" +fn_script_log_info "Fastdl completed" core_exit.sh diff --git a/lgsm/modules/command_install_resources_mta.sh b/lgsm/modules/command_install_resources_mta.sh index aecda1452..7eca4fb97 100644 --- a/lgsm/modules/command_install_resources_mta.sh +++ b/lgsm/modules/command_install_resources_mta.sh @@ -12,7 +12,7 @@ fn_firstcommand_set fn_install_resources() { echo -e "" - echo -e "${lightyellow}Installing Default Resources${default}" + echo -e "${bold}${lightyellow}Installing Default Resources${default}" fn_messages_separator fn_fetch_file "http://mirror.mtasa.com/mtasa/resources/mtasa-resources-latest.zip" "" "" "" "${tmpdir}" "mtasa-resources-latest.zip" "nochmodx" "norun" "noforce" "nohash" fn_dl_extract "${tmpdir}" "mtasa-resources-latest.zip" "${resourcesdir}" diff --git a/lgsm/modules/command_mods_install.sh b/lgsm/modules/command_mods_install.sh index d1b3fb67a..4401e2c56 100644 --- a/lgsm/modules/command_mods_install.sh +++ b/lgsm/modules/command_mods_install.sh @@ -6,7 +6,7 @@ # Description: List and installs available mods along with mods_list.sh and mods_core.sh. commandname="MODS-INSTALL" -commandaction="Installing mods" +commandaction="Installing Mods" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set diff --git a/lgsm/modules/command_mods_remove.sh b/lgsm/modules/command_mods_remove.sh index 412e07546..6dc52d95f 100644 --- a/lgsm/modules/command_mods_remove.sh +++ b/lgsm/modules/command_mods_remove.sh @@ -6,7 +6,7 @@ # Description: Uninstall mods along with mods_list.sh and mods_core.sh. commandname="MODS-REMOVE" -commandaction="Removing mods" +commandaction="Removing Mods" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set @@ -70,8 +70,8 @@ while [ "${modfileline}" -le "${modsfilelistsize}" ]; do if [ -f "${modinstalldir}/${currentfileremove}" ] || [ -d "${modinstalldir}/${currentfileremove}" ]; then rm -rf "${modinstalldir:?}/${currentfileremove:?}" - ((exitcode = $?)) - if [ "${exitcode}" != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "Removing ${modinstalldir}/${currentfileremove}" break else @@ -87,7 +87,7 @@ done # Added logic not to fail since removing game specific mods (amxmodxcs) removes files that will # not be found when removing the base (amxmodx) mod if [ "${modcommand}" != "amxmodx" ]; then - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl core_exit.sh else @@ -102,7 +102,7 @@ echo -en "removing ${modcommand}-files.txt..." fn_sleep_time_1 rm -rf "${modsdir:?}/${modcommand}-files.txt" exitcode=$? -if [ "${exitcode}" != 0 ]; then +if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "Removing ${modsdir}/${modcommand}-files.txt" fn_print_fail_eol_nl core_exit.sh @@ -117,7 +117,7 @@ fn_sleep_time_1 sed -i "/^${modcommand}$/d" "${modsinstalledlistfullpath}" exitcode=$? -if [ "${exitcode}" != 0 ]; then +if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "Removing ${modcommand} from ${modsinstalledlist}" fn_print_fail_eol_nl core_exit.sh diff --git a/lgsm/modules/command_mods_update.sh b/lgsm/modules/command_mods_update.sh index ca81dd947..10279b67b 100644 --- a/lgsm/modules/command_mods_update.sh +++ b/lgsm/modules/command_mods_update.sh @@ -6,7 +6,7 @@ # Description: Updates installed mods along with mods_list.sh and mods_core.sh. commandname="MODS-UPDATE" -commandaction="Updating mods" +commandaction="Updating Mods" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh index a9691fb98..78df55330 100644 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -18,10 +18,10 @@ fn_monitor_check_monitoring() { date '+%s' > "${lockdir:?}/${selfname}-monitoring.lock" elif [ ! -f "${lockdir}/${selfname}-monitoring.lock" ]; then # Monitor does not run if lockfile is not found. - fn_print_dots "Checking lockfile: " + fn_print_dots "Checking lockfile:" fn_print_checking_eol fn_script_log_info "Checking lockfile: CHECKING" - fn_print_error "Checking lockfile: No lockfile found: " + fn_print_error "Checking lockfile: No lockfile found:" fn_print_error_eol_nl fn_script_log_error "Checking lockfile: No lockfile found: ERROR" echo -e "* Start ${selfname} to run monitor." @@ -31,10 +31,10 @@ fn_monitor_check_monitoring() { fn_monitor_check_install() { if [ "$(pgrep -fc -u "${USER}" "/bin/bash ./${selfname} install")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} i")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} auto-install")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} ai")" != "0" ]; then - fn_print_dots "Checking installer: " + fn_print_dots "Checking installer:" fn_print_checking_eol fn_script_log_info "Checking installer: CHECKING" - fn_print_info "Checking installer: LinuxGSM is installing: " + fn_print_info "Checking installer: LinuxGSM is installing:" fn_print_info_eol_nl fn_script_log_pass "Checking installer: LinuxGSM is installing" core_exit.sh @@ -43,9 +43,9 @@ fn_monitor_check_install() { fn_monitor_check_debug() { if [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} debug")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} d")" != "0" ]; then - fn_print_dots "Checking debug: " + fn_print_dots "Checking debug:" fn_print_checking_eol - fn_print_info "Checking debug: Debug is running: " + fn_print_info "Checking debug: Debug is running:" fn_print_info_eol_nl fn_script_log_pass "Checking debug: Debug is running" core_exit.sh @@ -54,9 +54,9 @@ fn_monitor_check_debug() { fn_monitor_check_details() { if [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} details")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} dt")" != "0" ]; then - fn_print_dots "Checking details: " + fn_print_dots "Checking details:" fn_print_checking_eol - fn_print_info "Checking details: Details is running: " + fn_print_info "Checking details: Details is running:" fn_print_info_eol_nl fn_script_log_pass "Checking details: Details is running" core_exit.sh @@ -67,9 +67,9 @@ fn_monitor_check_starting() { # Remove stale lockfile. if [ -f "${lockdir}/${selfname}-starting.lock" ]; then if [ "$(find "${lockdir}/${selfname}-starting.lock" -mmin +5)" ]; then - fn_print_dots "Checking start: " + fn_print_dots "Checking start:" fn_print_checking_eol - fn_print_warn "Checking start: Removing stale lockfile: " + fn_print_warn "Checking start: Removing stale lockfile:" fn_print_warn_eol_nl fn_script_log_warn "Checking start: Removing stale lockfile" rm -f "${lockdir:?}/${selfname}-starting.lock" @@ -77,9 +77,9 @@ fn_monitor_check_starting() { fi if [ -f "${lockdir}/${selfname}-starting.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} start")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} s")" != "0" ]]; then - fn_print_dots "Checking start: " + fn_print_dots "Checking start:" fn_print_checking_eol - fn_print_info "Checking start: LinuxGSM is starting: " + fn_print_info "Checking start: LinuxGSM is starting:" fn_print_info_eol_nl fn_script_log_info "Checking backup: LinuxGSM is starting" core_exit.sh @@ -90,9 +90,9 @@ fn_monitor_check_stopping() { # Remove stale lockfile. if [ -f "${lockdir}/${selfname}-stopping.lock" ]; then if [ "$(find "${lockdir}/${selfname}-stopping.lock" -mmin +5)" ]; then - fn_print_dots "Checking stop: " + fn_print_dots "Checking stop:" fn_print_checking_eol - fn_print_warn "Checking stop: Removing stale lockfile: " + fn_print_warn "Checking stop: Removing stale lockfile:" fn_print_warn_eol_nl fn_script_log_warn "Checking stop: Removing stale lockfile" rm -f "${lockdir:?}/${selfname}-stopping.lock" @@ -100,9 +100,9 @@ fn_monitor_check_stopping() { fi if [ -f "${lockdir}/${selfname}-stopping.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} stop")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} s")" != "0" ]]; then - fn_print_dots "Checking stop: " + fn_print_dots "Checking stop:" fn_print_checking_eol - fn_print_info "Checking stop: LinuxGSM is stopping: " + fn_print_info "Checking stop: LinuxGSM is stopping:" fn_print_info_eol_nl fn_script_log_info "Checking backup: LinuxGSM is stopping" core_exit.sh @@ -113,9 +113,9 @@ fn_monitor_check_backup() { # Remove stale lockfile. if [ -f "${lockdir}/backup.lock" ]; then if [ "$(find "${lockdir}/backup.lock" -mmin +60)" ]; then - fn_print_dots "Checking backup: " + fn_print_dots "Checking backup:" fn_print_checking_eol - fn_print_warn "Checking backup: Removing stale lockfile: " + fn_print_warn "Checking backup: Removing stale lockfile:" fn_print_warn_eol fn_script_log_warn "Checking backup: Removing stale lockfile" rm -f "${lockdir:?}/backup.lock" @@ -123,9 +123,9 @@ fn_monitor_check_backup() { fi if [ -f "${lockdir}/backup.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} backup")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} b")" != "0" ]]; then - fn_print_dots "Checking backup: " + fn_print_dots "Checking backup:" fn_print_checking_eol - fn_print_info "Checking backup: Backup is running: " + fn_print_info "Checking backup: Backup is running:" fn_print_info_eol_nl fn_script_log_info "Checking backup: Backup is running" core_exit.sh @@ -136,9 +136,9 @@ fn_monitor_check_update() { # Remove stale lockfile. if [ -f "${lockdir}/update.lock" ]; then if [ "$(find "${lockdir}/update.lock" -mmin +15)" ]; then - fn_print_dots "Checking update: " + fn_print_dots "Checking update:" fn_print_checking_eol - fn_print_warn "Checking update: Removing stale lockfile: " + fn_print_warn "Checking update: Removing stale lockfile:" fn_print_warn_eol_nl fn_script_log_warn "Checking update: Removing stale lockfile" rm -f "${lockdir:?}/update.lock" @@ -146,9 +146,9 @@ fn_monitor_check_update() { fi if [ -f "${lockdir}/update.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} update")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} validate")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} v")" != "0" || "$(pgrep -fc force-update "${USER}" "/bin/bash ./${selfname} fu")" != "0" ]]; then - fn_print_dots "Checking update: " + fn_print_dots "Checking update:" fn_print_checking_eol - fn_print_info "Checking update: LinuxGSM is updating the game server: " + fn_print_info "Checking update: LinuxGSM is updating the game server:" fn_print_info_eol_nl fn_script_log_pass "Checking update: LinuxGSM is updating the game server" core_exit.sh @@ -159,10 +159,10 @@ fn_monitor_check_update() { fn_monitor_check_update_source() { if [ -f "${consolelogdir}/${selfname}-console.log" ] && [ "${engine}" == "source" ]; then if grep -q "Your server needs to be restarted in order to receive the latest update." "${consolelogdir}/${selfname}-console.log"; then - fn_print_dots "Checking update: " + fn_print_dots "Checking update:" fn_print_checking_eol fn_script_log_info "Checking update: CHECKING" - fn_print_ok "Checking update: " + fn_print_ok "Checking update:" fn_print_ok_eol_nl fn_script_log_info "Checking update: ${selfname} has requested an update and needs to be restarted" alert="update-request" @@ -174,7 +174,7 @@ fn_monitor_check_update_source() { } fn_monitor_check_session() { - fn_print_dots "Checking session: " + fn_print_dots "Checking session" fn_print_checking_eol fn_script_log_info "Checking session: CHECKING" # Tmux session width and height needs to be reviewed as may no longer be required. @@ -182,7 +182,7 @@ fn_monitor_check_session() { sessionheight="23" # Check for PIDS with identical tmux sessions running. if [ "$(pgrep -fcx "tmux -L ${socketname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" -ge "2" ]; then - fn_print_error "Checking session: There are PIDS with identical tmux sessions running: " + fn_print_error "Checking session: There are PIDS with identical tmux sessions running:" fn_print_error_eol_nl fn_script_log_error "Checking session: ERROR" fn_script_log_error "Checking session: There are PIDS with identical tmux sessions running" @@ -192,7 +192,7 @@ fn_monitor_check_session() { core_exit.sh # Check for tmux pids with the same tmux session and socket names. This will reduce issues with migration to release v23.5.0. #4296 elif [ "$(pgrep -fc -u "${USER}" "tmux -L ${sessionname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then - fn_print_error "Checking session: PIDS with the same tmux session and socket names are running: " + fn_print_error "Checking session: PIDS with the same tmux session and socket names are running:" fn_print_error_eol_nl fn_script_log_error "Checking session: ERROR" fn_script_log_error "Checking session: PIDS with the same tmux session and socket names are running" @@ -202,7 +202,7 @@ fn_monitor_check_session() { core_exit.sh # Check for tmux pids that are using the old type of tmux session. This will reduce issues with migration to release v23.5.0. #4296 elif [ "$(pgrep -fc -u "${USER}" "tmux new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then - fn_print_error "Checking session: PIDS with old type tmux session are running: " + fn_print_error "Checking session: PIDS with old type tmux session are running:" fn_print_error_eol_nl fn_script_log_error "Checking session: ERROR" fn_script_log_error "Checking session: PIDS with old type tmux session are running" @@ -211,7 +211,7 @@ fn_monitor_check_session() { command_restart.sh core_exit.sh elif [ "${status}" != "0" ]; then - fn_print_ok "Checking session: " + fn_print_ok "Checking session" fn_print_ok_eol_nl fn_script_log_pass "Checking session: OK" # send LinuxGSM stats if monitor is OK. @@ -219,7 +219,7 @@ fn_monitor_check_session() { info_stats.sh fi else - fn_print_error "Checking session: " + fn_print_error "Checking session" fn_print_fail_eol_nl fn_script_log_fail "Checking session: FAIL" alert="monitor-session" @@ -233,7 +233,7 @@ fn_monitor_check_session() { # Monitor will check queryport is set before continuing. fn_monitor_check_queryport() { if [ -z "${queryport}" ] || [ "${queryport}" == "0" ]; then - fn_print_dots "Checking port: " + fn_print_dots "Checking port:" fn_print_checking_eol fn_script_log_info "Checking port: CHECKING" if [ -n "${rconenabled}" ] && [ "${rconenabled}" != "true" ] && [ "${shortname}" == "av" ]; then @@ -266,12 +266,12 @@ fn_monitor_query() { totalseconds=0 for queryattempt in {1..5}; do for queryip in "${queryips[@]}"; do - fn_print_dots "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_dots "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}" fn_print_querying_eol fn_script_log_info "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : QUERYING" # querydelay if [ "$(head -n 1 "${lockdir}/${selfname}-started.lock")" -gt "$(date "+%s" -d "${querydelay} mins ago")" ]; then - fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}" fn_print_delay_eol_nl fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt} : DELAY" fn_script_log_info "Query bypassed: ${gameservername} started less than ${querydelay} minutes ago" @@ -293,7 +293,7 @@ fn_monitor_query() { if [ "${querystatus}" == "0" ]; then # Server query OK. - fn_print_ok "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_ok "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}" fn_print_ok_eol_nl fn_script_log_pass "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : OK" monitorpass=1 @@ -323,14 +323,14 @@ fn_monitor_query() { core_exit.sh else # Server query FAIL. - fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}" fn_print_fail_eol fn_script_log_warn "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : FAIL" # Monitor will try gamedig (if supported) for first 30s then gsquery before restarting. # gsquery will fail if longer than 60s if [ "${totalseconds}" -ge "59" ]; then # Monitor will FAIL if over 60s and trigger gane server reboot. - fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}" fn_print_fail_eol_nl fn_script_log_warn "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : FAIL" # Send alert if enabled. diff --git a/lgsm/modules/command_postdetails.sh b/lgsm/modules/command_postdetails.sh index 6626d51a7..f9e93be4a 100644 --- a/lgsm/modules/command_postdetails.sh +++ b/lgsm/modules/command_postdetails.sh @@ -6,20 +6,20 @@ # Description: Strips sensitive information out of Details output. commandname="POST-DETAILS" -commandaction="Posting details" +commandaction="Post Details" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -posttarget="https://termbin.com" - -# source all of the modules defined in the details command. -info_messages.sh - fn_bad_postdetailslog() { fn_print_fail_nl "Unable to create temporary file ${postdetailslog}." core_exit.sh } +fn_print_header + +# source all of the modules defined in the details command. +info_messages.sh + # Remove any existing postdetails.log file. if [ -f "${postdetailslog}" ]; then rm -f "${postdetailslog:?}" @@ -68,7 +68,7 @@ pdurl="${link}" if [ "${firstcommandname}" == "POST-DETAILS" ]; then echo -e "" echo -e "Please share the following url for support: " - echo -e "${pdurl}" + echo -e "${italic}${pdurl}${default}" fi fn_script_log_info "${pdurl}" alerturl="${pdurl}" diff --git a/lgsm/modules/command_send.sh b/lgsm/modules/command_send.sh index e31452707..de021599d 100644 --- a/lgsm/modules/command_send.sh +++ b/lgsm/modules/command_send.sh @@ -26,8 +26,8 @@ if [ "${status}" != "0" ]; then fi echo "" fn_print_dots "Sending command to console: \"${commandtosend}\"" - tmux -L "${socketname}" send-keys -t "${sessionname}" "${commandtosend}" ENTER fn_print_ok_nl "Sending command to console: \"${commandtosend}\"" + tmux -L "${socketname}" send-keys -t "${sessionname}" "${commandtosend}" ENTER fn_script_log_pass "Command \"${commandtosend}\" sent to console" else fn_print_error_nl "Server not running" diff --git a/lgsm/modules/command_skeleton.sh b/lgsm/modules/command_skeleton.sh index ca32610e9..b9f51205a 100644 --- a/lgsm/modules/command_skeleton.sh +++ b/lgsm/modules/command_skeleton.sh @@ -16,7 +16,7 @@ check.sh # Find all directorys and create them in the skel directory find "${rootdir}" -type d -not \( -path ./skel -prune \) | cpio -pdvm skel 2> /dev/null exitcode=$? -if [ "${exitcode}" != 0 ]; then +if [ "${exitcode}" -ne 0 ]; then fn_print_fail_nl "Creating skeleton directory" fn_script_log_fail "Creating skeleton directory" else diff --git a/lgsm/modules/command_sponsor.sh b/lgsm/modules/command_sponsor.sh index e7aeeda95..1915aa328 100755 --- a/lgsm/modules/command_sponsor.sh +++ b/lgsm/modules/command_sponsor.sh @@ -11,7 +11,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_print_ascii_logo -echo -e "${lightyellow}Support LinuxGSM${default}" +echo -e "${bold}${lightyellow}Support LinuxGSM${default}" fn_messages_separator echo -e "" echo -e "Been using LinuxGSM?" diff --git a/lgsm/modules/command_start.sh b/lgsm/modules/command_start.sh index c2be7ed2f..a4e07b44b 100644 --- a/lgsm/modules/command_start.sh +++ b/lgsm/modules/command_start.sh @@ -127,12 +127,12 @@ fn_start_tmux() { echo -e "" echo -e " usermod -G tty $(whoami)" echo -e "" - echo -e "https://linuxgsm.com/tmux-op-perm" + echo -e "${italic}https://linuxgsm.com/tmux-op-perm" fn_script_log_info "https://linuxgsm.com/tmux-op-perm" else echo -e "No known fix currently. Please log an issue." fn_script_log_info "No known fix currently. Please log an issue." - echo -e "https://linuxgsm.com/support" + echo -e "${italic}https://linuxgsm.com/support" fn_script_log_info "https://linuxgsm.com/support" fi fi @@ -176,7 +176,7 @@ check.sh # If the server already started dont start again. if [ "${status}" != "0" ]; then fn_print_dots "${servername}" - fn_print_info_nl "${servername} is already running" + fn_print_skip_nl "${servername} is already running" fn_script_log_error "${servername} is already running" if [ -z "${exitbypass}" ]; then # Remove starting lockfile when command ends. diff --git a/lgsm/modules/command_stop.sh b/lgsm/modules/command_stop.sh index 84f5998cd..f1edc3544 100644 --- a/lgsm/modules/command_stop.sh +++ b/lgsm/modules/command_stop.sh @@ -20,7 +20,7 @@ fn_stop_graceful_ctrlc() { for seconds in {1..30}; do check_status.sh if [ "${status}" == "0" ]; then - fn_print_ok "Graceful: CTRL+c: ${seconds}: " + fn_print_ok "Graceful: CTRL+c: ${seconds}" fn_print_ok_eol_nl fn_script_log_pass "Graceful: CTRL+c: OK: ${seconds} seconds" if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then @@ -52,7 +52,7 @@ fn_stop_graceful_cmd() { for ((seconds = 1; seconds <= ${2}; seconds++)); do check_status.sh if [ "${status}" == "0" ]; then - fn_print_ok "Graceful: sending \"${1}\": ${seconds}: " + fn_print_ok "Graceful: sending \"${1}\": ${seconds}" fn_print_ok_eol_nl fn_script_log_pass "Graceful: sending \"${1}\": OK: ${seconds} seconds" if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then @@ -85,7 +85,7 @@ fn_stop_graceful_goldsrc() { fn_sleep_time_1 fn_print_dots "Graceful: sending \"quit\": ${seconds}" done - fn_print_ok "Graceful: sending \"quit\": ${seconds}: " + fn_print_ok "Graceful: sending \"quit\": ${seconds}" fn_print_ok_eol_nl fn_script_log_pass "Graceful: sending \"quit\": OK: ${seconds} seconds" if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then @@ -297,7 +297,7 @@ fn_stop_graceful_avorion() { for seconds in {1..30}; do check_status.sh if [ "${status}" == "0" ]; then - fn_print_ok "Graceful: /save /stop: ${seconds}: " + fn_print_ok "Graceful: /save /stop: ${seconds}" fn_print_ok_eol_nl fn_script_log_pass "Graceful: /save /stop: OK: ${seconds} seconds" if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then @@ -370,7 +370,7 @@ fn_stop_tmux() { # Checks if the server is already stopped. fn_stop_pre_check() { if [ "${status}" == "0" ]; then - fn_print_info_nl "${servername} is already stopped" + fn_print_skip_nl "${servername} is already stopped" fn_script_log_info "${servername} is already stopped" else # Select graceful shutdown. diff --git a/lgsm/modules/command_ts3_server_pass.sh b/lgsm/modules/command_ts3_server_pass.sh index 807d025b7..f5fad684e 100644 --- a/lgsm/modules/command_ts3_server_pass.sh +++ b/lgsm/modules/command_ts3_server_pass.sh @@ -6,7 +6,7 @@ # Description: Changes TS3 serveradmin password. commandname="CHANGE-PASSWORD" -commandaction="Changing password" +commandaction="Changing Password" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set diff --git a/lgsm/modules/command_update_linuxgsm.sh b/lgsm/modules/command_update_linuxgsm.sh index eb4226ab8..3299be509 100644 --- a/lgsm/modules/command_update_linuxgsm.sh +++ b/lgsm/modules/command_update_linuxgsm.sh @@ -27,10 +27,11 @@ fn_script_log_info "Selecting repo" # Select remotereponame curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null - -if [ $? != "0" ]; then - curl curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null - if [ $? != "0" ]; then +exitcode=$? +if [ "${exitcode}" -ne "0" ]; then + curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null + exitcode=$? + if [ "${exitcode}" -ne "0" ]; then fn_print_fail_nl "Selecting repo: Unable to to access GitHub or Bitbucket repositories" fn_script_log_fail "Selecting repo: Unable to to access GitHub or Bitbucket repositories" core_exit.sh @@ -44,16 +45,17 @@ else fi # Check linuxsm.sh -echo -en "checking ${remotereponame} linuxgsm.sh...\c" +echo -en "checking ${remotereponame} script [ ${italic}linuxgsm.sh${default} ]\c" if [ "${remotereponame}" == "GitHub" ]; then curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null else curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null fi -if [ $? != "0" ]; then +exitcode=$? +if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Checking ${remotereponame} linuxgsm.sh" - fn_script_log_fail "Curl returned error: $?" + fn_script_log_fail "Curl returned error: ${exitcode}" core_exit.sh fi @@ -65,41 +67,42 @@ fi if [ "${tmp_script_diff}" != "" ]; then fn_print_update_eol_nl - fn_script_log_update "Checking ${remotereponame} linuxgsm.sh" + fn_script_log "Checking ${remotereponame} script linuxgsm.sh" rm -f "${tmpdir:?}/linuxgsm.sh" fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "nochmodx" "norun" "noforcedl" "nohash" else - fn_print_ok_eol_nl - fn_script_log_pass "Checking ${remotereponame} linuxgsm.sh" + fn_print_skip_eol_nl + fn_script_log_pass "Checking ${remotereponame} script linuxgsm.sh" fi # Check gameserver.sh # Compare gameserver.sh against linuxgsm.sh in the tmp dir. # Ignoring server specific vars. -echo -en "checking ${selfname}...\c" +echo -en "checking script [ ${italic}${selfname}${default} ]\c" fn_script_log_info "Checking ${selfname}" script_diff=$(diff <(sed '\/shortname/d;\/gameservername/d;\/gamename/d;\/githubuser/d;\/githubrepo/d;\/githubbranch/d' "${tmpdir}/linuxgsm.sh") <(sed '\/shortname/d;\/gameservername/d;\/gamename/d;\/githubuser/d;\/githubrepo/d;\/githubbranch/d' "${rootdir}/${selfname}")) if [ "${script_diff}" != "" ]; then fn_print_update_eol_nl - fn_script_log_update "Checking ${selfname}" - echo -en "backup ${selfname}...\c" - fn_script_log_info "Backup ${selfname}" + fn_script_log "Checking script ${selfname}" + echo -en "backup ${selfname}\c" + fn_script_log_info "Backup script ${selfname}" if [ ! -d "${backupdir}/script" ]; then mkdir -p "${backupdir}/script" fi cp "${rootdir}/${selfname}" "${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak" - if [ $? != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Backup ${selfname}" core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "Backup ${selfname}" - echo -e "backup location ${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak" + fn_script_log_pass "Backup script${selfname}" + echo -e "backup location [ ${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak ]" fn_script_log_pass "Backup location ${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak" fi - echo -en "copying ${selfname}...\c" + echo -en "copying ${selfname}" fn_script_log_info "Copying ${selfname}" cp "${tmpdir}/linuxgsm.sh" "${rootdir}/${selfname}" sed -i "s+shortname=\"core\"+shortname=\"${shortname}\"+g" "${rootdir}/${selfname}" @@ -109,7 +112,8 @@ if [ "${script_diff}" != "" ]; then sed -i "s+githubrepo=\"LinuxGSM\"+githubrepo=\"${githubrepo}\"+g" "${rootdir}/${selfname}" sed -i "s+githubbranch=\"master\"+githubbranch=\"${githubbranch}\"+g" "${rootdir}/${selfname}" - if [ $? != "0" ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "copying ${selfname}" core_exit.sh @@ -118,22 +122,23 @@ if [ "${script_diff}" != "" ]; then fn_script_log_pass "copying ${selfname}" fi else - fn_print_ok_eol_nl + fn_print_skip_eol_nl fn_script_log_info "Checking ${selfname}" fi # Check _default.cfg. -echo -en "checking ${remotereponame} config _default.cfg...\c" +echo -en "checking ${remotereponame} config [ ${italic}_default.cfg${default} ]\c" fn_script_log_info "Checking ${remotereponame} config _default.cfg" if [ "${remotereponame}" == "GitHub" ]; then curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null else curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null fi -if [ $? != "0" ]; then +exitcode=$? +if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Checking ${remotereponame} config _default.cfg" - fn_script_log_fail "Curl returned error: $?" + fn_script_log_fail "Curl returned error: ${exitcode}" core_exit.sh fi @@ -145,29 +150,30 @@ fi if [ "${config_file_diff}" != "" ]; then fn_print_update_eol_nl - fn_script_log_update "Checking ${remotereponame} config _default.cfg" + fn_script_log "Checking ${remotereponame} config _default.cfg" rm -f "${configdirdefault:?}/config-lgsm/${gameservername:?}/_default.cfg" fn_fetch_file_github "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "nochmodx" "norun" "noforce" "nohash" alert="config" alert.sh else - fn_print_ok_eol_nl + fn_print_skip_eol_nl fn_script_log_pass "Checking ${remotereponame} config _default.cfg" fi # Check distro csv. ${datadir}/${distroid}-${distroversioncsv}.csv if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then - echo -en "checking ${remotereponame} config ${distroid}-${distroversioncsv}.csv...\c" + echo -en "checking ${remotereponame} config [ ${italic}${distroid}-${distroversioncsv}.csv${default} ]\c" fn_script_log_info "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" if [ "${remotereponame}" == "GitHub" ]; then curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null else curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null fi - if [ $? != "0" ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" - fn_script_log_fail "Curl returned error: $?" + fn_script_log_fail "Curl returned error: ${exitcode}" core_exit.sh fi @@ -179,11 +185,11 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then if [ "${config_file_diff}" != "" ]; then fn_print_update_eol_nl - fn_script_log_update "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" + fn_script_log "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" rm -f "${datadir:?}/${distroid}-${distroversioncsv}.csv" fn_fetch_file_github "${datadir}" "${distroid}-${distroversioncsv}.csv" "${datadir}" "nochmodx" "norun" "noforce" "nohash" else - fn_print_ok_eol_nl + fn_print_skip_eol_nl fn_script_log_pass "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" fi fi @@ -195,14 +201,15 @@ if [ -n "${modulesdir}" ]; then 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 ${modulefile}...\c" + echo -en "checking ${remotereponame} module [ ${italic}${modulefile}${default} ]\c" github_file_url_dir="lgsm/modules" if [ "${remotereponame}" == "GitHub" ]; then curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null else curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null fi - if [ $? != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_error_eol_nl fn_script_log_error "Checking ${remotereponame} module ${modulefile}" echo -en "removing module ${modulefile}...\c" @@ -225,11 +232,11 @@ if [ -n "${modulesdir}" ]; then # results if [ "${module_file_diff}" != "" ]; then fn_print_update_eol_nl - fn_script_log_update "Checking ${remotereponame} module ${modulefile}" + fn_script_log "Checking ${remotereponame} module ${modulefile}" rm -rf "${modulesdir:?}/${modulefile}" fn_update_module else - fn_print_ok_eol_nl + fn_print_skip_eol_nl fn_script_log_pass "Checking ${remotereponame} module ${modulefile}" fi fi diff --git a/lgsm/modules/command_validate.sh b/lgsm/modules/command_validate.sh index e35749924..30c20e96e 100644 --- a/lgsm/modules/command_validate.sh +++ b/lgsm/modules/command_validate.sh @@ -11,18 +11,18 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_validate() { - fn_print_warn "Validate might overwrite some customised files" + fn_print_warn ": SteamCMD: Validate might overwrite some customised files" fn_script_log_warn "${commandaction} server: Validate might overwrite some customised files" totalseconds=3 for seconds in {3..1}; do - fn_print_warn "Validate might overwrite some customised files: ${totalseconds}" + fn_print_warn ": SteamCMD: Validate might overwrite some customised files: ${totalseconds}" totalseconds=$((totalseconds - 1)) fn_sleep_time_1 if [ "${seconds}" == "0" ]; then break fi done - fn_print_warn_nl "Validate might overwrite some customised files" + fn_print_warn_nl ": SteamCMD: Validate might overwrite some customised files" date '+%s' > "${lockdir:?}/update.lock" fn_dl_steamcmd } diff --git a/lgsm/modules/command_wipe.sh b/lgsm/modules/command_wipe.sh index daf9270e6..21023d17d 100644 --- a/lgsm/modules/command_wipe.sh +++ b/lgsm/modules/command_wipe.sh @@ -13,7 +13,7 @@ fn_firstcommand_set # Provides an exit code upon error. fn_wipe_exit_code() { exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl core_exit.sh else @@ -29,14 +29,14 @@ fn_wipe_files() { # Remove Map files if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ]; then - echo -en "removing .map file(s)..." + fn_print "removing .map file(s)..." fn_script_log_info "Removing *.map file(s)" fn_sleep_time find "${serveridentitydir:?}" -type f -name "*.map" -printf "%f\n" >> "${lgsmlog}" find "${serveridentitydir:?}" -type f -name "*.map" -delete | tee -a "${lgsmlog}" fn_wipe_exit_code else - echo -e "no .map file(s) to remove" + fn_print_nl "no .map file(s) to remove" fn_sleep_time fn_script_log_pass "no .map file(s) to remove" fi @@ -44,14 +44,14 @@ fn_wipe_files() { # Remove Save files. if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then if [ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ]; then - echo -en "removing .sav file(s)..." + fn_print "removing .sav file(s)..." fn_script_log_info "Removing .sav file(s)" fn_sleep_time find "${serveridentitydir:?}" -type f -name "*.sav*" -printf "%f\n" >> "${lgsmlog}" find "${serveridentitydir:?}" -type f -name "*.sav*" -delete fn_wipe_exit_code else - echo -e "no .sav file(s) to remove" + fn_print_nl "no .sav file(s) to remove" fn_script_log_pass "no .sav file(s) to remove" fn_sleep_time fi @@ -60,14 +60,14 @@ fn_wipe_files() { # Excluding player.tokens.db for Rust+. if [ -n "${serverwipe}" ]; then if [ -n "$(find "${serveridentitydir}" -type f ! -name 'player.tokens.db' -name "*.db")" ]; then - echo -en "removing .db file(s)..." + fn_print "removing .db file(s)..." fn_script_log_info "Removing .db file(s)" fn_sleep_time find "${serveridentitydir:?}" -type f ! -name 'player.tokens.db' -name "*.db" -printf "%f\n" >> "${lgsmlog}" find "${serveridentitydir:?}" -type f ! -name 'player.tokens.db' -name "*.db" -delete fn_wipe_exit_code else - echo -e "no .db file(s) to remove" + fn_print_nl "no .db file(s) to remove" fn_sleep_time fn_script_log_pass "no .db file(s) to remove" fi @@ -104,13 +104,13 @@ fn_full_wipe_warning() { fn_print_warn_nl "Server wipe will reset the map data and remove blueprint data" } -# Will change the seed if the seed is not defined by the user. +# If the seed is not defined by the user, generate a seed file. fn_wipe_random_seed() { if [ -f "${datadir}/${selfname}-seed.txt" ] && [ -n "${randomseed}" ]; then shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" seed=$(cat "${datadir}/${selfname}-seed.txt") randomseed=1 - echo -en "generating new random seed (${cyan}${seed}${default})..." + fn_print "generating new random seed (${cyan}${seed}${default})..." fn_script_log_pass "Generating new random seed (${cyan}${seed}${default})" fn_sleep_time fn_print_ok_eol_nl @@ -120,21 +120,21 @@ fn_wipe_random_seed() { # A summary of what wipe is going to do. fn_wipe_details() { fn_print_information_nl "Wipe does not remove Rust+ data." - echo -en "* Wipe map data: " + fn_print "* Wipe map data " if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then fn_print_yes_eol_nl else fn_print_no_eol_nl fi - echo -en "* Wipe blueprint data: " + fn_print "* Wipe blueprint data " if [ -n "${serverwipe}" ]; then fn_print_yes_eol_nl else fn_print_no_eol_nl fi - echo -en "* Change Procedural Map seed: " + fn_print "* Change Procedural Map seed " if [ -n "${randomseed}" ]; then fn_print_yes_eol_nl else @@ -142,10 +142,9 @@ fn_wipe_details() { fi } -fn_print_dots "" check.sh fix_rust.sh - +fn_print_dots "" # Check if there is something to wipe. if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ] || [ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ] && [ -n "$(find "${serveridentitydir}" -type f ! -name 'player.tokens.db' -name "*.db")" ]; then if [ -n "${serverwipe}" ]; then @@ -165,7 +164,7 @@ if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ] || [ -n "$(find fn_firstcommand_reset fn_wipe_files fn_wipe_random_seed - fn_print_complete_nl "${wipetype}" + fn_print_success_nl "${wipetype}" fn_script_log_pass "${wipetype}" alert="wipe" alert.sh @@ -175,7 +174,7 @@ if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ] || [ -n "$(find else fn_wipe_files fn_wipe_random_seed - fn_print_complete_nl "${wipetype}" + fn_print_success_nl "${wipetype}" fn_script_log_pass "${wipetype}" alert="wipe" alert.sh diff --git a/lgsm/modules/compress_unreal2_maps.sh b/lgsm/modules/compress_unreal2_maps.sh index 4469aca40..58824cbc7 100644 --- a/lgsm/modules/compress_unreal2_maps.sh +++ b/lgsm/modules/compress_unreal2_maps.sh @@ -6,7 +6,7 @@ # Description: Compresses unreal maps. commandname="MAP-COMPRESSOR" -commandaction="Compressing maps" +commandaction="Compressing Maps" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set diff --git a/lgsm/modules/compress_ut99_maps.sh b/lgsm/modules/compress_ut99_maps.sh index 23a93b3b7..885c32d9a 100644 --- a/lgsm/modules/compress_ut99_maps.sh +++ b/lgsm/modules/compress_ut99_maps.sh @@ -6,7 +6,7 @@ # Description: Compresses unreal maps. commandname="MAP-COMPRESSOR" -commandaction="Compressing maps" +commandaction="Compressing Maps" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh index 68d0cf576..72d50d69a 100644 --- a/lgsm/modules/core_dl.sh +++ b/lgsm/modules/core_dl.sh @@ -20,6 +20,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_dl_steamcmd() { + remotelocation="SteamCMD" fn_print_start_nl "${remotelocation}" fn_script_log_info "${commandaction} ${selfname}: ${remotelocation}" if [ -n "${branch}" ]; then @@ -53,7 +54,7 @@ fn_dl_steamcmd() { rm -f "${steamcmdlog:?}" fi counter=0 - while [ "${counter}" == "0" ] || [ "${exitcode}" != "0" ]; do + while [ "${counter}" -eq 0 ] || [ "${exitcode}" -ne 0 ]; do counter=$((counter + 1)) # Select SteamCMD parameters # If GoldSrc (appid 90) servers. GoldSrc (appid 90) require extra commands. @@ -129,14 +130,14 @@ fn_dl_steamcmd() { fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Missing update files" else fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured" - echo -en "Please provide content log to LinuxGSM developers https://linuxgsm.com/steamcmd-error" + fn_print_nl "Please provide content log to LinuxGSM developers https://linuxgsm.com/steamcmd-error" fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured" fi - elif [ "${exitcode}" != 0 ]; then + elif [ "${exitcode}" -ne 0 ]; then fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Exit code: ${exitcode}" fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Exit code: ${exitcode}" else - fn_print_complete_nl "${commandaction} ${selfname}: ${remotelocation}" + fn_print_success_nl "${commandaction} ${selfname}: ${remotelocation}" fn_script_log_pass "${commandaction} ${selfname}: ${remotelocation}" fi @@ -150,16 +151,16 @@ fn_dl_steamcmd() { # Emptys contents of the LinuxGSM tmpdir. fn_clear_tmp() { - echo -en "clearing LinuxGSM tmp directory..." + echo -en "clearing tmp directory [ ${italic}${tmpdir}${default} ]" if [ -d "${tmpdir}" ]; then rm -rf "${tmpdir:?}/"* - local exitcode=$? - if [ "${exitcode}" != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_error_eol_nl - fn_script_log_error "clearing LinuxGSM tmp directory" + fn_script_log_error "clearing tmp directory ${tmpdir}" else fn_print_ok_eol_nl - fn_script_log_pass "clearing LinuxGSM tmp directory" + fn_script_log_pass "clearing tmp directory ${tmpdir}" fi fi } @@ -259,8 +260,8 @@ fn_dl_extract() { extractcmd=$(unzip -qo -d "${extractdest}" "${local_filedir}/${local_filename}") fi fi - local exitcode=$? - if [ "${exitcode}" != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Extracting ${local_filename}" if [ -f "${lgsmlog}" ]; then @@ -277,11 +278,11 @@ fn_dl_extract() { # Trap to remove file download if canceled before completed. fn_fetch_trap() { echo -e "" - echo -en "downloading ${local_filename}..." + echo -en "downloading ${local_filename}" fn_print_canceled_eol_nl fn_script_log_info "Downloading ${local_filename}...CANCELED" rm -f "${local_filedir:?}/${local_filename}" - echo -en "downloading ${local_filename}..." + echo -en "downloading ${local_filename}" fn_print_removed_eol_nl fn_script_log_info "Downloading ${local_filename}...REMOVED" core_exit.sh @@ -313,12 +314,12 @@ fn_check_file() { fileurl_name="${remote_fileurl_backup_name}" fi counter=$((counter + 1)) - echo -en "checking ${fileurl_name} ${remote_filename}...\c" + echo -e "checking ${fileurl_name} ${remote_filename}\c" curlcmd=$(curl --output /dev/null --silent --head --fail "${fileurl}" 2>&1) - local exitcode=$? + exitcode=$? # On first try will error. On second try will fail. - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then if [ ${counter} -ge 2 ]; then fn_print_fail_eol_nl if [ -f "${lgsmlog}" ]; then @@ -379,6 +380,7 @@ fn_fetch_file() { counter=1 remote_fileurls_array=(remote_fileurl) fi + for remote_fileurl_array in "${remote_fileurls_array[@]}"; do if [ "${remote_fileurl_array}" == "remote_fileurl" ]; then fileurl="${remote_fileurl}" @@ -399,15 +401,15 @@ fn_fetch_file() { local exitcode="" large_files=("bz2" "gz" "zip" "jar" "xz") if grep -qE "(^|\s)${local_filename##*.}(\s|$)" <<< "${large_files[@]}"; then - echo -en "downloading ${local_filename}..." + echo -e "downloading file [ ${italic}${local_filename}${default} ]" fn_sleep_time - echo -en "\033[1K" "${curlcmd[@]}" --progress-bar "${fileurl}" 2>&1 - exitcode="$?" + exitcode=$? + echo -en "downloading file [ ${italic}${local_filename}${default} ]" else - echo -en "fetching ${fileurl_name} ${local_filename}...\c" + echo -en "fetching ${fileurl_name} [ ${italic}${local_filename}${default} ]\c" "${curlcmd[@]}" --silent --show-error "${fileurl}" 2>&1 - exitcode="$?" + exitcode=$? fi # Download will fail if downloads a html file. @@ -419,7 +421,7 @@ fn_fetch_file() { fi # On first try will error. On second try will fail. - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then if [ ${counter} -ge 2 ]; then fn_print_fail_eol_nl if [ -f "${lgsmlog}" ]; then diff --git a/lgsm/modules/core_exit.sh b/lgsm/modules/core_exit.sh index fd7645462..5f55dfcd1 100644 --- a/lgsm/modules/core_exit.sh +++ b/lgsm/modules/core_exit.sh @@ -27,14 +27,14 @@ fi if [ "${exitbypass}" ]; then unset exitbypass -elif [ "${exitcode}" != "0" ]; then +elif [ "${exitcode}" -ne 0 ]; then # List LinuxGSM version in logs fn_script_log_info "LinuxGSM version: ${version}" - if [ "${exitcode}" == "1" ]; then + if [ "${exitcode}" -eq 1 ]; then fn_script_log_fail "${moduleselfname} exiting with code: ${exitcode}" - elif [ "${exitcode}" == "2" ]; then + elif [ "${exitcode}" -eq 2 ]; then fn_script_log_error "${moduleselfname} exiting with code: ${exitcode}" - elif [ "${exitcode}" == "3" ]; then + elif [ "${exitcode}" -eq 3 ]; then fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}" else # if exit code is not set assume error. @@ -45,7 +45,7 @@ elif [ "${exitcode}" != "0" ]; then # remove trap. trap - INT exit "${exitcode}" -elif [ "${exitcode}" ] && [ "${exitcode}" == "0" ]; then +elif [ "${exitcode}" ] && [ "${exitcode}" -eq 0 ]; then # List LinuxGSM version in logs fn_script_log_info "LinuxGSM version: ${version}" fn_script_log_pass "${moduleselfname} exiting with code: ${exitcode}" diff --git a/lgsm/modules/core_getopt.sh b/lgsm/modules/core_getopt.sh index 688dcdc9c..9a5704663 100644 --- a/lgsm/modules/core_getopt.sh +++ b/lgsm/modules/core_getopt.sh @@ -56,6 +56,7 @@ cmd_dev_detect_deps=("dd;detect-deps" "command_dev_detect_deps.sh" "Detect requi 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_ui=("ui;ui" "command_dev_ui.sh" "Assist with UI development.") cmd_dev_clear_modules=("cm;clear-modules" "command_dev_clear_modules.sh" "Delete the contents of the modules dir.") ### Set specific opt here. @@ -147,7 +148,7 @@ currentopt+=("${cmd_install[@]}" "${cmd_auto_install[@]}") ## Developer commands. currentopt+=("${cmd_dev_debug[@]}") if [ -f ".dev-debug" ]; then - currentopt+=("${cmd_dev_parse_game_details[@]}" "${cmd_dev_parse_distro_details[@]}" "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_clear_modules[@]}") + currentopt+=("${cmd_dev_parse_game_details[@]}" "${cmd_dev_parse_distro_details[@]}" "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_ui[@]}" "${cmd_dev_clear_modules[@]}") fi ## Sponsor. @@ -165,19 +166,19 @@ done # Shows LinuxGSM usage. fn_opt_usage() { - echo -e "Usage: $0 [option]" - echo -e "" - echo -e "LinuxGSM - ${gamename} - Version ${version}" - echo -e "https://linuxgsm.com/${gameservername}" - echo -e "" - echo -e "${lightyellow}Commands${default}" + fn_print_nl "Usage: $0 [option]" + fn_print_nl "" + fn_print_nl "LinuxGSM - ${gamename} - Version ${version}" + fn_print_nl "https://linuxgsm.com/${gameservername}" + fn_print_nl "" + fn_print_nl "${bold}${lightyellow}Commands${default}" # Display available commands. index="0" { for ((index = "0"; index < ${#currentopt[@]}; index += 3)); do # Hide developer commands. if [ "${currentopt[index + 2]}" != "DEVCOMMAND" ]; then - echo -e "${cyan}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t| ${currentopt[index + 2]}" + fn_print_nl "${cyan}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t| ${currentopt[index + 2]}" fi done } | column -s $'\t' -t diff --git a/lgsm/modules/core_messages.sh b/lgsm/modules/core_messages.sh index 80ef293d8..37c2e98b5 100644 --- a/lgsm/modules/core_messages.sh +++ b/lgsm/modules/core_messages.sh @@ -34,6 +34,14 @@ fn_ansi_loader() { # erase to end of line. creeol+="\033[K" fi + # carriage return & erase to end of line. + creeol="\r\033[K" + + bold="\e[1m" + dim="\e[2m" + italic="\e[3m" + underline="\e[4m" + reverse="\e[7m" } fn_sleep_time() { @@ -71,216 +79,141 @@ fn_script_log() { ## Feb 28 14:56:58 ut99-server: Monitor: PASS: fn_script_log_pass() { - if [ -d "${lgsmlogdir}" ]; then - - if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: PASS: ${1}" >> "${lgsmlog}" - else - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: PASS: ${1}" >> "${lgsmlog}" - fi - fi + fn_script_log "PASS: ${1}" exitcode=0 } ## Feb 28 14:56:58 ut99-server: Monitor: FATAL: fn_script_log_fail() { - if [ -d "${lgsmlogdir}" ]; then - if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: FATAL: ${1}" >> "${lgsmlog}" - else - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: FATAL: ${1}" >> "${lgsmlog}" - fi - fi + fn_script_log "FAIL: ${1}" exitcode=1 } ## Feb 28 14:56:58 ut99-server: Monitor: ERROR: fn_script_log_error() { - if [ -d "${lgsmlogdir}" ]; then - if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: ERROR: ${1}" >> "${lgsmlog}" - else - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ERROR: ${1}" >> "${lgsmlog}" - fi - fi + fn_script_log "ERROR: ${1}" exitcode=2 } ## Feb 28 14:56:58 ut99-server: Monitor: WARN: fn_script_log_warn() { - if [ -d "${lgsmlogdir}" ]; then - if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: WARN: ${1}" >> "${lgsmlog}" - else - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: WARN: ${1}" >> "${lgsmlog}" - fi - fi + fn_script_log "WARN: ${1}" exitcode=3 } ## Feb 28 14:56:58 ut99-server: Monitor: INFO: fn_script_log_info() { - if [ -d "${lgsmlogdir}" ]; then - if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: INFO: ${1}" >> "${lgsmlog}" - else - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: INFO: ${1}" >> "${lgsmlog}" - fi - fi -} - -## Feb 28 14:56:58 ut99-server: Monitor: UPDATE: -fn_script_log_update() { - if [ -d "${lgsmlogdir}" ]; then - if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: UPDATE: ${1}" >> "${lgsmlog}" - else - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: UPDATE: ${1}" >> "${lgsmlog}" - fi - fi + fn_script_log "INFO: ${1}" } # On-Screen - Automated functions ################################## -# [ .... ] -fn_print_dots() { +fn_print() { + echo -en "$*${default}" +} + +fn_print_nl() { + echo -e "$*${default}" +} + +# Helper function to print messages with a specific format and color +fn_print_message() { + local type="$1" + local color="$2" + local message="$3" if [ "${commandaction}" ]; then - echo -en "${creeol}[ .... ] ${commandaction} ${selfname}: $*" + echo -en "${bold}${creeol}[${color} ${type} ${default}]${default} ${commandaction} ${selfname}: ${message}${default}" else - echo -en "${creeol}[ .... ] $*" + echo -en "${bold}${cree}[${color} ${type} ${default}]${default} ${message}${default}" fi - fn_sleep_time_05 + fn_sleep_time } -fn_print_dots_nl() { +fn_print_message_nl() { + local type="$1" + local color="$2" + local message="$3" if [ "${commandaction}" ]; then - echo -e "${creeol}[ .... ] ${commandaction} ${selfname}: $*" + echo -e "${bold}${creeol}[${color} ${type} ${default}]${default} ${commandaction} ${selfname}: ${message}${default}" else - echo -e "${creeol}[ .... ] $*" + echo -e "${bold}${creeol}[${color} ${type} ${default}]${default} ${message}${default}" fi + fn_sleep_time +} + +# [ .... ] +fn_print_dots() { + fn_print_message "...." "${default}" "$*" + fn_sleep_time_05 +} + +fn_print_dots_nl() { + fn_print_message_nl "...." "${default}" "$*" fn_sleep_time_05 - echo -en "\n" } # [ OK ] fn_print_ok() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${green} OK ${default}] $*" - fi - fn_sleep_time + fn_print_message " OK " "${green}" "$*" } fn_print_ok_nl() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${green} OK ${default}] $*" - fi - fn_sleep_time - echo -en "\n" + fn_print_message_nl " OK " "${green}" "$*" } # [ FAIL ] fn_print_fail() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${red} FAIL ${default}] $*" - fi - fn_sleep_time + fn_print_message "FAIL" "${red}" "$*" } fn_print_fail_nl() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${red} FAIL ${default}] $*" - fi - fn_sleep_time - echo -en "\n" + fn_print_message_nl "FAIL" "${red}" "$*" } # [ ERROR ] fn_print_error() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${red} ERROR ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${red} ERROR ${default}] $*" - fi - fn_sleep_time + fn_print_message "ERROR" "${red}" "$*" } fn_print_error_nl() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${red} ERROR ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${red} ERROR ${default}] $*" - fi - fn_sleep_time - echo -en "\n" + fn_print_message_nl "ERROR" "${red}" "$*" } # [ WARN ] fn_print_warn() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${lightyellow} WARN ${default}] $*" - fi - fn_sleep_time + fn_print_message "WARN" "${lightyellow}" "$*" } fn_print_warn_nl() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${lightyellow} WARN ${default}] $*" - fi - fn_sleep_time - echo -en "\n" + fn_print_message_nl "WARN" "${lightyellow}" "$*" } # [ INFO ] fn_print_info() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${cyan} INFO ${default}] $*" - fi - fn_sleep_time + fn_print_message "INFO" "${cyan}" "$*" } fn_print_info_nl() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${cyan} INFO ${default}] $*" - fi - fn_sleep_time - echo -en "\n" + fn_print_message_nl "INFO" "${cyan}" "$*" +} + +# [ SKIP ] +fn_print_skip() { + fn_print_message "SKIP" "${cyan}" "$*" +} + +fn_print_skip_nl() { + fn_print_message_nl "SKIP" "${cyan}" "$*" } # [ START ] fn_print_start() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${lightgreen} START ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${lightgreen} START ${default}] $*" - fi - fn_sleep_time + fn_print_message "START" "${lightgreen}" "$*" } fn_print_start_nl() { - if [ "${commandaction}" ]; then - echo -en "${creeol}[${lightgreen} START ${default}] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[${lightgreen} START ${default}] $*" - fi - fn_sleep_time - echo -en "\n" + fn_print_message_nl "START" "${lightgreen}" "$*" } # On-Screen - Interactive messages @@ -304,63 +237,75 @@ fn_print_header() { fn_messages_separator } -# Complete! -fn_print_complete() { - echo -en "${green}Complete!${default} $*" +# Success! +fn_print_success() { + echo -en "${green}Success!${default} $*${default}" fn_sleep_time } -fn_print_complete_nl() { - echo -e "${green}Complete!${default} $*" +fn_print_success_nl() { + echo -e "${green}Success!${default} $*${default}" fn_sleep_time } # Failure! fn_print_failure() { - echo -en "${red}Failure!${default} $*" + echo -en "${red}Failure!${default} $*${default}" fn_sleep_time } fn_print_failure_nl() { - echo -e "${red}Failure!${default} $*" + echo -e "${red}Failure!${default} $*${default}" fn_sleep_time } # Error! fn_print_error2() { - echo -en "${red}Error!${default} $*" + echo -en "${red}Error!${default} $*${default}" fn_sleep_time } fn_print_error2_nl() { - echo -e "${red}Error!${default} $*" + echo -e "${red}Error!${default} $*${default}" fn_sleep_time } # Warning! fn_print_warning() { - echo -en "${lightyellow}Warning!${default} $*" + echo -en "${lightyellow}Warning!${default} $*${default}" fn_sleep_time } fn_print_warning_nl() { - echo -e "${lightyellow}Warning!${default} $*" + echo -e "${lightyellow}Warning!${default} $*${default}" fn_sleep_time } # Information! fn_print_information() { - echo -en "${cyan}Information!${default} $*" + echo -en "${cyan}Information!${default} $*${default}" fn_sleep_time } fn_print_information_nl() { - echo -e "${cyan}Information!${default} $*" + echo -e "${cyan}Information!${default} $*${default}" + fn_sleep_time +} + +# Skip! +fn_print_skip2() { + echo -en "${cyan}Skip!${default} $*${default}" + fn_sleep_time +} + +fn_print_skip2_nl() { + echo -e "${cyan}Skip!${default} $*${default}" fn_sleep_time } # Y/N Prompt fn_prompt_yn() { + echo -e "" local prompt="$1" local initial="$2" @@ -400,155 +345,166 @@ fn_prompt_message() { # YES fn_print_yes_eol() { - echo -en "${cyan}YES${default}" + echo -en " ... ${cyan}YES${default}" fn_sleep_time } fn_print_yes_eol_nl() { - echo -e "${cyan}YES${default}" + echo -e " ... ${cyan}YES${default}" fn_sleep_time } # NO fn_print_no_eol() { - echo -en "${red}NO${default}" + echo -en " ... ${red}NO${default}" fn_sleep_time } fn_print_no_eol_nl() { - echo -e "${red}NO${default}" + echo -e " ... ${red}NO${default}" fn_sleep_time } # OK fn_print_ok_eol() { - echo -en "${green}OK${default}" + echo -en " ... ${green}OK${default}" fn_sleep_time } fn_print_ok_eol_nl() { - echo -e "${green}OK${default}" + echo -e " ... ${green}OK${default}" fn_sleep_time } # FAIL fn_print_fail_eol() { - echo -en "${red}FAIL${default}" + echo -en " ... ${red}FAIL${default}" fn_sleep_time } fn_print_fail_eol_nl() { - echo -e "${red}FAIL${default}" + echo -e " ... ${red}FAIL${default}" fn_sleep_time } # ERROR fn_print_error_eol() { - echo -en "${red}ERROR${default}" + echo -en " ... ${red}ERROR${default}" fn_sleep_time } fn_print_error_eol_nl() { - echo -e "${red}ERROR${default}" + echo -e " ... ${red}ERROR${default}" fn_sleep_time } # WAIT fn_print_wait_eol() { - echo -en "${cyan}WAIT${default}" + echo -en " ... ${cyan}WAIT${default}" fn_sleep_time } fn_print_wait_eol_nl() { - echo -e "${cyan}WAIT${default}" + echo -e " ... ${cyan}WAIT${default}" fn_sleep_time } # WARN fn_print_warn_eol() { - echo -en "${lightyellow}WARN${default}" + echo -en " ... ${lightyellow}WARN${default}" fn_sleep_time } fn_print_warn_eol_nl() { - echo -e "${lightyellow}WARN${default}" + echo -e " ... ${lightyellow}WARN${default}" fn_sleep_time } # INFO fn_print_info_eol() { - echo -en "${cyan}INFO${default}" + echo -en " ... ${cyan}INFO${default}" fn_sleep_time } fn_print_info_eol_nl() { - echo -e "${cyan}INFO${default}" + echo -e " ... ${cyan}INFO${default}" fn_sleep_time } # QUERYING fn_print_querying_eol() { - echo -en "${cyan}QUERYING${default}" + echo -en " ... ${cyan}QUERYING${default}" fn_sleep_time_1 } fn_print_querying_eol_nl() { - echo -e "${cyan}QUERYING${default}" + echo -e " ... ${cyan}QUERYING${default}" fn_sleep_time_1 } # CHECKING fn_print_checking_eol() { - echo -en "${cyan}CHECKING${default}" + echo -en " ... ${cyan}CHECKING${default}" fn_sleep_time_1 } fn_print_checking_eol_nl() { - echo -e "${cyan}CHECKING${default}" + echo -e " ... ${cyan}CHECKING${default}" fn_sleep_time_1 } # DELAY fn_print_delay_eol() { - echo -en "${green}DELAY${default}" + echo -en " ... ${green}DELAY${default}" fn_sleep_time_1 } fn_print_delay_eol_nl() { - echo -e "${green}DELAY${default}" + echo -e " ... ${green}DELAY${default}" fn_sleep_time_1 } # CANCELED fn_print_canceled_eol() { - echo -en "${lightyellow}CANCELED${default}" + echo -en " ... ${lightyellow}CANCELED${default}" fn_sleep_time_1 } fn_print_canceled_eol_nl() { - echo -e "${lightyellow}CANCELED${default}" + echo -e " ... ${lightyellow}CANCELED${default}" fn_sleep_time_1 } # REMOVED fn_print_removed_eol() { - echo -en "${red}REMOVED${default}" + echo -en " ... ${red}REMOVED${default}" fn_sleep_time_1 } fn_print_removed_eol_nl() { - echo -e "${red}REMOVED${default}" + echo -e " ... ${red}REMOVED${default}" fn_sleep_time_1 } # UPDATE fn_print_update_eol() { - echo -en "${cyan}UPDATE${default}" + echo -en " ... ${lightblue}UPDATE${default}" fn_sleep_time } fn_print_update_eol_nl() { - echo -e "${cyan}UPDATE${default}" + echo -e " ... ${lightblue}UPDATE${default}" + fn_sleep_time +} + +# SKIP +fn_print_skip_eol() { + echo -en " ... ${cyan}SKIP${default}" + fn_sleep_time +} + +fn_print_skip_eol_nl() { + echo -e " ... ${cyan}SKIP${default}" fn_sleep_time } diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index e4fa35b32..2371a550c 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -42,6 +42,11 @@ core_legacy.sh() { core_exit.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + echo "fn_fetch_module failed, using fn_bootstrap_fetch_module instead." + fn_bootstrap_fetch_module + fi } core_getopt.sh() { @@ -324,6 +329,11 @@ command_dev_detect_ldd.sh() { fn_fetch_module } +command_dev_ui.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + command_dev_query_raw.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh index e08c921dd..5ee14a742 100644 --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -23,7 +23,7 @@ fn_check_steamcmd_user() { # Checks if steamuser is setup. if [ "${steamuser}" == "username" ]; then fn_print_fail_nl "Steam login not set. Update steamuser in ${configdirserver}" - echo -e " * Change steamuser=\"username\" to a valid steam login." + fn_print_nl " * Change steamuser=\"username\" to a valid steam login." if [ -d "${lgsmlogdir}" ]; then fn_script_log_fail "Steam login not set. Update steamuser in ${configdirserver}" fi @@ -44,15 +44,16 @@ fn_check_steamcmd() { # Only install if steamcmd package is missing or steamcmd dir is missing. if [ ! -f "${steamcmddir}/steamcmd.sh" ] && [ -z "$(command -v steamcmd 2> /dev/null)" ]; then if [ "${commandname}" == "INSTALL" ]; then + fn_print_nl "install SteamCMD" fn_install_steamcmd else - fn_print_warn_nl "SteamCMD is missing" - fn_script_log_warn "SteamCMD is missing" + fn_print_warn_nl "SteamCMD is not installed" + fn_script_log_warn "SteamCMD is not installed" fn_install_steamcmd fi elif [ "${commandname}" == "INSTALL" ]; then - fn_print_information "SteamCMD is already installed..." - fn_print_ok_eol_nl + fn_print "install SteamCMD" + fn_print_skip_eol_nl fi } @@ -128,7 +129,7 @@ fn_check_steamcmd_clear() { if [ "$(command -v steamcmd 2> /dev/null)" ] && [ -d "${rootdir}/steamcmd" ]; then rm -rf "${steamcmddir:?}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "Removing ${rootdir}/steamcmd" else fn_script_log_pass "Removing ${rootdir}/steamcmd" @@ -213,18 +214,18 @@ fn_update_steamcmd_compare() { # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -n "${betapassword}" ]; then - echo -e "* Branch password: ${betapassword}" + fn_print_nl "* Branch password: ${betapassword}" fi - echo -e "https://steamdb.info/app/${appid}/" - echo -en "\n" + fn_print_nl "${italic}https://steamdb.info/app/${appid}/history" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" fn_script_log_info "Remote build: ${remotebuildversion}" @@ -263,18 +264,18 @@ fn_update_steamcmd_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -n "${betapassword}" ]; then - echo -e "* Branch password: ${betapassword}" + fn_print_nl "* Branch password: ${betapassword}" fi - echo -e "https://steamdb.info/app/${appid}/" - echo -en "\n" + fn_print_nl "https://steamdb.info/app/${appid}/history" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" fn_script_log_info "Remote build: ${remotebuildversion}" @@ -308,9 +309,9 @@ fn_check_steamcmd_appmanifest() { if [ "${appmanifestfilewc}" -ge "2" ]; then fn_print_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" fn_script_log_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" - echo -e "* Check user permissions" + fn_print_nl "* Check user permissions" for appfile in ${appmanifestfile}; do - echo -e " ${appfile}" + fn_print_nl " ${appfile}" done core_exit.sh else diff --git a/lgsm/modules/fix.sh b/lgsm/modules/fix.sh index f9628a335..f31030779 100644 --- a/lgsm/modules/fix.sh +++ b/lgsm/modules/fix.sh @@ -22,7 +22,8 @@ fn_fix_msg_start_nl() { } fn_fix_msg_end() { - if [ $? != 0 ]; then + exirtcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_error_nl "Applying ${fixname} fix: ${gamename}" fn_script_log_error "Applying ${fixname} fix: ${gamename}" else @@ -79,7 +80,7 @@ fi if [ "${commandname}" == "INSTALL" ]; then if grep -qEe "(^|\s)${shortname}(\s|$)" <<< "${apply_post_install_fix[@]}"; then echo -e "" - echo -e "${lightyellow}Applying Post-Install Fixes${default}" + echo -e "${bold}${lightyellow}Applying Post-Install Fixes${default}" fn_messages_separator postinstall=1 fn_apply_fix "post install" "${shortname}" diff --git a/lgsm/modules/fix_bt.sh b/lgsm/modules/fix_bt.sh index 51fc3d505..107c84458 100755 --- a/lgsm/modules/fix_bt.sh +++ b/lgsm/modules/fix_bt.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves issues with Barotrauma. -module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: Missing user data directory error. if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Daedalic Entertainment GmbH/Barotrauma" ]; then diff --git a/lgsm/modules/fix_rust.sh b/lgsm/modules/fix_rust.sh index af995a2fa..80c790a59 100644 --- a/lgsm/modules/fix_rust.sh +++ b/lgsm/modules/fix_rust.sh @@ -11,7 +11,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/RustDedicated_Data/Plugins/x86_64" # Part of random seed feature. -# If seed is not defined by user generate a seed file. +# If the seed is not defined by the user, generate a seed file. if [ -z "${seed}" ] || [ "${seed}" == "0" ]; then if [ ! -f "${datadir}/${selfname}-seed.txt" ]; then shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" diff --git a/lgsm/modules/info_distro.sh b/lgsm/modules/info_distro.sh index 0813554dc..67a9fd5df 100644 --- a/lgsm/modules/info_distro.sh +++ b/lgsm/modules/info_distro.sh @@ -188,13 +188,10 @@ if [ "$(command -v numfmt 2> /dev/null)" ]; then else # Older distros will need to use free. # Older versions of free do not support -h option. - if [ "$( - free -h > /dev/null 2>&1 - echo $? - )" -ne "0" ]; then - humanreadable="-m" - else + if free -h > /dev/null 2>&1; then humanreadable="-h" + else + humanreadable="-m" fi physmemtotalmb="$(free -m | awk '/Mem:/ {print $2}')" # integer physmemtotalgb="$(free -m | awk '/Mem:/ {print $2}')" # integer diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index ff4b5d870..91d78e670 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -132,7 +132,7 @@ fn_info_messages_server_resource() { echo -e "${bold}${lightyellow}Server Resource${default}" fn_messages_separator { - echo -e "${lightyellow}CPU\t${default}" + echo -e "${bold}${lightyellow}CPU\t${default}" echo -e "${lightblue}Model:\t${default}${cpumodel}" echo -e "${lightblue}Cores:\t${default}${cpucores}" echo -e "${lightblue}Frequency:\t${default}${cpufreqency}MHz" @@ -140,14 +140,14 @@ fn_info_messages_server_resource() { } | column -s $'\t' -t echo -e "" { - echo -e "${lightyellow}Memory\t${default}" + echo -e "${bold}${lightyellow}Memory\t${default}" echo -e "${lightblue}Mem:\t${lightblue}total\tused\tfree\tcached\tavailable${default}" echo -e "${lightblue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}\t${physmemavailable}${default}" echo -e "${lightblue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}" } | column -s $'\t' -t echo -e "" { - echo -e "${lightyellow}Storage${default}" + echo -e "${bold}${lightyellow}Storage${default}" echo -e "${lightblue}Filesystem:\t${default}${filesystem}" echo -e "${lightblue}Total:\t${default}${totalspace}" echo -e "${lightblue}Used:\t${default}${usedspace}" @@ -155,7 +155,7 @@ fn_info_messages_server_resource() { } | column -s $'\t' -t echo -e "" { - echo -e "${lightyellow}Network${default}" + echo -e "${bold}${lightyellow}Network${default}" if [ -n "${netint}" ]; then echo -e "${lightblue}Interface:\t${default}${netint}" fi @@ -203,7 +203,7 @@ fn_info_messages_gameserver_resource() { } | column -s $'\t' -t echo -e "" { - echo -e "${lightyellow}Storage${default}" + echo -e "${bold}${lightyellow}Storage${default}" echo -e "${lightblue}Total:\t${default}${rootdirdu}" echo -e "${lightblue}Serverfiles:\t${default}${serverfilesdu}" if [ -d "${backupdir}" ]; then @@ -292,7 +292,7 @@ fn_info_messages_gameserver() { echo -e "${lightblue}Server password:\t${default}${serverpassword}" fi - # Query enabled (Starbound) + # Query enabled (Starbound, Minecraft) if [ -n "${queryenabled}" ]; then echo -e "${lightblue}Query enabled:\t${default}${queryenabled}" fi @@ -553,23 +553,39 @@ fn_info_messages_script() { fi # Discord alert - echo -e "${lightblue}Discord alert:\t${default}${discordalert}" + if [ "${discordalert}" == "on" ]; then + echo -e "${lightblue}Discord alert:\t${default}${discordalert}" + fi # Email alert - echo -e "${lightblue}Email alert:\t${default}${emailalert}" + if [ "${emailalert}" == "on" ]; then + echo -e "${lightblue}Email alert:\t${default}${emailalert}" + fi # Gotify alert - echo -e "${lightblue}Gotify alert:\t${default}${gotifyalert}" + if [ "${gotifyalert}" == "on" ]; then + echo -e "${lightblue}Gotify alert:\t${default}${gotifyalert}" + fi # IFTTT alert echo -e "${lightblue}IFTTT alert:\t${default}${iftttalert}" # Pushbullet alert - echo -e "${lightblue}Pushbullet alert:\t${default}${pushbulletalert}" + if [ "${pushbulletalert}" == "on" ]; then + echo -e "${lightblue}Pushbullet alert:\t${default}${pushbulletalert}" + fi # Pushover alert - echo -e "${lightblue}Pushover alert:\t${default}${pushoveralert}" + if [ "${pushoveralert}" == "on" ]; then + echo -e "${lightblue}Pushover alert:\t${default}${pushoveralert}" + fi # Rocketchat alert - echo -e "${lightblue}Rocketchat alert:\t${default}${rocketchatalert}" + if [ "${rocketchatalert}" == "on" ]; then + echo -e "${lightblue}Rocketchat alert:\t${default}${rocketchatalert}" + fi # Slack alert - echo -e "${lightblue}Slack alert:\t${default}${slackalert}" + if [ "${slackalert}" == "on" ]; then + echo -e "${lightblue}Slack alert:\t${default}${slackalert}" + fi # Telegram alert - echo -e "${lightblue}Telegram alert:\t${default}${telegramalert}" + if [ "${telegramalert}" == "on" ]; then + echo -e "${lightblue}Telegram alert:\t${default}${telegramalert}" + fi # Update on start if [ -n "${updateonstart}" ]; then diff --git a/lgsm/modules/install_complete.sh b/lgsm/modules/install_complete.sh index 0ee01954a..c84e35fe0 100644 --- a/lgsm/modules/install_complete.sh +++ b/lgsm/modules/install_complete.sh @@ -8,25 +8,24 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -fn_messages_separator -if [ "${exitcode}" == "1" ]; then +if [ "${exitcode}" -eq 1 ]; then echo -e "${bold}${red}Install Failed!${default}" fn_script_log_fail "Install Failed!" -elif [ "${exitcode}" == "2" ]; then +elif [ "${exitcode}" -eq 2 ]; then echo -e "${bold}${red}Install Completed with Errors!${default}}" fn_script_log_error "Install Completed with Errors!" -elif [ "${exitcode}" == "3" ]; then +elif [ "${exitcode}" -eq 3 ]; then echo -e "${bold}${lightyellow}Install Completed with Warnings!${default}}" fn_script_log_warn "Install Completed with Warnings!" -elif [ -z "${exitcode}" ] || [ "${exitcode}" == "0" ]; then +elif [ -z "${exitcode}" ] || [ "${exitcode}" -eq 0 ]; then echo -e "${bold}${green}Install Complete!${default}" fn_script_log_pass "Install Complete!" fi +fn_messages_separator -fn_script_log_info "Install Complete!" echo -e "" -echo -e "To start server type:" -echo -e "./${selfname} start" +echo -e "To start the ${gamename} server type:" +echo -e "${italic}./${selfname} start${default}" echo -e "" core_exit.sh diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index f4005c6f8..ae395c205 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -16,43 +16,76 @@ fn_check_cfgdir() { fi } -# Downloads default configs from Game-Server-Configs repo to lgsm/config-default. -fn_fetch_default_config() { +# Copys default configs from Game-Server-Configs repo to server config location. +fn_default_config_remote() { echo -e "" echo -e "${bold}${lightyellow}Downloading ${gamename} Configs${default}" fn_messages_separator - echo -e "Downloading default configs from:" - echo -e "" - echo -e "${italic}https://github.com/GameServerManagers/Game-Server-Configs${default}" + echo -e "Downloading default configs from: ${italic}https://github.com/GameServerManagers/Game-Server-Configs${default}" echo -e "" fn_sleep_time_1 mkdir -p "${lgsmdir}/config-default/config-game" githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main" for config in "${array_configs[@]}"; do + # Downloads default configs from Game-Server-Configs repo to lgsm/config-default. fn_fetch_file "${githuburl}/${shortname}/${config}" "${remote_fileurl_backup}" "GitHub" "Bitbucket" "${lgsmdir}/config-default/config-game" "${config}" "nochmodx" "norun" "forcedl" "nohash" - done -} -# Copys default configs from Game-Server-Configs repo to server config location. -fn_default_config_remote() { - for config in "${array_configs[@]}"; do - # every config is copied - echo -e "copying ${config} config file." - fn_script_log_info "Copying ${servercfg} config file." + # Every config is copied. if [ "${config}" == "${servercfgdefault}" ]; then mkdir -p "${servercfgdir}" - cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}" + echo -en "copying config file [ ${italic}${servercfgfullpath}${default} ]" + changes+=$(cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}") + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fail "copying config file ${servercfgfullpath}" + elif [ "${changes}" != "" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "copying config file ${servercfgfullpath}" + else + fn_print_skip_eol_nl + fi elif [ "${shortname}" == "arma3" ] && [ "${config}" == "${networkcfgdefault}" ]; then mkdir -p "${servercfgdir}" - cp -nv "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}" + echo -en "copying config file [ ${italic}${networkcfgfullpath}${default} ]" + changes+=$(cp -nv "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}") + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fail "copying config file ${networkcfgdefault}" + elif [ "${changes}" != "" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "copying config file ${networkcfgdefault}" + else + fn_print_skip_eol_nl + fi elif [ "${shortname}" == "dst" ] && [ "${config}" == "${clustercfgdefault}" ]; then - cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}" + echo -en "copying config file [ ${italic}${clustercfgfullpath}${default} ]" + changes+=$(cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}") + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fail "copying config file ${clustercfgfullpath}" + elif [ "${changes}" != "" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "copying config file ${clustercfgfullpath}" + else + fn_print_skip_eol_nl + fi else - mkdir -p "${servercfgdir}" - cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgdir}/${config}" + echo -en "copying config file [ ${italic}${servercfgdir}/${config}${default} ]" + changes+=$(cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgdir}/${config}") + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fail "copying config file ${servercfgdir}/${config}" + elif [ "${changes}" != "" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "copying config file ${servercfgdir}/${config}" + else + fn_print_skip_eol_nl + fi fi + + unset changes done - fn_sleep_time } # Copys local default config to server config location. @@ -71,7 +104,7 @@ fn_default_config_local() { echo -en "copying config file [ ${italic}${servercfgdefault}${default} ]: " cp --update=none "${servercfgdir}/${servercfgdefault}" "${servercfgfullpath}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol fn_script_log_fail "copying config file [ ${servercfgdefault} ]: " else @@ -88,29 +121,47 @@ fn_set_config_vars() { randomstring=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2> /dev/null | head -c 8 | xargs) servername="LinuxGSM" rconpass="admin${randomstring}" - echo -e "changing hostname." - fn_script_log_info "Changing hostname." + echo -en "setting hostname\c" + fn_script_log_info "setting hostname" fn_sleep_time # prevents var from being overwritten with the servername. if grep -q "SERVERNAME=SERVERNAME" "${lgsmdir}/config-default/config-game/${config}" 2> /dev/null; then - sed -i "s/SERVERNAME=SERVERNAME/SERVERNAME=${servername}/g" "${servercfgfullpath}" + changes+=$(sed -i "s/SERVERNAME=SERVERNAME/SERVERNAME=${servername}/g w /dev/stdout" "${servercfgfullpath}") elif grep -q "SERVERNAME=\"SERVERNAME\"" "${lgsmdir}/config-default/config-game/${config}" 2> /dev/null; then - sed -i "s/SERVERNAME=\"SERVERNAME\"/SERVERNAME=\"${servername}\"/g" "${servercfgfullpath}" + changes+=$(sed -i "s/SERVERNAME=\"SERVERNAME\"/SERVERNAME=\"${servername}\"/g w /dev/stdout" "${servercfgfullpath}") else - sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}" + changes+=$(sed -i "s/SERVERNAME/${servername}/g w /dev/stdout" "${servercfgfullpath}") fi - echo -e "changing rcon/admin password." - fn_script_log_info "Changing rcon/admin password." - if [ "${shortname}" == "squad" ]; then - sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgdir}/Rcon.cfg" + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol + fn_script_log_fail "setting hostname" + elif [ "${changes}" != "" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "setting hostname" else - sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgfullpath}" + fn_print_skip_eol_nl fi + + echo -en "generating admin/rcon password\c" + fn_script_log_info "generating admin/rcon password" fn_sleep_time - else - fn_script_log_warn "Config file not found, cannot alter it." - echo -e "Config file not found, cannot alter it." - fn_sleep_time + if [ "${shortname}" == "squad" ]; then + changes+=$(sed -i "s/ADMINPASSWORD/${adminpass}/g w /dev/stdout" "${servercfgdir}/Rcon.cfg") + else + changes+=$(sed -i "s/ADMINPASSWORD/${adminpass}/g w /dev/stdout" "${servercfgfullpath}") + fi + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol + fn_script_log_fail "generating admin/rcon password" + elif [ "${changes}" != "" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "generating admin/rcon password" + else + fn_print_skip_eol_nl + fi + unset changes fi } @@ -164,22 +215,22 @@ fn_set_dst_config_vars() { echo -e "" } -# Lists local config file locations +# Lists local config locations fn_list_config_locations() { echo -e "" echo -e "${bold}${lightyellow}Config Locations${default}" fn_messages_separator if [ -n "${servercfgfullpath}" ]; then if [ -f "${servercfgfullpath}" ]; then - echo -e "Game Server Config File: ${servercfgfullpath}" + echo -e "${gamename} config file: ${italic}${servercfgfullpath}${default}" elif [ -d "${servercfgfullpath}" ]; then - echo -e "Game Server Config Dir: ${servercfgfullpath}" + echo -e "${gamename} config directory: ${italic}${servercfgfullpath}" else - echo -e "Config file: ${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})" + echo -e "${gamename} config: ${italic}${red}${servercfgfullpath}${default} (${red}CONFIG IS MISSING${default})" fi fi - echo -e "LinuxGSM Config: ${lgsmdir}/config-lgsm/${gameservername}" - echo -e "Documentation: https://docs.linuxgsm.com/configuration/game-server-config" + echo -e "LinuxGSM config: ${italic}${lgsmdir}/config-lgsm/${gameservername}${default}" + echo -e "Config documentation: ${italic}https://docs.linuxgsm.com/configuration${default}" } if [ "${shortname}" == "sdtd" ]; then @@ -187,66 +238,51 @@ if [ "${shortname}" == "sdtd" ]; then fn_list_config_locations elif [ "${shortname}" == "ac" ]; then array_configs+=(server_cfg.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ahl" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ahl2" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ark" ]; then - fn_check_cfgdir array_configs+=(GameUserSettings.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "arma3" ]; then - fn_check_cfgdir array_configs+=(server.cfg network.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "armar" ]; then - fn_check_cfgdir array_configs+=(server.json) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ats" ]; then - fn_check_cfgdir array_configs+=(server_config.sii) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bo" ]; then array_configs+=(config.txt) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bd" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bt" ]; then - fn_check_cfgdir array_configs+=(serversettings.xml) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -259,91 +295,76 @@ elif [ "${shortname}" == "btl" ]; then fn_list_config_locations elif [ "${shortname}" == "bf1942" ]; then array_configs+=(serversettings.con) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bfv" ]; then array_configs+=(serversettings.con) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bs" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bb" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bb2" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bmdm" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ck" ]; then array_configs+=(ServerConfig.json) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cod" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "coduo" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cod2" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cod4" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "codwaw" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cc" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "col" ]; then array_configs+=(colserver.json) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cs" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -355,86 +376,70 @@ elif [ "${shortname}" == "cs2" ]; then fn_list_config_locations elif [ "${shortname}" == "cscz" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "csgo" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "css" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ct" ]; then array_configs+=(ServerSetting.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dayz" ]; then - fn_check_cfgdir array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dod" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dodr" ]; then array_configs+=(Game.ini) - fn_fetch_default_config fn_default_config_remote fn_list_config_locations elif [ "${shortname}" == "dods" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "doi" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dmc" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dst" ]; then - fn_check_cfgdir array_configs+=(cluster.ini server.ini) - fn_fetch_default_config fn_default_config_remote fn_set_dst_config_vars fn_list_config_locations elif [ "${shortname}" == "dab" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dys" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "eco" ]; then array_configs+=(Network.eco) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -443,44 +448,36 @@ elif [ "${shortname}" == "em" ]; then fn_list_config_locations elif [ "${shortname}" == "etl" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ets2" ]; then - fn_check_cfgdir array_configs+=(server_config.sii) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "fctr" ]; then array_configs+=(server-settings.json) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "fof" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "gmod" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "hldm" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "hldms" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -492,13 +489,11 @@ elif [ "${shortname}" == "ohd" ]; then fn_list_config_locations elif [ "${shortname}" == "opfor" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "hl2dm" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -507,104 +502,84 @@ elif [ "${shortname}" == "hz" ]; then : elif [ "${shortname}" == "ins" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ios" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "jc2" ]; then array_configs+=(config.lua) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "jc3" ]; then array_configs+=(config.json) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "kf" ]; then array_configs+=(Default.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "l4d" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "l4d2" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then array_configs+=(server.properties) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mcb" ]; then array_configs+=(server.properties) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mohaa" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mh" ]; then - fn_check_cfgdir array_configs+=(Game.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ns" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "nmrih" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "nd" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mta" ]; then - fn_check_cfgdir array_configs+=(acl.xml mtaserver.conf vehiclecolors.conf) - fn_fetch_default_config fn_default_config_remote fn_list_config_locations elif [ "${shortname}" == "pvr" ]; then - fn_check_cfgdir array_configs+=(Game.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars elif [ "${shortname}" == "pvkii" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -615,22 +590,17 @@ elif [ "${shortname}" == "pw" ]; then fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "pz" ]; then - fn_check_cfgdir array_configs+=(server.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "nec" ]; then - fn_check_cfgdir array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "pc" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -639,7 +609,6 @@ elif [ "${shortname}" == "pc2" ]; then fn_list_config_locations elif [ "${shortname}" == "q2" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -657,48 +626,39 @@ elif [ "${shortname}" == "q4" ]; then fn_list_config_locations elif [ "${shortname}" == "ql" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "jk2" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars elif [ "${shortname}" == "qw" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ricochet" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "rtcw" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "rust" ]; then - fn_check_cfgdir array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_list_config_locations elif [ "${shortname}" == "scpsl" ] || [ "${shortname}" == "scpslsm" ]; then array_configs+=(config_gameplay.txt config_localadmin.txt) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sf" ]; then array_configs+=(GameUserSettings.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -707,109 +667,90 @@ elif [ "${shortname}" == "sm" ]; then fn_list_config_locations elif [ "${shortname}" == "sol" ]; then array_configs+=(soldat.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sof2" ]; then array_configs+=(server.cfg mapcycle.txt) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sfc" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "squad" ]; then array_configs+=(Admins.cfg Bans.cfg License.cfg Server.cfg Rcon.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sb" ]; then array_configs+=(starbound_server.config) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "stn" ]; then array_configs+=(ServerConfig.txt ServerUsers.txt TpPresets.json UserPermissions.json) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sven" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "tf2" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "tfc" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ti" ]; then array_configs+=(Game.ini Engine.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ts" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ts3" ]; then array_configs+=(ts3server.ini) - fn_fetch_default_config fn_default_config_remote fn_list_config_locations elif [ "${shortname}" == "tw" ]; then array_configs+=(server.cfg ctf.cfg dm.cfg duel.cfg tdm.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "terraria" ]; then array_configs+=(serverconfig.txt) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "tu" ]; then - fn_check_cfgdir array_configs+=(TowerServer.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ut" ]; then array_configs+=(Game.ini Engine.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ut2k4" ]; then array_configs+=(UT2004.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ut99" ]; then array_configs+=(Default.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -821,25 +762,21 @@ elif [ "${shortname}" == "vints" ]; then : elif [ "${shortname}" == "vs" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "wet" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "wf" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "wmc" ]; then array_configs+=(config.yml) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -851,19 +788,16 @@ elif [ "${shortname}" == "xnt" ]; then fn_list_config_locations elif [ "${shortname}" == "wurm" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "zmr" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "zps" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations diff --git a/lgsm/modules/install_dst_token.sh b/lgsm/modules/install_dst_token.sh index fd0b4727b..93ac1b8a4 100644 --- a/lgsm/modules/install_dst_token.sh +++ b/lgsm/modules/install_dst_token.sh @@ -12,7 +12,7 @@ echo -e "${bold}${lightyellow}Enter ${gamename} Cluster Token${default}" fn_messages_separator echo -e "A cluster token is required to run this server!" echo -e "Follow the instructions in this link to obtain this key:" -echo -e "https://linuxgsm.com/dst-auth-token" +echo -e "${italic}https://linuxgsm.com/dst-auth-token" echo -e "" if [ -z "${autoinstall}" ]; then overwritetoken="true" diff --git a/lgsm/modules/install_eula.sh b/lgsm/modules/install_eula.sh index 272ff205a..f32a1931e 100644 --- a/lgsm/modules/install_eula.sh +++ b/lgsm/modules/install_eula.sh @@ -19,11 +19,11 @@ echo -e "" echo -e "${bold}${lightyellow}Accept ${gamename} EULA${default}" fn_messages_separator echo -e "You are required to accept the EULA:" -echo -e "${eulaurl}" +echo -e "" +echo -e "${italic}${eulaurl}${default}" echo -e "" if [ -z "${autoinstall}" ]; then echo -e "By continuing you are indicating your agreement to the EULA." - echo -e "" if ! fn_prompt_yn "Continue?" Y; then exitcode=0 core_exit.sh diff --git a/lgsm/modules/install_gslt.sh b/lgsm/modules/install_gslt.sh index 960b1e20c..e4e4dbad7 100644 --- a/lgsm/modules/install_gslt.sh +++ b/lgsm/modules/install_gslt.sh @@ -11,17 +11,16 @@ echo -e "" echo -e "${bold}${lightyellow}Game Server Login Token${default}" fn_messages_separator if [ "${shortname}" == "csgo" ] || [ "${shortname}" == "css" ] || [ "${shortname}" == "nmrih" ] || [ "${shortname}" == "bs" ]; then - echo -e "GSLT is required to run a public ${gamename} server" + echo -e "GSLT is required to run a public ${gamename} server." fn_script_log_info "GSLT is required to run a public ${gamename} server" else - echo -e "GSLT is an optional feature for ${gamename} server" + echo -e "GSLT is an optional feature for ${gamename} server." fn_script_log_info "GSLT is an optional feature for ${gamename} server" fi -echo -e "Get more info and a token here:" -echo -e "https://docs.linuxgsm.com/steamcmd/gslt" -fn_script_log_info "Get more info and a token here:" -fn_script_log_info "https://docs.linuxgsm.com/steamcmd/gslt" +echo -e "" +echo -e "More info: ${italic}https://docs.linuxgsm.com/steamcmd/gslt${default}" +fn_script_log_info "More info: https://docs.linuxgsm.com/steamcmd/gslt" echo -e "" if [ -z "${autoinstall}" ]; then if [ "${shortname}" != "tu" ]; then @@ -37,11 +36,10 @@ if [ -z "${autoinstall}" ]; then fi if [ "${shortname}" == "tu" ]; then - echo -e "The GSLT can be changed by editing ${servercfgdir}/${servercfg}." - fn_script_log_info "The GSLT can be changed by editing ${servercfgdir}/${servercfg}." + echo -e "The GSLT can be changed by editing: ${italic}${servercfgdir}/${servercfg}${default}" + fn_script_log_info "The GSLT can be changed by editing: ${servercfgdir}/${servercfg}." else - echo -e "The GSLT can be changed by editing ${configdirserver}/${selfname}.cfg." - fn_script_log_info "The GSLT can be changed by editing ${configdirserver}/${selfname}.cfg." + echo -e "The GSLT can be changed by editing: ${italic}${configdirserver}/${selfname}.cfg${default}" + fn_script_log_info "The GSLT can be changed by editing: ${configdirserver}/${selfname}.cfg." fi fn_sleep_time_1 -echo -e "" diff --git a/lgsm/modules/install_logs.sh b/lgsm/modules/install_logs.sh index 3e522a082..9e1b89dbd 100644 --- a/lgsm/modules/install_logs.sh +++ b/lgsm/modules/install_logs.sh @@ -7,93 +7,117 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -if [ "${checklogs}" != "1" ]; then +if [ -z "${checklogs}" ]; then echo -e "" echo -e "${bold}${lightyellow}Creating Log Directories${default}" fn_messages_separator fi -# Create LinuxGSM logs. -echo -en "installing log dir: ${logdir}..." -mkdir -p "${logdir}" -if [ $? != 0 ]; then - fn_print_fail_eol_nl - core_exit.sh -else - fn_print_ok_eol_nl -fi -echo -en "installing LinuxGSM log dir: ${lgsmlogdir}..." -mkdir -p "${lgsmlogdir}" -if [ $? != 0 ]; then - fn_print_fail_eol_nl - core_exit.sh +echo -en "creating log directory [ ${italic}${logdir}${default} ]" +if [ ! -d "${logdir}" ]; then + if ! mkdir -p "${logdir}"; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi else - fn_print_ok_eol_nl + fn_print_skip_eol_nl fi -echo -en "creating LinuxGSM log: ${lgsmlog}..." -touch "${lgsmlog}" -if [ $? != 0 ]; then - fn_print_fail_eol_nl - core_exit.sh + +echo -en "creating script log directory [ ${italic}${lgsmlogdir}${default} ]" +if [ ! -d "${lgsmlogdir}" ]; then + if ! mkdir -p "${lgsmlogdir}"; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi else - fn_print_ok_eol_nl + fn_print_skip_eol_nl fi -# Create Console logs. -if [ "${consolelogdir}" ]; then - echo -en "installing console log dir: ${consolelogdir}..." - mkdir -p "${consolelogdir}" - if [ $? != 0 ]; then + +echo -en "creating script log [ ${italic}${lgsmlog}${default} ]" +if [ ! -f "${lgsmlog}" ]; then + if ! touch "${lgsmlog}"; then fn_print_fail_eol_nl core_exit.sh else fn_print_ok_eol_nl fi - echo -en "creating console log: ${consolelog}..." - if ! touch "${consolelog}"; then +else + fn_print_skip_eol_nl +fi + +echo -en "creating console log directory [ ${italic}${consolelogdir}${default} ]" +if [ ! -d "${consolelogdir}" ]; then + if ! mkdir -p "${consolelogdir}"; then fn_print_fail_eol_nl core_exit.sh else fn_print_ok_eol_nl fi +else + fn_print_skip_eol_nl fi -# Create Game logs. -if [ "${gamelogdir}" ] && [ ! -d "${gamelogdir}" ]; then - echo -en "installing game log dir: ${gamelogdir}..." - if ! mkdir -p "${gamelogdir}"; then +echo -en "creating console log [ ${italic}${consolelog}${default} ]" +if [ ! -f "${consolelog}" ]; then + if ! touch "${consolelog}"; then fn_print_fail_eol_nl core_exit.sh else fn_print_ok_eol_nl fi +else + fn_print_skip_eol_nl +fi + +if [ -n "${gamelogdir}" ]; then + echo -en "creating game log directory [ ${italic}${gamelogdir}${default} ]" + if [ ! -d "${gamelogdir}" ]; then + if ! mkdir -p "${gamelogdir}"; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi + else + fn_print_skip_eol_nl + fi fi # Symlink to gamelogdir # unless gamelogdir is within logdir. # e.g serverfiles/log is not within log/: symlink created # log/server is in log/: symlink not created -if [ "${gamelogdir}" ]; then - if [ "${gamelogdir:0:${#logdir}}" != "${logdir}" ]; then - echo -en "creating symlink to game log dir: ${logdir}/server -> ${gamelogdir}..." +if [ -n "${gamelogdir}" ] && [ "${gamelogdir:0:${#logdir}}" != "${logdir}" ]; then + echo -en "creating symlink to game log directory [ ${italic}${logdir}/server -> ${gamelogdir}${default} ]" + # if path does not exist or does not match gamelogdir + if [ ! -h "${logdir}/server" ] || [ "$(readlink -f "${logdir}/server")" != "${gamelogdir}" ]; then if ! ln -nfs "${gamelogdir}" "${logdir}/server"; then fn_print_fail_eol_nl core_exit.sh else fn_print_ok_eol_nl fi + else + fn_print_skip_eol_nl fi fi # If server uses SteamCMD create a symbolic link to the Steam logs. if [ -d "${HOME}/.steam/steam/logs" ]; then + echo -en "creating symlink to steam log directory [ ${italic}${logdir}/steam -> ${HOME}/.steam/steam/logs${default} ]" if [ ! -L "${logdir}/steam" ]; then - echo -en "creating symlink to steam log dir: ${logdir}/steam -> ${HOME}/.steam/steam/logs..." if ! ln -nfs "${HOME}/.steam/steam/logs" "${logdir}/steam"; then fn_print_fail_eol_nl core_exit.sh else fn_print_ok_eol_nl fi + else + fn_print_skip_eol_nl fi fi fn_script_log_info "Logs installed" diff --git a/lgsm/modules/install_server_dir.sh b/lgsm/modules/install_server_dir.sh index 2922f397a..318e4bc80 100644 --- a/lgsm/modules/install_server_dir.sh +++ b/lgsm/modules/install_server_dir.sh @@ -10,10 +10,16 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${bold}${lightyellow}Server Directory${default}" fn_messages_separator +echo -en "creating serverfiles directory [ ${italic}${serverfiles}${default} ]" + if [ -d "${serverfiles}" ]; then - fn_print_warning_nl "A server is already installed here." + fn_print_skip_eol_nl + echo -e "" + echo -e "${italic}A game server is already exists at this location.${default}" +else + fn_print_ok_eol_nl fi -pwd + if [ -z "${autoinstall}" ]; then if ! fn_prompt_yn "Continue?" Y; then exitcode=0 @@ -21,5 +27,5 @@ if [ -z "${autoinstall}" ]; then fi fi if [ ! -d "${serverfiles}" ]; then - mkdir -v "${serverfiles}" + mkdir "${serverfiles}" fi diff --git a/lgsm/modules/install_server_files.sh b/lgsm/modules/install_server_files.sh index baa18aef7..c667a7fe4 100644 --- a/lgsm/modules/install_server_files.sh +++ b/lgsm/modules/install_server_files.sh @@ -241,6 +241,10 @@ fn_install_server_files() { fn_clear_tmp } +if [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "ut" ]; then + install_eula.sh +fi + echo -e "" echo -e "${bold}${lightyellow}Installing ${gamename} Server${default}" fn_messages_separator @@ -255,12 +259,10 @@ fi if [ "${shortname}" == "ts3" ]; then update_ts3.sh elif [ "${shortname}" == "mc" ]; then - install_eula.sh update_mc.sh elif [ "${shortname}" == "mcb" ]; then update_mcb.sh elif [ "${shortname}" == "pmc" ]; then - install_eula.sh update_pmc.sh elif [ "${shortname}" == "wmc" ] || [ "${shortname}" == "vpmc" ]; then update_pmc.sh @@ -287,7 +289,6 @@ fi if [ -z "${autoinstall}" ]; then echo -e "" - fn_messages_separator if ! fn_prompt_yn "Was the install successful?" Y; then install_retry.sh fi diff --git a/lgsm/modules/install_squad_license.sh b/lgsm/modules/install_squad_license.sh index 0bb71c4a8..7b7d2ca66 100644 --- a/lgsm/modules/install_squad_license.sh +++ b/lgsm/modules/install_squad_license.sh @@ -14,7 +14,7 @@ echo -e "Server license is an optional feature for ${gamename} server" fn_script_log_info "Server license is an optional feature for ${gamename} server" echo -e "Get more info and a server license here:" -echo -e "https://squad.fandom.com/wiki/Server_licensing" +echo -e "${italic}https://squad.fandom.com/wiki/Server_licensing" fn_script_log_info "Get more info and a server license here:" fn_script_log_info "https://squad.fandom.com/wiki/Server_licensing" echo -e "" diff --git a/lgsm/modules/install_stats.sh b/lgsm/modules/install_stats.sh index fa43c280f..16653578b 100644 --- a/lgsm/modules/install_stats.sh +++ b/lgsm/modules/install_stats.sh @@ -13,6 +13,7 @@ fn_messages_separator echo -e "Assist LinuxGSM development by sending anonymous stats to developers." echo -e "Collected data is publicly available: ${italic}https://linuxgsm.com/data/usage${default}" echo -e "More info: ${italic}https://docs.linuxgsm.com/configuration/linuxgsm-stats${default}" +echo -e "" echo -e "The following info will be sent: " echo -e "* game server" echo -e "* distro" @@ -24,5 +25,6 @@ if [ -z "${autoinstall}" ]; then fn_print_information_nl "Stats setting is now enabled in common.cfg." fi else - fn_print_information_nl "auto-install leaves stats off by default. Stats can be enabled in common.cfg" + echo -e "" + echo -e "auto-install leaves stats off by default. Stats can be enabled in ${italic}common.cfg${default}" fi diff --git a/lgsm/modules/install_ts3db.sh b/lgsm/modules/install_ts3db.sh index c8f90a9cf..584fbd7c0 100644 --- a/lgsm/modules/install_ts3db.sh +++ b/lgsm/modules/install_ts3db.sh @@ -11,8 +11,8 @@ fn_install_ts3db_mariadb() { if [ ! -f "${serverfiles}/libts3db_mariadb.so" ]; then echo -e "copying libmariadb.so.2...\c" cp "${serverfiles}/redist/libmariadb.so.2" "${serverfiles}" - local exitcode=$? - if [ "${exitcode}" != "0" ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "copying libmariadb.so.2" core_exit.sh diff --git a/lgsm/modules/install_ut2k4_key.sh b/lgsm/modules/install_ut2k4_key.sh index 7ffbba20c..2829da8d6 100644 --- a/lgsm/modules/install_ut2k4_key.sh +++ b/lgsm/modules/install_ut2k4_key.sh @@ -12,7 +12,7 @@ echo -e "${bold}${lightyellow}Enter ${gamename} CD Key${default}" fn_messages_separator echo -e "To get your server listed on the Master Server list" echo -e "you must get a free CD key. Get a key here:" -echo -e "https://www.epicgames.com/unrealtournament/forums/cdkey.php?2004" +echo -e "${italic}https://www.epicgames.com/unrealtournament/forums/cdkey.php?2004" echo -e "" if [ -z "${autoinstall}" ]; then echo -e "Once you have the key enter it below" diff --git a/lgsm/modules/mods_core.sh b/lgsm/modules/mods_core.sh index 47bef26f7..b88e0c05e 100644 --- a/lgsm/modules/mods_core.sh +++ b/lgsm/modules/mods_core.sh @@ -57,8 +57,8 @@ fn_mod_lowercase() { # Finally we can rename the file mv "${src}" "${dst}" # Exit if it fails for any reason - local exitcode=$? - if [ "${exitcode}" != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl core_exit.sh fi @@ -74,8 +74,8 @@ fn_mod_create_filelist() { fn_sleep_time # ${modsdir}/${modcommand}-files.txt. find "${extractdest}" -mindepth 1 -printf '%P\n' > "${modsdir}/${modcommand}-files.txt" - local exitcode=$? - if [ "${exitcode}" != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Building ${modsdir}/${modcommand}-files.txt" core_exit.sh @@ -94,8 +94,8 @@ fn_mod_copy_destination() { echo -en "copying ${modprettyname} to ${modinstalldir}..." fn_sleep_time cp -Rf "${extractdest}/." "${modinstalldir}/" - local exitcode=$? - if [ "${exitcode}" != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Copying ${modprettyname} to ${modinstalldir}" else @@ -132,8 +132,8 @@ fn_mod_tidy_files_list() { # Delete line(s) matching exactly. sed -i "/^${removefilevar}$/d" "${modsdir}/${modcommand}-files.txt" # Exit on error. - local exitcode=$? - if [ "${exitcode}" != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Error while tidying line: ${removefilevar} from: ${modsdir}/${modcommand}-files.txt" core_exit.sh @@ -388,7 +388,7 @@ fn_create_mods_dir() { echo -en "creating LinuxGSM mods data directory ${modsdir}..." mkdir -p "${modsdir}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Creating mod download dir ${modsdir}" core_exit.sh @@ -402,7 +402,7 @@ fn_create_mods_dir() { echo -en "creating mods install directory ${modinstalldir}..." mkdir -p "${modinstalldir}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Creating mod install directory ${modinstalldir}" core_exit.sh @@ -425,7 +425,7 @@ fn_mods_create_tmp_dir() { mkdir -p "${modstmpdir}" exitcode=$? echo -en "creating mod download directory ${modstmpdir}..." - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Creating mod download directory ${modstmpdir}" core_exit.sh @@ -442,7 +442,7 @@ fn_mods_clear_tmp_dir() { echo -en "clearing mod download directory ${modstmpdir}..." rm -rf "${modstmpdir:?}" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Clearing mod download directory ${modstmpdir}" core_exit.sh @@ -580,7 +580,7 @@ fn_mod_install_liblist_gam_file() { grep -q "addons/metamod/dlls/metamod.dll" "${modinstalldir}/liblist.gam" exitcode=$? # if replacement back didn't happen, error out. - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else @@ -596,7 +596,7 @@ fn_mod_install_liblist_gam_file() { grep -q "addons/metamod/dlls/metamod.so" "${modinstalldir}/liblist.gam" exitcode=$? # if replacement back didn't happen, error out - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else @@ -614,11 +614,11 @@ fn_mod_install_liblist_gam_file() { grep -q "addons/metamod/dlls/metamod.dylib" "${modinstalldir}/liblist.gam" exitcode=$? # if replacement back didn't happen, error out. - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi fi @@ -638,11 +638,11 @@ fn_mod_remove_liblist_gam_file() { grep -q "${moddll}" "${modinstalldir}/liblist.gam" exitcode=$? # if replacement back didn't happen, error out. - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi @@ -654,11 +654,11 @@ fn_mod_remove_liblist_gam_file() { grep -q "${modso}" "${modinstalldir}/liblist.gam" exitcode=$? # if replacement back didn't happen, error out - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi @@ -672,11 +672,11 @@ fn_mod_remove_liblist_gam_file() { grep -q "${moddylib}" "${modinstalldir}/liblist.gam" # if replacement back didn't happen, error out. exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi fi @@ -691,15 +691,15 @@ fn_mod_install_amxmodx_file() { echo -en "adding amxmodx_mm_i386.so in plugins.ini..." grep -q "amxmodx_mm_i386.so" "${modinstalldir}/addons/metamod/plugins.ini" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then # file exists but the entry does not, let's add it echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" >> "${modinstalldir}/addons/metamod/plugins.ini" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi fi @@ -707,12 +707,12 @@ fn_mod_install_amxmodx_file() { # create new file and add the mod to it echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" > "${modinstalldir}/addons/metamod/plugins.ini" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl core_exit.sh else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi fi @@ -726,17 +726,17 @@ fn_mod_remove_amxmodx_file() { grep -q "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" "${modinstalldir}/addons/metamod/plugins.ini" # iIs it found? If so remove it and clean up exitcode=$? - if [ "${exitcode}" == 0 ]; then + if [ "${exitcode}" -eq 0 ]; then # delete the line we inserted sed -i '/linux addons\/amxmodx\/dlls\/amxmodx_mm_i386.so/d' "${modinstalldir}/addons/metamod/plugins.ini" # remove empty lines sed -i '/^$/d' "${modinstalldir}/addons/metamod/plugins.ini" exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi diff --git a/lgsm/modules/update_mcb.sh b/lgsm/modules/update_mcb.sh index 65ebc2546..e3a4776ce 100644 --- a/lgsm/modules/update_mcb.sh +++ b/lgsm/modules/update_mcb.sh @@ -15,8 +15,8 @@ fn_update_dl() { else unzip -oq "${tmpdir}/bedrock_server.${remotebuildversion}.zip" -x "permissions.json" "server.properties" "allowlist.json" -d "${serverfiles}" fi - local exitcode=$? - if [ "${exitcode}" != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "Extracting ${local_filename}" if [ -f "${lgsmlog}" ]; then @@ -27,7 +27,9 @@ fn_update_dl() { core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "Extracting ${local_filename}" + if [ -f "${lgsmlog}" ]; then + fn_script_log_pass "Extracting ${local_filename}" + fi fn_clear_tmp fi } diff --git a/lgsm/modules/update_pmc.sh b/lgsm/modules/update_pmc.sh index b3c7d0dc2..325e795df 100644 --- a/lgsm/modules/update_pmc.sh +++ b/lgsm/modules/update_pmc.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of PaperMC and Waterfall servers. -module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles. diff --git a/lgsm/modules/update_ut99.sh b/lgsm/modules/update_ut99.sh index cb74ec3b7..58927fd18 100644 --- a/lgsm/modules/update_ut99.sh +++ b/lgsm/modules/update_ut99.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of Unreal Tournament 99 servers. -module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles. diff --git a/lgsm/modules/update_xnt.sh b/lgsm/modules/update_xnt.sh index f2cdbe324..c0b0ddaeb 100644 --- a/lgsm/modules/update_xnt.sh +++ b/lgsm/modules/update_xnt.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of Unreal Tournament 99 servers. -module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles. diff --git a/linuxgsm.sh b/linuxgsm.sh index 9c35a6b84..9bb4ae872 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -70,6 +70,42 @@ core_modules.sh() { # Bootstrap # Fetches the core modules required before passed off to core_dl.sh. +fn_bootstrap_fetch_trap() { + echo -e "" + echo -en "downloading ${local_filename}" + fn_print_canceled_eol_nl + fn_script_log_info "Downloading ${local_filename}...CANCELED" + rm -f "${local_filedir:?}/${local_filename}" + echo -en "downloading ${local_filename}" + fn_print_removed_eol_nl + fn_script_log_info "Downloading ${local_filename}...REMOVED" + core_exit.sh +} + +# Fetches modules from the Git repo during first download. +fn_bootstrap_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}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" + else + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + fi + remote_fileurl_name="GitHub" + remote_fileurl_backup_name="Bitbucket" + local_filedir="${modulesdir}" + local_filename="${github_file_url_name}" + chmodx="chmodx" + run="run" + forcedl="noforce" + hash="nohash" + # 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}" +} + fn_bootstrap_fetch_file() { remote_fileurl="${1}" remote_fileurl_backup="${2}" @@ -80,7 +116,8 @@ fn_bootstrap_fetch_file() { chmodx="${7:-0}" run="${8:-0}" forcedl="${9:-0}" - md5="${10:-0}" + hash="${10:-0}" + # Download file if missing or download forced. if [ ! -f "${local_filedir}/${local_filename}" ] || [ "${forcedl}" == "forcedl" ]; then # If backup fileurl exists include it. @@ -107,44 +144,54 @@ fn_bootstrap_fetch_file() { mkdir -p "${local_filedir}" fi # Trap will remove part downloaded files if canceled. - trap fn_fetch_trap INT - # Larger files show a progress bar. - - echo -en "fetching ${fileurl_name} ${local_filename}...\c" - curlcmd=$(curl --connect-timeout 3 -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) - - local exitcode=$? + trap fn_bootstrap_fetch_trap INT + curlcmd=(curl --connect-timeout 3 --fail -L -o "${local_filedir}/${local_filename}" --retry 2 -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.${randomint}.212 Safari/537.36") + + # if is large file show progress, else be silent + local exitcode="" + large_files=("bz2" "gz" "zip" "jar" "xz") + if grep -qE "(^|\s)${local_filename##*.}(\s|$)" <<< "${large_files[@]}"; then + echo -e "downloading file [ ${local_filename} ]" + fn_sleep_time + "${curlcmd[@]}" --progress-bar "${fileurl}" 2>&1 + exitcode=$? + echo -en "downloading file [ ${local_filename} ]" + else + echo -en "fetching ${fileurl_name} [ ${local_filename} ]\c" + "${curlcmd[@]}" --silent --show-error "${fileurl}" 2>&1 + exitcode=$? + fi # Download will fail if downloads a html file. if [ -f "${local_filedir}/${local_filename}" ]; then - if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE")" ]; then - rm -f "${local_filedir:?}/${local_filename:?}" + if head -n 1 "${local_filedir}/${local_filename}" | grep -q "DOCTYPE"; then + rm "${local_filedir:?}/${local_filename:?}" local exitcode=2 fi fi # On first try will error. On second try will fail. - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then if [ ${counter} -ge 2 ]; then - echo -e "FAIL" + echo -e " ... FAIL" if [ -f "${lgsmlog}" ]; then - fn_script_log_fail "Downloading ${local_filename}" + fn_script_log_fail "Downloading ${local_filename}..." fn_script_log_fail "${fileurl}" fi core_exit.sh else - echo -e "ERROR" + echo -e " ... ERROR" if [ -f "${lgsmlog}" ]; then - fn_script_log_error "Downloading ${local_filename}" + fn_script_log_error "Downloading ${local_filename}..." fn_script_log_error "${fileurl}" fi fi else - echo -en "OK" - sleep 0.3 - echo -en "\033[2K\\r" + echo -en " ... OK" + sleep "0.1" + echo -e "\033\\r" if [ -f "${lgsmlog}" ]; then - fn_script_log_pass "Downloading ${local_filename}" + fn_script_log_pass "Downloading ${local_filename}..." fi # Make file executable if chmodx is set. @@ -246,7 +293,8 @@ fn_install_menu_whiptail() { menu_options+=("${val//\"/}" "${key//\"/}") done < "${options}" OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3) - if [ $? == 0 ]; then + exitcode=$? + if [ "${exitcode}" -eq 0 ]; then eval "$resultvar=\"${OPTION}\"" else eval "$resultvar=" @@ -395,13 +443,14 @@ else fi if [ ! -f "${configdirserver}/_default.cfg" ]; then mkdir -p "${configdirserver}" - echo -en "copying _default.cfg...\c" + echo -en "copying _default.cfg\c" cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" - if [ $? != 0 ]; then - echo -e "FAIL" + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + echo -e " ... FAIL" exit 1 else - echo -e "OK" + echo -e " ... OK" fi else config_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") @@ -409,11 +458,12 @@ else fn_print_warn_nl "_default.cfg has altered. reloading config." echo -en "copying _default.cfg...\c" cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" - if [ $? != 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then echo -e "FAIL" exit 1 else - echo -e "OK" + echo -e " ... OK" fi fi fi From 36717af4f2c24d2a9446478c12f332f7de08f88e Mon Sep 17 00:00:00 2001 From: Tom Burnett Date: Wed, 11 Dec 2024 14:29:44 -0800 Subject: [PATCH 002/132] fix(q3): Fix q3-only typo in install_config.sh (#4709) --- lgsm/modules/install_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index ae395c205..f12afd386 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -614,7 +614,7 @@ elif [ "${shortname}" == "q2" ]; then fn_list_config_locations elif [ "${shortname}" == "q3" ]; then array_configs+=(server.cfg) - fn_fetch_default_configs + fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations From d7e820c21a76a3d7257ffcef54073422ac8d1378 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 18 Dec 2024 23:09:36 +0100 Subject: [PATCH 003/132] fix(sf): add tcp gameport to details (#4681) --- lgsm/modules/info_messages.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index 91d78e670..09576e861 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -1477,6 +1477,7 @@ fn_info_messages_sm() { { fn_port "header" fn_port "Game" port udp + fn_port "Game" port tcp fn_port "Query" queryport udp fn_port "Telnet" telnetport tcp } | column -s $'\t' -t From d8d833ac490e3a1bf29e537f04566f607d08c1be Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 19 Dec 2024 21:22:55 +0000 Subject: [PATCH 004/132] fix(steamcmd): update remotebuildversion variable to work with recent steamcmd changes --- lgsm/modules/core_steamcmd.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh index 552ff1905..2f2fa17eb 100644 --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -182,8 +182,9 @@ fn_update_steamcmd_remotebuild() { if [ "${CI}" ]; then ${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +quit > /dev/null 2>&1 fi + # password for branch not needed to check the buildid - remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]') + remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_request "${appid}" +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" From 1e07895f09332e2398279900938c175e91da8775 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 19 Dec 2024 21:32:34 +0000 Subject: [PATCH 005/132] Release v24.3.3 --- lgsm/modules/core_modules.sh | 2 +- linuxgsm.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index e4fa35b32..ae6e7ea7a 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v24.3.2" +modulesversion="v24.3.3" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 9c35a6b84..96ce50a6d 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -24,7 +24,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v24.3.2" +version="v24.3.3" shortname="core" gameservername="core" commandname="CORE" From 77eea02b2997c06ef05d6380b6806160146e2c12 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 31 Dec 2024 02:24:16 +0000 Subject: [PATCH 006/132] Add error 0x6A6 --- lgsm/modules/core_dl.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh index 72d50d69a..3b9ec9945 100644 --- a/lgsm/modules/core_dl.sh +++ b/lgsm/modules/core_dl.sh @@ -128,6 +128,9 @@ fn_dl_steamcmd() { elif [ -n "$(grep "0x626" "${steamcmdlog}" | tail -1)" ] || [ -n "$(grep "0x626" "${steamcmdlog}" | tail -1)" ]; then fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Missing update files" fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Missing update files" + elif [ -n "$(grep "0x6A6" "${steamcmdlog}" | tail -1)" ]; then + fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Corrupt update files" + fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Corrupt update files" else fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured" fn_print_nl "Please provide content log to LinuxGSM developers https://linuxgsm.com/steamcmd-error" From 3e4c9b28dd4a5d4655d23f75c5936cfa473e390c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 31 Dec 2024 02:32:40 +0000 Subject: [PATCH 007/132] minor ui fix --- lgsm/modules/command_monitor.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh index 78df55330..6baa24a08 100644 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -344,7 +344,8 @@ fn_monitor_query() { done # Second counter will wait for 15s before breaking loop. for seconds in {1..15}; do - fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt} : ${cyan}WAIT${default}" + fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}" + fn_print_wait_eol fn_sleep_time_1 totalseconds=$((totalseconds + 1)) if [ "${seconds}" == "15" ]; then From 0ad6df3e2139022bd41f4eb858a2a2f76e3c7f58 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 31 Dec 2024 03:19:30 +0000 Subject: [PATCH 008/132] fix(armar): add rcon details --- lgsm/modules/command_postdetails.sh | 2 -- lgsm/modules/info_game.sh | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/command_postdetails.sh b/lgsm/modules/command_postdetails.sh index f9e93be4a..61d537440 100644 --- a/lgsm/modules/command_postdetails.sh +++ b/lgsm/modules/command_postdetails.sh @@ -15,8 +15,6 @@ fn_bad_postdetailslog() { core_exit.sh } -fn_print_header - # source all of the modules defined in the details command. info_messages.sh diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 62292ffa0..4e1d5dedd 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -936,6 +936,8 @@ fn_info_game_armar() { fn_info_game_json "queryport" ".a2s.port" fn_info_game_json "servername" ".game.name" fn_info_game_json "serverpassword" ".game.password" + fn_info_game_json "rconpassword" ".rcon.password" + fn_info_game_json "rconport" ".rcon.port" fi adminpassword="${adminpassword:-"NOT SET"}" battleeyeport="$((port + 4))" From 8649aa8c1e80a3b5b22fee42dae802dff0af6fa3 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 31 Dec 2024 03:23:18 +0000 Subject: [PATCH 009/132] fix: adminpassword not generating --- lgsm/modules/install_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index f12afd386..43d775c85 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -120,7 +120,7 @@ fn_set_config_vars() { if [ -f "${servercfgfullpath}" ]; then randomstring=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2> /dev/null | head -c 8 | xargs) servername="LinuxGSM" - rconpass="admin${randomstring}" + adminpass="admin${randomstring}" echo -en "setting hostname\c" fn_script_log_info "setting hostname" fn_sleep_time From bcb40baef6241880d0b4e88e5902afd4fbf51cf6 Mon Sep 17 00:00:00 2001 From: Zechiax <106590288+Zechiax@users.noreply.github.com> Date: Sun, 5 Jan 2025 00:33:30 +0100 Subject: [PATCH 010/132] fix(papermc): update API URL to prevent update failures (#4728) --- lgsm/modules/update_pmc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/update_pmc.sh b/lgsm/modules/update_pmc.sh index 325e795df..75d99d140 100644 --- a/lgsm/modules/update_pmc.sh +++ b/lgsm/modules/update_pmc.sh @@ -33,7 +33,7 @@ fn_update_localbuild() { fn_update_remotebuild() { # Get remote build info. - apiurl="https://papermc.io/api/v2/projects" + apiurl="https://api.papermc.io/v2/projects" # Get list of projects. remotebuildresponse=$(curl -s "${apiurl}") # Get list of Minecraft versions for project. From f3edc74de1463107ddf88676e402b4c13ecaa29f Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 5 Jan 2025 00:34:02 +0100 Subject: [PATCH 011/132] fix(sm): remove config install as it is not used (#4730) --- lgsm/modules/install_config.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index 43d775c85..c78c74fb2 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -662,9 +662,6 @@ elif [ "${shortname}" == "sf" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations -elif [ "${shortname}" == "sm" ]; then - fn_default_config_local - fn_list_config_locations elif [ "${shortname}" == "sol" ]; then array_configs+=(soldat.ini) fn_default_config_remote From 2b171da14cea7a79ab312b21457eab5d0a06d2bf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 4 Jan 2025 23:34:34 +0000 Subject: [PATCH 012/132] docs(license): update copyright year(s) (#4726) Co-authored-by: Daniel Gibbs Co-authored-by: github-actions --- LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index 344a8fb48..c8ab9fa34 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ # The MIT License (MIT) -Copyright (c) 2012-2024 Daniel Gibbs +Copyright (c) 2012-2025 Daniel Gibbs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 9495437a84ed185ce761b644a0de41f4683a92dd Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 4 Jan 2025 23:38:59 +0000 Subject: [PATCH 013/132] chore: update gamedig --- package-lock.json | 51 +++++++++++++++++++---------------------------- package.json | 6 +++--- 2 files changed, 24 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index 076a14533..581f6ea8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,11 +7,11 @@ "name": "linuxgsm", "license": "MIT", "dependencies": { - "gamedig": "^5.0.0-beta.2" + "gamedig": "^5.1.4" }, "devDependencies": { - "prettier": "^3.0.3", - "prettier-plugin-sh": "^0.13.1" + "prettier": "^3.4.2", + "prettier-plugin-sh": "^0.14.0" } }, "node_modules/@sindresorhus/is": { @@ -269,19 +269,18 @@ } }, "node_modules/gamedig": { - "version": "5.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gamedig/-/gamedig-5.0.0-beta.2.tgz", - "integrity": "sha512-YsHoGdb6rXyzdErakd9eSJvUAZCa8Hy+nQpiWZMps158wOovsH35Yrr/Y9wCvn1FDm6NJnHhQYkvtk3zhlmKWQ==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/gamedig/-/gamedig-5.1.4.tgz", + "integrity": "sha512-MgSbNVGh5QMdrmRTrZ3W7W6sC5/Mx+dMgTy2uZCKQ9vns9eFXkQj61Pw2Y2FNHNMMp4DXFSUMYAPJWLcR16Wwg==", "dependencies": { - "cheerio": "^1.0.0-rc.12", - "gbxremote": "^0.2.1", - "got": "^13.0.0", - "iconv-lite": "^0.6.3", - "long": "^5.2.3", - "minimist": "^1.2.8", - "punycode": "^2.3.0", - "seek-bzip": "^2.0.0", - "varint": "^6.0.0" + "cheerio": "1.0.0-rc.12", + "gbxremote": "0.2.1", + "got": "13.0.0", + "iconv-lite": "0.6.3", + "long": "5.2.3", + "minimist": "1.2.8", + "seek-bzip": "2.0.0", + "varint": "6.0.0" }, "bin": { "gamedig": "bin/gamedig.js" @@ -504,9 +503,9 @@ } }, "node_modules/prettier": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", - "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", + "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -519,9 +518,9 @@ } }, "node_modules/prettier-plugin-sh": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/prettier-plugin-sh/-/prettier-plugin-sh-0.13.1.tgz", - "integrity": "sha512-ytMcl1qK4s4BOFGvsc9b0+k9dYECal7U29bL/ke08FEUsF/JLN0j6Peo0wUkFDG4y2UHLMhvpyd6Sd3zDXe/eg==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-sh/-/prettier-plugin-sh-0.14.0.tgz", + "integrity": "sha512-hfXulj5+zEl/ulrO5kMuuTPKmXvOg0bnLHY1hKFNN/N+/903iZbNp8NyZBTsgI8dtkSgFfAEIQq0IQTyP1ZVFQ==", "dev": true, "dependencies": { "mvdan-sh": "^0.10.1", @@ -534,7 +533,7 @@ "url": "https://opencollective.com/unts" }, "peerDependencies": { - "prettier": "^3.0.0" + "prettier": "^3.0.3" } }, "node_modules/process-nextick-args": { @@ -542,14 +541,6 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "engines": { - "node": ">=6" - } - }, "node_modules/quick-lru": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", diff --git a/package.json b/package.json index 7fa277dcc..404356e5e 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "test": "tests" }, "devDependencies": { - "prettier": "^3.0.3", - "prettier-plugin-sh": "^0.13.1" + "prettier": "^3.4.2", + "prettier-plugin-sh": "^0.14.0" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" @@ -22,6 +22,6 @@ }, "homepage": "https://github.com/GameServerManagers/LinuxGSM#readme", "dependencies": { - "gamedig": "^5.1.3" + "gamedig": "^5.1.4" } } From abfe5c1a67f64a433394ccac5fd4f02a76e38c43 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 5 Jan 2025 11:53:50 +0000 Subject: [PATCH 014/132] fix(st): resolve Stationeers config issues (#4733) * feat(st): add config install * update start parameters * bug * ui fix * rename worldname to worldsave * add worldname to legacy vars --- .../config-lgsm/stserver/_default.cfg | 4 +- lgsm/modules/command_dev_query_raw.sh | 2 +- lgsm/modules/command_monitor.sh | 60 +++++++++---------- lgsm/modules/core_legacy.sh | 6 ++ lgsm/modules/info_game.sh | 2 +- lgsm/modules/install_config.sh | 5 ++ 6 files changed, 45 insertions(+), 34 deletions(-) diff --git a/lgsm/config-default/config-lgsm/stserver/_default.cfg b/lgsm/config-default/config-lgsm/stserver/_default.cfg index 2f2fe0ed4..e32bb2303 100644 --- a/lgsm/config-default/config-lgsm/stserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stserver/_default.cfg @@ -9,11 +9,11 @@ #### Game Server Settings #### ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters -worldname="moon_save" +worldsave="moon_save" worldtype="Moon" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="-LOADLATEST ${worldname} ${worldtype}" +startparameters="-LOAD ${worldsave} ${worldtype}" #### LinuxGSM Settings #### diff --git a/lgsm/modules/command_dev_query_raw.sh b/lgsm/modules/command_dev_query_raw.sh index ea42599f9..ebe54c40f 100644 --- a/lgsm/modules/command_dev_query_raw.sh +++ b/lgsm/modules/command_dev_query_raw.sh @@ -198,7 +198,7 @@ fn_messages_separator echo -e "" echo -e "${bold}${lightyellow}SS Output${default}" fn_messages_separator -fn_info_message_ports +fn_info_messages_ports eval "${portcommand}" echo -e "" diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh index 6baa24a08..7feb05455 100644 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -18,10 +18,10 @@ fn_monitor_check_monitoring() { date '+%s' > "${lockdir:?}/${selfname}-monitoring.lock" elif [ ! -f "${lockdir}/${selfname}-monitoring.lock" ]; then # Monitor does not run if lockfile is not found. - fn_print_dots "Checking lockfile:" + fn_print_dots "Checking lockfile" fn_print_checking_eol fn_script_log_info "Checking lockfile: CHECKING" - fn_print_error "Checking lockfile: No lockfile found:" + fn_print_error "Checking lockfile: No lockfile found" fn_print_error_eol_nl fn_script_log_error "Checking lockfile: No lockfile found: ERROR" echo -e "* Start ${selfname} to run monitor." @@ -31,10 +31,10 @@ fn_monitor_check_monitoring() { fn_monitor_check_install() { if [ "$(pgrep -fc -u "${USER}" "/bin/bash ./${selfname} install")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} i")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} auto-install")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} ai")" != "0" ]; then - fn_print_dots "Checking installer:" + fn_print_dots "Checking installer" fn_print_checking_eol fn_script_log_info "Checking installer: CHECKING" - fn_print_info "Checking installer: LinuxGSM is installing:" + fn_print_info "Checking installer: LinuxGSM is installing" fn_print_info_eol_nl fn_script_log_pass "Checking installer: LinuxGSM is installing" core_exit.sh @@ -43,9 +43,9 @@ fn_monitor_check_install() { fn_monitor_check_debug() { if [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} debug")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} d")" != "0" ]; then - fn_print_dots "Checking debug:" + fn_print_dots "Checking debug" fn_print_checking_eol - fn_print_info "Checking debug: Debug is running:" + fn_print_info "Checking debug: Debug is running" fn_print_info_eol_nl fn_script_log_pass "Checking debug: Debug is running" core_exit.sh @@ -54,9 +54,9 @@ fn_monitor_check_debug() { fn_monitor_check_details() { if [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} details")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} dt")" != "0" ]; then - fn_print_dots "Checking details:" + fn_print_dots "Checking details" fn_print_checking_eol - fn_print_info "Checking details: Details is running:" + fn_print_info "Checking details: Details is running" fn_print_info_eol_nl fn_script_log_pass "Checking details: Details is running" core_exit.sh @@ -67,9 +67,9 @@ fn_monitor_check_starting() { # Remove stale lockfile. if [ -f "${lockdir}/${selfname}-starting.lock" ]; then if [ "$(find "${lockdir}/${selfname}-starting.lock" -mmin +5)" ]; then - fn_print_dots "Checking start:" + fn_print_dots "Checking start" fn_print_checking_eol - fn_print_warn "Checking start: Removing stale lockfile:" + fn_print_warn "Checking start: Removing stale lockfile" fn_print_warn_eol_nl fn_script_log_warn "Checking start: Removing stale lockfile" rm -f "${lockdir:?}/${selfname}-starting.lock" @@ -77,9 +77,9 @@ fn_monitor_check_starting() { fi if [ -f "${lockdir}/${selfname}-starting.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} start")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} s")" != "0" ]]; then - fn_print_dots "Checking start:" + fn_print_dots "Checking start" fn_print_checking_eol - fn_print_info "Checking start: LinuxGSM is starting:" + fn_print_info "Checking start: LinuxGSM is starting" fn_print_info_eol_nl fn_script_log_info "Checking backup: LinuxGSM is starting" core_exit.sh @@ -90,9 +90,9 @@ fn_monitor_check_stopping() { # Remove stale lockfile. if [ -f "${lockdir}/${selfname}-stopping.lock" ]; then if [ "$(find "${lockdir}/${selfname}-stopping.lock" -mmin +5)" ]; then - fn_print_dots "Checking stop:" + fn_print_dots "Checking stop" fn_print_checking_eol - fn_print_warn "Checking stop: Removing stale lockfile:" + fn_print_warn "Checking stop: Removing stale lockfile" fn_print_warn_eol_nl fn_script_log_warn "Checking stop: Removing stale lockfile" rm -f "${lockdir:?}/${selfname}-stopping.lock" @@ -100,9 +100,9 @@ fn_monitor_check_stopping() { fi if [ -f "${lockdir}/${selfname}-stopping.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} stop")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} s")" != "0" ]]; then - fn_print_dots "Checking stop:" + fn_print_dots "Checking stop" fn_print_checking_eol - fn_print_info "Checking stop: LinuxGSM is stopping:" + fn_print_info "Checking stop: LinuxGSM is stopping" fn_print_info_eol_nl fn_script_log_info "Checking backup: LinuxGSM is stopping" core_exit.sh @@ -113,9 +113,9 @@ fn_monitor_check_backup() { # Remove stale lockfile. if [ -f "${lockdir}/backup.lock" ]; then if [ "$(find "${lockdir}/backup.lock" -mmin +60)" ]; then - fn_print_dots "Checking backup:" + fn_print_dots "Checking backup" fn_print_checking_eol - fn_print_warn "Checking backup: Removing stale lockfile:" + fn_print_warn "Checking backup: Removing stale lockfile" fn_print_warn_eol fn_script_log_warn "Checking backup: Removing stale lockfile" rm -f "${lockdir:?}/backup.lock" @@ -123,9 +123,9 @@ fn_monitor_check_backup() { fi if [ -f "${lockdir}/backup.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} backup")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} b")" != "0" ]]; then - fn_print_dots "Checking backup:" + fn_print_dots "Checking backup" fn_print_checking_eol - fn_print_info "Checking backup: Backup is running:" + fn_print_info "Checking backup: Backup is running" fn_print_info_eol_nl fn_script_log_info "Checking backup: Backup is running" core_exit.sh @@ -136,9 +136,9 @@ fn_monitor_check_update() { # Remove stale lockfile. if [ -f "${lockdir}/update.lock" ]; then if [ "$(find "${lockdir}/update.lock" -mmin +15)" ]; then - fn_print_dots "Checking update:" + fn_print_dots "Checking update" fn_print_checking_eol - fn_print_warn "Checking update: Removing stale lockfile:" + fn_print_warn "Checking update: Removing stale lockfile" fn_print_warn_eol_nl fn_script_log_warn "Checking update: Removing stale lockfile" rm -f "${lockdir:?}/update.lock" @@ -146,9 +146,9 @@ fn_monitor_check_update() { fi if [ -f "${lockdir}/update.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} update")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} validate")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} v")" != "0" || "$(pgrep -fc force-update "${USER}" "/bin/bash ./${selfname} fu")" != "0" ]]; then - fn_print_dots "Checking update:" + fn_print_dots "Checking update" fn_print_checking_eol - fn_print_info "Checking update: LinuxGSM is updating the game server:" + fn_print_info "Checking update: LinuxGSM is updating the game server" fn_print_info_eol_nl fn_script_log_pass "Checking update: LinuxGSM is updating the game server" core_exit.sh @@ -159,10 +159,10 @@ fn_monitor_check_update() { fn_monitor_check_update_source() { if [ -f "${consolelogdir}/${selfname}-console.log" ] && [ "${engine}" == "source" ]; then if grep -q "Your server needs to be restarted in order to receive the latest update." "${consolelogdir}/${selfname}-console.log"; then - fn_print_dots "Checking update:" + fn_print_dots "Checking update" fn_print_checking_eol fn_script_log_info "Checking update: CHECKING" - fn_print_ok "Checking update:" + fn_print_ok "Checking update" fn_print_ok_eol_nl fn_script_log_info "Checking update: ${selfname} has requested an update and needs to be restarted" alert="update-request" @@ -182,7 +182,7 @@ fn_monitor_check_session() { sessionheight="23" # Check for PIDS with identical tmux sessions running. if [ "$(pgrep -fcx "tmux -L ${socketname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" -ge "2" ]; then - fn_print_error "Checking session: There are PIDS with identical tmux sessions running:" + fn_print_error "Checking session: There are PIDS with identical tmux sessions running" fn_print_error_eol_nl fn_script_log_error "Checking session: ERROR" fn_script_log_error "Checking session: There are PIDS with identical tmux sessions running" @@ -192,7 +192,7 @@ fn_monitor_check_session() { core_exit.sh # Check for tmux pids with the same tmux session and socket names. This will reduce issues with migration to release v23.5.0. #4296 elif [ "$(pgrep -fc -u "${USER}" "tmux -L ${sessionname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then - fn_print_error "Checking session: PIDS with the same tmux session and socket names are running:" + fn_print_error "Checking session: PIDS with the same tmux session and socket names are running" fn_print_error_eol_nl fn_script_log_error "Checking session: ERROR" fn_script_log_error "Checking session: PIDS with the same tmux session and socket names are running" @@ -202,7 +202,7 @@ fn_monitor_check_session() { core_exit.sh # Check for tmux pids that are using the old type of tmux session. This will reduce issues with migration to release v23.5.0. #4296 elif [ "$(pgrep -fc -u "${USER}" "tmux new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then - fn_print_error "Checking session: PIDS with old type tmux session are running:" + fn_print_error "Checking session: PIDS with old type tmux session are running" fn_print_error_eol_nl fn_script_log_error "Checking session: ERROR" fn_script_log_error "Checking session: PIDS with old type tmux session are running" @@ -233,7 +233,7 @@ fn_monitor_check_session() { # Monitor will check queryport is set before continuing. fn_monitor_check_queryport() { if [ -z "${queryport}" ] || [ "${queryport}" == "0" ]; then - fn_print_dots "Checking port:" + fn_print_dots "Checking port" fn_print_checking_eol fn_script_log_info "Checking port: CHECKING" if [ -n "${rconenabled}" ] && [ "${rconenabled}" != "true" ] && [ "${shortname}" == "av" ]; then diff --git a/lgsm/modules/core_legacy.sh b/lgsm/modules/core_legacy.sh index 4c9a55c39..1d5bc430c 100644 --- a/lgsm/modules/core_legacy.sh +++ b/lgsm/modules/core_legacy.sh @@ -35,6 +35,12 @@ if [ -n "${autosaveinterval}" ]; then saveinterval="${autosaveinterval}" fi +if [ "${shortname}" == "st" ]; then + if [ -n "${worldname}" ]; then + worldsave="${worldname}" + fi +fi + # Added as part of migrating functions dir to modules dir. # Will remove functions dir if files in modules dir older than 14 days functionsdir="${lgsmdir}/modules" diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 4e1d5dedd..3bae60f0b 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -673,7 +673,7 @@ fn_info_game_st() { saveinterval="${saveinterval:-"0"}" servername="${servername:-"NOT SET"}" serverpassword="${serverpassword:-"NOT SET"}" - worldname="${worldname:-"NOT SET"}" + worldsave="${worldsave:-"NOT SET"}" worldtype="${worldtype:-"NOT SET"}" } diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index c78c74fb2..db6b1e5cf 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -687,6 +687,11 @@ elif [ "${shortname}" == "sb" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "st" ]; then + array_configs+=(setting.xml) + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations elif [ "${shortname}" == "stn" ]; then array_configs+=(ServerConfig.txt ServerUsers.txt TpPresets.json UserPermissions.json) fn_default_config_remote From 1639bd5d0d37098f3545b7ced7a1fcb9e577b15f Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 5 Jan 2025 13:27:03 +0000 Subject: [PATCH 015/132] feat: add extra checks to fail if jq is not installed (#4731) --- lgsm/modules/check.sh | 2 +- lgsm/modules/update_jk2.sh | 6 ++++++ lgsm/modules/update_mc.sh | 6 ++++++ lgsm/modules/update_mcb.sh | 6 ++++++ lgsm/modules/update_mta.sh | 6 ++++++ lgsm/modules/update_pmc.sh | 6 ++++++ lgsm/modules/update_ts3.sh | 6 ++++++ lgsm/modules/update_ut99.sh | 6 ++++++ lgsm/modules/update_vints.sh | 6 ++++++ lgsm/modules/update_xnt.sh | 6 ++++++ 10 files changed, 55 insertions(+), 1 deletion(-) diff --git a/lgsm/modules/check.sh b/lgsm/modules/check.sh index 7601898a9..59ac2a329 100644 --- a/lgsm/modules/check.sh +++ b/lgsm/modules/check.sh @@ -54,7 +54,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do fi done -allowed_commands_array=(BACKUP DEBUG START) +allowed_commands_array=(BACKUP DEBUG DETAILS START UPDATE) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_deps.sh diff --git a/lgsm/modules/update_jk2.sh b/lgsm/modules/update_jk2.sh index ed4886a48..20350aec6 100644 --- a/lgsm/modules/update_jk2.sh +++ b/lgsm/modules/update_jk2.sh @@ -152,6 +152,12 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="github.com" +if [ "$(command -v jq 2> /dev/null)" ]; then + fn_print_fail_nl "jq is not installed" + fn_script_log_fatal "jq is not installed" + core_exit.sh +fi + if [ "${firstcommandname}" == "INSTALL" ]; then fn_update_remotebuild fn_update_dl diff --git a/lgsm/modules/update_mc.sh b/lgsm/modules/update_mc.sh index 6ece44da4..8cac4067b 100644 --- a/lgsm/modules/update_mc.sh +++ b/lgsm/modules/update_mc.sh @@ -167,6 +167,12 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="mojang.com" +if [ "$(command -v jq 2> /dev/null)" ]; then + fn_print_fail_nl "jq is not installed" + fn_script_log_fatal "jq is not installed" + core_exit.sh +fi + if [ "${firstcommandname}" == "INSTALL" ]; then fn_update_remotebuild fn_update_dl diff --git a/lgsm/modules/update_mcb.sh b/lgsm/modules/update_mcb.sh index e3a4776ce..8b66aa006 100644 --- a/lgsm/modules/update_mcb.sh +++ b/lgsm/modules/update_mcb.sh @@ -175,6 +175,12 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="minecraft.net" +if [ "$(command -v jq 2> /dev/null)" ]; then + fn_print_fail_nl "jq is not installed" + fn_script_log_fatal "jq is not installed" + core_exit.sh +fi + if [ "${firstcommandname}" == "INSTALL" ]; then fn_update_remotebuild fn_update_dl diff --git a/lgsm/modules/update_mta.sh b/lgsm/modules/update_mta.sh index b93dc9af1..e677723a0 100644 --- a/lgsm/modules/update_mta.sh +++ b/lgsm/modules/update_mta.sh @@ -160,6 +160,12 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="linux.mtasa.com" +if [ "$(command -v jq 2> /dev/null)" ]; then + fn_print_fail_nl "jq is not installed" + fn_script_log_fatal "jq is not installed" + core_exit.sh +fi + if [ "${firstcommandname}" == "INSTALL" ]; then fn_update_remotebuild fn_update_dl diff --git a/lgsm/modules/update_pmc.sh b/lgsm/modules/update_pmc.sh index 75d99d140..053d1f9ae 100644 --- a/lgsm/modules/update_pmc.sh +++ b/lgsm/modules/update_pmc.sh @@ -177,6 +177,12 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="papermc.io" +if [ "$(command -v jq 2> /dev/null)" ]; then + fn_print_fail_nl "jq is not installed" + fn_script_log_fatal "jq is not installed" + core_exit.sh +fi + if [ "${shortname}" == "pmc" ]; then paperproject="paper" elif [ "${shortname}" == "vpmc" ]; then diff --git a/lgsm/modules/update_ts3.sh b/lgsm/modules/update_ts3.sh index 30ddf2801..8bbbbc2b2 100644 --- a/lgsm/modules/update_ts3.sh +++ b/lgsm/modules/update_ts3.sh @@ -171,6 +171,12 @@ fi # The location where the builds are checked and downloaded. remotelocation="teamspeak.com" +if [ "$(command -v jq 2> /dev/null)" ]; then + fn_print_fail_nl "jq is not installed" + fn_script_log_fatal "jq is not installed" + core_exit.sh +fi + if [ "${firstcommandname}" == "INSTALL" ]; then fn_update_remotebuild fn_update_dl diff --git a/lgsm/modules/update_ut99.sh b/lgsm/modules/update_ut99.sh index 58927fd18..f83208e6f 100644 --- a/lgsm/modules/update_ut99.sh +++ b/lgsm/modules/update_ut99.sh @@ -153,6 +153,12 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="github.com" +if [ "$(command -v jq 2> /dev/null)" ]; then + fn_print_fail_nl "jq is not installed" + fn_script_log_fatal "jq is not installed" + core_exit.sh +fi + if [ "${firstcommandname}" == "INSTALL" ]; then fn_update_remotebuild fn_update_dl diff --git a/lgsm/modules/update_vints.sh b/lgsm/modules/update_vints.sh index 2f7f857a1..1e17cac7d 100644 --- a/lgsm/modules/update_vints.sh +++ b/lgsm/modules/update_vints.sh @@ -160,6 +160,12 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="vintagestory.at" +if [ "$(command -v jq 2> /dev/null)" ]; then + fn_print_fail_nl "jq is not installed" + fn_script_log_fatal "jq is not installed" + core_exit.sh +fi + if [ "${firstcommandname}" == "INSTALL" ]; then fn_update_remotebuild fn_update_dl diff --git a/lgsm/modules/update_xnt.sh b/lgsm/modules/update_xnt.sh index c0b0ddaeb..31c5c1249 100644 --- a/lgsm/modules/update_xnt.sh +++ b/lgsm/modules/update_xnt.sh @@ -160,6 +160,12 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="github.com" +if [ "$(command -v jq 2> /dev/null)" ]; then + fn_print_fail_nl "jq is not installed" + fn_script_log_fatal "jq is not installed" + core_exit.sh +fi + if [ "${firstcommandname}" == "INSTALL" ]; then fn_update_remotebuild fn_update_dl From 6adf4da6d824e17cc9c5bdbc4671e0a16603eb27 Mon Sep 17 00:00:00 2001 From: Jimmy Maple <38733055+codingWithJimmy@users.noreply.github.com> Date: Sun, 5 Jan 2025 11:59:36 -0500 Subject: [PATCH 016/132] fix(mc): correct the of counting players online on Minecraft servers via gamedig --- lgsm/modules/query_gamedig.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lgsm/modules/query_gamedig.sh b/lgsm/modules/query_gamedig.sh index f370fae97..d8c3c6a7f 100644 --- a/lgsm/modules/query_gamedig.sh +++ b/lgsm/modules/query_gamedig.sh @@ -42,9 +42,7 @@ if [ "$(command -v "${gamedigbinary}" 2> /dev/null)" ] && [ "$(command -v jq 2> fi # numplayers. - if [ "${querytype}" == "minecraft" ]; then - gdplayers=$(echo "${gamedigraw}" | jq -re '.players | length-1') - elif [ "${querytype}" == "teamspeak3" ]; then + if [ "${querytype}" == "teamspeak3" ]; then gdplayers=$(echo "${gamedigraw}" | jq -re '.raw.virtualserver_clientsonline') else gdplayers=$(echo "${gamedigraw}" | jq -re '.players | length') From d0fbe4a7b63b6547c098272235188a7d4c935832 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 5 Jan 2025 17:21:11 +0000 Subject: [PATCH 017/132] feat: replace mailx with s-nail for email alerts --- lgsm/modules/check_deps.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh index 95d4a6ad0..dcc9c890c 100644 --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -114,13 +114,13 @@ fn_deps_email() { elif [ -d /etc/sendmail ]; then array_deps_required+=(sendmail) elif [ "$(command -v yum 2> /dev/null)" ] || [ "$(command -v dnf 2> /dev/null)" ]; then - array_deps_required+=(mailx postfix) + array_deps_required+=(s-nail postfix) elif [ "$(command -v apt 2> /dev/null)" ]; then array_deps_required+=(mailutils postfix) fi else if [ "$(command -v yum 2> /dev/null)" ] || [ "$(command -v dnf 2> /dev/null)" ]; then - array_deps_required+=(mailx postfix) + array_deps_required+=(s-nail postfix) elif [ "$(command -v apt 2> /dev/null)" ]; then array_deps_required+=(mailutils postfix) fi From 06166045bc01515ce743426dca630df3f8e0ac71 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 5 Jan 2025 23:28:35 +0000 Subject: [PATCH 018/132] fix(sof2): correct config location (#4739) --- lgsm/config-default/config-lgsm/sof2server/_default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/sof2server/_default.cfg b/lgsm/config-default/config-lgsm/sof2server/_default.cfg index e00afefa1..140773daf 100644 --- a/lgsm/config-default/config-lgsm/sof2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/sof2server/_default.cfg @@ -142,7 +142,7 @@ glibc="2.1" # Edit with care ## Game Server Directories -systemdir="${serverfiles}/main" +systemdir="${serverfiles}/base" executabledir="${serverfiles}" executable="./sof2ded" servercfgdir="${systemdir}" From f49c2b3aa7a1ff3bb8b057d83412ae27f7177411 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 5 Jan 2025 23:38:17 +0000 Subject: [PATCH 019/132] feat(bfv): add query for bfv (#4740) * fix quake2 and formatted * correct bfv ports * update bf config info * remove curl * tidy * fix jc2mp query name --- .../config-lgsm/bfvserver/_default.cfg | 4 ++-- .../config-lgsm/jc2server/_default.cfg | 2 +- lgsm/modules/info_game.sh | 6 ++++-- lgsm/modules/query_gsquery.py | 14 +++++++------- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/lgsm/config-default/config-lgsm/bfvserver/_default.cfg b/lgsm/config-default/config-lgsm/bfvserver/_default.cfg index 53aa36054..2e8aed8f1 100644 --- a/lgsm/config-default/config-lgsm/bfvserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bfvserver/_default.cfg @@ -123,8 +123,8 @@ stopmode="3" # 3: gamedig # 4: gsquery # 5: tcp -querymode="1" -querytype="" +querymode="3" +querytype="protocol-gamespy2" ## Console type consoleverbose="yes" diff --git a/lgsm/config-default/config-lgsm/jc2server/_default.cfg b/lgsm/config-default/config-lgsm/jc2server/_default.cfg index 5a82bbad9..21932e205 100644 --- a/lgsm/config-default/config-lgsm/jc2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc2server/_default.cfg @@ -134,7 +134,7 @@ stopmode="2" # 4: gsquery # 5: tcp querymode="2" -querytype="jc2m" +querytype="jc2mp" ## Console type consoleverbose="yes" diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 3bae60f0b..dcdbe2f2b 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -959,13 +959,14 @@ fn_info_game_bf1942() { fn_info_game_keyvalue_pairs_space "configip" "game.serverIP" fn_info_game_keyvalue_pairs_space "maxplayers" "game.serverMaxPlayers" fn_info_game_keyvalue_pairs_space "port" "game.serverPort" + fn_info_game_keyvalue_pairs_space "queryport" "game.gameSpyPort" fn_info_game_keyvalue_pairs_space "servername" "game.serverName" fn_info_game_keyvalue_pairs_space "serverpassword" "game.serverPassword" fi configip="${configip:-"0.0.0.0"}" maxplayers="${maxplayers:-"0"}" port="${port:-"0"}" - queryport="22000" + queryport="${queryport:-"0"}" servername="${servername:-"NOT SET"}" serverpassword="${serverpassword:-"NOT SET"}" } @@ -982,11 +983,12 @@ fn_info_game_bfv() { fn_info_game_keyvalue_pairs_space "port" "game.serverPort" fn_info_game_keyvalue_pairs_space "servername" "game.serverName" fn_info_game_keyvalue_pairs_space "serverpassword" "game.serverPassword" + fn_info_game_keyvalue_pairs_space "queryport" "game.gameSpyPort" fi configip="${configip:-"0.0.0.0"}" maxplayers="${maxplayers:-"0"}" port="${port:-"0"}" - queryport="22000" + queryport="${queryport:-"0"}" servername="${servername:-"NOT SET"}" serverpassword="${serverpassword:-"NOT SET"}" } diff --git a/lgsm/modules/query_gsquery.py b/lgsm/modules/query_gsquery.py index ecdf8165c..245a606e1 100644 --- a/lgsm/modules/query_gsquery.py +++ b/lgsm/modules/query_gsquery.py @@ -11,7 +11,7 @@ import socket import sys engine_types = ('protocol-valve', 'protocol-quake2', 'protocol-quake3', 'protocol-gamespy1', - 'protocol-unreal2', 'ut3', 'minecraft', 'minecraftbe', 'jc2m', 'mumbleping', 'soldat', 'teeworlds') + 'protocol-unreal2', 'ut3', 'minecraft', 'minecraftbe', 'jc2mp', 'mumbleping', 'soldat', 'teeworlds') class gsquery: @@ -22,11 +22,11 @@ class gsquery: idtech2query = ('protocol-quake2', 'idtech2', 'quake', 'iw2.0') idtech3query = ('protocol-quake3', 'iw3.0', 'ioquake3', 'qfusion') minecraftquery = ('minecraft', 'lwjgl2') - minecraftbequery = ('minecraftbe',) - jc2mquery = ('jc2m',) - mumblequery = ('mumbleping',) - soldatquery = ('soldat',) - twquery = ('teeworlds',) + minecraftbequery = ('minecraftbe') + jc2mpquery = ('jc2mp') + mumblequery = ('mumbleping') + soldatquery = ('soldat') + twquery = ('teeworlds') unrealquery = ('protocol-gamespy1', 'unreal') unreal2query = ('protocol-unreal2', 'unreal2') unreal3query = ('ut3', 'unreal3') @@ -40,7 +40,7 @@ class gsquery: self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00' elif self.argument.engine in self.idtech3query: self.query_prompt_string = b'\xff\xff\xff\xffgetstatus' - elif self.argument.engine in self.jc2mquery: + elif self.argument.engine in self.jc2mpquery: self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40' elif self.argument.engine in self.minecraftquery: self.query_prompt_string = b'\xFE\xFD\x09\x3d\x54\x1f\x93' From 181cd50e02e0fd6214d88ec6050f68fb9035c741 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 7 Jan 2025 18:15:22 +0000 Subject: [PATCH 020/132] fix: broken download url for name-left.csv name-right.csv --- lgsm/modules/info_stats.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/info_stats.sh b/lgsm/modules/info_stats.sh index b995d0e3b..c8a96552a 100644 --- a/lgsm/modules/info_stats.sh +++ b/lgsm/modules/info_stats.sh @@ -23,10 +23,10 @@ fi if [ ! -f "${datadir}/uuid-${selfname}.txt" ] || [ ! -f "${datadir}/uuid-install.txt" ]; then # download dictionary words if [ ! -f "${datadir}/name-left.csv" ]; then - fn_fetch_file_github "${datadir}" "name-left.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nohash" + fn_fetch_file_github "lgsm/data" "name-left.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nohash" fi if [ ! -f "${datadir}/name-right.csv" ]; then - fn_fetch_file_github "${datadir}" "name-right.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nohash" + fn_fetch_file_github "lgsm/data" "name-right.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nohash" fi # generate instance uuid From d900a62c7370d5a1125210c1d71352609dbadf57 Mon Sep 17 00:00:00 2001 From: Zechiax <106590288+Zechiax@users.noreply.github.com> Date: Sun, 5 Jan 2025 00:33:30 +0100 Subject: [PATCH 021/132] fix(papermc): update API URL to prevent update failures (#4728) --- lgsm/modules/update_pmc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/update_pmc.sh b/lgsm/modules/update_pmc.sh index b3c7d0dc2..ff48d385c 100644 --- a/lgsm/modules/update_pmc.sh +++ b/lgsm/modules/update_pmc.sh @@ -33,7 +33,7 @@ fn_update_localbuild() { fn_update_remotebuild() { # Get remote build info. - apiurl="https://papermc.io/api/v2/projects" + apiurl="https://api.papermc.io/v2/projects" # Get list of projects. remotebuildresponse=$(curl -s "${apiurl}") # Get list of Minecraft versions for project. From d24ea7420f870809f0dedeea6b36fd6bbd9e72e4 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 8 Jan 2025 11:24:02 +0000 Subject: [PATCH 022/132] Release v24.3.4 --- lgsm/modules/core_modules.sh | 2 +- linuxgsm.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index ae6e7ea7a..3f8c801a7 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v24.3.3" +modulesversion="v24.3.4" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 96ce50a6d..7e885b662 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -24,7 +24,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v24.3.3" +version="v24.3.4" shortname="core" gameservername="core" commandname="CORE" From 81c4f802863f97cb0008ef993ed27a8f2af4b913 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 8 Jan 2025 18:19:52 +0000 Subject: [PATCH 023/132] feat(squad44): Rename Post Scriptum to Squad 44 (#4737) --- .../config-lgsm/{psserver => squad44server}/_default.cfg | 0 lgsm/data/debian-10.csv | 2 +- lgsm/data/debian-11.csv | 2 +- lgsm/data/debian-12.csv | 2 +- lgsm/data/debian-13.csv | 2 +- lgsm/data/debian-9.csv | 2 +- lgsm/data/serverlist.csv | 2 +- lgsm/data/ubuntu-16.04.csv | 2 +- lgsm/data/ubuntu-18.04.csv | 2 +- lgsm/data/ubuntu-20.04.csv | 2 +- lgsm/data/ubuntu-22.04.csv | 2 +- lgsm/data/ubuntu-23.04.csv | 2 +- lgsm/data/ubuntu-23.10.csv | 2 +- lgsm/data/ubuntu-24.04.csv | 2 +- lgsm/modules/check_system_requirements.sh | 2 +- lgsm/modules/info_game.sh | 2 +- lgsm/modules/info_messages.sh | 2 +- 17 files changed, 16 insertions(+), 16 deletions(-) rename lgsm/config-default/config-lgsm/{psserver => squad44server}/_default.cfg (100%) diff --git a/lgsm/config-default/config-lgsm/psserver/_default.cfg b/lgsm/config-default/config-lgsm/squad44server/_default.cfg similarity index 100% rename from lgsm/config-default/config-lgsm/psserver/_default.cfg rename to lgsm/config-default/config-lgsm/squad44server/_default.cfg diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 6bfa1dae4..bfbf4dac0 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -81,7 +81,7 @@ opfor pc pc2 pmc,openjdk-11-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pw diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 5441a69b4..61a20b15f 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -82,7 +82,7 @@ opfor pc pc2 pmc,openjdk-17-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pw diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 1c0a39930..5fa249e15 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -82,7 +82,7 @@ opfor pc pc2 pmc,openjdk-17-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pw diff --git a/lgsm/data/debian-13.csv b/lgsm/data/debian-13.csv index 5ddb19405..4002eb0e9 100644 --- a/lgsm/data/debian-13.csv +++ b/lgsm/data/debian-13.csv @@ -82,7 +82,7 @@ opfor pc pc2 pmc,openjdk-22-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pw diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 4e54ac241..d00f64969 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -82,7 +82,7 @@ opfor pc pc2 pmc,openjdk-8-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pw diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 0f350b55d..d75bee3b5 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -81,7 +81,6 @@ opfor,opforserver,Opposing Force,ubuntu-24.04 pc,pcserver,Project Cars,ubuntu-24.04 pc2,pc2server,Project Cars 2,ubuntu-24.04 pmc,pmcserver,PaperMC,ubuntu-24.04 -ps,psserver,Post Scriptum,ubuntu-24.04 pvkii,pvkiiserver,Pirates Vikings & Knights II,ubuntu-24.04 pvr,pvrserver,Pavlov VR,ubuntu-24.04 pw,pwserver,Palworld,ubuntu-24.04 @@ -108,6 +107,7 @@ sm,smserver,Soulmask,ubuntu-24.04 sof2,sof2server,Soldier Of Fortune 2: Gold Edition,ubuntu-24.04 sol,solserver,Soldat,ubuntu-24.04 squad,squadserver,Squad,ubuntu-24.04 +squad44,squad44server,Squad 44,ubuntu-24.04 st,stserver,Stationeers,ubuntu-24.04 stn,stnserver,Survive the Nights,ubuntu-24.04 sven,svenserver,Sven Co-op,ubuntu-20.04 diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 51f769c1a..1327946e5 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,openjdk-8-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pz,openjdk-8-jre,rng-tools diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 7ca2d86c6..d693fba00 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,openjdk-11-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pz,openjdk-11-jre,rng-tools diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index f16d8b3be..193054da8 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -82,7 +82,7 @@ opfor pc pc2 pmc,openjdk-21-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pw diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index e84f4dddd..1b8849bba 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -82,7 +82,7 @@ opfor pc pc2 pmc,openjdk-21-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pw diff --git a/lgsm/data/ubuntu-23.04.csv b/lgsm/data/ubuntu-23.04.csv index c0135abd7..2ed8416a2 100644 --- a/lgsm/data/ubuntu-23.04.csv +++ b/lgsm/data/ubuntu-23.04.csv @@ -82,7 +82,7 @@ opfor pc pc2 pmc,openjdk-21-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pw diff --git a/lgsm/data/ubuntu-23.10.csv b/lgsm/data/ubuntu-23.10.csv index c0135abd7..2ed8416a2 100644 --- a/lgsm/data/ubuntu-23.10.csv +++ b/lgsm/data/ubuntu-23.10.csv @@ -82,7 +82,7 @@ opfor pc pc2 pmc,openjdk-21-jre -ps,libgconf-2-4 +squad44 pvkii pvr,libc++1 pw diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index c0135abd7..6414652ec 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -82,7 +82,7 @@ opfor pc pc2 pmc,openjdk-21-jre -ps,libgconf-2-4 +ps pvkii pvr,libc++1 pw diff --git a/lgsm/modules/check_system_requirements.sh b/lgsm/modules/check_system_requirements.sh index 531695a6e..39cef3a42 100644 --- a/lgsm/modules/check_system_requirements.sh +++ b/lgsm/modules/check_system_requirements.sh @@ -39,7 +39,7 @@ elif [ "${shortname}" == "mh" ]; then ramrequirementgb="4" elif [ "${shortname}" == "ns2" ] || [ "${shortname}" == "ns2c" ]; then ramrequirementgb="1" -elif [ "${shortname}" == "ps" ]; then +elif [ "${shortname}" == "squad44" ]; then ramrequirementgb="2" elif [ "${shortname}" == "pvr" ]; then ramrequirementgb="1" diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index dcdbe2f2b..2819b65d1 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -2406,7 +2406,7 @@ elif [ "${shortname}" == "pc" ]; then fn_info_game_pc elif [ "${shortname}" == "pc2" ]; then fn_info_game_pc2 -elif [ "${shortname}" == "ps" ]; then +elif [ "${shortname}" == "squad44" ]; then fn_info_game_ps elif [ "${shortname}" == "pvr" ]; then fn_info_game_pvr diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index 09576e861..e47f5dd08 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -1858,7 +1858,7 @@ fn_info_messages_select_engine() { fn_info_messages_pc elif [ "${shortname}" == "pc2" ]; then fn_info_messages_pc2 - elif [ "${shortname}" == "ps" ]; then + elif [ "${shortname}" == "squad44" ]; then fn_info_messages_ps elif [ "${shortname}" == "pvr" ]; then fn_info_messages_pvr From 8d17622af3d24bfe120cd8a3296ac7d0908e9a3e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 8 Jan 2025 18:22:16 +0000 Subject: [PATCH 024/132] feat: add ismygameserver.online links (#4742) --- lgsm/modules/alert_discord.sh | 97 +++------------------------ lgsm/modules/alert_gotify.sh | 34 ++++++---- lgsm/modules/alert_ifttt.sh | 34 ++++++---- lgsm/modules/alert_pushbullet.sh | 35 +++++----- lgsm/modules/alert_pushover.sh | 24 +++++-- lgsm/modules/alert_rocketchat.sh | 34 +++++++--- lgsm/modules/alert_slack.sh | 38 ++++++++--- lgsm/modules/alert_telegram.sh | 37 +++++----- lgsm/modules/check_permissions.sh | 4 +- lgsm/modules/command_dev_query_raw.sh | 4 ++ lgsm/modules/info_messages.sh | 33 +++++++++ 11 files changed, 205 insertions(+), 169 deletions(-) diff --git a/lgsm/modules/alert_discord.sh b/lgsm/modules/alert_discord.sh index 93eda8d5b..3b489984d 100644 --- a/lgsm/modules/alert_discord.sh +++ b/lgsm/modules/alert_discord.sh @@ -7,7 +7,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -jsoninfo=$( +json=$( cat << EOF { "username": "LinuxGSM", @@ -29,103 +29,32 @@ jsoninfo=$( "url": "${alerticon}" }, "fields": [ - { - "name": "Server Name", - "value": "${servername}" - }, - { - "name": "Information", - "value": "${alertmessage}" - }, { - "name": "Game", - "value": "${gamename}", - "inline": true + "name": "Server Name", + "value": "${servername}" }, { - "name": "Server IP", - "value": "\`${alertip}:${port}\`", - "inline": true - }, - { - "name": "Hostname", - "value": "${HOSTNAME}", - "inline": true + "name": "Information", + "value": "${alertmessage}" }, - { - "name": "More info", - "value": "${alerturl}", - "inline": true - }, - { - "name": "Server Time", - "value": "$(date)", - "inline": true - } - ], - "footer": { - "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", - "text": "Sent by LinuxGSM ${version}" - } - } - ] -} -EOF -) - -jsonnoinfo=$( - cat << EOF -{ - "username": "LinuxGSM", - "avatar_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", - "file": "content", - "embeds": [ - { - "author": { - "name": "LinuxGSM Alert", - "url": "", - "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg" - }, - "title": "${alerttitle}", - "url": "", - "description": "", - "color": "${alertcolourdec}", - "type": "content", - "thumbnail": { - "url": "${alerticon}" - }, - "fields": [ - { - "name": "Server Name", - "value": "${servername}" - }, - { - "name": "Information", - "value": "${alertmessage}" - }, { "name": "Game", "value": "${gamename}", "inline": true }, { - "name": "Server IP", - "value": "\`${alertip}:${port}\`", - "inline": true - }, - { - "name": "Hostname", - "value": "${HOSTNAME}", + "name": "Server Time", + "value": "$(date)", "inline": true }, { - "name": "Server Time", - "value": "$(date)", + "name": "Is my Game Server Online?", + "value": "https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}", "inline": true } ], "footer": { - "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", + "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", "text": "Sent by LinuxGSM ${version}" } } @@ -136,12 +65,6 @@ EOF fn_print_dots "Sending Discord alert" -if [ -z "${alerturl}" ]; then - json="${jsonnoinfo}" -else - json="${jsoninfo}" -fi - discordsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${discordwebhook}") if [ -n "${discordsend}" ]; then diff --git a/lgsm/modules/alert_gotify.sh b/lgsm/modules/alert_gotify.sh index dcb438fb2..2f627c774 100644 --- a/lgsm/modules/alert_gotify.sh +++ b/lgsm/modules/alert_gotify.sh @@ -7,32 +7,38 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -jsoninfo=$( +json=$( cat << EOF { "title": "${alerttitle}", - "message": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}\n\nServer Time\n$(date)", - "priority": 5 -} + "message": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\n EOF ) -jsonnoinfo=$( +if [ -n "${querytype}" ]; then + json+=$( + cat << EOF +Is my Game Server Online?\nhttps://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}\n\n +EOF + ) +fi + +if [ -n "${alerturl}" ]; then + json+=$( + cat << EOF +More info\n${alerturl}\n\n +EOF + ) +fi + +json+=$( cat << EOF -{ - "title": "${alerttitle}", - "message": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nServer Time\n$(date)", +Server Time\n$(date)", "priority": 5 } EOF ) -if [ -z "${alerturl}" ]; then - json="${jsonnoinfo}" -else - json="${jsoninfo}" -fi - fn_print_dots "Sending Gotify alert" gotifysend=$(curl --connect-timeout 3 -sSL "${gotifywebhook}/message"?token="${gotifytoken}" -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)") diff --git a/lgsm/modules/alert_ifttt.sh b/lgsm/modules/alert_ifttt.sh index ca1c005d0..aaae3b4e8 100644 --- a/lgsm/modules/alert_ifttt.sh +++ b/lgsm/modules/alert_ifttt.sh @@ -7,32 +7,38 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -jsoninfo=$( +json=$( cat << EOF { "value1": "${selfname}", "value2": "${alerttitle}", - "value3": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}\n\nServer Time\n$(date)" -} + "value3": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\n EOF ) -jsonnoinfo=$( +if [ -n "${querytype}" ]; then + json+=$( + cat << EOF +Is my Game Server Online?\nhttps://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}\n\n +EOF + ) +fi + +if [ -n "${alerturl}" ]; then + json+=$( + cat << EOF +More info\n${alerturl}\n\n +EOF + ) +fi + +json+=$( cat << EOF -{ - "value1": "${selfname}", - "value2": "${alerttitle}", - "value3": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nServer Time\n$(date)" +Server Time\n$(date)" } EOF ) -if [ -z "${alerturl}" ]; then - json="${jsonnoinfo}" -else - json="${jsoninfo}" -fi - fn_print_dots "Sending IFTTT alert" iftttsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "https://maker.ifttt.com/trigger/${iftttevent}/with/key/${ifttttoken}" | grep "Bad Request") diff --git a/lgsm/modules/alert_pushbullet.sh b/lgsm/modules/alert_pushbullet.sh index 4b96a1f9f..abdfa0bb2 100644 --- a/lgsm/modules/alert_pushbullet.sh +++ b/lgsm/modules/alert_pushbullet.sh @@ -7,34 +7,39 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -jsoninfo=$( +json=$( cat << EOF { "channel_tag": "${channeltag}", "type": "note", "title": "${alerttitle}", - "body": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}\n\nServer Time\n$(date)" -} + "body": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\n EOF ) -jsonnoinfo=$( +if [ -n "${querytype}" ]; then + json+=$( + cat << EOF +Is my Game Server Online?\nhttps://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}\n\n +EOF + ) +fi + +if [ -n "${alerturl}" ]; then + json+=$( + cat << EOF +More info\n${alerturl}\n\n +EOF + ) +fi + +json+=$( cat << EOF -{ - "channel_tag": "${channeltag}", - "type": "note", - "title": "${alerttitle}", - "body": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nServer Time\n$(date)" +Server Time\n$(date)" } EOF ) -if [ -z "${alerturl}" ]; then - json="${jsonnoinfo}" -else - json="${jsoninfo}" -fi - fn_print_dots "Sending Pushbullet alert" pushbulletsend=$(curl --connect-timeout 3 -sSL -H "Access-Token: ${pushbullettoken}" -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "https://api.pushbullet.com/v2/pushes" | grep "error_code") diff --git a/lgsm/modules/alert_pushover.sh b/lgsm/modules/alert_pushover.sh index dc488026a..8dc0ce2dc 100644 --- a/lgsm/modules/alert_pushover.sh +++ b/lgsm/modules/alert_pushover.sh @@ -22,12 +22,28 @@ else alertpriority="0" fi -if [ -z "${alerturl}" ]; then - pushoversend=$(curl --connect-timeout 3 -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alerttitle}" -F message=" Server name
${servername}

Information
${alertmessage}

Game
${gamename}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

Server Time
$(date)" "https://api.pushover.net/1/messages.json" | grep errors) -else - pushoversend=$(curl --connect-timeout 3 -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alerttitle}" -F message=" Server name
${servername}

Information
${alertmessage}

Game
${gamename}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

More info
${alerturl}

Server Time
$(date)" "https://api.pushover.net/1/messages.json" | grep errors) +message=" Server name
${servername}

Information
${alertmessage}

Game
${gamename}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

" + +if [ -n "${querytype}" ]; then + message+="Is my Game Server Online?
Check here

" +fi + +if [ -n "${alerturl}" ]; then + message+="More info
${alerturl}

" fi +message+="Server Time
$(date)" + +pushoversend=$(curl --connect-timeout 3 -sS \ + -F token="${pushovertoken}" \ + -F user="${pushoveruserkey}" \ + -F html="1" \ + -F sound="${alertsound}" \ + -F priority="${alertpriority}" \ + -F title="${alerttitle}" \ + -F message="${message}" \ + "https://api.pushover.net/1/messages.json" | grep errors) + if [ -n "${pushoversend}" ]; then fn_print_fail_nl "Sending Pushover alert: ${pushoversend}" fn_script_log_fail "Sending Pushover alert: ${pushoversend}" diff --git a/lgsm/modules/alert_rocketchat.sh b/lgsm/modules/alert_rocketchat.sh index bff2c6a0b..35bcf4928 100644 --- a/lgsm/modules/alert_rocketchat.sh +++ b/lgsm/modules/alert_rocketchat.sh @@ -7,7 +7,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -jsoninfo=$( +json=$( cat << EOF { "alias": "LinuxGSM", @@ -64,7 +64,31 @@ jsoninfo=$( EOF ) -jsonnoinfo=$( +if [ -n "${querytype}" ]; then + json+=$( + cat << EOF + { + "short": false, + "title": "Is my Game Server Online?", + "value": "" + }, +EOF + ) +fi + +if [ -n "${alerturl}" ]; then + json+=$( + cat << EOF + { + "short": false, + "title": "More info", + "value": "${alerturl}" + }, +EOF + ) +fi + +json+=$( cat << EOF { "alias": "LinuxGSM", @@ -116,12 +140,6 @@ jsonnoinfo=$( EOF ) -if [ -z "${alerturl}" ]; then - json="${jsonnoinfo}" -else - json="${jsoninfo}" -fi - fn_print_dots "Sending Rocketchat alert" rocketchatsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${rocketchatwebhook}") diff --git a/lgsm/modules/alert_slack.sh b/lgsm/modules/alert_slack.sh index 58dc54772..0a1e9015e 100644 --- a/lgsm/modules/alert_slack.sh +++ b/lgsm/modules/alert_slack.sh @@ -7,7 +7,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -jsonnoinfo=$( +json=$( cat << EOF { "attachments": [ @@ -87,7 +87,35 @@ jsonnoinfo=$( EOF ) -jsoninfo=$( +if [ -n "${querytype}" ]; then + json+=$( + cat << EOF + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*Is my Game Server Online?*\n" + } + }, +EOF + ) +fi + +if [ -n "${alerturl}" ]; then + json+=$( + cat << EOF + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*More info*\n<${alerturl}|${alerturl}>" + } + }, +EOF + ) +fi + +json+=$( cat << EOF { "attachments": [ @@ -174,12 +202,6 @@ jsoninfo=$( EOF ) -if [ -z "${alerturl}" ]; then - json="${jsonnoinfo}" -else - json="${jsoninfo}" -fi - fn_print_dots "Sending Slack alert" slacksend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${slackwebhook}") diff --git a/lgsm/modules/alert_telegram.sh b/lgsm/modules/alert_telegram.sh index 2e719dba7..d7c9b8447 100644 --- a/lgsm/modules/alert_telegram.sh +++ b/lgsm/modules/alert_telegram.sh @@ -7,38 +7,41 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -jsoninfo=$( +json=$( cat << EOF { "chat_id": "${telegramchatid}", "message_thread_id": "${telegramthreadid}", "parse_mode": "HTML", "disable_notification": "${telegramdisablenotification}", - "text": "${alerttitle}\n\nServer name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}\n\nServer Time\n$(date)", - "disable_web_page_preview": "yes" -} + "text": "${alerttitle}\n\nServer name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\n EOF ) -jsonnoinfo=$( +if [ -n "${querytype}" ]; then + json+=$( + cat << EOF +Is my Game Server Online?\nCheck here\n\n +EOF + ) +fi + +if [ -n "${alerturl}" ]; then + json+=$( + cat << EOF +More info\n${alerturl}\n\n +EOF + ) +fi + +json+=$( cat << EOF -{ - "chat_id": "${telegramchatid}", - "message_thread_id": "${telegramthreadid}", - "parse_mode": "HTML", - "disable_notification": "${telegramdisablenotification}", - "text": "${alerttitle}\n\nServer name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nServer Time\n$(date)", +Server Time\n$(date)", "disable_web_page_preview": "yes" } EOF ) -if [ -z "${alerturl}" ]; then - json="${jsonnoinfo}" -else - json="${jsoninfo}" -fi - fn_print_dots "Sending Telegram alert" telegramsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" ${curlcustomstring} "https://${telegramapi}/bot${telegramtoken}/sendMessage" | grep "error_code") diff --git a/lgsm/modules/check_permissions.sh b/lgsm/modules/check_permissions.sh index 9ed1bb65e..4004732f2 100644 --- a/lgsm/modules/check_permissions.sh +++ b/lgsm/modules/check_permissions.sh @@ -63,8 +63,8 @@ fn_check_permissions() { findnotexecutable="$(find "${modulesdir}" -type f -not -executable)" findnotexecutablewc="$(find "${modulesdir}" -type f -not -executable | wc -l)" if [ "${findnotexecutablewc}" -ne "0" ]; then - fn_print_fail_nl "Permissions issues found" - fn_script_log_fail "Permissions issues found" + fn_print_error_nl "Permissions issues found" + fn_script_log_error "Permissions issues found" fn_print_information_nl "The following files are not executable:" fn_script_log_info "The following files are not executable:" { diff --git a/lgsm/modules/command_dev_query_raw.sh b/lgsm/modules/command_dev_query_raw.sh index ebe54c40f..a27850df8 100644 --- a/lgsm/modules/command_dev_query_raw.sh +++ b/lgsm/modules/command_dev_query_raw.sh @@ -208,6 +208,10 @@ echo -e "" echo -e "PORT: ${port}" echo -e "QUERY PORT: ${queryport}" echo -e "" +echo -e "${lightgreen}Is My Game Server Online?${default}" +fn_messages_separator +echo -e "Game server status: https://ismygameserver.online/${imgsoquerytype}/${queryip}:${queryport}" +echo -e "" echo -e "${lightgreen}Gamedig Raw Output${default}" fn_messages_separator echo -e "" diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index e47f5dd08..fd6ebc447 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -7,6 +7,29 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +# Converts querytype to imgsoquerytype for use with ismygameserver.online urls +if [ -n "${querytype}" ]; then + if [ "${querytype}" == "protocol-valve" ]; then + imgsoquerytype="valve" + elif [ "${querytype}" == "protocol-gamespy1" ]; then + imgsoquerytype="gamespy" + elif [ "${querytype}" == "protocol-gamespy2" ]; then + imgsoquerytype="gamespy" + elif [ "${querytype}" == "protocol-gamespy3" ]; then + imgsoquerytype="gamespy" + elif [ "${querytype}" == "protocol-quake1" ]; then + imgsoquerytype="quake" + elif [ "${querytype}" == "protocol-quake2" ]; then + imgsoquerytype="quake" + elif [ "${querytype}" == "protocol-quake3" ]; then + imgsoquerytype="quake" + elif [ "${querytype}" == "protocol-unreal2" ]; then + imgsoquerytype="unrealtournament2004" + else + imgsoquerytype="${querytype}" + fi +fi + # Removes the passwords form all but details. fn_info_messages_password_strip() { if [ "${commandname}" != "DETAILS" ]; then @@ -66,6 +89,11 @@ fn_info_messages_head() { echo -e "Hostname" echo -e "${HOSTNAME}" echo -e "" + if [ -n "${querytype}" ]; then + echo -e "Is my Game Server Online?" + echo -e "https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}" + echo -e "" + fi echo -e "Server Time" echo -e "$(date)" } @@ -503,6 +531,11 @@ fn_info_messages_gameserver() { else echo -e "${lightblue}Status:\t${green}STARTED${default}" fi + + # ismygameserver.online + if [ -n "${querytype}" ]; then + echo -e "${lightblue}Query Check:\t${default}https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}" + fi } | column -s $'\t' -t echo -e "" } From 7a0fc70d81db2f8e859b636982cd7390746073ce Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 8 Jan 2025 19:12:05 +0000 Subject: [PATCH 025/132] fix: add missing imgso filter if not required in discord alert --- lgsm/modules/alert_discord.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lgsm/modules/alert_discord.sh b/lgsm/modules/alert_discord.sh index 3b489984d..2b50f0c01 100644 --- a/lgsm/modules/alert_discord.sh +++ b/lgsm/modules/alert_discord.sh @@ -46,12 +46,25 @@ json=$( "name": "Server Time", "value": "$(date)", "inline": true - }, + } +EOF +) + +if [ -n "${querytype}" ]; then + json+=$( + cat << EOF + , { "name": "Is my Game Server Online?", "value": "https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}", "inline": true } +EOF + ) +fi + +json+=$( + cat << EOF ], "footer": { "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", From 579d54bc407bd85592fbd46651e734e21f7ead04 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 20 Jan 2025 00:23:22 +0000 Subject: [PATCH 026/132] fix permissions --- .github/workflows/lock.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index ce00b840b..8a08284a4 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -1,11 +1,13 @@ name: Lock Threads on: + workflow_dispatch: schedule: - cron: "0 0 * * 1" permissions: issues: write pull-requests: write + discussions: write jobs: lock: From 47e95d13dde288f5a970101a0e1863f96b354ca7 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 8 Feb 2025 13:43:05 +0000 Subject: [PATCH 027/132] Release v25.1.0 --- lgsm/modules/core_modules.sh | 2 +- linuxgsm.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 76a02ba0e..3d5837750 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v24.3.4" +modulesversion="v25.1.0" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 65ecef509..8b655c44c 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -24,7 +24,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v24.3.4" +version="v25.1.0" shortname="core" gameservername="core" commandname="CORE" From 114486107e4b3787a2dfb3624c038af23905cb55 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 8 Feb 2025 14:38:11 +0000 Subject: [PATCH 028/132] fix: remove libtinfo5:i386 from Ubuntu 24.04 --- lgsm/data/ubuntu-24.04.csv | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index 6414652ec..78ab08f3c 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -11,7 +11,7 @@ av bb bb2,libcurl4-gnutls-dev:i386 bd -bf1942,libncurses5:i386,libtinfo5:i386 +bf1942,libncurses5:i386 bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo @@ -31,7 +31,7 @@ cs cs2 cscz csgo -css,libtinfo5:i386 +css ct dab dayz @@ -48,7 +48,7 @@ etl ets2 fctr fof -gmod,libtinfo5:i386 +gmod hcu hl2dm hldm @@ -72,7 +72,7 @@ mohaa,libstdc++5:i386 mta,libncursesw5,libxml2-utils nd nec -nmrih,libtinfo5:i386 +nmrih ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 @@ -104,7 +104,7 @@ scpsl,mono-complete scpslsm,mono-complete sdtd,telnet,expect,libxml2-utils sf -sfc,libtinfo5:i386 +sfc sm,telnet,expect sof2 sol @@ -135,5 +135,5 @@ wf wmc,openjdk-21-jre wurm,xvfb xnt -zmr,libtinfo5:i386 -zps,libtinfo5:i386 +zmr +zps From e4a7772d8267164cbeeb4b4f98fbb626b83d2341 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 8 Feb 2025 14:39:03 +0000 Subject: [PATCH 029/132] fix: remove libncurses5:i386 from Ubuntu 24.04 --- lgsm/data/ubuntu-24.04.csv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index 78ab08f3c..d9312a7b3 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -11,9 +11,9 @@ av bb bb2,libcurl4-gnutls-dev:i386 bd -bf1942,libncurses5:i386 -bfv,libncurses5:i386,libstdc++5:i386 -bmdm,libncurses5:i386 +bf1942 +bfv,libstdc++5:i386 +bmdm bo bs bt,libicu-dev,dos2unix,libxml2-utils From bf850bf0c7a12f12c5e26070b758f7f51e2ec42f Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 8 Feb 2025 14:42:47 +0000 Subject: [PATCH 030/132] fix: update aspnetcore-runtime to verion 8 on Ubunut 24.04 --- lgsm/data/ubuntu-24.04.csv | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index d9312a7b3..aacb0ca7d 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -69,13 +69,13 @@ mc,openjdk-21-jre mcb mh mohaa,libstdc++5:i386 -mta,libncursesw5,libxml2-utils +mta,libxml2-utils nd nec nmrih ns -ns2,speex,libtbb2 -ns2c,speex:i386,libtbb2 +ns2,speex +ns2c,speex:i386 ohd onset,libmariadb-dev opfor @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,aspnetcore-runtime-8.0 vpmc,openjdk-21-jre vs wet From 6d48fbf41a495e868656a4c14c2eb851bf223145 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 8 Feb 2025 14:44:26 +0000 Subject: [PATCH 031/132] Release v.25.1.1 --- lgsm/modules/core_modules.sh | 2 +- linuxgsm.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 3d5837750..4c72f127b 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v25.1.0" +modulesversion="v25.1.1" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 8b655c44c..9d689231c 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -24,7 +24,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v25.1.0" +version="v25.1.1" shortname="core" gameservername="core" commandname="CORE" From 5a667ae8b8cffecae84faea4b3900f0798c17722 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Feb 2025 00:37:34 +0000 Subject: [PATCH 032/132] fix: put bfv and bf1942 back to ubuntu 22.04 --- lgsm/data/serverlist.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index d75bee3b5..68f25de70 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -10,8 +10,8 @@ av,avserver,Avorion,ubuntu-24.04 bb,bbserver,BrainBread,ubuntu-24.04 bb2,bb2server,BrainBread 2,ubuntu-24.04 bd,bdserver,Base Defense,ubuntu-24.04 -bf1942,bf1942server,Battlefield 1942,ubuntu-24.04 -bfv,bfvserver,Battlefield: Vietnam,ubuntu-24.04 +bf1942,bf1942server,Battlefield 1942,ubuntu-22.04 +bfv,bfvserver,Battlefield: Vietnam,ubuntu-22.04 bmdm,bmdmserver,Black Mesa: Deathmatch,ubuntu-24.04 bo,boserver,Ballistic Overkill,ubuntu-24.04 bs,bsserver,Blade Symphony,ubuntu-24.04 From 69735b3cb33bd21231d977f3d19eb500dd49b4fa Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Feb 2025 00:38:14 +0000 Subject: [PATCH 033/132] Release v25.1.2 --- lgsm/modules/core_modules.sh | 2 +- linuxgsm.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 4c72f127b..6a0764166 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v25.1.1" +modulesversion="v25.1.2" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 9d689231c..41862a8d8 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -24,7 +24,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v25.1.1" +version="v25.1.2" shortname="core" gameservername="core" commandname="CORE" From f28becd8ca573ab637bf27e56b64fb48ac033e6a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Feb 2025 17:08:47 +0000 Subject: [PATCH 034/132] revert: mapfile to declare --- lgsm/modules/command_backup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/command_backup.sh b/lgsm/modules/command_backup.sh index 010c60577..f427e8b00 100644 --- a/lgsm/modules/command_backup.sh +++ b/lgsm/modules/command_backup.sh @@ -190,7 +190,7 @@ fn_backup_prune() { fn_backup_relpath() { # Written by CedarLUG as a "realpath --relative-to" alternative in bash. # Populate an array of tokens initialized from the rootdir components. - mapfile -t rdirtoks < <(readlink -f "${rootdir}" | sed "s/\// /g") + declare -a rdirtoks=($(readlink -f "${rootdir}" | sed "s/\// /g")) if [ ${#rdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing rootdir during relative path assessment" fn_script_log_fail "Problem assessing rootdir during relative path assessment: ${rootdir}" @@ -198,7 +198,7 @@ fn_backup_relpath() { fi # Populate an array of tokens initialized from the backupdir components. - mapfile -t bdirtoks < <(readlink -f "${backupdir}" | sed "s/\// /g") + declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g")) if [ ${#bdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing backupdir during relative path assessment" fn_script_log_fail "Problem assessing backupdir during relative path assessment: ${rootdir}" From 421971c73f3c10617d4ae3f4c2dd949b4bfc4564 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Feb 2025 17:17:21 +0000 Subject: [PATCH 035/132] fix: minor messaging bug --- lgsm/modules/update_jk2.sh | 2 +- lgsm/modules/update_mc.sh | 2 +- lgsm/modules/update_mcb.sh | 2 +- lgsm/modules/update_mta.sh | 2 +- lgsm/modules/update_pmc.sh | 2 +- lgsm/modules/update_ts3.sh | 2 +- lgsm/modules/update_ut99.sh | 2 +- lgsm/modules/update_vints.sh | 2 +- lgsm/modules/update_xnt.sh | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lgsm/modules/update_jk2.sh b/lgsm/modules/update_jk2.sh index 20350aec6..af2709ec6 100644 --- a/lgsm/modules/update_jk2.sh +++ b/lgsm/modules/update_jk2.sh @@ -154,7 +154,7 @@ remotelocation="github.com" if [ "$(command -v jq 2> /dev/null)" ]; then fn_print_fail_nl "jq is not installed" - fn_script_log_fatal "jq is not installed" + fn_script_log_fail "jq is not installed" core_exit.sh fi diff --git a/lgsm/modules/update_mc.sh b/lgsm/modules/update_mc.sh index 8cac4067b..897b0df27 100644 --- a/lgsm/modules/update_mc.sh +++ b/lgsm/modules/update_mc.sh @@ -169,7 +169,7 @@ remotelocation="mojang.com" if [ "$(command -v jq 2> /dev/null)" ]; then fn_print_fail_nl "jq is not installed" - fn_script_log_fatal "jq is not installed" + fn_script_log_fail "jq is not installed" core_exit.sh fi diff --git a/lgsm/modules/update_mcb.sh b/lgsm/modules/update_mcb.sh index 8b66aa006..29faf3363 100644 --- a/lgsm/modules/update_mcb.sh +++ b/lgsm/modules/update_mcb.sh @@ -177,7 +177,7 @@ remotelocation="minecraft.net" if [ "$(command -v jq 2> /dev/null)" ]; then fn_print_fail_nl "jq is not installed" - fn_script_log_fatal "jq is not installed" + fn_script_log_fail "jq is not installed" core_exit.sh fi diff --git a/lgsm/modules/update_mta.sh b/lgsm/modules/update_mta.sh index e677723a0..0946cf642 100644 --- a/lgsm/modules/update_mta.sh +++ b/lgsm/modules/update_mta.sh @@ -162,7 +162,7 @@ remotelocation="linux.mtasa.com" if [ "$(command -v jq 2> /dev/null)" ]; then fn_print_fail_nl "jq is not installed" - fn_script_log_fatal "jq is not installed" + fn_script_log_fail "jq is not installed" core_exit.sh fi diff --git a/lgsm/modules/update_pmc.sh b/lgsm/modules/update_pmc.sh index 053d1f9ae..0a883c150 100644 --- a/lgsm/modules/update_pmc.sh +++ b/lgsm/modules/update_pmc.sh @@ -179,7 +179,7 @@ remotelocation="papermc.io" if [ "$(command -v jq 2> /dev/null)" ]; then fn_print_fail_nl "jq is not installed" - fn_script_log_fatal "jq is not installed" + fn_script_log_fail "jq is not installed" core_exit.sh fi diff --git a/lgsm/modules/update_ts3.sh b/lgsm/modules/update_ts3.sh index 8bbbbc2b2..abc9a60c8 100644 --- a/lgsm/modules/update_ts3.sh +++ b/lgsm/modules/update_ts3.sh @@ -173,7 +173,7 @@ remotelocation="teamspeak.com" if [ "$(command -v jq 2> /dev/null)" ]; then fn_print_fail_nl "jq is not installed" - fn_script_log_fatal "jq is not installed" + fn_script_log_fail "jq is not installed" core_exit.sh fi diff --git a/lgsm/modules/update_ut99.sh b/lgsm/modules/update_ut99.sh index f83208e6f..e8d4a2848 100644 --- a/lgsm/modules/update_ut99.sh +++ b/lgsm/modules/update_ut99.sh @@ -155,7 +155,7 @@ remotelocation="github.com" if [ "$(command -v jq 2> /dev/null)" ]; then fn_print_fail_nl "jq is not installed" - fn_script_log_fatal "jq is not installed" + fn_script_log_fail "jq is not installed" core_exit.sh fi diff --git a/lgsm/modules/update_vints.sh b/lgsm/modules/update_vints.sh index 1e17cac7d..e683156db 100644 --- a/lgsm/modules/update_vints.sh +++ b/lgsm/modules/update_vints.sh @@ -162,7 +162,7 @@ remotelocation="vintagestory.at" if [ "$(command -v jq 2> /dev/null)" ]; then fn_print_fail_nl "jq is not installed" - fn_script_log_fatal "jq is not installed" + fn_script_log_fail "jq is not installed" core_exit.sh fi diff --git a/lgsm/modules/update_xnt.sh b/lgsm/modules/update_xnt.sh index 31c5c1249..05b73d33c 100644 --- a/lgsm/modules/update_xnt.sh +++ b/lgsm/modules/update_xnt.sh @@ -162,7 +162,7 @@ remotelocation="github.com" if [ "$(command -v jq 2> /dev/null)" ]; then fn_print_fail_nl "jq is not installed" - fn_script_log_fatal "jq is not installed" + fn_script_log_fail "jq is not installed" core_exit.sh fi From 5e5cd30a1017e19e47787a24371b4fcc44e3c849 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Feb 2025 17:33:42 +0000 Subject: [PATCH 036/132] Release v25.1.3 --- lgsm/modules/core_modules.sh | 2 +- linuxgsm.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 4c72f127b..af80ba05f 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v25.1.1" +modulesversion="v25.1.3" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 9d689231c..d73ee7094 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -24,7 +24,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v25.1.1" +version="v25.1.3" shortname="core" gameservername="core" commandname="CORE" From cd208f6f07972cc37c4649b030cea1848609f713 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Feb 2025 19:15:12 +0000 Subject: [PATCH 037/132] fix: resolve jq dependency issue fix --- lgsm/modules/core_modules.sh | 2 +- lgsm/modules/update_jk2.sh | 2 +- lgsm/modules/update_mc.sh | 2 +- lgsm/modules/update_mcb.sh | 2 +- lgsm/modules/update_mta.sh | 2 +- lgsm/modules/update_pmc.sh | 2 +- lgsm/modules/update_ts3.sh | 2 +- lgsm/modules/update_ut99.sh | 2 +- lgsm/modules/update_vints.sh | 2 +- lgsm/modules/update_xnt.sh | 2 +- linuxgsm.sh | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index af80ba05f..92aab59fd 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v25.1.3" +modulesversion="v25.1.4" # Core diff --git a/lgsm/modules/update_jk2.sh b/lgsm/modules/update_jk2.sh index af2709ec6..098154499 100644 --- a/lgsm/modules/update_jk2.sh +++ b/lgsm/modules/update_jk2.sh @@ -152,7 +152,7 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="github.com" -if [ "$(command -v jq 2> /dev/null)" ]; then +if [ ! "$(command -v jq 2> /dev/null)" ]; then fn_print_fail_nl "jq is not installed" fn_script_log_fail "jq is not installed" core_exit.sh diff --git a/lgsm/modules/update_mc.sh b/lgsm/modules/update_mc.sh index 897b0df27..0ce4e2e39 100644 --- a/lgsm/modules/update_mc.sh +++ b/lgsm/modules/update_mc.sh @@ -167,7 +167,7 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="mojang.com" -if [ "$(command -v jq 2> /dev/null)" ]; then +if [ ! "$(command -v jq 2> /dev/null)" ]; then fn_print_fail_nl "jq is not installed" fn_script_log_fail "jq is not installed" core_exit.sh diff --git a/lgsm/modules/update_mcb.sh b/lgsm/modules/update_mcb.sh index 29faf3363..8154b813e 100644 --- a/lgsm/modules/update_mcb.sh +++ b/lgsm/modules/update_mcb.sh @@ -175,7 +175,7 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="minecraft.net" -if [ "$(command -v jq 2> /dev/null)" ]; then +if [ ! "$(command -v jq 2> /dev/null)" ]; then fn_print_fail_nl "jq is not installed" fn_script_log_fail "jq is not installed" core_exit.sh diff --git a/lgsm/modules/update_mta.sh b/lgsm/modules/update_mta.sh index 0946cf642..c7214665d 100644 --- a/lgsm/modules/update_mta.sh +++ b/lgsm/modules/update_mta.sh @@ -160,7 +160,7 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="linux.mtasa.com" -if [ "$(command -v jq 2> /dev/null)" ]; then +if [ ! "$(command -v jq 2> /dev/null)" ]; then fn_print_fail_nl "jq is not installed" fn_script_log_fail "jq is not installed" core_exit.sh diff --git a/lgsm/modules/update_pmc.sh b/lgsm/modules/update_pmc.sh index 0a883c150..9c288827e 100644 --- a/lgsm/modules/update_pmc.sh +++ b/lgsm/modules/update_pmc.sh @@ -177,7 +177,7 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="papermc.io" -if [ "$(command -v jq 2> /dev/null)" ]; then +if [ ! "$(command -v jq 2> /dev/null)" ]; then fn_print_fail_nl "jq is not installed" fn_script_log_fail "jq is not installed" core_exit.sh diff --git a/lgsm/modules/update_ts3.sh b/lgsm/modules/update_ts3.sh index abc9a60c8..92f9d3489 100644 --- a/lgsm/modules/update_ts3.sh +++ b/lgsm/modules/update_ts3.sh @@ -171,7 +171,7 @@ fi # The location where the builds are checked and downloaded. remotelocation="teamspeak.com" -if [ "$(command -v jq 2> /dev/null)" ]; then +if [ ! "$(command -v jq 2> /dev/null)" ]; then fn_print_fail_nl "jq is not installed" fn_script_log_fail "jq is not installed" core_exit.sh diff --git a/lgsm/modules/update_ut99.sh b/lgsm/modules/update_ut99.sh index e8d4a2848..5f30bdc23 100644 --- a/lgsm/modules/update_ut99.sh +++ b/lgsm/modules/update_ut99.sh @@ -153,7 +153,7 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="github.com" -if [ "$(command -v jq 2> /dev/null)" ]; then +if [ ! "$(command -v jq 2> /dev/null)" ]; then fn_print_fail_nl "jq is not installed" fn_script_log_fail "jq is not installed" core_exit.sh diff --git a/lgsm/modules/update_vints.sh b/lgsm/modules/update_vints.sh index e683156db..d468d58d4 100644 --- a/lgsm/modules/update_vints.sh +++ b/lgsm/modules/update_vints.sh @@ -160,7 +160,7 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="vintagestory.at" -if [ "$(command -v jq 2> /dev/null)" ]; then +if [ ! "$(command -v jq 2> /dev/null)" ]; then fn_print_fail_nl "jq is not installed" fn_script_log_fail "jq is not installed" core_exit.sh diff --git a/lgsm/modules/update_xnt.sh b/lgsm/modules/update_xnt.sh index 05b73d33c..7014ab1a9 100644 --- a/lgsm/modules/update_xnt.sh +++ b/lgsm/modules/update_xnt.sh @@ -160,7 +160,7 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="github.com" -if [ "$(command -v jq 2> /dev/null)" ]; then +if [ ! "$(command -v jq 2> /dev/null)" ]; then fn_print_fail_nl "jq is not installed" fn_script_log_fail "jq is not installed" core_exit.sh diff --git a/linuxgsm.sh b/linuxgsm.sh index d73ee7094..2b464f99a 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -24,7 +24,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v25.1.3" +version="v25.1.4" shortname="core" gameservername="core" commandname="CORE" From 9edc3ca206e270bd48e3502c8241994b022f87c7 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Feb 2025 00:37:34 +0000 Subject: [PATCH 038/132] fix: put bfv and bf1942 back to ubuntu 22.04 --- lgsm/data/serverlist.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index d75bee3b5..68f25de70 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -10,8 +10,8 @@ av,avserver,Avorion,ubuntu-24.04 bb,bbserver,BrainBread,ubuntu-24.04 bb2,bb2server,BrainBread 2,ubuntu-24.04 bd,bdserver,Base Defense,ubuntu-24.04 -bf1942,bf1942server,Battlefield 1942,ubuntu-24.04 -bfv,bfvserver,Battlefield: Vietnam,ubuntu-24.04 +bf1942,bf1942server,Battlefield 1942,ubuntu-22.04 +bfv,bfvserver,Battlefield: Vietnam,ubuntu-22.04 bmdm,bmdmserver,Black Mesa: Deathmatch,ubuntu-24.04 bo,boserver,Ballistic Overkill,ubuntu-24.04 bs,bsserver,Blade Symphony,ubuntu-24.04 From eabf26fcaa7dc8b535772f9361e94d75a4466138 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 10 Feb 2025 21:17:25 +0000 Subject: [PATCH 039/132] Release v25.1.5 --- lgsm/modules/core_modules.sh | 2 +- linuxgsm.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 92aab59fd..51f691d5c 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v25.1.4" +modulesversion="v25.1.5" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 2b464f99a..af7c182dd 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -24,7 +24,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v25.1.4" +version="v25.1.5" shortname="core" gameservername="core" commandname="CORE" From 9be745f115af223243d65284b2fc0eb4cff04cd8 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 24 Feb 2025 21:57:19 +0000 Subject: [PATCH 040/132] fix(hz): update config location --- lgsm/config-default/config-lgsm/hzserver/_default.cfg | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lgsm/config-default/config-lgsm/hzserver/_default.cfg b/lgsm/config-default/config-lgsm/hzserver/_default.cfg index b610594e7..98b6dda1e 100644 --- a/lgsm/config-default/config-lgsm/hzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hzserver/_default.cfg @@ -12,7 +12,6 @@ ip="0.0.0.0" port="7777" queryport="27015" -servername="LinuxGSM" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters startparameters="-log -port=${port} -queryport=${queryport} -steamservername=${servername}" @@ -157,8 +156,8 @@ glibc="2.17" systemdir="${serverfiles}/TSSGame" executabledir="${systemdir}/Binaries/Linux" executable="./TSSGameServer-Linux-Shipping" -servercfgdir="${systemdir}/Saved/Config/LinuxServer" -servercfg="GameUserSettings.ini" +servercfgdir="${systemdir}" +servercfg="GameServerSettings.ini" servercfgdefault="GameUserSettings.ini" servercfgfullpath="${servercfgdir}/${servercfg}" From 64980655f48af7b22cfa4fc42d10a737d9be211d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 24 Feb 2025 22:28:37 +0000 Subject: [PATCH 041/132] feat: bypass termbin if site is down --- lgsm/modules/command_postdetails.sh | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/lgsm/modules/command_postdetails.sh b/lgsm/modules/command_postdetails.sh index 61d537440..7f5f67304 100644 --- a/lgsm/modules/command_postdetails.sh +++ b/lgsm/modules/command_postdetails.sh @@ -58,18 +58,27 @@ else fi fn_print_dots "termbin.com" -link=$(cat "${postdetailslog}" | nc termbin.com 9999 | tr -d '\n\0') -fn_print_ok_nl "termbin.com for 30D" -fn_script_log_pass "termbin.com for 30D" -pdurl="${link}" +link=$(cat "${postdetailslog}" | { + nc -w 3 termbin.com 9999 + echo $? > /tmp/nc_exit_status +} | tr -d '\n\0') +nc_exit_status=$(cat /tmp/nc_exit_status) +if [ "${nc_exit_status}" -ne 0 ]; then + fn_print_error_nl "Failed to post to termbin.com" + fn_script_log_error "Failed to post to termbin.com" +else + fn_print_ok_nl "termbin.com for 30D" + fn_script_log_pass "termbin.com for 30D" + pdurl="${link}" -if [ "${firstcommandname}" == "POST-DETAILS" ]; then - echo -e "" - echo -e "Please share the following url for support: " - echo -e "${italic}${pdurl}${default}" + if [ "${firstcommandname}" == "POST-DETAILS" ]; then + echo -e "" + echo -e "Please share the following url for support: " + echo -e "${italic}${pdurl}${default}" + fi + fn_script_log_info "${pdurl}" + alerturl="${pdurl}" fi -fn_script_log_info "${pdurl}" -alerturl="${pdurl}" if [ -z "${exitbypass}" ]; then core_exit.sh From 3c313de2ba2bfbc87235cf96938680ad22cdd0b2 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 7 Mar 2025 16:25:33 +0000 Subject: [PATCH 042/132] fix(armar): update dependency name to libcurl4t64 for Ubuntu 24.04 --- lgsm/data/ubuntu-24.04.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index aacb0ca7d..dccd1f753 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -5,7 +5,7 @@ ahl ahl2 ark arma3 -armar,libcurl4 +armar,libcurl4t64 ats av bb From b2eb64532b4458c9f59fd880f9872ad79b7ecfab Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 7 Mar 2025 16:27:57 +0000 Subject: [PATCH 043/132] fix(alert): Restore more info in alert --- lgsm/modules/alert_discord.sh | 113 +++++++++++++++++++--------------- 1 file changed, 63 insertions(+), 50 deletions(-) diff --git a/lgsm/modules/alert_discord.sh b/lgsm/modules/alert_discord.sh index 2b50f0c01..1ed3da441 100644 --- a/lgsm/modules/alert_discord.sh +++ b/lgsm/modules/alert_discord.sh @@ -10,68 +10,81 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" json=$( cat << EOF { - "username": "LinuxGSM", - "avatar_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", - "file": "content", - "embeds": [ - { - "author": { - "name": "LinuxGSM Alert", - "url": "", - "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg" - }, - "title": "${alerttitle}", - "url": "", - "description": "", - "color": "${alertcolourdec}", - "type": "content", - "thumbnail": { - "url": "${alerticon}" - }, - "fields": [ - { - "name": "Server Name", - "value": "${servername}" - }, - { - "name": "Information", - "value": "${alertmessage}" - }, - { - "name": "Game", - "value": "${gamename}", - "inline": true - }, - { - "name": "Server Time", - "value": "$(date)", - "inline": true - } + "username": "LinuxGSM", + "avatar_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", + "file": "content", + "embeds": [ + { + "author": { + "name": "LinuxGSM Alert", + "url": "", + "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg" + }, + "title": "${alerttitle}", + "url": "", + "description": "", + "color": "${alertcolourdec}", + "type": "content", + "thumbnail": { + "url": "${alerticon}" + }, + "fields": [ + { + "name": "Server Name", + "value": "${servername}" + }, + { + "name": "Information", + "value": "${alertmessage}" + }, + { + "name": "Game", + "value": "${gamename}", + "inline": true + }, + { + "name": "Server Time", + "value": "$(date)", + "inline": true + } EOF ) if [ -n "${querytype}" ]; then json+=$( cat << EOF - , - { - "name": "Is my Game Server Online?", - "value": "https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}", - "inline": true - } + , + { + "name": "Is my Game Server Online?", + "value": "https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}", + "inline": true + } +EOF + ) +fi + +if [ -n "{alerturl}" ]; then + json+=$( + cat << EOF + , + { + "name": "More info", + "value": "${alerturl}", + "inline": true + } EOF ) fi json+=$( cat << EOF - ], - "footer": { - "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", - "text": "Sent by LinuxGSM ${version}" - } - } - ] + ], + "footer": { + "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", + "text": "Sent by LinuxGSM ${version}" + } + } + ] } EOF ) From 7e937133f14d54ef72df76f4ee69483dfb748dd2 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 8 Mar 2025 21:46:33 +0000 Subject: [PATCH 044/132] fix(tf): change queryport to udp --- lgsm/modules/info_messages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index fd6ebc447..4f1f00268 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -1658,7 +1658,7 @@ fn_info_messages_tf() { { fn_port "header" fn_port "Game" port udp - fn_port "Query" queryport tcp + fn_port "Query" queryport udp fn_port "Beacon" beaconport udp fn_port "Shutdown" shutdownport tcp } | column -s $'\t' -t From b133c444caf73405efa9c6f949c76d92774d6890 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 8 Mar 2025 21:49:47 +0000 Subject: [PATCH 045/132] fix(tf): update anticheat to UseEAC --- lgsm/config-default/config-lgsm/tfserver/_default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/tfserver/_default.cfg b/lgsm/config-default/config-lgsm/tfserver/_default.cfg index fbce96a44..53fde059d 100644 --- a/lgsm/config-default/config-lgsm/tfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tfserver/_default.cfg @@ -33,7 +33,7 @@ servertags="LinuxGSM" steamsocket="0" # Use Steam Socket. 0 = off; 1 = on. Use Steam Servers for network penetration. Enable this if you don't have a public IP but you want to allow players from outside your network to join your server. If disabled, only you and other players on your LAN can join. If you have a public IP, you do not need to enable this. ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="ProjectWar_Start?DedicatedServer?MaxPlayers=${maxplayers} -server -game -log -MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -BeaconPort=${beaconport} -ShutDownServicePort=${shutdownport} -ConfigServerName='${selfname}' -OutIPAddress=${publicip} -ServerTags='${servertags}' -UseSteamSocket=${steamsocket} -UserDir='${serverfiles}/${selfname}' -ServerName='${servername}' -EnableParallelCharacterMovementTickFunction -EnableParallelCharacterTickFunction -UseDynamicPhysicsScene -Game.PhysicsVehicle=false -ansimalloc -Game.MaxFrameRate=35 -MaxQueueSize=${maxqueuesize} -QueueValidTime=${queuevalidtime} -QueueThreshold=${maxplayers} -ServerFightModeType=${gamemode} -IsCanSelfDamage=${damageself} -IsCanFriendDamage=${damageallies} -SaveWorldInterval=${saveinterval} -GMOverlapRatio=2 -GreenHand=${greenhand} -SensitiveWords=${allowsensitivewords} -UseACE=${anticheat} -ServerAdminAccounts='${serveradmins}' -IsShowGmTitle=${adminlabel} -ServerPassword='${serverpassword}'" +startparameters="ProjectWar_Start?DedicatedServer?MaxPlayers=${maxplayers} -server -game -log -MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -BeaconPort=${beaconport} -ShutDownServicePort=${shutdownport} -ConfigServerName='${selfname}' -OutIPAddress=${publicip} -ServerTags='${servertags}' -UseSteamSocket=${steamsocket} -UserDir='${serverfiles}/${selfname}' -ServerName='${servername}' -EnableParallelCharacterMovementTickFunction -EnableParallelCharacterTickFunction -UseDynamicPhysicsScene -Game.PhysicsVehicle=false -ansimalloc -Game.MaxFrameRate=35 -MaxQueueSize=${maxqueuesize} -QueueValidTime=${queuevalidtime} -QueueThreshold=${maxplayers} -ServerFightModeType=${gamemode} -IsCanSelfDamage=${damageself} -IsCanFriendDamage=${damageallies} -SaveWorldInterval=${saveinterval} -GMOverlapRatio=2 -GreenHand=${greenhand} -SensitiveWords=${allowsensitivewords} -UseEAC=${anticheat} -ServerAdminAccounts='${serveradmins}' -IsShowGmTitle=${adminlabel} -ServerPassword='${serverpassword}'" #### LinuxGSM Settings #### From 916e9f5e91e27503bb053b456c8958a2448fe8f6 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 8 Mar 2025 21:54:56 +0000 Subject: [PATCH 046/132] fix: remove Precision Alignment from mods list --- lgsm/modules/mods_list.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/lgsm/modules/mods_list.sh b/lgsm/modules/mods_list.sh index d6622d1b2..f6f8301bd 100644 --- a/lgsm/modules/mods_list.sh +++ b/lgsm/modules/mods_list.sh @@ -189,7 +189,6 @@ mod_info_spinnertool=(MOD "spinnertool" "Spinner Tool" "https://github.com/dvdvi mod_info_surfacefrictiontool=(MOD "surfacefrictiontool" "Surface Friction Tool" "https://github.com/dvdvideo1234/surfacefrictiontool/archive/master.zip" "surfacefrictiontool-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/SurfaceFrictionTool" "Controls the surface friction of a prop") mod_info_magneticdipole=(MOD "magneticdipole" "Magnetic Dipole" "https://github.com/dvdvideo1234/magneticdipole/archive/master.zip" "magneticdipole-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/MagneticDipole" "Magnet entity that runs forces on its poles. Supports wire") mod_info_environmentorganizer=(MOD "environmentorganizer" "Environment Organizer" "https://github.com/dvdvideo1234/environmentorganizer/archive/master.zip" "environmentorganizer-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/EnvironmentOrganizer" "Installs routines designed for server settings adjustment") -mod_info_precision_alignment=(MOD "precision-alignment" "Precision Alignment" "https://github.com/Mista-Tea/precision-alignment/archive/master.zip" "precision-alignment-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/precision-alignment" "Creates precise constraints and aligments") mod_info_improved_stacker=(MOD "improved-stacker" "Improved Stacker" "https://github.com/Mista-Tea/improved-stacker/archive/master.zip" "improved-stacker-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-stacker" "Stacks entities in the direction chosen") mod_info_improved_weight=(MOD "improved-weight" "Improved Weight" "https://github.com/Mista-Tea/improved-weight/archive/master.zip" "improved-weight-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-weight" "Weight tool but with more features") mod_info_improved_antinoclip=(MOD "improved-antinoclip" "Improved Antinoclip" "https://github.com/Mista-Tea/improved-antinoclip/archive/master.zip" "improved-antinoclip-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-antinoclip" "Controls clipping trough an object") From d56742bee857023cc8c11da86c4dc62a0da3c8b5 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Mar 2025 16:42:10 +0000 Subject: [PATCH 047/132] fix(monitor): will now restart instead of update if restart requested --- lgsm/modules/command_monitor.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh index 7feb05455..5fa3c3000 100644 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -167,7 +167,7 @@ fn_monitor_check_update_source() { fn_script_log_info "Checking update: ${selfname} has requested an update and needs to be restarted" alert="update-request" alert.sh - command_update.sh + command_restart.sh core_exit.sh fi fi From f657ee74052336d59b66746bd2954714326b7dc2 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Mar 2025 22:26:12 +0000 Subject: [PATCH 048/132] fix: dependencies not being removed if not required --- lgsm/modules/check_deps.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh index dcc9c890c..8cbdf626c 100644 --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -251,12 +251,15 @@ fn_deps_detector() { if [ "${deptocheck}" == "libsdl2-2.0-0:i386" ] && [ -z "${appid}" ]; then array_deps_required=("${array_deps_required[@]/libsdl2-2.0-0:i386/}") steamcmdstatus=1 + return elif [ "${deptocheck}" == "steamcmd" ] && [ -z "${appid}" ]; then array_deps_required=("${array_deps_required[@]/steamcmd/}") steamcmdstatus=1 + return elif [ "${deptocheck}" == "steamcmd" ] && [ "${distroid}" == "debian" ] && ! grep -qE '[^deb]+non-free([^-]|$)' /etc/apt/sources.list; then array_deps_required=("${array_deps_required[@]/steamcmd/}") steamcmdstatus=1 + return # Java: Added for users using Oracle JRE to bypass check. elif [[ ${deptocheck} == "openjdk"* ]] || [[ ${deptocheck} == "java"* ]]; then # Is java already installed? From 71d551e29130c5923a505cc1f54fa32fe9bf5705 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Mar 2025 22:50:41 +0000 Subject: [PATCH 049/132] fix(vints): update dependency requirement dotnet-runtime-7.0 --- lgsm/data/almalinux-8.csv | 2 +- lgsm/data/almalinux-9.csv | 2 +- lgsm/data/centos-7.csv | 2 +- lgsm/data/centos-8.csv | 2 +- lgsm/data/centos-9.csv | 2 +- lgsm/data/debian-10.csv | 2 +- lgsm/data/debian-11.csv | 2 +- lgsm/data/debian-12.csv | 2 +- lgsm/data/debian-13.csv | 2 +- lgsm/data/debian-9.csv | 2 +- lgsm/data/rhel-7.csv | 2 +- lgsm/data/rhel-8.csv | 2 +- lgsm/data/rhel-9.csv | 2 +- lgsm/data/rocky-8.csv | 2 +- lgsm/data/rocky-9.csv | 2 +- lgsm/data/ubuntu-16.04.csv | 2 +- lgsm/data/ubuntu-18.04.csv | 2 +- lgsm/data/ubuntu-20.04.csv | 2 +- lgsm/data/ubuntu-22.04.csv | 2 +- lgsm/data/ubuntu-23.04.csv | 2 +- lgsm/data/ubuntu-23.10.csv | 2 +- lgsm/data/ubuntu-24.04.csv | 2 +- lgsm/modules/check_deps.sh | 6 +++--- 23 files changed, 25 insertions(+), 25 deletions(-) diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index d4d2456bd..08d91f8fc 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index 7dae6338e..a16722c2f 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index 266b358ba..7b467fa00 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-11-openjdk vs wet diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index bd5b72c33..4b9fd2133 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-17-openjdk vs wet diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index 893f3698c..c6ff3a272 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-17-openjdk vs wet diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index bfbf4dac0..74d82e158 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 61a20b15f..33b7deaf9 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 5fa249e15..06fd9e52c 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-17-jre vs wet diff --git a/lgsm/data/debian-13.csv b/lgsm/data/debian-13.csv index 4002eb0e9..7d775040e 100644 --- a/lgsm/data/debian-13.csv +++ b/lgsm/data/debian-13.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index d00f64969..02acceacd 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-8-jre vs wet diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 7800136bb..90c9df07e 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-11-openjdk vs wet diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index f8bb1d492..0298bd0b0 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index 7dae6338e..a16722c2f 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index f8bb1d492..0298bd0b0 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index 7dae6338e..a16722c2f 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 1327946e5..436bdecb8 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-8-jre vs wet diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index d693fba00..3b24ff37f 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 193054da8..f19436d6a 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 1b8849bba..f8a48ccce 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/data/ubuntu-23.04.csv b/lgsm/data/ubuntu-23.04.csv index 2ed8416a2..c14964d2d 100644 --- a/lgsm/data/ubuntu-23.04.csv +++ b/lgsm/data/ubuntu-23.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/data/ubuntu-23.10.csv b/lgsm/data/ubuntu-23.10.csv index 2ed8416a2..c14964d2d 100644 --- a/lgsm/data/ubuntu-23.10.csv +++ b/lgsm/data/ubuntu-23.10.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index dccd1f753..bd220a501 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-8.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh index 8cbdf626c..7145eff0a 100644 --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -9,8 +9,8 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_dotnet_repo() { if [ "${distroid}" == "ubuntu" ]; then - # if package aspnetcore-runtime-7.0 is unavailable in ubuntu repos, add the microsoft repo. - if ! apt-cache show aspnetcore-runtime-7.0 > /dev/null 2>&1; then + # if package dotnet-runtime-7.0 is unavailable in ubuntu repos, add the microsoft repo. + if ! apt-cache show dotnet-runtime-7.0 > /dev/null 2>&1; then fn_fetch_file "https://packages.microsoft.com/config/ubuntu/${distroversion}/packages-microsoft-prod.deb" "" "" "" "/tmp" "packages-microsoft-prod.deb" "" "" "" "" sudo dpkg -i /tmp/packages-microsoft-prod.deb fi @@ -282,7 +282,7 @@ fn_deps_detector() { monoinstalled=false fi # .NET Core: A .NET Core repo needs to be installed. - elif [ "${deptocheck}" == "aspnetcore-runtime-7.0" ]; then + elif [ "${deptocheck}" == "dotnet-runtime-7.0" ]; then # .NET is not installed. if [ -n "${dotnetversion}" ]; then depstatus=0 From 1719101444e18adff331e5343308d695ff3dcc65 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Mar 2025 23:07:38 +0000 Subject: [PATCH 050/132] fix: install microsoft repo dotnet-7.0 not available in standard repos --- lgsm/modules/check_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh index 7145eff0a..5667876e5 100644 --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -284,7 +284,7 @@ fn_deps_detector() { # .NET Core: A .NET Core repo needs to be installed. elif [ "${deptocheck}" == "dotnet-runtime-7.0" ]; then # .NET is not installed. - if [ -n "${dotnetversion}" ]; then + if dotnet --list-runtimes | grep -q "Microsoft.NETCore.App 7.0"; then depstatus=0 dotnetinstalled=true else From d56a95ad9ba03e5cf462f1dd5530997c1c1cb1c9 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Mar 2025 23:20:35 +0000 Subject: [PATCH 051/132] fix(vints): roll back to Ubuntu 22.04 docker --- lgsm/data/serverlist.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 68f25de70..3b8121a26 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -126,7 +126,7 @@ ut2k4,ut2k4server,Unreal Tournament 2004,ubuntu-24.04 ut3,ut3server,Unreal Tournament 3,ubuntu-24.04 ut99,ut99server,Unreal Tournament 99,ubuntu-24.04 vh,vhserver,Valheim,ubuntu-24.04 -vints,vintsserver,Vintage Story,ubuntu-24.04 +vints,vintsserver,Vintage Story,ubuntu-22.04 vpmc,vpmcserver,Velocity Proxy MC,ubuntu-24.04 vs,vsserver,Vampire Slayer,ubuntu-24.04 wet,wetserver,Wolfenstein: Enemy Territory,ubuntu-24.04 From d0e8127fcf48647bfb6331e2cbccc2ba8b43270e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 10 Mar 2025 09:44:14 +0000 Subject: [PATCH 052/132] feat(eco): add usertoken parameter --- lgsm/config-default/config-lgsm/ecoserver/_default.cfg | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg index c08f37072..0c18318e9 100644 --- a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg @@ -8,8 +8,11 @@ #### Game Server Settings #### +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +usertoken="" + ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="-nogui" +startparameters="-nogui -userToken=${usertoken}" #### LinuxGSM Settings #### From c87f48f5ec3df0eea5a40fa62c4938707a87b19d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 10 Mar 2025 10:06:25 +0000 Subject: [PATCH 053/132] fix(jc2): update query name to jc2m --- lgsm/config-default/config-lgsm/jc2server/_default.cfg | 2 +- lgsm/modules/query_gsquery.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lgsm/config-default/config-lgsm/jc2server/_default.cfg b/lgsm/config-default/config-lgsm/jc2server/_default.cfg index 21932e205..5a82bbad9 100644 --- a/lgsm/config-default/config-lgsm/jc2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc2server/_default.cfg @@ -134,7 +134,7 @@ stopmode="2" # 4: gsquery # 5: tcp querymode="2" -querytype="jc2mp" +querytype="jc2m" ## Console type consoleverbose="yes" diff --git a/lgsm/modules/query_gsquery.py b/lgsm/modules/query_gsquery.py index 245a606e1..4dbde90dd 100644 --- a/lgsm/modules/query_gsquery.py +++ b/lgsm/modules/query_gsquery.py @@ -11,7 +11,7 @@ import socket import sys engine_types = ('protocol-valve', 'protocol-quake2', 'protocol-quake3', 'protocol-gamespy1', - 'protocol-unreal2', 'ut3', 'minecraft', 'minecraftbe', 'jc2mp', 'mumbleping', 'soldat', 'teeworlds') + 'protocol-unreal2', 'ut3', 'minecraft', 'minecraftbe', 'jc2m', 'mumbleping', 'soldat', 'teeworlds') class gsquery: @@ -23,7 +23,7 @@ class gsquery: idtech3query = ('protocol-quake3', 'iw3.0', 'ioquake3', 'qfusion') minecraftquery = ('minecraft', 'lwjgl2') minecraftbequery = ('minecraftbe') - jc2mpquery = ('jc2mp') + jc2mquery = ('jc2m') mumblequery = ('mumbleping') soldatquery = ('soldat') twquery = ('teeworlds') @@ -40,7 +40,7 @@ class gsquery: self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00' elif self.argument.engine in self.idtech3query: self.query_prompt_string = b'\xff\xff\xff\xffgetstatus' - elif self.argument.engine in self.jc2mpquery: + elif self.argument.engine in self.jc2mquery: self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40' elif self.argument.engine in self.minecraftquery: self.query_prompt_string = b'\xFE\xFD\x09\x3d\x54\x1f\x93' From 3cd3009adf2fb35c01a9ba567115008cab30bb9e Mon Sep 17 00:00:00 2001 From: Justus557 <59891919+FeneralGeldmarschall@users.noreply.github.com> Date: Sun, 15 Jun 2025 22:53:17 +0200 Subject: [PATCH 054/132] fix(backup): add -h flag to backup tar command so it follows symlinks (#4780) --- lgsm/modules/command_backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/command_backup.sh b/lgsm/modules/command_backup.sh index f427e8b00..2c8f4bcda 100644 --- a/lgsm/modules/command_backup.sh +++ b/lgsm/modules/command_backup.sh @@ -126,7 +126,7 @@ fn_backup_compression() { core_exit.sh fi - tar --use-compress-program=pigz -cf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}" --exclude "${tmpdir}" ./. + tar --use-compress-program=pigz -hcf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}" --exclude "${tmpdir}" ./. exitcode=$? if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol From 63d0f8159927c88d91124ccb03f6c0efabffe337 Mon Sep 17 00:00:00 2001 From: FlaminSarge Date: Sun, 15 Jun 2025 13:54:23 -0700 Subject: [PATCH 055/132] docs(tf2/hl2dm): Add note about unrestricted_maxplayers param (#4783) --- lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg | 2 ++ lgsm/config-default/config-lgsm/tf2server/_default.cfg | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg index c429a6c8e..7ce4dd073 100644 --- a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg @@ -9,6 +9,8 @@ #### Game Server Settings #### ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +# Note that for HL2DM, maxplayers > 33 must be specified like so: +# maxplayers="101 -unrestricted_maxplayers" ip="0.0.0.0" port="27015" clientport="27005" diff --git a/lgsm/config-default/config-lgsm/tf2server/_default.cfg b/lgsm/config-default/config-lgsm/tf2server/_default.cfg index 600249013..74fd359ab 100644 --- a/lgsm/config-default/config-lgsm/tf2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/tf2server/_default.cfg @@ -9,6 +9,8 @@ #### Game Server Settings #### ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +# Note that for TF2, maxplayers > 33 must be specified like so: +# maxplayers="101 -unrestricted_maxplayers" ip="0.0.0.0" port="27015" clientport="27005" From 783db0a175f70bbcf39785eb7e5852fd5c36938b Mon Sep 17 00:00:00 2001 From: Stephan Schaffner Date: Sun, 15 Jun 2025 23:19:07 +0200 Subject: [PATCH 056/132] fix(alert): resolve more info missing from discord alert (#4771) * Fixing missing more Info * minor bug --------- Co-authored-by: Hornochs Co-authored-by: Daniel Gibbs --- lgsm/modules/alert_discord.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lgsm/modules/alert_discord.sh b/lgsm/modules/alert_discord.sh index 1ed3da441..1440b6a96 100644 --- a/lgsm/modules/alert_discord.sh +++ b/lgsm/modules/alert_discord.sh @@ -46,6 +46,11 @@ json=$( "name": "Server Time", "value": "$(date)", "inline": true + }, + { + "name": "More info", + "value": "${alerturl}", + "inline": true } EOF ) @@ -63,7 +68,7 @@ EOF ) fi -if [ -n "{alerturl}" ]; then +if [ -n "${alerturl}" ]; then json+=$( cat << EOF , From dffed7b29897044b7121f503a3e08ce15ee2e524 Mon Sep 17 00:00:00 2001 From: Awesomerly Date: Sun, 15 Jun 2025 17:20:19 -0400 Subject: [PATCH 057/132] feat(mods): update sourcemod to 1.12 (#4767) --- lgsm/modules/mods_list.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/mods_list.sh b/lgsm/modules/mods_list.sh index f6f8301bd..89412e65d 100644 --- a/lgsm/modules/mods_list.sh +++ b/lgsm/modules/mods_list.sh @@ -61,7 +61,7 @@ metamodsourcelatestfile=$(wget "${metamodsourcescrapeurl}" -q -O -) metamodsourcedownloadurl="https://www.metamodsource.net/latest.php?os=linux&version=${metamodsourceversion}" metamodsourceurl="${metamodsourcedownloadurl}" # Sourcemod -sourcemodversion="1.11" +sourcemodversion="1.12" sourcemodscrapeurl="https://sm.alliedmods.net/smdrop/${sourcemodversion}/sourcemod-latest-linux" sourcemodlatestfile=$(wget "${sourcemodscrapeurl}" -q -O -) sourcemoddownloadurl="https://www.sourcemod.net/latest.php?os=linux&version=${sourcemodversion}" From 233ea15e00efce9cebb874c975fa75c31c761d14 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 17 Jun 2025 23:23:57 +0200 Subject: [PATCH 058/132] fix(mcb): change updater to use the new api url (#4790) --------- Co-authored-by: Daniel Gibbs --- .../config-lgsm/ecoserver/_default.cfg | 5 +- .../config-lgsm/hzserver/_default.cfg | 5 +- .../config-lgsm/jc2server/_default.cfg | 2 +- .../config-lgsm/tfserver/_default.cfg | 2 +- lgsm/data/almalinux-8.csv | 2 +- lgsm/data/almalinux-9.csv | 2 +- lgsm/data/centos-7.csv | 2 +- lgsm/data/centos-8.csv | 2 +- lgsm/data/centos-9.csv | 2 +- lgsm/data/debian-10.csv | 2 +- lgsm/data/debian-11.csv | 2 +- lgsm/data/debian-12.csv | 2 +- lgsm/data/debian-13.csv | 2 +- lgsm/data/debian-9.csv | 2 +- lgsm/data/rhel-7.csv | 2 +- lgsm/data/rhel-8.csv | 2 +- lgsm/data/rhel-9.csv | 2 +- lgsm/data/rocky-8.csv | 2 +- lgsm/data/rocky-9.csv | 2 +- lgsm/data/serverlist.csv | 2 +- lgsm/data/ubuntu-16.04.csv | 2 +- lgsm/data/ubuntu-18.04.csv | 2 +- lgsm/data/ubuntu-20.04.csv | 2 +- lgsm/data/ubuntu-22.04.csv | 2 +- lgsm/data/ubuntu-23.04.csv | 2 +- lgsm/data/ubuntu-23.10.csv | 2 +- lgsm/data/ubuntu-24.04.csv | 4 +- lgsm/modules/alert_discord.sh | 113 ++++++++++-------- lgsm/modules/check_deps.sh | 11 +- lgsm/modules/command_monitor.sh | 2 +- lgsm/modules/command_postdetails.sh | 29 +++-- lgsm/modules/core_steamcmd.sh | 2 +- lgsm/modules/info_messages.sh | 2 +- lgsm/modules/mods_list.sh | 1 - lgsm/modules/query_gsquery.py | 6 +- lgsm/modules/update_fctr.sh | 2 +- lgsm/modules/update_jk2.sh | 2 +- lgsm/modules/update_mc.sh | 2 +- lgsm/modules/update_mcb.sh | 19 +-- lgsm/modules/update_mta.sh | 2 +- lgsm/modules/update_pmc.sh | 2 +- lgsm/modules/update_ts3.sh | 2 +- lgsm/modules/update_ut99.sh | 2 +- lgsm/modules/update_vints.sh | 2 +- lgsm/modules/update_xnt.sh | 2 +- 45 files changed, 147 insertions(+), 118 deletions(-) diff --git a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg index c08f37072..0c18318e9 100644 --- a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg @@ -8,8 +8,11 @@ #### Game Server Settings #### +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +usertoken="" + ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="-nogui" +startparameters="-nogui -userToken=${usertoken}" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/hzserver/_default.cfg b/lgsm/config-default/config-lgsm/hzserver/_default.cfg index b610594e7..98b6dda1e 100644 --- a/lgsm/config-default/config-lgsm/hzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hzserver/_default.cfg @@ -12,7 +12,6 @@ ip="0.0.0.0" port="7777" queryport="27015" -servername="LinuxGSM" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters startparameters="-log -port=${port} -queryport=${queryport} -steamservername=${servername}" @@ -157,8 +156,8 @@ glibc="2.17" systemdir="${serverfiles}/TSSGame" executabledir="${systemdir}/Binaries/Linux" executable="./TSSGameServer-Linux-Shipping" -servercfgdir="${systemdir}/Saved/Config/LinuxServer" -servercfg="GameUserSettings.ini" +servercfgdir="${systemdir}" +servercfg="GameServerSettings.ini" servercfgdefault="GameUserSettings.ini" servercfgfullpath="${servercfgdir}/${servercfg}" diff --git a/lgsm/config-default/config-lgsm/jc2server/_default.cfg b/lgsm/config-default/config-lgsm/jc2server/_default.cfg index 21932e205..5a82bbad9 100644 --- a/lgsm/config-default/config-lgsm/jc2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc2server/_default.cfg @@ -134,7 +134,7 @@ stopmode="2" # 4: gsquery # 5: tcp querymode="2" -querytype="jc2mp" +querytype="jc2m" ## Console type consoleverbose="yes" diff --git a/lgsm/config-default/config-lgsm/tfserver/_default.cfg b/lgsm/config-default/config-lgsm/tfserver/_default.cfg index fbce96a44..53fde059d 100644 --- a/lgsm/config-default/config-lgsm/tfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tfserver/_default.cfg @@ -33,7 +33,7 @@ servertags="LinuxGSM" steamsocket="0" # Use Steam Socket. 0 = off; 1 = on. Use Steam Servers for network penetration. Enable this if you don't have a public IP but you want to allow players from outside your network to join your server. If disabled, only you and other players on your LAN can join. If you have a public IP, you do not need to enable this. ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="ProjectWar_Start?DedicatedServer?MaxPlayers=${maxplayers} -server -game -log -MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -BeaconPort=${beaconport} -ShutDownServicePort=${shutdownport} -ConfigServerName='${selfname}' -OutIPAddress=${publicip} -ServerTags='${servertags}' -UseSteamSocket=${steamsocket} -UserDir='${serverfiles}/${selfname}' -ServerName='${servername}' -EnableParallelCharacterMovementTickFunction -EnableParallelCharacterTickFunction -UseDynamicPhysicsScene -Game.PhysicsVehicle=false -ansimalloc -Game.MaxFrameRate=35 -MaxQueueSize=${maxqueuesize} -QueueValidTime=${queuevalidtime} -QueueThreshold=${maxplayers} -ServerFightModeType=${gamemode} -IsCanSelfDamage=${damageself} -IsCanFriendDamage=${damageallies} -SaveWorldInterval=${saveinterval} -GMOverlapRatio=2 -GreenHand=${greenhand} -SensitiveWords=${allowsensitivewords} -UseACE=${anticheat} -ServerAdminAccounts='${serveradmins}' -IsShowGmTitle=${adminlabel} -ServerPassword='${serverpassword}'" +startparameters="ProjectWar_Start?DedicatedServer?MaxPlayers=${maxplayers} -server -game -log -MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -BeaconPort=${beaconport} -ShutDownServicePort=${shutdownport} -ConfigServerName='${selfname}' -OutIPAddress=${publicip} -ServerTags='${servertags}' -UseSteamSocket=${steamsocket} -UserDir='${serverfiles}/${selfname}' -ServerName='${servername}' -EnableParallelCharacterMovementTickFunction -EnableParallelCharacterTickFunction -UseDynamicPhysicsScene -Game.PhysicsVehicle=false -ansimalloc -Game.MaxFrameRate=35 -MaxQueueSize=${maxqueuesize} -QueueValidTime=${queuevalidtime} -QueueThreshold=${maxplayers} -ServerFightModeType=${gamemode} -IsCanSelfDamage=${damageself} -IsCanFriendDamage=${damageallies} -SaveWorldInterval=${saveinterval} -GMOverlapRatio=2 -GreenHand=${greenhand} -SensitiveWords=${allowsensitivewords} -UseEAC=${anticheat} -ServerAdminAccounts='${serveradmins}' -IsShowGmTitle=${adminlabel} -ServerPassword='${serverpassword}'" #### LinuxGSM Settings #### diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index d4d2456bd..08d91f8fc 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index 7dae6338e..a16722c2f 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index 266b358ba..7b467fa00 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-11-openjdk vs wet diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index bd5b72c33..4b9fd2133 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-17-openjdk vs wet diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index 893f3698c..c6ff3a272 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-17-openjdk vs wet diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index bfbf4dac0..74d82e158 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 61a20b15f..33b7deaf9 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 5fa249e15..06fd9e52c 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-17-jre vs wet diff --git a/lgsm/data/debian-13.csv b/lgsm/data/debian-13.csv index 4002eb0e9..7d775040e 100644 --- a/lgsm/data/debian-13.csv +++ b/lgsm/data/debian-13.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index d00f64969..02acceacd 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-8-jre vs wet diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 7800136bb..90c9df07e 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-11-openjdk vs wet diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index f8bb1d492..0298bd0b0 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index 7dae6338e..a16722c2f 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index f8bb1d492..0298bd0b0 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index 7dae6338e..a16722c2f 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 68f25de70..3b8121a26 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -126,7 +126,7 @@ ut2k4,ut2k4server,Unreal Tournament 2004,ubuntu-24.04 ut3,ut3server,Unreal Tournament 3,ubuntu-24.04 ut99,ut99server,Unreal Tournament 99,ubuntu-24.04 vh,vhserver,Valheim,ubuntu-24.04 -vints,vintsserver,Vintage Story,ubuntu-24.04 +vints,vintsserver,Vintage Story,ubuntu-22.04 vpmc,vpmcserver,Velocity Proxy MC,ubuntu-24.04 vs,vsserver,Vampire Slayer,ubuntu-24.04 wet,wetserver,Wolfenstein: Enemy Territory,ubuntu-24.04 diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 1327946e5..436bdecb8 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-8-jre vs wet diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index d693fba00..3b24ff37f 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 193054da8..f19436d6a 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 1b8849bba..f8a48ccce 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/data/ubuntu-23.04.csv b/lgsm/data/ubuntu-23.04.csv index 2ed8416a2..c14964d2d 100644 --- a/lgsm/data/ubuntu-23.04.csv +++ b/lgsm/data/ubuntu-23.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/data/ubuntu-23.10.csv b/lgsm/data/ubuntu-23.10.csv index 2ed8416a2..c14964d2d 100644 --- a/lgsm/data/ubuntu-23.10.csv +++ b/lgsm/data/ubuntu-23.10.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-7.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index aacb0ca7d..bd220a501 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -5,7 +5,7 @@ ahl ahl2 ark arma3 -armar,libcurl4 +armar,libcurl4t64 ats av bb @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,aspnetcore-runtime-8.0 +vints,dotnet-runtime-7.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/modules/alert_discord.sh b/lgsm/modules/alert_discord.sh index 2b50f0c01..1ed3da441 100644 --- a/lgsm/modules/alert_discord.sh +++ b/lgsm/modules/alert_discord.sh @@ -10,68 +10,81 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" json=$( cat << EOF { - "username": "LinuxGSM", - "avatar_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", - "file": "content", - "embeds": [ - { - "author": { - "name": "LinuxGSM Alert", - "url": "", - "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg" - }, - "title": "${alerttitle}", - "url": "", - "description": "", - "color": "${alertcolourdec}", - "type": "content", - "thumbnail": { - "url": "${alerticon}" - }, - "fields": [ - { - "name": "Server Name", - "value": "${servername}" - }, - { - "name": "Information", - "value": "${alertmessage}" - }, - { - "name": "Game", - "value": "${gamename}", - "inline": true - }, - { - "name": "Server Time", - "value": "$(date)", - "inline": true - } + "username": "LinuxGSM", + "avatar_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", + "file": "content", + "embeds": [ + { + "author": { + "name": "LinuxGSM Alert", + "url": "", + "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg" + }, + "title": "${alerttitle}", + "url": "", + "description": "", + "color": "${alertcolourdec}", + "type": "content", + "thumbnail": { + "url": "${alerticon}" + }, + "fields": [ + { + "name": "Server Name", + "value": "${servername}" + }, + { + "name": "Information", + "value": "${alertmessage}" + }, + { + "name": "Game", + "value": "${gamename}", + "inline": true + }, + { + "name": "Server Time", + "value": "$(date)", + "inline": true + } EOF ) if [ -n "${querytype}" ]; then json+=$( cat << EOF - , - { - "name": "Is my Game Server Online?", - "value": "https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}", - "inline": true - } + , + { + "name": "Is my Game Server Online?", + "value": "https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}", + "inline": true + } +EOF + ) +fi + +if [ -n "{alerturl}" ]; then + json+=$( + cat << EOF + , + { + "name": "More info", + "value": "${alerturl}", + "inline": true + } EOF ) fi json+=$( cat << EOF - ], - "footer": { - "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", - "text": "Sent by LinuxGSM ${version}" - } - } - ] + ], + "footer": { + "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", + "text": "Sent by LinuxGSM ${version}" + } + } + ] } EOF ) diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh index dcc9c890c..5667876e5 100644 --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -9,8 +9,8 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_dotnet_repo() { if [ "${distroid}" == "ubuntu" ]; then - # if package aspnetcore-runtime-7.0 is unavailable in ubuntu repos, add the microsoft repo. - if ! apt-cache show aspnetcore-runtime-7.0 > /dev/null 2>&1; then + # if package dotnet-runtime-7.0 is unavailable in ubuntu repos, add the microsoft repo. + if ! apt-cache show dotnet-runtime-7.0 > /dev/null 2>&1; then fn_fetch_file "https://packages.microsoft.com/config/ubuntu/${distroversion}/packages-microsoft-prod.deb" "" "" "" "/tmp" "packages-microsoft-prod.deb" "" "" "" "" sudo dpkg -i /tmp/packages-microsoft-prod.deb fi @@ -251,12 +251,15 @@ fn_deps_detector() { if [ "${deptocheck}" == "libsdl2-2.0-0:i386" ] && [ -z "${appid}" ]; then array_deps_required=("${array_deps_required[@]/libsdl2-2.0-0:i386/}") steamcmdstatus=1 + return elif [ "${deptocheck}" == "steamcmd" ] && [ -z "${appid}" ]; then array_deps_required=("${array_deps_required[@]/steamcmd/}") steamcmdstatus=1 + return elif [ "${deptocheck}" == "steamcmd" ] && [ "${distroid}" == "debian" ] && ! grep -qE '[^deb]+non-free([^-]|$)' /etc/apt/sources.list; then array_deps_required=("${array_deps_required[@]/steamcmd/}") steamcmdstatus=1 + return # Java: Added for users using Oracle JRE to bypass check. elif [[ ${deptocheck} == "openjdk"* ]] || [[ ${deptocheck} == "java"* ]]; then # Is java already installed? @@ -279,9 +282,9 @@ fn_deps_detector() { monoinstalled=false fi # .NET Core: A .NET Core repo needs to be installed. - elif [ "${deptocheck}" == "aspnetcore-runtime-7.0" ]; then + elif [ "${deptocheck}" == "dotnet-runtime-7.0" ]; then # .NET is not installed. - if [ -n "${dotnetversion}" ]; then + if dotnet --list-runtimes | grep -q "Microsoft.NETCore.App 7.0"; then depstatus=0 dotnetinstalled=true else diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh index 7feb05455..5fa3c3000 100644 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -167,7 +167,7 @@ fn_monitor_check_update_source() { fn_script_log_info "Checking update: ${selfname} has requested an update and needs to be restarted" alert="update-request" alert.sh - command_update.sh + command_restart.sh core_exit.sh fi fi diff --git a/lgsm/modules/command_postdetails.sh b/lgsm/modules/command_postdetails.sh index 61d537440..7f5f67304 100644 --- a/lgsm/modules/command_postdetails.sh +++ b/lgsm/modules/command_postdetails.sh @@ -58,18 +58,27 @@ else fi fn_print_dots "termbin.com" -link=$(cat "${postdetailslog}" | nc termbin.com 9999 | tr -d '\n\0') -fn_print_ok_nl "termbin.com for 30D" -fn_script_log_pass "termbin.com for 30D" -pdurl="${link}" +link=$(cat "${postdetailslog}" | { + nc -w 3 termbin.com 9999 + echo $? > /tmp/nc_exit_status +} | tr -d '\n\0') +nc_exit_status=$(cat /tmp/nc_exit_status) +if [ "${nc_exit_status}" -ne 0 ]; then + fn_print_error_nl "Failed to post to termbin.com" + fn_script_log_error "Failed to post to termbin.com" +else + fn_print_ok_nl "termbin.com for 30D" + fn_script_log_pass "termbin.com for 30D" + pdurl="${link}" -if [ "${firstcommandname}" == "POST-DETAILS" ]; then - echo -e "" - echo -e "Please share the following url for support: " - echo -e "${italic}${pdurl}${default}" + if [ "${firstcommandname}" == "POST-DETAILS" ]; then + echo -e "" + echo -e "Please share the following url for support: " + echo -e "${italic}${pdurl}${default}" + fi + fn_script_log_info "${pdurl}" + alerturl="${pdurl}" fi -fn_script_log_info "${pdurl}" -alerturl="${pdurl}" if [ -z "${exitbypass}" ]; then core_exit.sh diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh index dad98a1e2..bf9790132 100644 --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -164,7 +164,7 @@ fn_update_steamcmd_localbuild() { } fn_update_steamcmd_remotebuild() { - # Get remote build info. + # Gets remote build info. if [ -d "${steamcmddir}" ]; then cd "${steamcmddir}" || exit fi diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index fd6ebc447..4f1f00268 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -1658,7 +1658,7 @@ fn_info_messages_tf() { { fn_port "header" fn_port "Game" port udp - fn_port "Query" queryport tcp + fn_port "Query" queryport udp fn_port "Beacon" beaconport udp fn_port "Shutdown" shutdownport tcp } | column -s $'\t' -t diff --git a/lgsm/modules/mods_list.sh b/lgsm/modules/mods_list.sh index d6622d1b2..f6f8301bd 100644 --- a/lgsm/modules/mods_list.sh +++ b/lgsm/modules/mods_list.sh @@ -189,7 +189,6 @@ mod_info_spinnertool=(MOD "spinnertool" "Spinner Tool" "https://github.com/dvdvi mod_info_surfacefrictiontool=(MOD "surfacefrictiontool" "Surface Friction Tool" "https://github.com/dvdvideo1234/surfacefrictiontool/archive/master.zip" "surfacefrictiontool-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/SurfaceFrictionTool" "Controls the surface friction of a prop") mod_info_magneticdipole=(MOD "magneticdipole" "Magnetic Dipole" "https://github.com/dvdvideo1234/magneticdipole/archive/master.zip" "magneticdipole-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/MagneticDipole" "Magnet entity that runs forces on its poles. Supports wire") mod_info_environmentorganizer=(MOD "environmentorganizer" "Environment Organizer" "https://github.com/dvdvideo1234/environmentorganizer/archive/master.zip" "environmentorganizer-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/EnvironmentOrganizer" "Installs routines designed for server settings adjustment") -mod_info_precision_alignment=(MOD "precision-alignment" "Precision Alignment" "https://github.com/Mista-Tea/precision-alignment/archive/master.zip" "precision-alignment-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/precision-alignment" "Creates precise constraints and aligments") mod_info_improved_stacker=(MOD "improved-stacker" "Improved Stacker" "https://github.com/Mista-Tea/improved-stacker/archive/master.zip" "improved-stacker-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-stacker" "Stacks entities in the direction chosen") mod_info_improved_weight=(MOD "improved-weight" "Improved Weight" "https://github.com/Mista-Tea/improved-weight/archive/master.zip" "improved-weight-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-weight" "Weight tool but with more features") mod_info_improved_antinoclip=(MOD "improved-antinoclip" "Improved Antinoclip" "https://github.com/Mista-Tea/improved-antinoclip/archive/master.zip" "improved-antinoclip-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-antinoclip" "Controls clipping trough an object") diff --git a/lgsm/modules/query_gsquery.py b/lgsm/modules/query_gsquery.py index 245a606e1..4dbde90dd 100644 --- a/lgsm/modules/query_gsquery.py +++ b/lgsm/modules/query_gsquery.py @@ -11,7 +11,7 @@ import socket import sys engine_types = ('protocol-valve', 'protocol-quake2', 'protocol-quake3', 'protocol-gamespy1', - 'protocol-unreal2', 'ut3', 'minecraft', 'minecraftbe', 'jc2mp', 'mumbleping', 'soldat', 'teeworlds') + 'protocol-unreal2', 'ut3', 'minecraft', 'minecraftbe', 'jc2m', 'mumbleping', 'soldat', 'teeworlds') class gsquery: @@ -23,7 +23,7 @@ class gsquery: idtech3query = ('protocol-quake3', 'iw3.0', 'ioquake3', 'qfusion') minecraftquery = ('minecraft', 'lwjgl2') minecraftbequery = ('minecraftbe') - jc2mpquery = ('jc2mp') + jc2mquery = ('jc2m') mumblequery = ('mumbleping') soldatquery = ('soldat') twquery = ('teeworlds') @@ -40,7 +40,7 @@ class gsquery: self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00' elif self.argument.engine in self.idtech3query: self.query_prompt_string = b'\xff\xff\xff\xffgetstatus' - elif self.argument.engine in self.jc2mpquery: + elif self.argument.engine in self.jc2mquery: self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40' elif self.argument.engine in self.minecraftquery: self.query_prompt_string = b'\xFE\xFD\x09\x3d\x54\x1f\x93' diff --git a/lgsm/modules/update_fctr.sh b/lgsm/modules/update_fctr.sh index b49386654..3418c7424 100644 --- a/lgsm/modules/update_fctr.sh +++ b/lgsm/modules/update_fctr.sh @@ -34,7 +34,7 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://factorio.com/get-download/${branch}/headless/${factorioarch}" remotebuildresponse=$(curl -s "${apiurl}") remotebuildversion=$(echo "${remotebuildresponse}" | grep -o '[0-9]\.[0-9]\{1,\}\.[0-9]\{1,\}' | head -1) diff --git a/lgsm/modules/update_jk2.sh b/lgsm/modules/update_jk2.sh index 098154499..5fdd54c65 100644 --- a/lgsm/modules/update_jk2.sh +++ b/lgsm/modules/update_jk2.sh @@ -31,7 +31,7 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://api.github.com/repos/mvdevs/jk2mv/releases/latest" remotebuildresponse=$(curl -s "${apiurl}") remotebuildfilename=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("dedicated.zip")) | .name') diff --git a/lgsm/modules/update_mc.sh b/lgsm/modules/update_mc.sh index 0ce4e2e39..a9be77576 100644 --- a/lgsm/modules/update_mc.sh +++ b/lgsm/modules/update_mc.sh @@ -34,7 +34,7 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://launchermeta.mojang.com/mc/game/version_manifest.json" remotebuildresponse=$(curl -s "${apiurl}") # Latest release. diff --git a/lgsm/modules/update_mcb.sh b/lgsm/modules/update_mcb.sh index 8154b813e..a8616c3b8 100644 --- a/lgsm/modules/update_mcb.sh +++ b/lgsm/modules/update_mcb.sh @@ -38,7 +38,7 @@ fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" # Uses log file to get local build. - localbuild=$(grep Version "${consolelogdir}"/* 2> /dev/null | tail -1 | sed 's/.*Version: //' | tr -d '\000-\011\013-\037') + localbuild=$(grep -hoP 'Version:\s*\K[\d.]+' "${consolelogdir}"/* 2> /dev/null | sort -V -r | head -n1) if [ -z "${localbuild}" ]; then fn_print_error "Checking local build: ${remotelocation}: missing local build info" fn_script_log_error "Missing local build info" @@ -51,15 +51,18 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Random number for userAgent - randomint=$(tr -dc 0-9 < /dev/urandom 2> /dev/null | head -c 4 | xargs) - # Get remote build info. - if [ "${mcversion}" == "latest" ]; then - remotebuildversion=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -Ls -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.${randomint}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://www.minecraft.net/bedrockdedicatedserver/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]") + # Gets remote build info. + apiurl="https://net-secondary.web.minecraft-services.net/api/v1.0/download/links" + remotebuildresponse=$(curl -s "${apiurl}" | jq '.result.links[]') + # Latest preview. + if [ "${mcversion}" == "preview" ]; then + remotebuildurl=$(echo "${remotebuildresponse}" | jq -r 'select(.downloadType == "serverBedrockPreviewLinux") | .downloadUrl') + # Latest release. else - remotebuildversion="${mcversion}" + remotebuildurl=$(echo "${remotebuildresponse}" | jq -r 'select(.downloadType == "serverBedrockLinux") | .downloadUrl') fi - remotebuildurl="https://www.minecraft.net/bedrockdedicatedserver/bin-linux/bedrock-server-${remotebuildversion}.zip" + remotebuildversion=$(echo "${remotebuildurl}" | grep -Eo "[.0-9]+[0-9]") + remotebuildfilename="bedrock-server-${remotebuildversion}.zip" if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" diff --git a/lgsm/modules/update_mta.sh b/lgsm/modules/update_mta.sh index c7214665d..50a3fb895 100644 --- a/lgsm/modules/update_mta.sh +++ b/lgsm/modules/update_mta.sh @@ -34,7 +34,7 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://linux.multitheftauto.com/revision/latest.txt" remotebuildresponse=$(curl -s "${apiurl}") remotebuildfilename="multitheftauto_linux_x64.tar.gz" diff --git a/lgsm/modules/update_pmc.sh b/lgsm/modules/update_pmc.sh index 9c288827e..c38911d4e 100644 --- a/lgsm/modules/update_pmc.sh +++ b/lgsm/modules/update_pmc.sh @@ -32,7 +32,7 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://api.papermc.io/v2/projects" # Get list of projects. remotebuildresponse=$(curl -s "${apiurl}") diff --git a/lgsm/modules/update_ts3.sh b/lgsm/modules/update_ts3.sh index 92f9d3489..e1917e5e1 100644 --- a/lgsm/modules/update_ts3.sh +++ b/lgsm/modules/update_ts3.sh @@ -31,7 +31,7 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://www.teamspeak.com/versions/server.json" remotebuildresponse=$(curl -s "${apiurl}") diff --git a/lgsm/modules/update_ut99.sh b/lgsm/modules/update_ut99.sh index 5f30bdc23..bdfb96f0b 100644 --- a/lgsm/modules/update_ut99.sh +++ b/lgsm/modules/update_ut99.sh @@ -32,7 +32,7 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://api.github.com/repos/OldUnreal/UnrealTournamentPatches/releases/latest" remotebuildresponse=$(curl -s "${apiurl}") remotebuildfilename=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("Linux-amd64")) | .name') diff --git a/lgsm/modules/update_vints.sh b/lgsm/modules/update_vints.sh index d468d58d4..4021af11a 100644 --- a/lgsm/modules/update_vints.sh +++ b/lgsm/modules/update_vints.sh @@ -34,7 +34,7 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="http://api.vintagestory.at/stable-unstable.json" remotebuildresponse=$(curl -s "${apiurl}") if [ "${branch}" == "stable" ]; then diff --git a/lgsm/modules/update_xnt.sh b/lgsm/modules/update_xnt.sh index 7014ab1a9..f043a4227 100644 --- a/lgsm/modules/update_xnt.sh +++ b/lgsm/modules/update_xnt.sh @@ -36,7 +36,7 @@ fn_update_localbuild() { } fn_update_remotebuild() { - # Get remote build info. + # Gets remote build info. apiurl="https://api.github.com/repos/xonotic/xonotic/tags" remotebuildresponse=$(curl -s "${apiurl}") remotebuildtag=$(echo "${remotebuildresponse}" | jq -r '.[0].name') From 1fbd1aad9b6061f936fb92b2761af92ad558a3fb Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 17 Jun 2025 22:26:49 +0100 Subject: [PATCH 059/132] Release v25.1.6 --- lgsm/modules/core_modules.sh | 2 +- linuxgsm.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 51f691d5c..e5e6d1e5d 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v25.1.5" +modulesversion="v25.1.6" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index af7c182dd..6d6f7251f 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -24,7 +24,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v25.1.5" +version="v25.1.6" shortname="core" gameservername="core" commandname="CORE" From 6847401b0406b7eb7691ee0476bd1a60b588e649 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 19 Jun 2025 20:20:36 +0100 Subject: [PATCH 060/132] chore: pre-load details in workflow --- .github/workflows/details-check.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/details-check.yml b/.github/workflows/details-check.yml index 748a77991..f52d12c5a 100644 --- a/.github/workflows/details-check.yml +++ b/.github/workflows/details-check.yml @@ -68,6 +68,10 @@ jobs: else curl -f -o config "https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main/${{ matrix.shortname }}/${{ steps.sets-servercfgname.outputs.servercfgname }}" fi + + - name: Pre-load LinuxGSM + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server details + - name: Display config run: | if [ "${{ steps.sets-servercfgname.outputs.servercfgname }}" == "" ]; then From 35db6a891829e0def1a576bb12455341604feb1c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 19 Jun 2025 22:07:24 +0100 Subject: [PATCH 061/132] chore: changed workflow to fail-fast false --- .github/workflows/update-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index 932e3ea2a..2f2f7babc 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -13,12 +13,12 @@ concurrency: jobs: update-check: if: github.repository_owner == 'GameServerManagers' - continue-on-error: true runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - shortname: [css, fctr, jk2, mc, mcb, mta, pmc, ts3, ut99, vints] + shortname: [css, fctr, jk2, mc, mcb, mta, pmc, ts3, ut99, vints, xnt] steps: - name: Download linuxgsm.sh From 1c91b9b36c0d11abaf66e03d55c072d53096a42c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 19 Jun 2025 22:23:05 +0100 Subject: [PATCH 062/132] fix:(xnt): add missing code to check-update --- lgsm/modules/command_check_update.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lgsm/modules/command_check_update.sh b/lgsm/modules/command_check_update.sh index ee4c8ccb3..38f8b4ddc 100644 --- a/lgsm/modules/command_check_update.sh +++ b/lgsm/modules/command_check_update.sh @@ -32,6 +32,8 @@ elif [ "${shortname}" == "vints" ]; then update_vints.sh elif [ "${shortname}" == "ut99" ]; then update_ut99.sh +elif [ "${shortname}" == "xnt" ]; then + update_xnt.sh else update_steamcmd.sh fi From 3622b288c84495ca8beead27274ece034ac15218 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 19 Jun 2025 23:19:38 +0100 Subject: [PATCH 063/132] fix(xnt): version command not completing carriage return --- lgsm/modules/update_xnt.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/lgsm/modules/update_xnt.sh b/lgsm/modules/update_xnt.sh index f043a4227..c00233aa7 100644 --- a/lgsm/modules/update_xnt.sh +++ b/lgsm/modules/update_xnt.sh @@ -1,9 +1,9 @@ #!/bin/bash -# LinuxGSM command_ut99.sh module +# LinuxGSM command_xnt.sh module # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Handles updating of Unreal Tournament 99 servers. +# Description: Handles updating of Xontic servers. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" @@ -17,10 +17,21 @@ fn_update_dl() { fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" - + check_status.sh # Send version command to Xonotic server. - tmux -L "${socketname}" send-keys -t "${sessionname}" "version\r" > /dev/null 2>&1 - fn_sleep_time_1 + if [ "${status}" != "0" ]; then + tmux -L "${socketname}" send-keys -t "${sessionname}" "version" C-m > /dev/null 2>&1 + fn_sleep_time_1 + else + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + fn_sleep_time_5 + tmux -L "${socketname}" send-keys -t "${sessionname}" "version" C-m > /dev/null 2>&1 + command_stop.sh + fn_firstcommand_reset + fi # Uses log file to get local build. localbuild=$(grep "SVQC version: xonotic-v" "${consolelogdir}"/* 2> /dev/null | tail -1 | sed 's/.*SVQC version: \(xonotic-v[0-9.]*\).*/\1/' | tr -d '\000-\011\013-\037') From 61d4866b3413b3f0627b1939a7de6892276fb40c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 20 Jun 2025 00:23:45 +0100 Subject: [PATCH 064/132] fix: remove redundant fetch of default config for multiple game types --- lgsm/modules/install_config.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index db6b1e5cf..3d6fe5374 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -289,7 +289,6 @@ elif [ "${shortname}" == "bt" ]; then elif [ "${shortname}" == "btl" ]; then fn_check_cfgdir array_configs+=(Game.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -370,7 +369,6 @@ elif [ "${shortname}" == "cs" ]; then fn_list_config_locations elif [ "${shortname}" == "cs2" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -483,7 +481,6 @@ elif [ "${shortname}" == "hldms" ]; then fn_list_config_locations elif [ "${shortname}" == "ohd" ]; then array_configs+=(Admins.cfg Engine.ini Game.ini MapCycle.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -585,7 +582,6 @@ elif [ "${shortname}" == "pvkii" ]; then fn_list_config_locations elif [ "${shortname}" == "pw" ]; then array_configs+=(PalWorldSettings.ini) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -614,13 +610,11 @@ elif [ "${shortname}" == "q2" ]; then fn_list_config_locations elif [ "${shortname}" == "q3" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "q4" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations @@ -784,7 +778,6 @@ elif [ "${shortname}" == "wmc" ]; then fn_list_config_locations elif [ "${shortname}" == "xnt" ]; then array_configs+=(server.cfg) - fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations From 9eabf2e2f99d02db97d2a1309064c107a8f44850 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 20 Jun 2025 00:32:05 +0100 Subject: [PATCH 065/132] fix(xnt): add call to fix_xnt.sh for configuration setup --- lgsm/modules/install_config.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index 3d6fe5374..b73e7b4b2 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -777,6 +777,7 @@ elif [ "${shortname}" == "wmc" ]; then fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "xnt" ]; then + fix_xnt.sh array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars From 8f01d1bd9504db645d3107e5c3b9683b1d617cde Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 21 Jun 2025 19:19:11 +0100 Subject: [PATCH 066/132] fix(check): update allowed commands to include RESTART in various checks (#4278) --- lgsm/modules/check.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lgsm/modules/check.sh b/lgsm/modules/check.sh index 59ac2a329..3922aec21 100644 --- a/lgsm/modules/check.sh +++ b/lgsm/modules/check.sh @@ -31,7 +31,7 @@ if [ "${commandname}" != "INSTALL" ] && [ "${commandname}" != "UPDATE-LGSM" ] && check_system_dir.sh fi -allowed_commands_array=(START DEBUG) +allowed_commands_array=(DEBUG RESTART START) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_executable.sh @@ -39,7 +39,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do done if [ "$(whoami)" != "root" ]; then - allowed_commands_array=(DEBUG START INSTALL) + allowed_commands_array=(DEBUG RESTART START INSTALL) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_glibc.sh @@ -54,21 +54,21 @@ for allowed_command in "${allowed_commands_array[@]}"; do fi done -allowed_commands_array=(BACKUP DEBUG DETAILS START UPDATE) +allowed_commands_array=(BACKUP DEBUG DETAILS RESTART START UPDATE) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_deps.sh fi done -allowed_commands_array=(CONSOLE DEBUG MONITOR START STOP) +allowed_commands_array=(CONSOLE DEBUG MONITOR RESTART START STOP) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_config.sh fi done -allowed_commands_array=(DEBUG DETAILS DEV-QUERY-RAW MONITOR POST_DETAILS START STOP POST-DETAILS) +allowed_commands_array=(DEBUG DETAILS DEV-QUERY-RAW MONITOR POST_DETAILS RESTART START STOP POST-DETAILS) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then if [ -z "${installflag}" ]; then @@ -77,7 +77,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do fi done -allowed_commands_array=(DEBUG START UPDATE VALIDATE CHECK-UPDATE) +allowed_commands_array=(DEBUG RESTART START UPDATE VALIDATE CHECK-UPDATE) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then if [ "${appid}" ]; then @@ -86,21 +86,21 @@ for allowed_command in "${allowed_commands_array[@]}"; do fi done -allowed_commands_array=(CHANGE-PASSWORD DETAILS MONITOR START STOP UPDATE VALIDATE POST-DETAILS) +allowed_commands_array=(CHANGE-PASSWORD DETAILS MONITOR RESTART START STOP UPDATE VALIDATE POST-DETAILS) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_status.sh fi done -allowed_commands_array=(DEBUG START INSTALL) +allowed_commands_array=(DEBUG RESTART START INSTALL) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_system_requirements.sh fi done -allowed_commands_array=(DETAILS MONITOR START STOP UPDATE VALIDATE POST-DETAILS) +allowed_commands_array=(DETAILS MONITOR RESTART START STOP UPDATE VALIDATE POST-DETAILS) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_gamedig.sh From 62710410ed687d069607b51fd0ee67fd0b2027cf Mon Sep 17 00:00:00 2001 From: Steve Axtmann Date: Sat, 21 Jun 2025 22:53:09 +0200 Subject: [PATCH 067/132] feat(fastdl): add goldsrc support for the fastdl command (#4472) * feat(hldmserver): add support for the fastdl command * fix(mods): set exit code to 0 when user cancels mod installation/removal * fix(fastdl): update bzip2 support check and adjust FastDL command conditions --------- Co-authored-by: Daniel Gibbs --- lgsm/modules/command_fastdl.sh | 35 ++++++++++++++-------------- lgsm/modules/command_mods_install.sh | 1 + lgsm/modules/command_mods_remove.sh | 1 + lgsm/modules/core_getopt.sh | 2 +- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/lgsm/modules/command_fastdl.sh b/lgsm/modules/command_fastdl.sh index e3437bc1f..3b8165444 100644 --- a/lgsm/modules/command_fastdl.sh +++ b/lgsm/modules/command_fastdl.sh @@ -21,13 +21,6 @@ luasvautorundir="${systemdir}/lua/autorun/server" luafastdlfile="lgsm_cl_force_fastdl.lua" luafastdlfullpath="${luasvautorundir}/${luafastdlfile}" -# Check if bzip2 is installed. -if [ ! "$(command -v bzip2 2> /dev/null)" ]; then - fn_print_fail "bzip2 is not installed" - fn_script_log_fail "bzip2 is not installed" - core_exit.sh -fi - # Header fn_print_header fn_print_nl "More info: ${italic}https://docs.linuxgsm.com/commands/fastdl" @@ -112,13 +105,13 @@ fn_fastdl_dirs() { # Using this gist https://gist.github.com/agunnerson-ibm/efca449565a3e7356906 fn_human_readable_file_size() { local abbrevs=( - $((1 << 60)):ZB - $((1 << 50)):EB - $((1 << 40)):TB - $((1 << 30)):GB - $((1 << 20)):MB - $((1 << 10)):KB - $((1)):bytes + "1152921504606846976:ZB" + "1125899906842624:EB" + "1099511627776:TB" + "1073741824:GB" + "1048576:MB" + "1024:KB" + "1:bytes" ) local bytes="${1}" @@ -225,11 +218,17 @@ fn_fastdl_preview() { fn_script_log_fail "Generating file list." core_exit.sh fi - fn_print_nl "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)" + + if [ "${engine}" == "source" ]; then + echo -e "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)" + elif [ "${engine}" == "goldsrc" ]; then + echo -e "about to copy ${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)" + fi + fn_script_log_info "${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)" rm -f "${tmpdir:?}/fastdl_files_to_compress.txt" if ! fn_prompt_yn "Continue?" Y; then - fn_script_log "User exited" + exitcode=0 core_exit.sh fi } @@ -431,7 +430,9 @@ fn_fastdl_preview fn_clear_old_fastdl fn_fastdl_dirs fn_fastdl_build -fn_fastdl_bzip2 +if [ "${engine}" == "source" ]; then + fn_fastdl_bzip2 +fi # Finished message. fn_print_nl "Fastdl files are located in:" fn_print_nl "${fastdldir}" diff --git a/lgsm/modules/command_mods_install.sh b/lgsm/modules/command_mods_install.sh index 4401e2c56..e76f3f1fa 100644 --- a/lgsm/modules/command_mods_install.sh +++ b/lgsm/modules/command_mods_install.sh @@ -88,6 +88,7 @@ if [ -f "${modsinstalledlistfullpath}" ]; then fn_script_log_warn "${modprettyname} is already installed" echo -e " * Any configs may be overwritten." if ! fn_prompt_yn "Continue?" Y; then + exitcode=0 core_exit.sh fi fn_script_log_info "User selected to continue" diff --git a/lgsm/modules/command_mods_remove.sh b/lgsm/modules/command_mods_remove.sh index 6dc52d95f..589046b11 100644 --- a/lgsm/modules/command_mods_remove.sh +++ b/lgsm/modules/command_mods_remove.sh @@ -47,6 +47,7 @@ done fn_print_warning_nl "You are about to remove ${cyan}${usermodselect}${default}." echo -e " * Any custom files/configuration will be removed." if ! fn_prompt_yn "Continue?" Y; then + exitcode=0 core_exit.sh fi diff --git a/lgsm/modules/core_getopt.sh b/lgsm/modules/core_getopt.sh index 9a5704663..8997ff3a0 100644 --- a/lgsm/modules/core_getopt.sh +++ b/lgsm/modules/core_getopt.sh @@ -96,7 +96,7 @@ fi ## Game server exclusive commands. # FastDL command. -if [ "${engine}" == "source" ]; then +if [ "${engine}" == "source" ] || [ "${engine}" == "goldsrc" ]; then currentopt+=("${cmd_fastdl[@]}") fi From c90c8fefb6ee25cf29c31987712e9fe4229cb344 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 21 Jun 2025 23:52:55 +0100 Subject: [PATCH 068/132] fix(send): will no longer ask to start the server #4621 --- lgsm/modules/command_send.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lgsm/modules/command_send.sh b/lgsm/modules/command_send.sh index de021599d..20ef188e3 100644 --- a/lgsm/modules/command_send.sh +++ b/lgsm/modules/command_send.sh @@ -30,12 +30,8 @@ if [ "${status}" != "0" ]; then tmux -L "${socketname}" send-keys -t "${sessionname}" "${commandtosend}" ENTER fn_script_log_pass "Command \"${commandtosend}\" sent to console" else - fn_print_error_nl "Server not running" - fn_script_log_error "Failed to access: Server not running" - if fn_prompt_yn "Do you want to start the server?" Y; then - exitbypass=1 - command_start.sh - fi + fn_print_error_nl "Unable to send command to console. Server not running" + fn_script_log_error "Unable to send command to console. Server not running" fi core_exit.sh From 2fd56ebeca3adb616f9562305d1836ae90f7c9ca Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 22 Jun 2025 02:06:01 +0100 Subject: [PATCH 069/132] fix(core_exit): correct log file path for dev-debug module order --- lgsm/modules/core_exit.sh | 4 ++-- linuxgsm.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/modules/core_exit.sh b/lgsm/modules/core_exit.sh index 5f55dfcd1..1dd6e2f46 100644 --- a/lgsm/modules/core_exit.sh +++ b/lgsm/modules/core_exit.sh @@ -13,8 +13,8 @@ fn_exit_dev_debug() { echo -e "${moduleselfname} exiting with code: ${exitcode}" if [ -f "${rootdir}/dev-debug.log" ]; then grep -a "modulefile=" "${rootdir}/dev-debug.log" | sed 's/modulefile=//g' > "${rootdir}/dev-debug-module-order.log" - elif [ -f "${lgsmlogdir}/dev-debug.log" ]; then - grep -a "modulefile=" "${lgsmlogdir}/dev-debug.log" | sed 's/modulefile=//g' > "${rootdir}/dev-debug-module-order.log" + elif [ -f "${logdir}/dev-debug.log" ]; then + grep -a "modulefile=" "${logdir}/dev-debug.log" | sed 's/modulefile=//g' > "${logdir}/dev-debug-module-order.log" fi fi } diff --git a/linuxgsm.sh b/linuxgsm.sh index 6d6f7251f..f6cfe03cf 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -32,7 +32,7 @@ rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") lgsmdir="${rootdir}/lgsm" [ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" -lgsmlogdir="${logdir}/lgsm" +lgsmlogdir="${logdir}/script" steamcmddir="${HOME}/.steam/steamcmd" [ -n "${LGSM_SERVERFILES}" ] && serverfiles="${LGSM_SERVERFILES}" || serverfiles="${rootdir}/serverfiles" modulesdir="${lgsmdir}/modules" From 04f1654db2d98ec0c8f94d2abb72447a43d117fa Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 22 Jun 2025 02:34:50 +0100 Subject: [PATCH 070/132] fix(logging): define log file path for script logging --- linuxgsm.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/linuxgsm.sh b/linuxgsm.sh index f6cfe03cf..2be308d9c 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -33,6 +33,7 @@ selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") lgsmdir="${rootdir}/lgsm" [ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" lgsmlogdir="${logdir}/script" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" steamcmddir="${HOME}/.steam/steamcmd" [ -n "${LGSM_SERVERFILES}" ] && serverfiles="${LGSM_SERVERFILES}" || serverfiles="${rootdir}/serverfiles" modulesdir="${lgsmdir}/modules" From e4c712d411348cdec88e98f7f0d8bb185c3328a0 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 27 Jun 2025 09:57:29 +0100 Subject: [PATCH 071/132] feat(backup): add support for multiple compression methods in backup (#4795) * feat(backup): add support for multiple compression methods in backup process * fix(backup): update backup file extensions to support multiple compression formats --- lgsm/modules/command_backup.sh | 60 ++++++++++++++++++++++++---------- lgsm/modules/info_distro.sh | 6 ++-- 2 files changed, 45 insertions(+), 21 deletions(-) diff --git a/lgsm/modules/command_backup.sh b/lgsm/modules/command_backup.sh index 2c8f4bcda..aeedcbb36 100644 --- a/lgsm/modules/command_backup.sh +++ b/lgsm/modules/command_backup.sh @@ -13,13 +13,13 @@ fn_firstcommand_set # Trap to remove lockfile on quit. fn_backup_trap() { echo -e "" - echo -en "backup ${backupname}.tar.gz..." + echo -en "backup ${backupname}.${compressext}..." fn_print_canceled_eol_nl - fn_script_log_info "Backup ${backupname}.tar.gz: CANCELED" - rm -f "${backupdir:?}/${backupname}.tar.gz" | tee -a "${lgsmlog}" - echo -en "backup ${backupname}.tar.gz..." + fn_script_log_info "Backup ${backupname}.${compressext}: CANCELED" + rm -f "${backupdir:?}/${backupname}.${compressext}" | tee -a "${lgsmlog}" + echo -en "backup ${backupname}.${compressext}..." fn_print_removed_eol_nl - fn_script_log_info "Backup ${backupname}.tar.gz: REMOVED" + fn_script_log_info "Backup ${backupname}.${compressext}: REMOVED" # Remove backup lockfile. rm -f "${lockdir:?}/backup.lock" fn_backup_start_server @@ -110,23 +110,47 @@ fn_backup_create_lockfile() { trap fn_backup_trap INT } +fn_select_compression() { + if command -v zstd > /dev/null 2>&1; then + compressprog="zstd" + compressext="tar.zst" + compressflag="--zstd" + elif command -v pigz > /dev/null 2>&1; then + compressprog="pigz" + compressext="tar.gz" + compressflag="--use-compress-program=pigz" + elif command -v gzip > /dev/null 2>&1; then + compressprog="gzip" + compressext="tar.gz" + compressflag="--gzip" + else + compressprog="" + compressext="tar" + compressflag="" + fi +} + # Compressing files. fn_backup_compression() { - # Tells how much will be compressed using rootdirduexbackup value from info_distro and prompt for continue. + fn_print_info "A total of ${rootdirduexbackup} will be compressed." - fn_script_log_info "A total of ${rootdirduexbackup} will be compressed: ${backupdir}/${backupname}.tar.gz" - fn_print_dots "Backup (${rootdirduexbackup}) ${backupname}.tar.gz, in progress ..." - fn_script_log_info "Backup ${rootdirduexbackup} ${backupname}.tar.gz, in progress" + fn_script_log_info "A total of ${rootdirduexbackup} will be compressed: ${backupdir}/${backupname}.${compressext}" + fn_print_dots "Backup (${rootdirduexbackup}) ${backupname}.${compressext}, in progress ..." + fn_script_log_info "Backup ${rootdirduexbackup} ${backupname}.${compressext}, in progress" excludedir=$(fn_backup_relpath) - # Check that excludedir is a valid path. if [ ! -d "${excludedir}" ]; then fn_print_fail_nl "Problem identifying the previous backup directory for exclusion." fn_script_log_fail "Problem identifying the previous backup directory for exclusion" core_exit.sh fi - tar --use-compress-program=pigz -hcf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}" --exclude "${tmpdir}" ./. + if [ -n "${compressflag}" ]; then + tar ${compressflag} -hcf "${backupdir}/${backupname}.${compressext}" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}" --exclude "${tmpdir}" ./. + else + tar -hcf "${backupdir}/${backupname}.${compressext}" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}" --exclude "${tmpdir}" ./. + fi + exitcode=$? if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol @@ -136,8 +160,8 @@ fn_backup_compression() { fn_script_log_fail "Starting backup" else fn_print_ok_eol - fn_print_ok_nl "Completed: ${italic}${backupname}.tar.gz${default}, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" - fn_script_log_pass "Backup created: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" + fn_print_ok "Completed: ${italic}${backupname}.${compressext}${default}, total size $(du -sh "${backupdir}/${backupname}.${compressext}" | awk '{print $1}')" + fn_script_log_pass "Backup created: ${backupname}.${compressext}, total size $(du -sh "${backupdir}/${backupname}.${compressext}" | awk '{print $1}')" alert="backup" alert.sh fi @@ -152,7 +176,7 @@ fn_backup_prune() { # How many backups exceed maxbackups. backupquotadiff=$((backupcount - maxbackups)) # How many backups exceed maxbackupdays. - backupsoudatedcount=$(find "${backupdir}"/ -type f -name "*.tar.gz" -mtime +"${maxbackupdays}" | wc -l) + backupsoudatedcount=$(find "${backupdir}"/ -type f -name "*.tar.*" -mtime +"${maxbackupdays}" | wc -l) # If anything can be cleared. if [ "${backupquotadiff}" -gt "0" ] || [ "${backupsoudatedcount}" -gt "0" ]; then fn_print_dots "Pruning" @@ -167,7 +191,7 @@ fn_backup_prune() { fn_print_dots "Pruning: Clearing ${backupquotadiff} backup(s)" fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)" # Clear backups over quota. - find "${backupdir}"/ -type f -name "*.tar.gz" -printf '%T@ %p\n' | sort -rn | tail -${backupquotadiff} | cut -f2- -d" " | xargs rm + find "${backupdir}"/ -type f -name "*.tar.*" -printf '%T@ %p\n' | sort -rn | tail -${backupquotadiff} | cut -f2- -d" " | xargs rm fn_print_ok_nl "Pruning: Clearing ${backupquotadiff} backup(s)" fn_script_log_pass "Pruning: Cleared ${backupquotadiff} backup(s)" # If maxbackupdays is used over maxbackups. @@ -190,7 +214,7 @@ fn_backup_prune() { fn_backup_relpath() { # Written by CedarLUG as a "realpath --relative-to" alternative in bash. # Populate an array of tokens initialized from the rootdir components. - declare -a rdirtoks=($(readlink -f "${rootdir}" | sed "s/\// /g")) + mapfile -t rdirtoks < <(readlink -f "${rootdir}" | sed "s/\//\n/g") if [ ${#rdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing rootdir during relative path assessment" fn_script_log_fail "Problem assessing rootdir during relative path assessment: ${rootdir}" @@ -198,7 +222,7 @@ fn_backup_relpath() { fi # Populate an array of tokens initialized from the backupdir components. - declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g")) + mapfile -t bdirtoks < <(readlink -f "${backupdir}" | sed "s/\//\n/g") if [ ${#bdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing backupdir during relative path assessment" fn_script_log_fail "Problem assessing backupdir during relative path assessment: ${rootdir}" @@ -243,7 +267,7 @@ fn_backup_start_server() { fn_print_dots "" check.sh core_logs.sh - +fn_select_compression fn_backup_check_lockfile fn_backup_init fn_backup_stop_server diff --git a/lgsm/modules/info_distro.sh b/lgsm/modules/info_distro.sh index 67a9fd5df..a986edf1f 100644 --- a/lgsm/modules/info_distro.sh +++ b/lgsm/modules/info_distro.sh @@ -252,11 +252,11 @@ if [ -d "${backupdir}" ]; then backupcount=0 # If there are backups in backup dir. - if [ "$(find "${backupdir}" -name "*.tar.gz" | wc -l)" -ne "0" ]; then + if [ "$(find "${backupdir}" -name "*.tar.*" | wc -l)" -ne "0" ]; then # number of backups. - backupcount="$(find "${backupdir}"/*.tar.gz | wc -l)" # integer + backupcount="$(find "${backupdir}"/*.tar.* | wc -l)" # integer # most recent backup. - lastbackup="$(ls -1t "${backupdir}"/*.tar.gz | head -1)" # string + lastbackup="$(ls -1t "${backupdir}"/*.tar.* | head -1)" # string # date of most recent backup. lastbackupdate="$(date -r "${lastbackup}")" # string # no of days since last backup. From d472d662219dac1702273aae8fa96b7ecfac066b Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 27 Jun 2025 10:06:42 +0100 Subject: [PATCH 072/132] fix(backup): reorder backup functions to ensure lockfile creation occurs before initialisation --- lgsm/modules/command_backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/command_backup.sh b/lgsm/modules/command_backup.sh index aeedcbb36..5892a81eb 100644 --- a/lgsm/modules/command_backup.sh +++ b/lgsm/modules/command_backup.sh @@ -269,10 +269,10 @@ check.sh core_logs.sh fn_select_compression fn_backup_check_lockfile +fn_backup_create_lockfile fn_backup_init fn_backup_stop_server fn_backup_dir -fn_backup_create_lockfile fn_backup_compression fn_backup_prune fn_backup_start_server From fc4b2f33fe7fe1733fe44050f8962e99d29a9ddd Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 27 Jun 2025 11:29:06 +0100 Subject: [PATCH 073/132] fix(mods_list): update Metamod:Source and Sourcemod versions to latest releases --- lgsm/modules/mods_list.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/mods_list.sh b/lgsm/modules/mods_list.sh index 89412e65d..bbefc5ea2 100644 --- a/lgsm/modules/mods_list.sh +++ b/lgsm/modules/mods_list.sh @@ -55,13 +55,13 @@ amxxtslatestfile="amxmodx-${amxxtsversion}-${amxxtsmod}-linux.tar.gz" amxxtsdownloadurl="https://www.amxmodx.org/release/${amxxtslatestfile}" amxxtsurl="${amxxtsdownloadurl}" # Metamod:Source -metamodsourceversion="1.11" +metamodsourceversion="1.12" metamodsourcescrapeurl="https://mms.alliedmods.net/mmsdrop/${metamodsourceversion}/mmsource-latest-linux" metamodsourcelatestfile=$(wget "${metamodsourcescrapeurl}" -q -O -) metamodsourcedownloadurl="https://www.metamodsource.net/latest.php?os=linux&version=${metamodsourceversion}" metamodsourceurl="${metamodsourcedownloadurl}" # Sourcemod -sourcemodversion="1.12" +sourcemodversion="1.13" sourcemodscrapeurl="https://sm.alliedmods.net/smdrop/${sourcemodversion}/sourcemod-latest-linux" sourcemodlatestfile=$(wget "${sourcemodscrapeurl}" -q -O -) sourcemoddownloadurl="https://www.sourcemod.net/latest.php?os=linux&version=${sourcemodversion}" From de27a6acc44c5f08dc763d0fc107031c0f9fc6de Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 25 Jul 2025 14:03:58 +0000 Subject: [PATCH 074/132] feat(devcontainer): add initial devcontainer configuration for Ubuntu environment --- .devcontainer/devcontainer.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..b6287a9df --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,21 @@ +{ + "name": "Ubuntu", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "ghcr.io/devcontainers-extra/features/prettier:1": {}, + "ghcr.io/devcontainers-extra/features/shellcheck:1": {} + }, + "customizations": { + "vscode": { + "extensions": [ + "editorconfig.editorconfig", + "esbenp.prettier-vscode", + "ms-python.python", + "redhat.vscode-yaml", + "timonwong.shellcheck", + "yzhang.markdown-all-in-one" + ] + } + }, + "postCreateCommand": "npm install --save-dev prettier-plugin-sh" +} From 7cc48be50114b85671cdb86a1eb9328f51fb6c12 Mon Sep 17 00:00:00 2001 From: magistratus-de Date: Sat, 9 Aug 2025 00:15:35 +0200 Subject: [PATCH 075/132] fix: correct if statement (#4801) correction of a minor error Co-authored-by: Daniel Gibbs --- lgsm/modules/alert_email.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/alert_email.sh b/lgsm/modules/alert_email.sh index aa13494d1..81c01e25b 100644 --- a/lgsm/modules/alert_email.sh +++ b/lgsm/modules/alert_email.sh @@ -15,7 +15,7 @@ else mail -s "${alerttitle}" "${email}" < "${alertlog}" fi exitcode=$? -if [ "${exitcode}" -ne 0 ]; then +if [ "${exitcode}" -eq 0 ]; then fn_print_ok_nl "Sending Email alert: ${email}" fn_script_log_pass "Sending Email alert: ${email}" else From 471485117c7dcb5178920af57350cd1efb3c17a5 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 9 Aug 2025 01:36:24 +0100 Subject: [PATCH 076/132] feat(unreal): consolidate map compression scripts (#4805) * fix(compress_unreal2_maps): streamline file removal and compression process * lint * feat(unreal): consolidate map compression scripts * Removed `compress_ut99_maps.sh` and integrated its functionality into `compress_unreal_maps.sh`. * Updated `core_getopt.sh` to reference the new unified compression script. * Cleaned up `core_modules.sh` by removing the obsolete function for `compress_ut99_maps.sh`. * Added `core_exit.sh` call to `install_ut2k4_key.sh` for consistent exit handling. * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix(compress_unreal_maps): correct array usage in file compression loop * Updated the loop to iterate over the `exts` array correctly using `"${exts[@]}"` instead of `${exts}`. * This change ensures proper handling of file extensions during the compression process. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .shellcheckrc | 1 + lgsm/modules/compress_unreal2_maps.sh | 35 ------------ lgsm/modules/compress_unreal_maps.sh | 80 +++++++++++++++++++++++++++ lgsm/modules/compress_ut99_maps.sh | 35 ------------ lgsm/modules/core_getopt.sh | 9 ++- lgsm/modules/core_modules.sh | 5 -- lgsm/modules/install_ut2k4_key.sh | 1 + 7 files changed, 86 insertions(+), 80 deletions(-) create mode 100644 .shellcheckrc delete mode 100644 lgsm/modules/compress_unreal2_maps.sh create mode 100644 lgsm/modules/compress_unreal_maps.sh delete mode 100644 lgsm/modules/compress_ut99_maps.sh diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 000000000..026ee646c --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1 @@ +disable=SC2154 diff --git a/lgsm/modules/compress_unreal2_maps.sh b/lgsm/modules/compress_unreal2_maps.sh deleted file mode 100644 index 58824cbc7..000000000 --- a/lgsm/modules/compress_unreal2_maps.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# LinuxGSM compress_unreal2_maps.sh module -# Author: Daniel Gibbs -# Contributors: https://linuxgsm.com/contrib -# Website: https://linuxgsm.com -# Description: Compresses unreal maps. - -commandname="MAP-COMPRESSOR" -commandaction="Compressing Maps" -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_firstcommand_set - -check.sh -fn_print_header -echo -e "Will compress all maps in:" -echo -e "" -pwd -echo -e "" -echo -e "Compressed maps saved to:" -echo -e "" -echo -e "${compressedmapsdir}" -echo -e "" -if ! fn_prompt_yn "Start compression?" Y; then - exitcode=0 - core_exit.sh -fi -mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 -rm -rfv "${serverfiles:?}/Maps/"*.ut2.uz2 -cd "${systemdir}" || exit -for map in "${serverfiles}/Maps/"*; do - ./ucc-bin compress "${map}" --nohomedir -done -mv -fv "${serverfiles}/Maps/"*.ut2.uz2 "${compressedmapsdir}" - -core_exit.sh diff --git a/lgsm/modules/compress_unreal_maps.sh b/lgsm/modules/compress_unreal_maps.sh new file mode 100644 index 000000000..6b97e03d9 --- /dev/null +++ b/lgsm/modules/compress_unreal_maps.sh @@ -0,0 +1,80 @@ +#!/bin/bash +# LinuxGSM compress_unreal_maps.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Compresses unreal and unreal2 resources. + +commandname="MAP-COMPRESSOR" +commandaction="Compressing Maps" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +fn_print_header +echo -e "Will compress all maps in:" +echo -e "" +pwd +echo -e "" +echo -e "Compressed maps saved to:" +echo -e "" +echo -e "${compressedmapsdir}" +echo -e "" +totalseconds=3 +for seconds in {3..1}; do + fn_print_warn "map compression starting in: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + fn_sleep_time_1 + if [ "${seconds}" == "0" ]; then + break + fi +done +fn_print_nl +mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 + +# List of extensions to compress +exts=(ut2 kfm rom u ucl upl int utx uax ukx usx unr umx umod uzx) + +# Remove old compressed files using find +for ext in "${exts[@]}"; do + mapfile -t oldfiles < <(find "${serverfiles}" -name "*.${ext}.uz2" -type f) + if [ ${#oldfiles[@]} -gt 0 ]; then + echo -e "found ${#oldfiles[@]} old compressed file(s) to remove for extension: ${ext}" + fi + for file in "${oldfiles[@]}"; do + if rm -f "$file"; then + echo -en "removing file [ ${italic}$(basename "$file")${default} ]\c" + fn_print_ok_eol_nl + else + echo -en "removing file [ ${italic}$(basename "$file")${default} ]\c" + fn_print_fail_eol_nl + fi + done +done + +cd "${systemdir}" || exit + +# Find and compress files, then move .uz2 to compressedmapsdir +for ext in "${exts[@]}"; do + # Collect all files with the current extension into an array + mapfile -t files < <(find "${serverfiles}" -name "*.${ext}" -type f) + for file in "${files[@]}"; do + echo -en "compressing file [ ${italic}$(basename "$file") -> $(basename "$file").uz2${default} ]\c" + if ! ./ucc-bin compress "${file}" --nohomedir > /dev/null 2>&1; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi + + if ! mv -f "${file}.uz2" "${compressedmapsdir}" > /dev/null 2>&1; then + echo -en "moving compressed file [ ${italic}$(basename "$file").uz2 -> ${compressedmapsdir}/$(basename "$file").uz2${default} ]\c" + fn_print_fail_eol_nl + core_exit.sh + fi + done +done + +fn_print_ok_nl "Compression complete: All compressed files moved to: ${compressedmapsdir}" + +core_exit.sh diff --git a/lgsm/modules/compress_ut99_maps.sh b/lgsm/modules/compress_ut99_maps.sh deleted file mode 100644 index 885c32d9a..000000000 --- a/lgsm/modules/compress_ut99_maps.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# LinuxGSM compress_ut99_maps.sh module -# Author: Daniel Gibbs -# Contributors: https://linuxgsm.com/contrib -# Website: https://linuxgsm.com -# Description: Compresses unreal maps. - -commandname="MAP-COMPRESSOR" -commandaction="Compressing Maps" -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_firstcommand_set - -check.sh -fn_print_header -echo -e "Will compress all maps in:" -echo -e "" -pwd -echo -e "" -echo -e "Compressed maps saved to:" -echo -e "" -echo -e "${compressedmapsdir}" -echo -e "" -if ! fn_prompt_yn "Start compression?" Y; then - exitcode=0 - core_exit.sh -fi -mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 -rm -rfv "${serverfiles:?}/Maps/"*.unr.uz -cd "${systemdir}" || exit -for map in "${serverfiles}/Maps/"*; do - ./ucc-bin compress "${map}" --nohomedir -done -mv -fv "${serverfiles}/Maps/"*.unr.uz "${compressedmapsdir}" - -core_exit.sh diff --git a/lgsm/modules/core_getopt.sh b/lgsm/modules/core_getopt.sh index 8997ff3a0..295f9900b 100644 --- a/lgsm/modules/core_getopt.sh +++ b/lgsm/modules/core_getopt.sh @@ -42,8 +42,7 @@ cmd_change_password=("pw;change-password" "command_ts3_server_pass.sh" "Change T cmd_install_default_resources=("ir;install-default-resources" "command_install_resources_mta.sh" "Install the MTA default resources.") cmd_fullwipe=("fw;full-wipe;wa;wipeall" "serverwipe=1; command_wipe.sh" "Reset the map and remove blueprint data.") cmd_mapwipe=("mw;map-wipe;w;wipe;wi" "mapwipe=1; command_wipe.sh" "Reset the map and keep blueprint data.") -cmd_map_compressor_u99=("mc;map-compressor" "compress_ut99_maps.sh" "Compresses all ${gamename} server maps.") -cmd_map_compressor_u2=("mc;map-compressor" "compress_unreal2_maps.sh" "Compresses all ${gamename} server maps.") +cmd_map_compressor_unreal=("mc;map-compressor" "compress_unreal_maps.sh" "Compresses all ${gamename} server maps.") cmd_install_cdkey=("cd;server-cd-key" "install_ut2k4_key.sh" "Add your server cd key.") cmd_install_dst_token=("ct;cluster-token" "install_dst_token.sh" "Configure cluster token.") cmd_install_squad_license=("li;license" "install_squad_license.sh" "Add your Squad server license.") @@ -113,13 +112,13 @@ fi # Unreal exclusive. if [ "${engine}" == "unreal2" ]; then if [ "${shortname}" == "ut2k4" ]; then - currentopt+=("${cmd_install_cdkey[@]}" "${cmd_map_compressor_u2[@]}") + currentopt+=("${cmd_install_cdkey[@]}" "${cmd_map_compressor_unreal[@]}") else - currentopt+=("${cmd_map_compressor_u2[@]}") + currentopt+=("${cmd_map_compressor_unreal[@]}") fi fi if [ "${engine}" == "unreal" ]; then - currentopt+=("${cmd_map_compressor_u99[@]}") + currentopt+=("${cmd_map_compressor_unreal[@]}") fi # DST exclusive. diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index e5e6d1e5d..2116e5366 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -275,11 +275,6 @@ compress_unreal2_maps.sh() { fn_fetch_module } -compress_ut99_maps.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - # Mods mods_list.sh() { diff --git a/lgsm/modules/install_ut2k4_key.sh b/lgsm/modules/install_ut2k4_key.sh index 2829da8d6..963a52f10 100644 --- a/lgsm/modules/install_ut2k4_key.sh +++ b/lgsm/modules/install_ut2k4_key.sh @@ -27,3 +27,4 @@ else echo -e "./${selfname} server-cd-key" fi echo -e "" +core_exit.sh From e2397f126b2e40a96991af86bfecf74542e4fa69 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 9 Aug 2025 01:40:09 +0100 Subject: [PATCH 077/132] feat(devcontainer): update devcontainer configuration for improved tooling * Changed container name to "BASH Dev Container" * Added additional features: `actionlint`, `checkov`, `markdownlint-cli`, and `github-cli` * Updated VSCode extensions for enhanced development experience a --- .devcontainer/devcontainer.json | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b6287a9df..339a0a150 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,21 +1,29 @@ { - "name": "Ubuntu", + "name": "BASH Dev Container", "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "features": { - "ghcr.io/devcontainers-extra/features/prettier:1": {}, - "ghcr.io/devcontainers-extra/features/shellcheck:1": {} + "ghcr.io/devcontainers-community/npm-features/prettier:1": { + "plugins": "prettier-plugin-sh" + }, + "ghcr.io/devcontainers-extra/features/actionlint:1": {}, + "ghcr.io/devcontainers-extra/features/checkov:1": {}, + "ghcr.io/devcontainers-extra/features/markdownlint-cli:1": {}, + "ghcr.io/devcontainers-extra/features/shellcheck:1": {}, + "ghcr.io/devcontainers-extra/features/yamllint:2": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} }, "customizations": { "vscode": { "extensions": [ - "editorconfig.editorconfig", - "esbenp.prettier-vscode", - "ms-python.python", + "DavidAnson.vscode-markdownlint", + "github.vscode-github-actions", + "GitHub.vscode-pull-request-github", + "hashicorp.terraform", + "ms-azuretools.vscode-azureterraform", "redhat.vscode-yaml", "timonwong.shellcheck", "yzhang.markdown-all-in-one" ] } - }, - "postCreateCommand": "npm install --save-dev prettier-plugin-sh" + } } From 0374441cef20f09234d069ee7968b5788a75e9c6 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 19 Aug 2025 15:22:15 +0100 Subject: [PATCH 078/132] chore: synced file(s) with dgibbs64/repo-sync (#4804) * chore: synced local '.github/' with remote 'general/.github/' * chore: synced local './' with remote 'bash/' --- .devcontainer/devcontainer.json | 7 +-- .editorconfig | 17 ++----- .github/FUNDING.yml | 14 +----- .github/dependabot.yml | 10 ++-- .github/workflows/action-prettier.yml | 32 ++++++++++++ .github/workflows/action-super-linter.yml | 49 +++++++++++++++++++ ...update-copyright-years-in-license-file.yml | 27 ++++++++++ .gitignore | 14 +++++- .prettierrc.json | 3 ++ .vscode/extensions.json | 8 +-- 10 files changed, 144 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/action-prettier.yml create mode 100644 .github/workflows/action-super-linter.yml create mode 100644 .github/workflows/action-update-copyright-years-in-license-file.yml create mode 100644 .prettierrc.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 339a0a150..506b50754 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -16,14 +16,15 @@ "vscode": { "extensions": [ "DavidAnson.vscode-markdownlint", + "editorconfig.editorconfig", + "esbenp.prettier-vscode", "github.vscode-github-actions", "GitHub.vscode-pull-request-github", - "hashicorp.terraform", - "ms-azuretools.vscode-azureterraform", "redhat.vscode-yaml", "timonwong.shellcheck", "yzhang.markdown-all-in-one" ] } - } + }, + "postCreateCommand": "npm init -y >/dev/null 2>&1 || true && npm install --no-save prettier prettier-plugin-sh prettier-plugin-jinja-template" } diff --git a/.editorconfig b/.editorconfig index f20e02e1c..da6e5f2ca 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,28 +1,17 @@ # EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs. -# Atom: Please assure your Atom's config setting Tab Type is set to auto, otherwise Atom-EditorConfig may not work as expected. Also disable whitespace package. # http://editorconfig.org/ root = true [*] charset = utf-8 -indent_style = tab -indent_size = 4 -trim_trailing_whitespace = true end_of_line = lf -insert_final_newline = true - -# YAML Files -[*.{yml,yaml}] -indent_size = 2 -indent_style = space - -# JSON Files -[*.{json,json5,webmanifest}] indent_size = 2 indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true # BASH Files [*.{.sh}] -indent_style = tab indent_size = 4 +indent_style = tab diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 441867e9c..dc3c5b515 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,12 +1,2 @@ -# These are supported funding model platforms - -github: dgibbs64 # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: dgibbs # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with a single custom sponsorship URL +github: dgibbs64 +patreon: dgibbs diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 443cf3bec..a0f180569 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,8 +1,12 @@ -# Set update schedule for GitHub Actions +--- version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: - # Check for updates to GitHub Actions every weekday - interval: "daily" + interval: "weekly" + + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly diff --git a/.github/workflows/action-prettier.yml b/.github/workflows/action-prettier.yml new file mode 100644 index 000000000..45ee27b8c --- /dev/null +++ b/.github/workflows/action-prettier.yml @@ -0,0 +1,32 @@ +name: Prettier +on: + push: + branches: + - "*" + +concurrency: + group: prettier-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: write + +jobs: + prettier: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Install Prettier and plugins + run: | + npm install --no-save prettier prettier-plugin-sh prettier-plugin-jinja-template + + - name: Prettify code + uses: creyD/prettier_action@v4.6 + with: + prettier_plugins: "prettier-plugin-sh prettier-plugin-jinja-template" + prettier_options: --write . + github_token: ${{ secrets.GITHUB_TOKEN }} + commit_message: "chore(prettier): format code" diff --git a/.github/workflows/action-super-linter.yml b/.github/workflows/action-super-linter.yml new file mode 100644 index 000000000..c85f22b73 --- /dev/null +++ b/.github/workflows/action-super-linter.yml @@ -0,0 +1,49 @@ +--- +name: Super Linter + +on: + workflow_dispatch: + push: + branches: + - "*" + +concurrency: + group: super-linter-${{ github.ref }} + cancel-in-progress: true + +permissions: {} + +jobs: + build: + name: Lint + runs-on: ubuntu-latest + + permissions: + contents: read + packages: read + # To report GitHub Actions status checks + statuses: write + + steps: + - name: Checkout code + uses: actions/checkout@v5 + with: + # super-linter needs the full git history to get the + # list of files that changed across commits + fetch-depth: 0 + + - name: Install Prettier plugins (for summary formatting) + run: | + npm install --no-save prettier prettier-plugin-sh prettier-plugin-jinja-template || true + + - name: Super-linter + uses: super-linter/super-linter@v8 + env: + # To report GitHub Actions status checks + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_JSCPD: false + VALIDATE_SHELL_SHFMT: false + VALIDATE_YAML_PRETTIER: false + VALIDATE_JSON_PRETTIER: false + VALIDATE_MARKDOWN_PRETTIER: false + VALIDATE_NATURAL_LANGUAGE: false diff --git a/.github/workflows/action-update-copyright-years-in-license-file.yml b/.github/workflows/action-update-copyright-years-in-license-file.yml new file mode 100644 index 000000000..bb6126a97 --- /dev/null +++ b/.github/workflows/action-update-copyright-years-in-license-file.yml @@ -0,0 +1,27 @@ +name: Update copyright year(s) in license file +on: + workflow_dispatch: + schedule: + - cron: "0 3 1 1 *" # 03:00 AM on January 1 + +permissions: + contents: write + +jobs: + update-license-year: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - name: Action Update License Year + uses: FantasticFiasco/action-update-license-year@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + path: LICENSE.md + - name: Merge pull request + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr merge --merge --delete-branch diff --git a/.gitignore b/.gitignore index e5c465ce2..8bffd3faa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,12 @@ -.vscode/settings.json -/node_modules +# Visual Studio Code +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets +.history/ +*.vsix + +# Node.js +node_modules diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 000000000..02d542d50 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "plugins": ["prettier-plugin-sh"] +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json index c7a7dab10..d31b65dd2 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,10 +1,12 @@ { "recommendations": [ - "ms-python.python", + "DavidAnson.vscode-markdownlint", "editorconfig.editorconfig", - "yzhang.markdown-all-in-one", "esbenp.prettier-vscode", + "github.vscode-github-actions", + "GitHub.vscode-pull-request-github", + "redhat.vscode-yaml", "timonwong.shellcheck", - "redhat.vscode-yaml" + "yzhang.markdown-all-in-one" ] } From f12a3ae542a97a2894636579bc217f79b8c14c31 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 19 Aug 2025 17:26:17 +0100 Subject: [PATCH 079/132] chore: synced file(s) with dgibbs64/repo-sync (#4810) * chore: synced local '.github/' with remote 'general/.github/' * chore: synced local './' with remote 'bash/' --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8bffd3faa..c6dd34d73 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # Visual Studio Code .vscode/* -!.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json From 83df2c6edace3443c395c1c8e4d7f35d7eff8875 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 25 Aug 2025 01:08:30 +0200 Subject: [PATCH 080/132] feat(sf): add new port for ReliableMessaging (#4813) --- lgsm/config-default/config-lgsm/sfserver/_default.cfg | 3 ++- lgsm/modules/command_dev_parse_game_details.sh | 1 + lgsm/modules/command_dev_query_raw.sh | 6 ++++++ lgsm/modules/info_game.sh | 1 + lgsm/modules/info_messages.sh | 1 + 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/sfserver/_default.cfg b/lgsm/config-default/config-lgsm/sfserver/_default.cfg index d6ce41d82..f71c1a8d4 100644 --- a/lgsm/config-default/config-lgsm/sfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sfserver/_default.cfg @@ -12,11 +12,12 @@ ip="0.0.0.0" queryport="15777" beaconport="15000" +reliableport="8888" port="7777" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters ## Game Server Docs | https://satisfactory.fandom.com/wiki/Dedicated_servers -startparameters="FactoryGame -Port=${port} -ServerQueryPort=${queryport} -BeaconPort=${beaconport} -log" +startparameters="FactoryGame -Port=${port} -ServerQueryPort=${queryport} -BeaconPort=${beaconport} -ReliablePort=${reliableport} -log" #### LinuxGSM Settings #### diff --git a/lgsm/modules/command_dev_parse_game_details.sh b/lgsm/modules/command_dev_parse_game_details.sh index 7c0767eea..893785ff3 100644 --- a/lgsm/modules/command_dev_parse_game_details.sh +++ b/lgsm/modules/command_dev_parse_game_details.sh @@ -96,6 +96,7 @@ declare -A server_details=( ['RCON Port']="${rconport}" ['RCON Web']="${rconweb}" ['Reserved Slots']="${reservedslots}" + ['Reliable Messaging']="${reliableport}" ['RMI Port']="${rmiport}" ['RMI Reg Port']="${rmiregport}" ['Salt']="${salt}" diff --git a/lgsm/modules/command_dev_query_raw.sh b/lgsm/modules/command_dev_query_raw.sh index a27850df8..b95ef6c33 100644 --- a/lgsm/modules/command_dev_query_raw.sh +++ b/lgsm/modules/command_dev_query_raw.sh @@ -90,6 +90,12 @@ fn_messages_separator echo -e "Beacon:" fi + if [ -n "${reliableport}" ]; then + echo -e "ReliableMessaging: \t${reliableport} \t$(ss -tupl | grep -c "${reliableport}") \t$(ss -tupl | grep "${reliableport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${reliableport}" | grep udp | awk '{ print $2 }')" + else + echo -e "ReliableMessaging:" + fi + if [ -n "${clientport}" ]; then echo -e "Client: \t${clientport} \t$(ss -tupl | grep -c "${clientport}") \t$(ss -tupl | grep "${clientport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${clientport}" | grep udp | awk '{ print $2 }')" else diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 2819b65d1..0b43ba626 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -1993,6 +1993,7 @@ fn_info_game_sf() { port="${port:-"0"}" queryport="${queryport:-"0"}" beaconport="${beaconport:-"0"}" + reliableport="${reliableport:-"0"}" } # Config Type: Parameters (with an ini) diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index 4f1f00268..cff7467b1 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -1502,6 +1502,7 @@ fn_info_messages_sf() { fn_port "Game" port udp fn_port "Query" queryport udp fn_port "Beacon" beaconport udp + fn_port "ReliableMessaging" reliableport tcp } | column -s $'\t' -t } From 2dc8dc340e4369fe90ffb3e37500ffe2731bae08 Mon Sep 17 00:00:00 2001 From: dlstenbro <7519739+dlstenbro@users.noreply.github.com> Date: Sat, 8 Nov 2025 15:20:39 -0600 Subject: [PATCH 081/132] feat(vs): update dotnet-runtime dependency from v7.0 to v8.0 (#4823) Signed-off-by: dlstenbro --- lgsm/data/almalinux-8.csv | 2 +- lgsm/data/almalinux-9.csv | 2 +- lgsm/data/centos-7.csv | 2 +- lgsm/data/centos-8.csv | 2 +- lgsm/data/centos-9.csv | 2 +- lgsm/data/debian-10.csv | 2 +- lgsm/data/debian-11.csv | 2 +- lgsm/data/debian-12.csv | 2 +- lgsm/data/debian-13.csv | 2 +- lgsm/data/debian-9.csv | 2 +- lgsm/data/rhel-7.csv | 2 +- lgsm/data/rhel-8.csv | 2 +- lgsm/data/rhel-9.csv | 2 +- lgsm/data/rocky-8.csv | 2 +- lgsm/data/rocky-9.csv | 2 +- lgsm/data/ubuntu-16.04.csv | 2 +- lgsm/data/ubuntu-18.04.csv | 2 +- lgsm/data/ubuntu-20.04.csv | 2 +- lgsm/data/ubuntu-22.04.csv | 2 +- lgsm/data/ubuntu-23.04.csv | 2 +- lgsm/data/ubuntu-23.10.csv | 2 +- lgsm/data/ubuntu-24.04.csv | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 08d91f8fc..2405a4b3e 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index a16722c2f..069e8e437 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index 7b467fa00..39af5868d 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-11-openjdk vs wet diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index 4b9fd2133..bcaf1e31d 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-17-openjdk vs wet diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index c6ff3a272..446a55ebb 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-17-openjdk vs wet diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 74d82e158..9082f1cc8 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 33b7deaf9..65bc39535 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 06fd9e52c..e67a822b7 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-17-jre vs wet diff --git a/lgsm/data/debian-13.csv b/lgsm/data/debian-13.csv index 7d775040e..5c981134e 100644 --- a/lgsm/data/debian-13.csv +++ b/lgsm/data/debian-13.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 02acceacd..43fb4c5a2 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-8-jre vs wet diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 90c9df07e..26420d76f 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-11-openjdk vs wet diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index 0298bd0b0..9515a12ac 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index a16722c2f..069e8e437 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index 0298bd0b0..9515a12ac 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index a16722c2f..069e8e437 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,glibc-devel,libatomic,pulseaudio-libs-devel -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,java-21-openjdk vs wet diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 436bdecb8..da755fc1f 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-8-jre vs wet diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 3b24ff37f..b8d996023 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index f19436d6a..18cb1c457 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index f8a48ccce..0d09631f0 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/data/ubuntu-23.04.csv b/lgsm/data/ubuntu-23.04.csv index c14964d2d..1f1bf371c 100644 --- a/lgsm/data/ubuntu-23.04.csv +++ b/lgsm/data/ubuntu-23.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/data/ubuntu-23.10.csv b/lgsm/data/ubuntu-23.10.csv index c14964d2d..1f1bf371c 100644 --- a/lgsm/data/ubuntu-23.10.csv +++ b/lgsm/data/ubuntu-23.10.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-21-jre vs wet diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index bd220a501..1217ee49b 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -127,7 +127,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-7.0 +vints,dotnet-runtime-8.0 vpmc,openjdk-21-jre vs wet From f1314950f489f2536f5a0b03a91e5668b03be54f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcell=20P=C3=BCnk=C3=B6sd?= Date: Sat, 8 Nov 2025 22:21:10 +0100 Subject: [PATCH 082/132] fix(deps): remove libtinfo5:i386 from Debian 13 (#4828) Co-authored-by: Daniel Gibbs --- lgsm/data/debian-13.csv | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lgsm/data/debian-13.csv b/lgsm/data/debian-13.csv index 5c981134e..feeed5f54 100644 --- a/lgsm/data/debian-13.csv +++ b/lgsm/data/debian-13.csv @@ -11,7 +11,7 @@ av bb bb2,libcurl4-gnutls-dev:i386 bd -bf1942,libncurses5:i386,libtinfo5:i386 +bf1942,libncurses5:i386 bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo @@ -31,7 +31,7 @@ cs cs2 cscz csgo -css,libtinfo5:i386 +css ct dab dayz @@ -48,7 +48,7 @@ etl ets2 fctr fof -gmod,libtinfo5:i386 +gmod hcu hl2dm hldm @@ -72,7 +72,7 @@ mohaa,libstdc++5:i386 mta,libncursesw5,libxml2-utils nd nec -nmrih,libtinfo5:i386 +nmrih ns ns2,speex,libtbb12 ns2c,speex:i386,libtbb12 @@ -104,7 +104,7 @@ scpsl,mono-complete scpslsm,mono-complete sdtd,telnet,expect,libxml2-utils sf -sfc,libtinfo5:i386 +sfc sm,telnet,expect sof2 sol @@ -135,5 +135,5 @@ wf wmc,openjdk21-jre wurm,xvfb xnt -zmr,libtinfo5:i386 -zps,libtinfo5:i386 +zmr +zps From d33f830a6a3435e5d8b39c36fb46b4240e4d07b9 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 8 Nov 2025 21:28:07 +0000 Subject: [PATCH 083/132] chore: synced file(s) with dgibbs64/repo-sync (#4811) * chore: synced local '.github/' with remote 'general/.github/' * chore: synced local './' with remote 'bash/' --- .github/dependabot.yml | 1 - .github/workflows/action-prettier.yml | 4 ++++ .github/workflows/action-super-linter.yml | 8 +++++--- .../action-update-copyright-years-in-license-file.yml | 2 ++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a0f180569..84c7ea0ee 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,4 +1,3 @@ ---- version: 2 updates: - package-ecosystem: "github-actions" diff --git a/.github/workflows/action-prettier.yml b/.github/workflows/action-prettier.yml index 45ee27b8c..a7e0a7172 100644 --- a/.github/workflows/action-prettier.yml +++ b/.github/workflows/action-prettier.yml @@ -1,5 +1,7 @@ name: Prettier + on: + workflow_dispatch: push: branches: - "*" @@ -18,6 +20,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v5 + with: + persist-credentials: false - name: Install Prettier and plugins run: | diff --git a/.github/workflows/action-super-linter.yml b/.github/workflows/action-super-linter.yml index c85f22b73..a2b12fca4 100644 --- a/.github/workflows/action-super-linter.yml +++ b/.github/workflows/action-super-linter.yml @@ -1,4 +1,3 @@ ---- name: Super Linter on: @@ -31,6 +30,7 @@ jobs: # super-linter needs the full git history to get the # list of files that changed across commits fetch-depth: 0 + persist-credentials: false - name: Install Prettier plugins (for summary formatting) run: | @@ -41,9 +41,11 @@ jobs: env: # To report GitHub Actions status checks GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_GITHUB_ACTIONS_ZIZMOR: false VALIDATE_JSCPD: false - VALIDATE_SHELL_SHFMT: false - VALIDATE_YAML_PRETTIER: false VALIDATE_JSON_PRETTIER: false VALIDATE_MARKDOWN_PRETTIER: false VALIDATE_NATURAL_LANGUAGE: false + VALIDATE_SHELL_SHFMT: false + VALIDATE_TERRAFORM_TERRASCAN: false + VALIDATE_YAML_PRETTIER: false diff --git a/.github/workflows/action-update-copyright-years-in-license-file.yml b/.github/workflows/action-update-copyright-years-in-license-file.yml index bb6126a97..7ee528ca9 100644 --- a/.github/workflows/action-update-copyright-years-in-license-file.yml +++ b/.github/workflows/action-update-copyright-years-in-license-file.yml @@ -1,4 +1,5 @@ name: Update copyright year(s) in license file + on: workflow_dispatch: schedule: @@ -15,6 +16,7 @@ jobs: uses: actions/checkout@v5 with: fetch-depth: 0 + persist-credentials: false - name: Action Update License Year uses: FantasticFiasco/action-update-license-year@v3 with: From 2ac6802c4f69769152ed35f01fdb0078567b9173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcell=20P=C3=BCnk=C3=B6sd?= Date: Sat, 8 Nov 2025 22:30:31 +0100 Subject: [PATCH 084/132] fix(deps): change jre version from 22 to 25 (#4830) --- lgsm/data/debian-13.csv | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lgsm/data/debian-13.csv b/lgsm/data/debian-13.csv index feeed5f54..2ca56633f 100644 --- a/lgsm/data/debian-13.csv +++ b/lgsm/data/debian-13.csv @@ -65,7 +65,7 @@ kf kf2 l4d l4d2 -mc,openjdk-22-jre +mc,openjdk-25-jre mcb mh mohaa,libstdc++5:i386 @@ -81,12 +81,12 @@ onset,libmariadb-dev opfor pc pc2 -pmc,openjdk-22-jre +pmc,openjdk-25-jre squad44 pvkii pvr,libc++1 pw -pz,openjdk-22-jre,rng-tools5 +pz,openjdk-25-jre,rng-tools5 q2 q3 q4 @@ -96,7 +96,7 @@ ricochet ro rtcw rust,lib32z1 -rw,openjdk-22-jre +rw,openjdk-25-jre samp sb sbots From 1689f3c63caaa77df7695e293433b35710e8953f Mon Sep 17 00:00:00 2001 From: Tyler Johnson Date: Sat, 8 Nov 2025 15:32:41 -0600 Subject: [PATCH 085/132] feat(vints): add ability to select Vintage Story versions (#4817) * feat(vints): add ability to select Vintage Story versions * docs(vints): update vintage story default config --------- Co-authored-by: Daniel Gibbs --- lgsm/config-default/config-lgsm/vintsserver/_default.cfg | 2 +- lgsm/modules/update_vints.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/vintsserver/_default.cfg b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg index a3bc472c4..740b3923d 100644 --- a/lgsm/config-default/config-lgsm/vintsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg @@ -12,7 +12,7 @@ startparameters="--dataPath ${servercfgdir}" ## Release Settings | https://docs.linuxgsm.com/game-servers/vintagestory#release-settings -# Branch (stable|unstable) +# Branch (stable|unstable|) branch="stable" #### LinuxGSM Settings #### diff --git a/lgsm/modules/update_vints.sh b/lgsm/modules/update_vints.sh index 4021af11a..a300b87eb 100644 --- a/lgsm/modules/update_vints.sh +++ b/lgsm/modules/update_vints.sh @@ -39,8 +39,10 @@ fn_update_remotebuild() { remotebuildresponse=$(curl -s "${apiurl}") if [ "${branch}" == "stable" ]; then remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -Ev "\-rc|\-pre" | sort -r -V | head -1) - else + elif [ "${branch}" == "unstable" ]; then remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -E "\-rc|\-pre" | sort -r -V | head -1) + else + remotebuildversion="${branch}" fi remotebuildfilename=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].linuxserver.filename') remotebuildurl=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].linuxserver.urls.cdn') From bfdfe141c1f9f4312244ac1258bbaa5aa8eb5788 Mon Sep 17 00:00:00 2001 From: Attila <1230402+borzaka@users.noreply.github.com> Date: Sat, 8 Nov 2025 22:41:36 +0100 Subject: [PATCH 086/132] fix(cs2server): use cs2.sh script instead of cs2 binary for server startup (#4843) Update CS2 server launch to use the cs2.sh script as recommended by Valve. The script properly sets LD_LIBRARY_PATH environment variable, which is required after recent CS2 updates. Closes #4842 Co-authored-by: Daniel Gibbs --- lgsm/config-default/config-lgsm/cs2server/_default.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/cs2server/_default.cfg b/lgsm/config-default/config-lgsm/cs2server/_default.cfg index dca9194f4..66414592a 100644 --- a/lgsm/config-default/config-lgsm/cs2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cs2server/_default.cfg @@ -163,8 +163,8 @@ glibc="2.31" ## Game Server Directories systemdir="${serverfiles}/game/csgo" -executabledir="${serverfiles}/game/bin/linuxsteamrt64" -executable="./cs2" +executabledir="${serverfiles}/game" +executable="./cs2.sh" servercfgdir="${systemdir}/cfg" servercfg="${selfname}.cfg" servercfgdefault="server.cfg" From 42bfe606b66d1b7616495f326b90bf74ec7ea783 Mon Sep 17 00:00:00 2001 From: Justin Turner Arthur Date: Sat, 8 Nov 2025 15:43:37 -0600 Subject: [PATCH 087/132] fix(vh): switch query mode to work on all networking backends (#4840) --- lgsm/config-default/config-lgsm/vhserver/_default.cfg | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/vhserver/_default.cfg b/lgsm/config-default/config-lgsm/vhserver/_default.cfg index b027d0fca..76bed1890 100644 --- a/lgsm/config-default/config-lgsm/vhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vhserver/_default.cfg @@ -174,8 +174,12 @@ stopmode="2" # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="protocol-valve" +querymode="1" +querytype="" + +# Deeper monitoring is possible when the server is public and not using Crossplay: +# querymode="2" +# querytype="protocol-valve" ## Console type consoleverbose="yes" From ba55460a563e12760543ee61ce6f00b3929bd662 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 8 Nov 2025 22:06:40 +0000 Subject: [PATCH 088/132] Release v25.2.0 --- lgsm/modules/core_modules.sh | 2 +- linuxgsm.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 2116e5366..e5dd2cf31 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v25.1.6" +modulesversion="v25.2.0" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 2be308d9c..997bc30c8 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -24,7 +24,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v25.1.6" +version="v25.2.0" shortname="core" gameservername="core" commandname="CORE" From 3d55f41ab91484129b7a7be834a0383a833567fe Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 8 Nov 2025 22:31:34 +0000 Subject: [PATCH 089/132] fix: add workflow_dispatch trigger to Docker build workflow --- .github/workflows/trigger-docker-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/trigger-docker-build.yml b/.github/workflows/trigger-docker-build.yml index ae66542de..fe45aee43 100644 --- a/.github/workflows/trigger-docker-build.yml +++ b/.github/workflows/trigger-docker-build.yml @@ -3,6 +3,7 @@ on: release: types: - published + workflow_dispatch: jobs: trigger_build_docker-linuxgsm: From f8ca751b031c6263cd418820376611bc2103f43c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 8 Nov 2025 22:45:54 +0000 Subject: [PATCH 090/132] Add workflow_dispatch trigger to Docker build --- .github/workflows/trigger-docker-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trigger-docker-build.yml b/.github/workflows/trigger-docker-build.yml index fe45aee43..235c2556b 100644 --- a/.github/workflows/trigger-docker-build.yml +++ b/.github/workflows/trigger-docker-build.yml @@ -1,9 +1,9 @@ name: Trigger Docker Build on: + workflow_dispatch: release: types: - published - workflow_dispatch: jobs: trigger_build_docker-linuxgsm: From 80350f308adcd3e658ef38efa5d2fd33f0a35027 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 8 Nov 2025 23:05:36 +0000 Subject: [PATCH 091/132] fix: Update workflow file names for Docker publish actions --- .github/workflows/trigger-docker-build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/trigger-docker-build.yml b/.github/workflows/trigger-docker-build.yml index 235c2556b..ab37c882d 100644 --- a/.github/workflows/trigger-docker-build.yml +++ b/.github/workflows/trigger-docker-build.yml @@ -1,4 +1,5 @@ name: Trigger Docker Build + on: workflow_dispatch: release: @@ -17,7 +18,7 @@ jobs: owner: GameServerManagers repo: docker-linuxgsm github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - workflow_file_name: docker-publish.yml + workflow_file_name: action-docker-publish.yml trigger_build_docker-gameserver: if: github.repository_owner == 'GameServerManagers' @@ -31,4 +32,4 @@ jobs: owner: GameServerManagers repo: docker-gameserver github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - workflow_file_name: docker-publish.yml + workflow_file_name: action-docker-publish.yml From 77f942932575c0e86b098981470cd3487c277cb5 Mon Sep 17 00:00:00 2001 From: trogdor Date: Sun, 9 Nov 2025 13:09:41 -0800 Subject: [PATCH 092/132] feat: Support ntfy alerts (#4779) * feat: default cfg * feat: add alert_ntfy call * feat: init alert_ntfy * fix: ntfy alert should be off by default * fix: add alert_ntfy to core modules * feat: add ntfy to all default configs --------- Co-authored-by: Daniel Gibbs --- .../config-lgsm/acserver/_default.cfg | 10 ++ .../config-lgsm/ahl2server/_default.cfg | 10 ++ .../config-lgsm/ahlserver/_default.cfg | 10 ++ .../config-lgsm/arkserver/_default.cfg | 10 ++ .../config-lgsm/arma3server/_default.cfg | 10 ++ .../config-lgsm/armarserver/_default.cfg | 10 ++ .../config-lgsm/atsserver/_default.cfg | 10 ++ .../config-lgsm/avserver/_default.cfg | 10 ++ .../config-lgsm/bb2server/_default.cfg | 10 ++ .../config-lgsm/bbserver/_default.cfg | 10 ++ .../config-lgsm/bdserver/_default.cfg | 10 ++ .../config-lgsm/bf1942server/_default.cfg | 10 ++ .../config-lgsm/bfvserver/_default.cfg | 10 ++ .../config-lgsm/bmdmserver/_default.cfg | 10 ++ .../config-lgsm/boserver/_default.cfg | 10 ++ .../config-lgsm/bsserver/_default.cfg | 10 ++ .../config-lgsm/btlserver/_default.cfg | 10 ++ .../config-lgsm/btserver/_default.cfg | 10 ++ .../config-lgsm/ccserver/_default.cfg | 10 ++ .../config-lgsm/ckserver/_default.cfg | 10 ++ .../config-lgsm/cmwserver/_default.cfg | 10 ++ .../config-lgsm/cod2server/_default.cfg | 10 ++ .../config-lgsm/cod4server/_default.cfg | 10 ++ .../config-lgsm/codserver/_default.cfg | 10 ++ .../config-lgsm/coduoserver/_default.cfg | 10 ++ .../config-lgsm/codwawserver/_default.cfg | 10 ++ .../config-lgsm/colserver/_default.cfg | 10 ++ .../config-lgsm/cs2server/_default.cfg | 20 ++++ .../config-lgsm/csczserver/_default.cfg | 10 ++ .../config-lgsm/csgoserver/_default.cfg | 10 ++ .../config-lgsm/csserver/_default.cfg | 10 ++ .../config-lgsm/cssserver/_default.cfg | 10 ++ .../config-lgsm/ctserver/_default.cfg | 10 ++ .../config-lgsm/dabserver/_default.cfg | 10 ++ .../config-lgsm/dayzserver/_default.cfg | 10 ++ .../config-lgsm/dmcserver/_default.cfg | 10 ++ .../config-lgsm/dodrserver/_default.cfg | 10 ++ .../config-lgsm/dodserver/_default.cfg | 10 ++ .../config-lgsm/dodsserver/_default.cfg | 10 ++ .../config-lgsm/doiserver/_default.cfg | 10 ++ .../config-lgsm/dstserver/_default.cfg | 10 ++ .../config-lgsm/dysserver/_default.cfg | 10 ++ .../config-lgsm/ecoserver/_default.cfg | 10 ++ .../config-lgsm/emserver/_default.cfg | 10 ++ .../config-lgsm/etlserver/_default.cfg | 10 ++ .../config-lgsm/ets2server/_default.cfg | 10 ++ .../config-lgsm/fctrserver/_default.cfg | 10 ++ .../config-lgsm/fofserver/_default.cfg | 10 ++ .../config-lgsm/gmodserver/_default.cfg | 10 ++ .../config-lgsm/hcuserver/_default.cfg | 10 ++ .../config-lgsm/hl2dmserver/_default.cfg | 10 ++ .../config-lgsm/hldmserver/_default.cfg | 10 ++ .../config-lgsm/hldmsserver/_default.cfg | 10 ++ .../config-lgsm/hwserver/_default.cfg | 10 ++ .../config-lgsm/hzserver/_default.cfg | 10 ++ .../config-lgsm/insserver/_default.cfg | 10 ++ .../config-lgsm/inssserver/_default.cfg | 10 ++ .../config-lgsm/iosserver/_default.cfg | 10 ++ .../config-lgsm/jc2server/_default.cfg | 10 ++ .../config-lgsm/jc3server/_default.cfg | 10 ++ .../config-lgsm/jk2server/_default.cfg | 10 ++ .../config-lgsm/kf2server/_default.cfg | 10 ++ .../config-lgsm/kfserver/_default.cfg | 10 ++ .../config-lgsm/l4d2server/_default.cfg | 10 ++ .../config-lgsm/l4dserver/_default.cfg | 10 ++ .../config-lgsm/mcbserver/_default.cfg | 10 ++ .../config-lgsm/mcserver/_default.cfg | 10 ++ .../config-lgsm/mhserver/_default.cfg | 10 ++ .../config-lgsm/mohaaserver/_default.cfg | 10 ++ .../config-lgsm/momserver/_default.cfg | 10 ++ .../config-lgsm/mtaserver/_default.cfg | 10 ++ .../config-lgsm/ndserver/_default.cfg | 10 ++ .../config-lgsm/necserver/_default.cfg | 10 ++ .../config-lgsm/nmrihserver/_default.cfg | 10 ++ .../config-lgsm/ns2cserver/_default.cfg | 10 ++ .../config-lgsm/ns2server/_default.cfg | 10 ++ .../config-lgsm/nsserver/_default.cfg | 10 ++ .../config-lgsm/ohdserver/_default.cfg | 10 ++ .../config-lgsm/onsetserver/_default.cfg | 10 ++ .../config-lgsm/opforserver/_default.cfg | 10 ++ .../config-lgsm/pc2server/_default.cfg | 10 ++ .../config-lgsm/pcserver/_default.cfg | 10 ++ .../config-lgsm/pmcserver/_default.cfg | 10 ++ .../config-lgsm/pvkiiserver/_default.cfg | 10 ++ .../config-lgsm/pvrserver/_default.cfg | 10 ++ .../config-lgsm/pwserver/_default.cfg | 10 ++ .../config-lgsm/pzserver/_default.cfg | 10 ++ .../config-lgsm/q2server/_default.cfg | 10 ++ .../config-lgsm/q3server/_default.cfg | 10 ++ .../config-lgsm/q4server/_default.cfg | 10 ++ .../config-lgsm/qlserver/_default.cfg | 10 ++ .../config-lgsm/qwserver/_default.cfg | 10 ++ .../config-lgsm/ricochetserver/_default.cfg | 10 ++ .../config-lgsm/roserver/_default.cfg | 10 ++ .../config-lgsm/rtcwserver/_default.cfg | 10 ++ .../config-lgsm/rustserver/_default.cfg | 10 ++ .../config-lgsm/rwserver/_default.cfg | 10 ++ .../config-lgsm/sampserver/_default.cfg | 10 ++ .../config-lgsm/sbotsserver/_default.cfg | 10 ++ .../config-lgsm/sbserver/_default.cfg | 10 ++ .../config-lgsm/scpslserver/_default.cfg | 10 ++ .../config-lgsm/scpslsmserver/_default.cfg | 10 ++ .../config-lgsm/sdtdserver/_default.cfg | 10 ++ .../config-lgsm/sfcserver/_default.cfg | 10 ++ .../config-lgsm/sfserver/_default.cfg | 10 ++ .../config-lgsm/smserver/_default.cfg | 10 ++ .../config-lgsm/sof2server/_default.cfg | 10 ++ .../config-lgsm/solserver/_default.cfg | 10 ++ .../config-lgsm/squad44server/_default.cfg | 10 ++ .../config-lgsm/squadserver/_default.cfg | 10 ++ .../config-lgsm/stnserver/_default.cfg | 10 ++ .../config-lgsm/stserver/_default.cfg | 10 ++ .../config-lgsm/svenserver/_default.cfg | 10 ++ .../config-lgsm/terrariaserver/_default.cfg | 10 ++ .../config-lgsm/tf2server/_default.cfg | 10 ++ .../config-lgsm/tfcserver/_default.cfg | 10 ++ .../config-lgsm/tfserver/_default.cfg | 10 ++ .../config-lgsm/tiserver/_default.cfg | 10 ++ .../config-lgsm/ts3server/_default.cfg | 10 ++ .../config-lgsm/tsserver/_default.cfg | 10 ++ .../config-lgsm/tuserver/_default.cfg | 10 ++ .../config-lgsm/twserver/_default.cfg | 10 ++ .../config-lgsm/untserver/_default.cfg | 10 ++ .../config-lgsm/ut2k4server/_default.cfg | 10 ++ .../config-lgsm/ut3server/_default.cfg | 10 ++ .../config-lgsm/ut99server/_default.cfg | 10 ++ .../config-lgsm/utserver/_default.cfg | 10 ++ .../config-lgsm/vhserver/_default.cfg | 10 ++ .../config-lgsm/vintsserver/_default.cfg | 10 ++ .../config-lgsm/vpmcserver/_default.cfg | 10 ++ .../config-lgsm/vsserver/_default.cfg | 10 ++ .../config-lgsm/wetserver/_default.cfg | 10 ++ .../config-lgsm/wfserver/_default.cfg | 10 ++ .../config-lgsm/wmcserver/_default.cfg | 10 ++ .../config-lgsm/wurmserver/_default.cfg | 10 ++ .../config-lgsm/xntserver/_default.cfg | 10 ++ .../config-lgsm/zmrserver/_default.cfg | 10 ++ .../config-lgsm/zpsserver/_default.cfg | 10 ++ lgsm/modules/alert.sh | 13 ++- lgsm/modules/alert_ntfy.sh | 99 +++++++++++++++++++ lgsm/modules/core_modules.sh | 11 ++- 141 files changed, 1509 insertions(+), 4 deletions(-) create mode 100644 lgsm/modules/alert_ntfy.sh diff --git a/lgsm/config-default/config-lgsm/acserver/_default.cfg b/lgsm/config-default/config-lgsm/acserver/_default.cfg index 154f38c7b..2c4f8c84a 100644 --- a/lgsm/config-default/config-lgsm/acserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/acserver/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ahl2server/_default.cfg b/lgsm/config-default/config-lgsm/ahl2server/_default.cfg index a98c90701..8e2f9b272 100644 --- a/lgsm/config-default/config-lgsm/ahl2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ahl2server/_default.cfg @@ -62,6 +62,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ahlserver/_default.cfg b/lgsm/config-default/config-lgsm/ahlserver/_default.cfg index 04cc2e6f9..84501a48e 100644 --- a/lgsm/config-default/config-lgsm/ahlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ahlserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/arkserver/_default.cfg b/lgsm/config-default/config-lgsm/arkserver/_default.cfg index 8680c1bad..0866ac0a0 100644 --- a/lgsm/config-default/config-lgsm/arkserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/arkserver/_default.cfg @@ -59,6 +59,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/arma3server/_default.cfg b/lgsm/config-default/config-lgsm/arma3server/_default.cfg index b0918ef3c..2db6dc955 100644 --- a/lgsm/config-default/config-lgsm/arma3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/arma3server/_default.cfg @@ -73,6 +73,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/armarserver/_default.cfg b/lgsm/config-default/config-lgsm/armarserver/_default.cfg index 61103d332..d5b6d0e18 100644 --- a/lgsm/config-default/config-lgsm/armarserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/armarserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/atsserver/_default.cfg b/lgsm/config-default/config-lgsm/atsserver/_default.cfg index f6d165098..a37b64547 100644 --- a/lgsm/config-default/config-lgsm/atsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/atsserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/avserver/_default.cfg b/lgsm/config-default/config-lgsm/avserver/_default.cfg index 7b225de1f..5220fa4e7 100644 --- a/lgsm/config-default/config-lgsm/avserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/avserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/bb2server/_default.cfg b/lgsm/config-default/config-lgsm/bb2server/_default.cfg index b9250cc5f..c00bd7e7d 100644 --- a/lgsm/config-default/config-lgsm/bb2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/bb2server/_default.cfg @@ -63,6 +63,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/bbserver/_default.cfg b/lgsm/config-default/config-lgsm/bbserver/_default.cfg index 99262d8e3..5453a35f1 100644 --- a/lgsm/config-default/config-lgsm/bbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bbserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/bdserver/_default.cfg b/lgsm/config-default/config-lgsm/bdserver/_default.cfg index 3c1769fb3..ac5df16ae 100644 --- a/lgsm/config-default/config-lgsm/bdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bdserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/bf1942server/_default.cfg b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg index 30e2f957a..69c4ba727 100644 --- a/lgsm/config-default/config-lgsm/bf1942server/_default.cfg +++ b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/bfvserver/_default.cfg b/lgsm/config-default/config-lgsm/bfvserver/_default.cfg index 2e8aed8f1..7a28076b0 100644 --- a/lgsm/config-default/config-lgsm/bfvserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bfvserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg index e353d57b0..f4946bf34 100644 --- a/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg @@ -63,6 +63,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/boserver/_default.cfg b/lgsm/config-default/config-lgsm/boserver/_default.cfg index ae7912ab6..7eba6c82a 100644 --- a/lgsm/config-default/config-lgsm/boserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/boserver/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/bsserver/_default.cfg b/lgsm/config-default/config-lgsm/bsserver/_default.cfg index d81cde16d..865e8cf20 100644 --- a/lgsm/config-default/config-lgsm/bsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bsserver/_default.cfg @@ -67,6 +67,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/btlserver/_default.cfg b/lgsm/config-default/config-lgsm/btlserver/_default.cfg index 28e8b95e3..a95a7e77c 100644 --- a/lgsm/config-default/config-lgsm/btlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/btlserver/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/btserver/_default.cfg b/lgsm/config-default/config-lgsm/btserver/_default.cfg index 71c02c3fc..e12b1dfa3 100644 --- a/lgsm/config-default/config-lgsm/btserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/btserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ccserver/_default.cfg b/lgsm/config-default/config-lgsm/ccserver/_default.cfg index 66847b410..dcd65011d 100644 --- a/lgsm/config-default/config-lgsm/ccserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ccserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ckserver/_default.cfg b/lgsm/config-default/config-lgsm/ckserver/_default.cfg index f54d7cc7f..35f36dbf5 100644 --- a/lgsm/config-default/config-lgsm/ckserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ckserver/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/cmwserver/_default.cfg b/lgsm/config-default/config-lgsm/cmwserver/_default.cfg index 776b06a1d..bd81c0cdc 100644 --- a/lgsm/config-default/config-lgsm/cmwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/cmwserver/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/cod2server/_default.cfg b/lgsm/config-default/config-lgsm/cod2server/_default.cfg index 9665a9ba8..f33d207cf 100644 --- a/lgsm/config-default/config-lgsm/cod2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cod2server/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/cod4server/_default.cfg b/lgsm/config-default/config-lgsm/cod4server/_default.cfg index f9787c352..e2fee45b1 100644 --- a/lgsm/config-default/config-lgsm/cod4server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cod4server/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/codserver/_default.cfg b/lgsm/config-default/config-lgsm/codserver/_default.cfg index 8f1476ad3..364096768 100644 --- a/lgsm/config-default/config-lgsm/codserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/codserver/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/coduoserver/_default.cfg b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg index c405966d4..0a8da94a9 100644 --- a/lgsm/config-default/config-lgsm/coduoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/codwawserver/_default.cfg b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg index ca0f002d3..ce6bba88e 100644 --- a/lgsm/config-default/config-lgsm/codwawserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/colserver/_default.cfg b/lgsm/config-default/config-lgsm/colserver/_default.cfg index cd94e9b37..4a560cebb 100644 --- a/lgsm/config-default/config-lgsm/colserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/colserver/_default.cfg @@ -51,6 +51,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/cs2server/_default.cfg b/lgsm/config-default/config-lgsm/cs2server/_default.cfg index 66414592a..56948c77f 100644 --- a/lgsm/config-default/config-lgsm/cs2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cs2server/_default.cfg @@ -62,6 +62,26 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/csczserver/_default.cfg b/lgsm/config-default/config-lgsm/csczserver/_default.cfg index 29001a098..f5d90a35b 100644 --- a/lgsm/config-default/config-lgsm/csczserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csczserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg index 29b3aea10..6ae89331f 100644 --- a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg @@ -94,6 +94,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/csserver/_default.cfg b/lgsm/config-default/config-lgsm/csserver/_default.cfg index 266448e74..2ca833c87 100644 --- a/lgsm/config-default/config-lgsm/csserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/cssserver/_default.cfg b/lgsm/config-default/config-lgsm/cssserver/_default.cfg index 103c30897..a396678ff 100644 --- a/lgsm/config-default/config-lgsm/cssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/cssserver/_default.cfg @@ -63,6 +63,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ctserver/_default.cfg b/lgsm/config-default/config-lgsm/ctserver/_default.cfg index ac87d7516..c90d6125c 100644 --- a/lgsm/config-default/config-lgsm/ctserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ctserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/dabserver/_default.cfg b/lgsm/config-default/config-lgsm/dabserver/_default.cfg index 3d5015808..28c4478fd 100644 --- a/lgsm/config-default/config-lgsm/dabserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dabserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/dayzserver/_default.cfg b/lgsm/config-default/config-lgsm/dayzserver/_default.cfg index f09d23c23..7e84df534 100644 --- a/lgsm/config-default/config-lgsm/dayzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dayzserver/_default.cfg @@ -73,6 +73,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/dmcserver/_default.cfg b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg index 3d74fca4d..9d40dd637 100644 --- a/lgsm/config-default/config-lgsm/dmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/dodrserver/_default.cfg b/lgsm/config-default/config-lgsm/dodrserver/_default.cfg index 0565b94e9..3c16fcdd5 100644 --- a/lgsm/config-default/config-lgsm/dodrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodrserver/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/dodserver/_default.cfg b/lgsm/config-default/config-lgsm/dodserver/_default.cfg index e2419289a..8f3845911 100644 --- a/lgsm/config-default/config-lgsm/dodserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/dodsserver/_default.cfg b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg index b6973f0a7..4f113a64f 100644 --- a/lgsm/config-default/config-lgsm/dodsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/doiserver/_default.cfg b/lgsm/config-default/config-lgsm/doiserver/_default.cfg index 9a06b7b02..65ee56f1e 100644 --- a/lgsm/config-default/config-lgsm/doiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/doiserver/_default.cfg @@ -59,6 +59,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/dstserver/_default.cfg b/lgsm/config-default/config-lgsm/dstserver/_default.cfg index 2c8de8bd4..7c8f3fa30 100644 --- a/lgsm/config-default/config-lgsm/dstserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dstserver/_default.cfg @@ -60,6 +60,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/dysserver/_default.cfg b/lgsm/config-default/config-lgsm/dysserver/_default.cfg index fcb37c41a..b65d0ba47 100644 --- a/lgsm/config-default/config-lgsm/dysserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dysserver/_default.cfg @@ -63,6 +63,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg index 0c18318e9..c68902ffc 100644 --- a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg @@ -53,6 +53,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/emserver/_default.cfg b/lgsm/config-default/config-lgsm/emserver/_default.cfg index 1762e5175..e8f537aab 100644 --- a/lgsm/config-default/config-lgsm/emserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/emserver/_default.cfg @@ -63,6 +63,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/etlserver/_default.cfg b/lgsm/config-default/config-lgsm/etlserver/_default.cfg index 11a408fb8..04ebe4e23 100644 --- a/lgsm/config-default/config-lgsm/etlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/etlserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ets2server/_default.cfg b/lgsm/config-default/config-lgsm/ets2server/_default.cfg index 6abe98fb3..116de6b6d 100644 --- a/lgsm/config-default/config-lgsm/ets2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ets2server/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg index 284fafaec..6eeeda637 100644 --- a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/fofserver/_default.cfg b/lgsm/config-default/config-lgsm/fofserver/_default.cfg index 7ce630310..857c596a2 100644 --- a/lgsm/config-default/config-lgsm/fofserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/fofserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/gmodserver/_default.cfg b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg index 2cc683d20..852094b7c 100644 --- a/lgsm/config-default/config-lgsm/gmodserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg @@ -68,6 +68,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/hcuserver/_default.cfg b/lgsm/config-default/config-lgsm/hcuserver/_default.cfg index 0925fe384..2340506a9 100644 --- a/lgsm/config-default/config-lgsm/hcuserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hcuserver/_default.cfg @@ -65,6 +65,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg index 7ce4dd073..55f1c3918 100644 --- a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg @@ -60,6 +60,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/hldmserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg index 3bddb128e..84d7ca030 100644 --- a/lgsm/config-default/config-lgsm/hldmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg index 74321c1f4..c1de9618d 100644 --- a/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/hwserver/_default.cfg b/lgsm/config-default/config-lgsm/hwserver/_default.cfg index 7fe1a4969..70c08c204 100644 --- a/lgsm/config-default/config-lgsm/hwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hwserver/_default.cfg @@ -68,6 +68,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/hzserver/_default.cfg b/lgsm/config-default/config-lgsm/hzserver/_default.cfg index 98b6dda1e..61403a6d2 100644 --- a/lgsm/config-default/config-lgsm/hzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hzserver/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/insserver/_default.cfg b/lgsm/config-default/config-lgsm/insserver/_default.cfg index cd1d13029..74760c2e0 100644 --- a/lgsm/config-default/config-lgsm/insserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/insserver/_default.cfg @@ -64,6 +64,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/inssserver/_default.cfg b/lgsm/config-default/config-lgsm/inssserver/_default.cfg index 4049e5e11..60f138093 100644 --- a/lgsm/config-default/config-lgsm/inssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/inssserver/_default.cfg @@ -67,6 +67,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/iosserver/_default.cfg b/lgsm/config-default/config-lgsm/iosserver/_default.cfg index ff6764d0b..30c41d1fa 100644 --- a/lgsm/config-default/config-lgsm/iosserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/iosserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/jc2server/_default.cfg b/lgsm/config-default/config-lgsm/jc2server/_default.cfg index 5a82bbad9..fe3f28dff 100644 --- a/lgsm/config-default/config-lgsm/jc2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc2server/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/jc3server/_default.cfg b/lgsm/config-default/config-lgsm/jc3server/_default.cfg index 62d9cd4ab..faa4f0a09 100644 --- a/lgsm/config-default/config-lgsm/jc3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc3server/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/jk2server/_default.cfg b/lgsm/config-default/config-lgsm/jk2server/_default.cfg index f238c45fe..ef0a54ad8 100644 --- a/lgsm/config-default/config-lgsm/jk2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jk2server/_default.cfg @@ -59,6 +59,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/kf2server/_default.cfg b/lgsm/config-default/config-lgsm/kf2server/_default.cfg index 8f44458cd..b6e39b1ed 100644 --- a/lgsm/config-default/config-lgsm/kf2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/kf2server/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/kfserver/_default.cfg b/lgsm/config-default/config-lgsm/kfserver/_default.cfg index 222ba9979..77507e436 100644 --- a/lgsm/config-default/config-lgsm/kfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/kfserver/_default.cfg @@ -62,6 +62,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/l4d2server/_default.cfg b/lgsm/config-default/config-lgsm/l4d2server/_default.cfg index a37ef4eb4..5e6dcfc4e 100644 --- a/lgsm/config-default/config-lgsm/l4d2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/l4d2server/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/l4dserver/_default.cfg b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg index dc22bc871..4039df849 100644 --- a/lgsm/config-default/config-lgsm/l4dserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg index d7171a3f6..49ac842a6 100644 --- a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg @@ -53,6 +53,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/mcserver/_default.cfg b/lgsm/config-default/config-lgsm/mcserver/_default.cfg index 1288fab95..20ede8c01 100644 --- a/lgsm/config-default/config-lgsm/mcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcserver/_default.cfg @@ -59,6 +59,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/mhserver/_default.cfg b/lgsm/config-default/config-lgsm/mhserver/_default.cfg index 197440ab2..4414621fa 100644 --- a/lgsm/config-default/config-lgsm/mhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mhserver/_default.cfg @@ -59,6 +59,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg index dfd87335c..5784ceede 100644 --- a/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/momserver/_default.cfg b/lgsm/config-default/config-lgsm/momserver/_default.cfg index 5834670c9..44eef19e7 100644 --- a/lgsm/config-default/config-lgsm/momserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/momserver/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg index d1880ef89..7bba9fc10 100644 --- a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg @@ -53,6 +53,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ndserver/_default.cfg b/lgsm/config-default/config-lgsm/ndserver/_default.cfg index 249556af4..3ef7000cd 100644 --- a/lgsm/config-default/config-lgsm/ndserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ndserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/necserver/_default.cfg b/lgsm/config-default/config-lgsm/necserver/_default.cfg index 8062f8d5f..6c1f65a39 100644 --- a/lgsm/config-default/config-lgsm/necserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/necserver/_default.cfg @@ -53,6 +53,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg index 8757caa6c..330160428 100644 --- a/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg @@ -63,6 +63,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg index 2f8f47af5..7f4aeb9bc 100644 --- a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg @@ -65,6 +65,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ns2server/_default.cfg b/lgsm/config-default/config-lgsm/ns2server/_default.cfg index 9cec798da..69aa2486a 100644 --- a/lgsm/config-default/config-lgsm/ns2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2server/_default.cfg @@ -66,6 +66,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/nsserver/_default.cfg b/lgsm/config-default/config-lgsm/nsserver/_default.cfg index 367878519..98fce8ae9 100644 --- a/lgsm/config-default/config-lgsm/nsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/nsserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ohdserver/_default.cfg b/lgsm/config-default/config-lgsm/ohdserver/_default.cfg index 26bc3a30c..6213a365f 100644 --- a/lgsm/config-default/config-lgsm/ohdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ohdserver/_default.cfg @@ -60,6 +60,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/onsetserver/_default.cfg b/lgsm/config-default/config-lgsm/onsetserver/_default.cfg index 0103ef069..17a6c0767 100644 --- a/lgsm/config-default/config-lgsm/onsetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/onsetserver/_default.cfg @@ -51,6 +51,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/opforserver/_default.cfg b/lgsm/config-default/config-lgsm/opforserver/_default.cfg index 93d00fc5c..7f025a854 100644 --- a/lgsm/config-default/config-lgsm/opforserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/opforserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/pc2server/_default.cfg b/lgsm/config-default/config-lgsm/pc2server/_default.cfg index d4e6ce1d6..ad71870c9 100644 --- a/lgsm/config-default/config-lgsm/pc2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/pc2server/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/pcserver/_default.cfg b/lgsm/config-default/config-lgsm/pcserver/_default.cfg index c36dfaac6..54dfa4019 100644 --- a/lgsm/config-default/config-lgsm/pcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pcserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/pmcserver/_default.cfg b/lgsm/config-default/config-lgsm/pmcserver/_default.cfg index 74e0e7e18..b915a9712 100644 --- a/lgsm/config-default/config-lgsm/pmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pmcserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg index 1e2ca3660..64ee41bb0 100644 --- a/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg index 374da3dd1..e3f0bc989 100644 --- a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg @@ -59,6 +59,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/pwserver/_default.cfg b/lgsm/config-default/config-lgsm/pwserver/_default.cfg index 5e848264e..7359064a0 100644 --- a/lgsm/config-default/config-lgsm/pwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pwserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/pzserver/_default.cfg b/lgsm/config-default/config-lgsm/pzserver/_default.cfg index f830d7cc4..aa0ca6525 100644 --- a/lgsm/config-default/config-lgsm/pzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pzserver/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/q2server/_default.cfg b/lgsm/config-default/config-lgsm/q2server/_default.cfg index 79820d650..5b40936e1 100644 --- a/lgsm/config-default/config-lgsm/q2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/q2server/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/q3server/_default.cfg b/lgsm/config-default/config-lgsm/q3server/_default.cfg index 74b0d11f3..35e612651 100644 --- a/lgsm/config-default/config-lgsm/q3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/q3server/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/q4server/_default.cfg b/lgsm/config-default/config-lgsm/q4server/_default.cfg index d07828e9f..32293c955 100644 --- a/lgsm/config-default/config-lgsm/q4server/_default.cfg +++ b/lgsm/config-default/config-lgsm/q4server/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/qlserver/_default.cfg b/lgsm/config-default/config-lgsm/qlserver/_default.cfg index 84631b765..e1c8d2fac 100644 --- a/lgsm/config-default/config-lgsm/qlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/qlserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/qwserver/_default.cfg b/lgsm/config-default/config-lgsm/qwserver/_default.cfg index 620943c3e..39cce3204 100644 --- a/lgsm/config-default/config-lgsm/qwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/qwserver/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg index bb1957de0..b97ff5b7f 100644 --- a/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/roserver/_default.cfg b/lgsm/config-default/config-lgsm/roserver/_default.cfg index 0af49a0d4..10eb081bd 100644 --- a/lgsm/config-default/config-lgsm/roserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/roserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg b/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg index 9011bbced..b8d3e1eb7 100644 --- a/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/rustserver/_default.cfg b/lgsm/config-default/config-lgsm/rustserver/_default.cfg index cf609a84c..c5823b5f1 100644 --- a/lgsm/config-default/config-lgsm/rustserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rustserver/_default.cfg @@ -70,6 +70,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/rwserver/_default.cfg b/lgsm/config-default/config-lgsm/rwserver/_default.cfg index 9523dd63b..2d95710e1 100644 --- a/lgsm/config-default/config-lgsm/rwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rwserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/sampserver/_default.cfg b/lgsm/config-default/config-lgsm/sampserver/_default.cfg index 870603bb0..3caf0a4f2 100644 --- a/lgsm/config-default/config-lgsm/sampserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sampserver/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg index 82d651ec3..2bd551530 100644 --- a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/sbserver/_default.cfg b/lgsm/config-default/config-lgsm/sbserver/_default.cfg index 3d06b4235..671e09b31 100644 --- a/lgsm/config-default/config-lgsm/sbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sbserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/scpslserver/_default.cfg b/lgsm/config-default/config-lgsm/scpslserver/_default.cfg index 237bbebe3..02140723b 100644 --- a/lgsm/config-default/config-lgsm/scpslserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/scpslserver/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg b/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg index e54814df2..1ca04be52 100644 --- a/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg index 0a091dae4..985b29643 100644 --- a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg @@ -53,6 +53,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/sfcserver/_default.cfg b/lgsm/config-default/config-lgsm/sfcserver/_default.cfg index 831f92353..4b5c3bc91 100644 --- a/lgsm/config-default/config-lgsm/sfcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sfcserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/sfserver/_default.cfg b/lgsm/config-default/config-lgsm/sfserver/_default.cfg index f71c1a8d4..4e7272b47 100644 --- a/lgsm/config-default/config-lgsm/sfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sfserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/smserver/_default.cfg b/lgsm/config-default/config-lgsm/smserver/_default.cfg index 306179b9c..4fd669e9b 100644 --- a/lgsm/config-default/config-lgsm/smserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/smserver/_default.cfg @@ -61,6 +61,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/sof2server/_default.cfg b/lgsm/config-default/config-lgsm/sof2server/_default.cfg index 140773daf..70783da4a 100644 --- a/lgsm/config-default/config-lgsm/sof2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/sof2server/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/solserver/_default.cfg b/lgsm/config-default/config-lgsm/solserver/_default.cfg index 8581104dd..06147b620 100644 --- a/lgsm/config-default/config-lgsm/solserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/solserver/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/squad44server/_default.cfg b/lgsm/config-default/config-lgsm/squad44server/_default.cfg index 80d991f94..36037a113 100644 --- a/lgsm/config-default/config-lgsm/squad44server/_default.cfg +++ b/lgsm/config-default/config-lgsm/squad44server/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/squadserver/_default.cfg b/lgsm/config-default/config-lgsm/squadserver/_default.cfg index 99b91b538..db783c810 100644 --- a/lgsm/config-default/config-lgsm/squadserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/squadserver/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/stnserver/_default.cfg b/lgsm/config-default/config-lgsm/stnserver/_default.cfg index 70c7d290c..4fef17c4b 100644 --- a/lgsm/config-default/config-lgsm/stnserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stnserver/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/stserver/_default.cfg b/lgsm/config-default/config-lgsm/stserver/_default.cfg index e32bb2303..4aeaa9c8d 100644 --- a/lgsm/config-default/config-lgsm/stserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stserver/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/svenserver/_default.cfg b/lgsm/config-default/config-lgsm/svenserver/_default.cfg index 4cd97c50e..24ea8bf66 100644 --- a/lgsm/config-default/config-lgsm/svenserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/svenserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg index fc0d291c9..557ad48af 100644 --- a/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/tf2server/_default.cfg b/lgsm/config-default/config-lgsm/tf2server/_default.cfg index 74fd359ab..16a4285f0 100644 --- a/lgsm/config-default/config-lgsm/tf2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/tf2server/_default.cfg @@ -65,6 +65,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/tfcserver/_default.cfg b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg index 17787eef5..ec2e2cade 100644 --- a/lgsm/config-default/config-lgsm/tfcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/tfserver/_default.cfg b/lgsm/config-default/config-lgsm/tfserver/_default.cfg index 53fde059d..880e12acb 100644 --- a/lgsm/config-default/config-lgsm/tfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tfserver/_default.cfg @@ -74,6 +74,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/tiserver/_default.cfg b/lgsm/config-default/config-lgsm/tiserver/_default.cfg index 4090d85c9..75aa946f0 100644 --- a/lgsm/config-default/config-lgsm/tiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tiserver/_default.cfg @@ -56,6 +56,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ts3server/_default.cfg b/lgsm/config-default/config-lgsm/ts3server/_default.cfg index bacda7aaa..87cd0dc31 100644 --- a/lgsm/config-default/config-lgsm/ts3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ts3server/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/tsserver/_default.cfg b/lgsm/config-default/config-lgsm/tsserver/_default.cfg index 418727ae6..b3e9799d6 100644 --- a/lgsm/config-default/config-lgsm/tsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tsserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/tuserver/_default.cfg b/lgsm/config-default/config-lgsm/tuserver/_default.cfg index ba22c5aa6..a4e7acaf8 100644 --- a/lgsm/config-default/config-lgsm/tuserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tuserver/_default.cfg @@ -60,6 +60,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/twserver/_default.cfg b/lgsm/config-default/config-lgsm/twserver/_default.cfg index 4d47cb2d1..ea512f271 100644 --- a/lgsm/config-default/config-lgsm/twserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/twserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/untserver/_default.cfg b/lgsm/config-default/config-lgsm/untserver/_default.cfg index a556c1758..7dd97e269 100644 --- a/lgsm/config-default/config-lgsm/untserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/untserver/_default.cfg @@ -64,6 +64,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg index ef8fab731..37b219ece 100644 --- a/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ut3server/_default.cfg b/lgsm/config-default/config-lgsm/ut3server/_default.cfg index 22817e40c..1d7ecf269 100644 --- a/lgsm/config-default/config-lgsm/ut3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut3server/_default.cfg @@ -70,6 +70,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/ut99server/_default.cfg b/lgsm/config-default/config-lgsm/ut99server/_default.cfg index 3343afc81..62b4abc57 100644 --- a/lgsm/config-default/config-lgsm/ut99server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut99server/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/utserver/_default.cfg b/lgsm/config-default/config-lgsm/utserver/_default.cfg index 299d2571a..401cded1a 100644 --- a/lgsm/config-default/config-lgsm/utserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/utserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/vhserver/_default.cfg b/lgsm/config-default/config-lgsm/vhserver/_default.cfg index 76bed1890..8380e7c16 100644 --- a/lgsm/config-default/config-lgsm/vhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vhserver/_default.cfg @@ -91,6 +91,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/vintsserver/_default.cfg b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg index 740b3923d..ed57b6d84 100644 --- a/lgsm/config-default/config-lgsm/vintsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg @@ -54,6 +54,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg b/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg index 28bc1b2ea..6bccc92fd 100644 --- a/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/vsserver/_default.cfg b/lgsm/config-default/config-lgsm/vsserver/_default.cfg index c7976b384..9414c6978 100644 --- a/lgsm/config-default/config-lgsm/vsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vsserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/wetserver/_default.cfg b/lgsm/config-default/config-lgsm/wetserver/_default.cfg index b53a0674c..fdd42aaf9 100644 --- a/lgsm/config-default/config-lgsm/wetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wetserver/_default.cfg @@ -50,6 +50,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/wfserver/_default.cfg b/lgsm/config-default/config-lgsm/wfserver/_default.cfg index d59790ca5..adde08321 100644 --- a/lgsm/config-default/config-lgsm/wfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wfserver/_default.cfg @@ -55,6 +55,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/wmcserver/_default.cfg b/lgsm/config-default/config-lgsm/wmcserver/_default.cfg index c9a0a5d52..d5ff2893f 100644 --- a/lgsm/config-default/config-lgsm/wmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wmcserver/_default.cfg @@ -57,6 +57,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg index 0141e7d7e..d65df817f 100644 --- a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg @@ -94,6 +94,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/xntserver/_default.cfg b/lgsm/config-default/config-lgsm/xntserver/_default.cfg index 402e6188f..d7b85f58a 100644 --- a/lgsm/config-default/config-lgsm/xntserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/xntserver/_default.cfg @@ -52,6 +52,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/zmrserver/_default.cfg b/lgsm/config-default/config-lgsm/zmrserver/_default.cfg index 391d83baf..b2c61b9fd 100644 --- a/lgsm/config-default/config-lgsm/zmrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/zmrserver/_default.cfg @@ -58,6 +58,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/config-default/config-lgsm/zpsserver/_default.cfg b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg index b5a7b3b93..c43b008b5 100644 --- a/lgsm/config-default/config-lgsm/zpsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg @@ -63,6 +63,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/modules/alert.sh b/lgsm/modules/alert.sh index f2698e3b7..16ba7e939 100644 --- a/lgsm/modules/alert.sh +++ b/lgsm/modules/alert.sh @@ -24,7 +24,7 @@ fn_alert_log() { fn_info_messages_gameserver_resource fn_info_messages_gameserver fn_info_logs - } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | tee -a "${alertlog}" > /dev/null 2>&1 + } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | tee -a "${alertlog}" >/dev/null 2>&1 } fn_alert_test() { @@ -357,3 +357,14 @@ elif [ -z "${slacktoken}" ] && [ "${commandname}" == "TEST-ALERT" ]; then echo -e "* https://docs.linuxgsm.com/alerts/slack" fn_script_error "Slack token not set" fi + +if [ "${ntfyalert}" == "on" ] && [ -n "${ntfytopic}" ]; then + alert_ntfy.sh +elif [ "${ntfyalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "ntfy alerts not enabled" + fn_script_log_warn "ntfy alerts not enabled" +elif [ -z "${ntfytopic}" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "ntfy topic not set" + echo -e "* https://docs.linuxgsm.com/alerts/ntfy" + fn_script_error "ntfy topic not set" +fi diff --git a/lgsm/modules/alert_ntfy.sh b/lgsm/modules/alert_ntfy.sh new file mode 100644 index 000000000..35e3f4c55 --- /dev/null +++ b/lgsm/modules/alert_ntfy.sh @@ -0,0 +1,99 @@ +#!/bin/bash +# LinuxGSM alert_ntfy.sh module +# Author: Daniel Gibbs (Original Structure), rconjoe (ntfy Adaptation) +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends ntfy alert. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Default ntfy server if not set in config +if [ -z "${ntfyserver}" ]; then + ntfyserver="https://ntfy.sh" +fi + +# Construct the target URL +ntfyurl="${ntfyserver}/${ntfytopic}" + +# Determine priority based on alertsound or config override +# ntfy priorities: 1 (min), 2 (low), 3 (default), 4 (high), 5 (max) +if [ -n "${ntfypriority}" ]; then + priority="${ntfypriority}" +elif [ "${alertsound}" == "2" ]; then + # High priority for monitor failures/permissions issues + priority="4" +else + # Default priority for standard notifications + priority="3" +fi + +# Determine tags based on alertemoji or config override +if [ -n "${ntfytags}" ]; then + tags="${ntfytags}" +else + # Use the alert emoji as a tag + tags="${alertemoji}" +fi + +# Construct the message body +message="Server Name: ${servername} +Information: ${alertmessage} +Game: ${gamename} +Server IP: ${alertip}:${port} +Hostname: ${HOSTNAME} +Server Time: $(date)" + +# Add optional links if available +if [ -n "${querytype}" ]; then + message+="\nIs my Game Server Online?: https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}" +fi + +# Use alerturl for the click action if available +clickurl="" +if [ -n "${alerturl}" ]; then + message+="\nMore info: ${alerturl}" + clickurl="${alerturl}" +fi + +# Prepare curl command +# Start with base command and add headers +cmd=(curl --connect-timeout 10 -sS -X POST) +cmd+=(-H "Title: ${alerttitle}") +cmd+=(-H "Priority: ${priority}") +cmd+=(-H "Tags: ${tags}") + +# Add icon if available +if [ -n "${alerticon}" ]; then + cmd+=(-H "Icon: ${alerticon}") +fi + +# Add click URL if available +if [ -n "${clickurl}" ]; then + cmd+=(-H "Click: ${clickurl}") +fi + +# Add authentication header if token is provided +if [ -n "${ntfytoken}" ]; then + cmd+=(-H "Authorization: Bearer ${ntfytoken}") +# Add basic auth if username/password provided (and token isn't) +elif [ -n "${ntfyusername}" ] && [ -n "${ntfypassword}" ]; then + cmd+=(-u "${ntfyusername}:${ntfypassword}") +fi + +# Add message body and target URL +cmd+=(-d "${message}" "${ntfyurl}") + +fn_print_dots "Sending ntfy alert to ${ntfyurl}" + +# Execute the command +ntfysend=$("${cmd[@]}") +exitcode=$? + +# Check exit code and response +if [ "${exitcode}" -eq 0 ] && [[ "${ntfysend}" != *"\"code\":"* ]] && [[ "${ntfysend}" != *"401"* ]] && [[ "${ntfysend}" != *"404"* ]]; then + fn_print_ok_nl "Sending ntfy alert to ${ntfyurl}" + fn_script_log_pass "Sending ntfy alert to ${ntfyurl}" +else + fn_print_fail_nl "Sending ntfy alert to ${ntfyurl}: ${ntfysend} (Exit code: ${exitcode})" + fn_script_log_fail "Sending ntfy alert to ${ntfyurl}: ${ntfysend} (Exit code: ${exitcode})" +fi diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index e5dd2cf31..614f5d019 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -14,7 +14,7 @@ modulesversion="v25.2.0" core_dl.sh() { modulefile="${FUNCNAME[0]}" - if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + 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" @@ -23,7 +23,7 @@ core_dl.sh() { core_messages.sh() { modulefile="${FUNCNAME[0]}" - if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + 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" @@ -32,7 +32,7 @@ core_messages.sh() { core_legacy.sh() { modulefile="${FUNCNAME[0]}" - if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + 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" @@ -619,6 +619,11 @@ alert_slack.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } + +alert_ntfy.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} # Logs core_logs.sh() { From fc5e723d1715475e8bc823723b02dc3733396423 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Nov 2025 22:11:00 +0000 Subject: [PATCH 093/132] fix(info_messages): Correct IFTTT alert condition check * Updated the IFTTT alert output to only display when the alert is set to "on". * This change ensures that unnecessary output is avoided when the alert is not active. --- lgsm/modules/info_messages.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index cff7467b1..242c6b337 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -598,7 +598,9 @@ fn_info_messages_script() { echo -e "${lightblue}Gotify alert:\t${default}${gotifyalert}" fi # IFTTT alert - echo -e "${lightblue}IFTTT alert:\t${default}${iftttalert}" + if [ "${iftttalert}" == "on" ]; then + echo -e "${lightblue}IFTTT alert:\t${default}${iftttalert}" + fi # Pushbullet alert if [ "${pushbulletalert}" == "on" ]; then echo -e "${lightblue}Pushbullet alert:\t${default}${pushbulletalert}" From 31031c609ff56421964c7e099da5dac8e1cb00d9 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Nov 2025 23:09:02 +0000 Subject: [PATCH 094/132] feat: update various game server distro compatibility's (#4853) * add compatabilty message * failure * fix(serverlist): Update Vintage Story OS version to ubuntu-24.04 * Corrected the operating system version for `Vintage Story` from `ubuntu-22.04` to `ubuntu-24.04`. * Ensures compatibility with the latest server requirements. * fix(sven): Update dependencies * fix(check_deps): Update support for Ubuntu and Debian versions * Adjusted version checks for supported distributions. * Added specific error messages for unsupported game titles based on OS version. --- lgsm/data/debian-10.csv | 2 +- lgsm/data/debian-11.csv | 2 +- lgsm/data/debian-9.csv | 2 +- lgsm/data/serverlist.csv | 4 ++-- lgsm/data/ubuntu-16.04.csv | 2 +- lgsm/data/ubuntu-18.04.csv | 2 +- lgsm/data/ubuntu-20.04.csv | 2 +- lgsm/data/ubuntu-22.04.csv | 2 +- lgsm/data/ubuntu-23.04.csv | 2 +- lgsm/data/ubuntu-23.10.csv | 2 +- lgsm/data/ubuntu-24.04.csv | 2 +- lgsm/modules/check_deps.sh | 20 +++++++++++++++++++- 12 files changed, 31 insertions(+), 13 deletions(-) diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 9082f1cc8..e0c6ea7e4 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -111,7 +111,7 @@ squad st,libxml2-utils steamcmd,lib32gcc1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 65bc39535..0d2652293 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -111,7 +111,7 @@ sol squad st,libxml2-utils stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 43fb4c5a2..a111c6800 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -111,7 +111,7 @@ sol squad st,libxml2-utils stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 3b8121a26..49d7b1d10 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -110,7 +110,7 @@ squad,squadserver,Squad,ubuntu-24.04 squad44,squad44server,Squad 44,ubuntu-24.04 st,stserver,Stationeers,ubuntu-24.04 stn,stnserver,Survive the Nights,ubuntu-24.04 -sven,svenserver,Sven Co-op,ubuntu-20.04 +sven,svenserver,Sven Co-op,ubuntu-24.04 terraria,terrariaserver,Terraria,ubuntu-24.04 tf,tfserver,The Front,ubuntu-24.04 tf2,tf2server,Team Fortress 2,ubuntu-24.04 @@ -126,7 +126,7 @@ ut2k4,ut2k4server,Unreal Tournament 2004,ubuntu-24.04 ut3,ut3server,Unreal Tournament 3,ubuntu-24.04 ut99,ut99server,Unreal Tournament 99,ubuntu-24.04 vh,vhserver,Valheim,ubuntu-24.04 -vints,vintsserver,Vintage Story,ubuntu-22.04 +vints,vintsserver,Vintage Story,ubuntu-24.04 vpmc,vpmcserver,Velocity Proxy MC,ubuntu-24.04 vs,vsserver,Vampire Slayer,ubuntu-24.04 wet,wetserver,Wolfenstein: Enemy Territory,ubuntu-24.04 diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index da755fc1f..844903c3a 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -111,7 +111,7 @@ sol squad st,libxml2-utils stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index b8d996023..b058c3024 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -111,7 +111,7 @@ sol squad st,libxml2-utils stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 18cb1c457..dc54ea10f 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -111,7 +111,7 @@ sol squad st,libxml2-utils stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 0d09631f0..46c036e1b 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -111,7 +111,7 @@ sol squad st,libxml2-utils stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/ubuntu-23.04.csv b/lgsm/data/ubuntu-23.04.csv index 1f1bf371c..ca84edf29 100644 --- a/lgsm/data/ubuntu-23.04.csv +++ b/lgsm/data/ubuntu-23.04.csv @@ -111,7 +111,7 @@ sol squad st,libxml2-utils stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/ubuntu-23.10.csv b/lgsm/data/ubuntu-23.10.csv index 1f1bf371c..ca84edf29 100644 --- a/lgsm/data/ubuntu-23.10.csv +++ b/lgsm/data/ubuntu-23.10.csv @@ -111,7 +111,7 @@ sol squad st,libxml2-utils stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index 1217ee49b..d130d68c4 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -111,7 +111,7 @@ sol squad st,libxml2-utils stn -sven,libssl1.1:i386,zlib1g:i386 +sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh index 5667876e5..edcdb6c7b 100644 --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -351,6 +351,8 @@ if [ "${commandname}" == "INSTALL" ]; then fi fi +info_distro.sh + # Will warn user if their distro is no longer supported by the vendor. if [ -n "${distrosupport}" ]; then if [ "${distrosupport}" == "unsupported" ]; then @@ -359,7 +361,23 @@ if [ -n "${distrosupport}" ]; then fi fi -info_distro.sh +# These titles are only supported up to Ubuntu 22.04 (Jammy) and Debian 12 (Bookworm). +if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" "gt" "22.04"; } || { [ "${distroidlike}" == "debian" ] && dpkg --compare-versions "${distroversion}" "gt" "12"; }; then + if [ "${shortname}" == "bf1942" ] || [ "${shortname}" == "bfv" ]; then + fn_print_failure_nl "${gamename} is not supported on ${distroname} (requires Ubuntu <= 22.04 or Debian <= 12)." + fn_script_log_fail "${gamename} is not supported on ${distroname}." + core_exit.sh + fi +fi + +# These titles are only supported up to Ubuntu 20.04 and Debian 11 (and Debian-like derivatives). +if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" "gt" "20.04"; } || { [ "${distroidlike}" == "debian" ] && dpkg --compare-versions "${distroversion}" "gt" "11"; }; then + if [ "${shortname}" == "onset" ] || [ "${shortname}" == "btl" ]; then + fn_print_failure_nl "${gamename} is not supported on ${distroname} (requires Ubuntu <= 20.04 or Debian <= 11)." + fn_script_log_fail "${gamename} is not supported on ${distroname}." + core_exit.sh + fi +fi if [ ! -f "${tmpdir}/dependency-no-check.tmp" ] && [ ! -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then # Check that the distro dependency csv file exists. From 3cefc9c0c4b6f6630ba12fb6f6ff9cef9a33e8a5 Mon Sep 17 00:00:00 2001 From: o1rik Date: Sun, 8 Feb 2026 22:52:58 +0100 Subject: [PATCH 095/132] fix(hz): HumanitZ 1.0 new binary path (#4873) --- lgsm/config-default/config-lgsm/hzserver/_default.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/hzserver/_default.cfg b/lgsm/config-default/config-lgsm/hzserver/_default.cfg index 61403a6d2..d2e63e692 100644 --- a/lgsm/config-default/config-lgsm/hzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hzserver/_default.cfg @@ -163,9 +163,9 @@ glibc="2.17" # Edit with care ## Game Server Directories -systemdir="${serverfiles}/TSSGame" +systemdir="${serverfiles}/HumanitZServer" executabledir="${systemdir}/Binaries/Linux" -executable="./TSSGameServer-Linux-Shipping" +executable="./HumanitZServer-Linux-Shipping" servercfgdir="${systemdir}" servercfg="GameServerSettings.ini" servercfgdefault="GameUserSettings.ini" From 30dcde03cc8dbbcfcc64e12369836de90dda885b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcell=20P=C3=BCnk=C3=B6sd?= Date: Thu, 12 Mar 2026 23:28:12 +0100 Subject: [PATCH 096/132] fix(scpsl): Add libicu76 as a dependency of scpsl (#4869) Co-authored-by: Daniel Gibbs --- lgsm/data/debian-13.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/data/debian-13.csv b/lgsm/data/debian-13.csv index 2ca56633f..e7a622a7e 100644 --- a/lgsm/data/debian-13.csv +++ b/lgsm/data/debian-13.csv @@ -100,7 +100,7 @@ rw,openjdk-25-jre samp sb sbots -scpsl,mono-complete +scpsl,mono-complete,libicu76 scpslsm,mono-complete sdtd,telnet,expect,libxml2-utils sf From e1cbee07a53a423b36ed1d3421bb5c6c883c5210 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 12 Mar 2026 22:30:36 +0000 Subject: [PATCH 097/132] chore: synced local '.github/' with remote 'general/.github/' (#4852) --- .github/workflows/action-prettier.yml | 2 +- .github/workflows/action-super-linter.yml | 6 ++++-- .../action-update-copyright-years-in-license-file.yml | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/action-prettier.yml b/.github/workflows/action-prettier.yml index a7e0a7172..f5d51a44a 100644 --- a/.github/workflows/action-prettier.yml +++ b/.github/workflows/action-prettier.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: persist-credentials: false diff --git a/.github/workflows/action-super-linter.yml b/.github/workflows/action-super-linter.yml index a2b12fca4..31b2fa949 100644 --- a/.github/workflows/action-super-linter.yml +++ b/.github/workflows/action-super-linter.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: # super-linter needs the full git history to get the # list of files that changed across commits @@ -41,11 +41,13 @@ jobs: env: # To report GitHub Actions status checks GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_BIOME_FORMAT: false + VALIDATE_BIOME_LINT: false VALIDATE_GITHUB_ACTIONS_ZIZMOR: false VALIDATE_JSCPD: false VALIDATE_JSON_PRETTIER: false VALIDATE_MARKDOWN_PRETTIER: false VALIDATE_NATURAL_LANGUAGE: false VALIDATE_SHELL_SHFMT: false - VALIDATE_TERRAFORM_TERRASCAN: false + VALIDATE_TRIVY: false VALIDATE_YAML_PRETTIER: false diff --git a/.github/workflows/action-update-copyright-years-in-license-file.yml b/.github/workflows/action-update-copyright-years-in-license-file.yml index 7ee528ca9..ab1549f0e 100644 --- a/.github/workflows/action-update-copyright-years-in-license-file.yml +++ b/.github/workflows/action-update-copyright-years-in-license-file.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 persist-credentials: false From fef128fb7d31f01a776ec60e17cb44e8de570563 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 12 Mar 2026 22:37:36 +0000 Subject: [PATCH 098/132] fix (alerts): Alerts on update uses the old game server version not the new one (#4854) * feat: refactor update comparison output for consistency and clarity - Replaced direct echo statements with fn_print functions for uniformity in output formatting across multiple update scripts. - Ensured lockfile creation uses the correct syntax for variable expansion. - Moved lock file to the same location to ensure monitor doesnt reboot at the wrong time - Updated remote build information display to enhance readability and maintain consistency in logging. - Removed unnecessary echo commands to streamline the output process. * Refactor remote build version handling across multiple modules - Updated variable names from 'remotebuildversion' to 'remotebuild' for consistency. - Adjusted logic to check for remote build availability using the new variable name. - Modified output messages to reflect the change in variable naming. - Ensured all modules (update_mc.sh, update_mcb.sh, update_mta.sh, update_pmc.sh, update_ts3.sh, update_ut99.sh, update_vints.sh, update_xnt.sh) are aligned with the new naming convention for better readability and maintainability. * fix(alert): resolve issue with servername not always being listed in title * Moved `info_distro.sh`, `info_game.sh`, and `info_messages.sh` calls to the top of the `fn_alert_log` function for better clarity. * Updated `alerticon` assignment to maintain consistency in alert information handling. * fix(alert_discord): remove "More info" field from Discord alert JSON * Eliminated the "More info" field to streamline the alert message. * This change enhances the clarity of the alert by focusing on essential information. * fix(alert): improve update alert messaging for clarity * Updated alert messages in `fn_alert_update` and `fn_alert_update_failed` for better readability. * Changed alert action from `update-request` to `update-restart-request` in `fn_monitor_check_update_source`. * remove inline * fix(alert): Correct grammar in update alert message * Changed "an LinuxGSM update" to "a LinuxGSM update" for grammatical accuracy. * typo * fix(alert_discord): Add inline property to "Is my Game Server Online?" field * Ensures proper formatting of the Discord alert message. * Improves the display of the server status information. * fix(pd): increase timeout for termbin.com connection * fix(alert_discord): reorder fields in Discord alert JSON * Changed the order of fields in the Discord alert JSON structure. * Updated the "More info" and "Is my Game Server Online?" fields for better clarity. * revert back to factorio.com Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Standardizes alert messages across platforms Ensures consistency in alert messages across Discord, NTFY, Pushover, Rocketchat, Slack, and Telegram. Updates Discord alerts to include server hostname and time, removes redundant formatting. Standardizes plain-text alert formatting for NTFY. Refactors Pushover messages to use consistent HTML formatting. Streamlines Rocketchat and Slack messages by removing duplicate server info and adding optional link support. * Removes Hostname from alert messages Removes the Hostname field from various alert messages (Discord, Gotify, IFTTT, ntfy, Pushbullet, Pushover, Rocketchat, Slack, Telegram). The hostname was deemed redundant or unnecessary in the context of these alerts. Relates to #4696 * Configures shellcheckrc filename Configures the Super-Linter action to use `.shellcheckrc` as the BASH_FILE_NAME. This ensures that shellcheck uses the correct configuration file for bash script linting. Fixes #4696 * Disables shellcheck errors and removes variable Disables specific shellcheck errors to allow certain coding patterns and removes an unused variable from the super-linter workflow. This improves the linter's signal-to-noise ratio and reduces unnecessary checks. Relates to #4696 * Fixes and improves server list validation scripts Addresses issues in the server list validation scripts: - Fixes potential issues with parsing curl custom arguments in telegram alerts. - Corrects the shortname array generation. - Implements more robust checks for validating game icons. - Ensures the consistency of server counts across different CSV files. * Fixes glibc check and mod selection logic Corrects glibc version comparison to properly handle version strings. Improves mod installation and removal by validating user input against available options, providing a more robust selection process. This prevents errors caused by invalid mod names and enhances the user experience. Updates arithmetic expression syntax for better compatibility. * Fixes cache control for dev-debug mode Updates the handling of cache control headers in dev-debug mode. The `nocache` variable is changed to an array to correctly pass multiple headers to `curl`. This resolves issues with cached versions of files being used when dev-debug is enabled, ensuring that the latest versions are always fetched. Fixes #4696 * Allows spaces in steamcmdcommand variable Parses steamcmdcommand as an array to allow spaces in the variable. This prevents issues when the user wants to pass arguments with spaces to the steamcmd executable. * Addresses various script improvements Addresses multiple improvements across various scripts: - Fixes Valheim unstripped_corlib override by commenting out the lines in the config files. - Improves process identification for source and goldsrc engines using `pgrep`. - Enhances backup file identification using `find` with `-maxdepth 1` and `-type f`. - Fixes glibc version comparison logic in multiple files. - Improves UT2K4 key installation script by using printf for writing the key to the file. - Corrects the mod info extraction logic to correctly identify mod entries. - Improves amxmodx file installation/removal logic to prevent duplicate entries. - Fixes server info retrieval to handle spaces in the server list. Relates to #4696 * Fixes mono repo install exit code check Corrects the mono repo install exit code check to use the dedicated monorepoexitcode variable, ensuring accurate error detection. Updates the exit trap to preserve the original exit status, preventing potential loss of information when handling script termination. * Refactors and reorders core modules Improves module loading by reordering and refactoring the core modules. This change addresses inconsistencies and improves the overall structure of how core modules are handled within the system. Some fix scripts were renamed to match the module name. * Makes scripts executable Changes file permissions to make shell scripts executable. This ensures that the scripts can be run directly. Addresses a pre-existing issue. Related to #4696 * Adds explicit permissions to workflows Specifies explicit permissions for GitHub Actions workflows to enhance security and control access to resources. This ensures that each workflow only has the necessary permissions, following the principle of least privilege. * Fixes output redirection and URL parsing Corrects output redirection in GitHub Actions workflows by enclosing the $GITHUB_OUTPUT variable in quotes, preventing potential issues with variable expansion. Ensures proper URL parsing in workflows by enclosing the URL within quotes, addressing potential parsing errors. Fixes #4696 * Applies code formatting for consistency Applies Prettier formatting to the codebase for improved readability and consistency. Addresses minor code style inconsistencies across several files. * Fixes minor formatting and logic issues Addresses various minor issues including: - Standardizes indentation in `.editorconfig` for different file types. - Simplifies Prettier configuration. - Updates image links in `README.md`. - Ensures newline character at end of `.csv` files. - Corrects a conditional statement in `command_fastdl.sh`. - Corrects a conditional statement in `info_messages.sh`. - Updates server query protocols in `query_gsquery.py`. * Configures and disables linters Adds YAML linting configuration and disables unnecessary linters to streamline the CI/CD process and reduce noise from irrelevant checks. * Improves documentation and linting Updates documentation links to be enclosed in angle brackets, preventing markdown rendering issues. Configures markdownlint to align with repository standards and avoid common false positives. The updated links in the documentation ensure they are correctly interpreted by markdown parsers, improving user experience. The markdownlint configuration fine-tunes linting rules to better match the project's existing style and conventions, reducing noise from irrelevant warnings. * Fixes typos and improves code consistency Addresses various typos and inconsistencies across multiple files, enhancing code readability and maintainability. Adds codespell and flake8 configurations for linting. Relates to #4696 * Excludes workflow files from Prettier formatting Prevents Prettier from formatting workflow files due to GitHub token restrictions, as the token used by the Prettier auto-commit action lacks permissions to update files within the `.github/workflows/` directory. * chore(prettier): format code * Updates Super-Linter configuration Improves Super-Linter's reliability by switching to linting the entire codebase instead of relying on git history. This change also addresses potential transient fetch failures from GitHub. Additionally, this commit expands the ignored paths in codespell and disables some linters to improve performance and reduce false positives. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: dgibbs64 --- .devcontainer/devcontainer.json | 56 ++--- .editorconfig | 17 +- .github/linters/.codespellrc | 11 + .github/linters/.flake8 | 2 + .github/linters/.markdown-lint.yml | 23 ++ .github/linters/.shellcheckrc | 1 + .github/linters/.yaml-lint.yml | 25 +++ .github/pull_request_template.md | 30 +-- .github/workflows/action-super-linter.yml | 8 +- .github/workflows/add-to-project.yml | 2 + .../details-check-generate-matrix.sh | 10 +- .github/workflows/details-check.yml | 7 +- .github/workflows/git-sync.yml | 2 + .github/workflows/potential-duplicates.yml | 4 + .../serverlist-validate-game-icons.sh | 12 +- .github/workflows/serverlist-validate.sh | 9 +- .github/workflows/serverlist-validate.yml | 3 + .github/workflows/trigger-docker-build.yml | 2 + .github/workflows/update-check.yml | 4 +- ...update-copyright-years-in-license-file.yml | 4 + .github/workflows/version-check.sh | 0 .prettierignore | 3 + .prettierrc | 2 +- .prettierrc.json | 2 +- .shellcheckrc | 2 +- .vscode/extensions.json | 20 +- CODE_OF_CONDUCT.md | 30 +-- CONTRIBUTING.md | 133 ++++++----- README.md | 32 +-- .../config-lgsm/armarserver/_default.cfg | 2 +- .../config-lgsm/necserver/_default.cfg | 2 +- .../config-lgsm/ns2cserver/_default.cfg | 2 +- .../config-lgsm/ns2server/_default.cfg | 2 +- .../config-lgsm/pwserver/_default.cfg | 2 +- lgsm/data/name-left.csv | 2 +- lgsm/data/name-right.csv | 2 +- lgsm/modules/README.md | 18 +- lgsm/modules/alert.sh | 61 ++++-- lgsm/modules/alert_discord.sh | 21 +- lgsm/modules/alert_email.sh | 0 lgsm/modules/alert_gotify.sh | 2 +- lgsm/modules/alert_ifttt.sh | 2 +- lgsm/modules/alert_ntfy.sh | 26 ++- lgsm/modules/alert_pushbullet.sh | 2 +- lgsm/modules/alert_pushover.sh | 4 +- lgsm/modules/alert_rocketchat.sh | 66 +----- lgsm/modules/alert_slack.sh | 96 +------- lgsm/modules/alert_telegram.sh | 10 +- lgsm/modules/check.sh | 0 lgsm/modules/check_config.sh | 0 lgsm/modules/check_deps.sh | 6 +- lgsm/modules/check_executable.sh | 0 lgsm/modules/check_gamedig.sh | 0 lgsm/modules/check_glibc.sh | 2 +- lgsm/modules/check_ip.sh | 0 lgsm/modules/check_last_update.sh | 1 + lgsm/modules/check_logs.sh | 0 lgsm/modules/check_permissions.sh | 2 +- lgsm/modules/check_root.sh | 0 lgsm/modules/check_status.sh | 0 lgsm/modules/check_steamcmd.sh | 0 lgsm/modules/check_system_dir.sh | 0 lgsm/modules/check_system_requirements.sh | 2 +- lgsm/modules/check_tmuxception.sh | 0 lgsm/modules/check_version.sh | 0 lgsm/modules/command_backup.sh | 0 lgsm/modules/command_check_update.sh | 0 lgsm/modules/command_console.sh | 0 lgsm/modules/command_debug.sh | 2 +- lgsm/modules/command_details.sh | 2 +- lgsm/modules/command_dev_clear_modules.sh | 0 lgsm/modules/command_dev_debug.sh | 0 lgsm/modules/command_dev_detect_deps.sh | 0 lgsm/modules/command_dev_detect_glibc.sh | 2 +- lgsm/modules/command_dev_detect_ldd.sh | 0 .../command_dev_parse_distro_details.sh | 0 .../modules/command_dev_parse_game_details.sh | 0 lgsm/modules/command_dev_query_raw.sh | 8 +- lgsm/modules/command_dev_ui.sh | 0 lgsm/modules/command_fastdl.sh | 2 +- lgsm/modules/command_install.sh | 0 lgsm/modules/command_install_resources_mta.sh | 0 lgsm/modules/command_mods_install.sh | 23 +- lgsm/modules/command_mods_remove.sh | 21 +- lgsm/modules/command_mods_update.sh | 0 lgsm/modules/command_monitor.sh | 4 +- lgsm/modules/command_postdetails.sh | 4 +- lgsm/modules/command_restart.sh | 0 lgsm/modules/command_send.sh | 0 lgsm/modules/command_skeleton.sh | 4 +- lgsm/modules/command_start.sh | 0 lgsm/modules/command_stop.sh | 4 +- lgsm/modules/command_test_alert.sh | 0 lgsm/modules/command_ts3_server_pass.sh | 0 lgsm/modules/command_update.sh | 0 lgsm/modules/command_update_linuxgsm.sh | 39 ++-- lgsm/modules/command_validate.sh | 0 lgsm/modules/command_wipe.sh | 0 lgsm/modules/compress_unreal_maps.sh | 0 lgsm/modules/core_dl.sh | 38 ++-- lgsm/modules/core_exit.sh | 0 lgsm/modules/core_getopt.sh | 0 lgsm/modules/core_github.sh | 0 lgsm/modules/core_legacy.sh | 2 +- lgsm/modules/core_logs.sh | 0 lgsm/modules/core_messages.sh | 2 +- lgsm/modules/core_modules.sh | 206 +++++++++--------- lgsm/modules/core_steamcmd.sh | 22 +- lgsm/modules/core_trap.sh | 6 +- lgsm/modules/fix.sh | 0 lgsm/modules/fix_ark.sh | 4 +- lgsm/modules/fix_arma3.sh | 0 lgsm/modules/fix_av.sh | 0 lgsm/modules/fix_bo.sh | 0 lgsm/modules/fix_cmw.sh | 0 lgsm/modules/fix_csgo.sh | 0 lgsm/modules/fix_dst.sh | 2 +- lgsm/modules/fix_hw.sh | 0 lgsm/modules/fix_ins.sh | 0 lgsm/modules/fix_kf.sh | 0 lgsm/modules/fix_kf2.sh | 0 lgsm/modules/fix_mcb.sh | 0 lgsm/modules/fix_mta.sh | 0 lgsm/modules/fix_nmrih.sh | 0 lgsm/modules/fix_onset.sh | 2 +- lgsm/modules/fix_pvr.sh | 0 lgsm/modules/fix_ro.sh | 0 lgsm/modules/fix_rust.sh | 2 +- lgsm/modules/fix_rw.sh | 0 lgsm/modules/fix_samp.sh | 0 lgsm/modules/fix_sdtd.sh | 0 lgsm/modules/fix_sfc.sh | 0 lgsm/modules/fix_sm.sh | 0 lgsm/modules/fix_sof2.sh | 2 +- lgsm/modules/fix_squad.sh | 0 lgsm/modules/fix_st.sh | 2 +- lgsm/modules/fix_steamcmd.sh | 0 lgsm/modules/fix_terraria.sh | 0 lgsm/modules/fix_tf2.sh | 0 lgsm/modules/fix_ts3.sh | 0 lgsm/modules/fix_unt.sh | 2 +- lgsm/modules/fix_ut.sh | 0 lgsm/modules/fix_ut2k4.sh | 0 lgsm/modules/fix_ut3.sh | 0 lgsm/modules/fix_vh.sh | 6 +- lgsm/modules/fix_wurm.sh | 0 lgsm/modules/fix_xnt.sh | 0 lgsm/modules/fix_zmr.sh | 0 lgsm/modules/info_distro.sh | 14 +- lgsm/modules/info_game.sh | 6 +- lgsm/modules/info_messages.sh | 6 +- lgsm/modules/info_stats.sh | 0 lgsm/modules/install_complete.sh | 0 lgsm/modules/install_config.sh | 4 +- lgsm/modules/install_dst_token.sh | 0 lgsm/modules/install_eula.sh | 0 lgsm/modules/install_factorio_save.sh | 0 lgsm/modules/install_gslt.sh | 0 lgsm/modules/install_header.sh | 0 lgsm/modules/install_logs.sh | 0 lgsm/modules/install_mta_resources.sh | 0 lgsm/modules/install_retry.sh | 0 lgsm/modules/install_server_dir.sh | 0 lgsm/modules/install_server_files.sh | 0 lgsm/modules/install_squad_license.sh | 0 lgsm/modules/install_stats.sh | 0 lgsm/modules/install_steamcmd.sh | 0 lgsm/modules/install_ts3db.sh | 0 lgsm/modules/install_ut2k4_key.sh | 2 +- lgsm/modules/mods_core.sh | 33 ++- lgsm/modules/mods_list.sh | 6 +- lgsm/modules/query_gamedig.sh | 2 +- lgsm/modules/query_gsquery.py | 184 ++++++++++------ lgsm/modules/update_fctr.sh | 100 +++++---- lgsm/modules/update_jk2.sh | 68 +++--- lgsm/modules/update_mc.sh | 76 +++---- lgsm/modules/update_mcb.sh | 76 +++---- lgsm/modules/update_mta.sh | 68 +++--- lgsm/modules/update_pmc.sh | 70 +++--- lgsm/modules/update_steamcmd.sh | 0 lgsm/modules/update_ts3.sh | 68 +++--- lgsm/modules/update_ut99.sh | 70 +++--- lgsm/modules/update_vints.sh | 73 +++---- lgsm/modules/update_xnt.sh | 69 +++--- linuxgsm.sh | 3 +- package.json | 50 ++--- 186 files changed, 1155 insertions(+), 1097 deletions(-) create mode 100644 .github/linters/.codespellrc create mode 100644 .github/linters/.flake8 create mode 100644 .github/linters/.markdown-lint.yml create mode 100644 .github/linters/.shellcheckrc create mode 100644 .github/linters/.yaml-lint.yml mode change 100644 => 100755 .github/workflows/version-check.sh create mode 100644 .prettierignore mode change 100644 => 100755 lgsm/modules/alert.sh mode change 100644 => 100755 lgsm/modules/alert_discord.sh mode change 100644 => 100755 lgsm/modules/alert_email.sh mode change 100644 => 100755 lgsm/modules/alert_gotify.sh mode change 100644 => 100755 lgsm/modules/alert_ifttt.sh mode change 100644 => 100755 lgsm/modules/alert_ntfy.sh mode change 100644 => 100755 lgsm/modules/alert_pushbullet.sh mode change 100644 => 100755 lgsm/modules/alert_pushover.sh mode change 100644 => 100755 lgsm/modules/alert_rocketchat.sh mode change 100644 => 100755 lgsm/modules/alert_slack.sh mode change 100644 => 100755 lgsm/modules/alert_telegram.sh mode change 100644 => 100755 lgsm/modules/check.sh mode change 100644 => 100755 lgsm/modules/check_config.sh mode change 100644 => 100755 lgsm/modules/check_deps.sh mode change 100644 => 100755 lgsm/modules/check_executable.sh mode change 100644 => 100755 lgsm/modules/check_gamedig.sh mode change 100644 => 100755 lgsm/modules/check_glibc.sh mode change 100644 => 100755 lgsm/modules/check_ip.sh mode change 100644 => 100755 lgsm/modules/check_last_update.sh mode change 100644 => 100755 lgsm/modules/check_logs.sh mode change 100644 => 100755 lgsm/modules/check_permissions.sh mode change 100644 => 100755 lgsm/modules/check_root.sh mode change 100644 => 100755 lgsm/modules/check_status.sh mode change 100644 => 100755 lgsm/modules/check_steamcmd.sh mode change 100644 => 100755 lgsm/modules/check_system_dir.sh mode change 100644 => 100755 lgsm/modules/check_system_requirements.sh mode change 100644 => 100755 lgsm/modules/check_tmuxception.sh mode change 100644 => 100755 lgsm/modules/check_version.sh mode change 100644 => 100755 lgsm/modules/command_backup.sh mode change 100644 => 100755 lgsm/modules/command_check_update.sh mode change 100644 => 100755 lgsm/modules/command_console.sh mode change 100644 => 100755 lgsm/modules/command_debug.sh mode change 100644 => 100755 lgsm/modules/command_details.sh mode change 100644 => 100755 lgsm/modules/command_dev_clear_modules.sh mode change 100644 => 100755 lgsm/modules/command_dev_debug.sh mode change 100644 => 100755 lgsm/modules/command_dev_detect_deps.sh mode change 100644 => 100755 lgsm/modules/command_dev_detect_glibc.sh mode change 100644 => 100755 lgsm/modules/command_dev_detect_ldd.sh mode change 100644 => 100755 lgsm/modules/command_dev_parse_distro_details.sh mode change 100644 => 100755 lgsm/modules/command_dev_parse_game_details.sh mode change 100644 => 100755 lgsm/modules/command_dev_query_raw.sh mode change 100644 => 100755 lgsm/modules/command_dev_ui.sh mode change 100644 => 100755 lgsm/modules/command_fastdl.sh mode change 100644 => 100755 lgsm/modules/command_install.sh mode change 100644 => 100755 lgsm/modules/command_install_resources_mta.sh mode change 100644 => 100755 lgsm/modules/command_mods_install.sh mode change 100644 => 100755 lgsm/modules/command_mods_remove.sh mode change 100644 => 100755 lgsm/modules/command_mods_update.sh mode change 100644 => 100755 lgsm/modules/command_monitor.sh mode change 100644 => 100755 lgsm/modules/command_postdetails.sh mode change 100644 => 100755 lgsm/modules/command_restart.sh mode change 100644 => 100755 lgsm/modules/command_send.sh mode change 100644 => 100755 lgsm/modules/command_skeleton.sh mode change 100644 => 100755 lgsm/modules/command_start.sh mode change 100644 => 100755 lgsm/modules/command_stop.sh mode change 100644 => 100755 lgsm/modules/command_test_alert.sh mode change 100644 => 100755 lgsm/modules/command_ts3_server_pass.sh mode change 100644 => 100755 lgsm/modules/command_update.sh mode change 100644 => 100755 lgsm/modules/command_update_linuxgsm.sh mode change 100644 => 100755 lgsm/modules/command_validate.sh mode change 100644 => 100755 lgsm/modules/command_wipe.sh mode change 100644 => 100755 lgsm/modules/compress_unreal_maps.sh mode change 100644 => 100755 lgsm/modules/core_dl.sh mode change 100644 => 100755 lgsm/modules/core_exit.sh mode change 100644 => 100755 lgsm/modules/core_getopt.sh mode change 100644 => 100755 lgsm/modules/core_github.sh mode change 100644 => 100755 lgsm/modules/core_legacy.sh mode change 100644 => 100755 lgsm/modules/core_logs.sh mode change 100644 => 100755 lgsm/modules/core_messages.sh mode change 100644 => 100755 lgsm/modules/core_modules.sh mode change 100644 => 100755 lgsm/modules/core_steamcmd.sh mode change 100644 => 100755 lgsm/modules/core_trap.sh mode change 100644 => 100755 lgsm/modules/fix.sh mode change 100644 => 100755 lgsm/modules/fix_ark.sh mode change 100644 => 100755 lgsm/modules/fix_arma3.sh mode change 100644 => 100755 lgsm/modules/fix_av.sh mode change 100644 => 100755 lgsm/modules/fix_bo.sh mode change 100644 => 100755 lgsm/modules/fix_cmw.sh mode change 100644 => 100755 lgsm/modules/fix_csgo.sh mode change 100644 => 100755 lgsm/modules/fix_dst.sh mode change 100644 => 100755 lgsm/modules/fix_hw.sh mode change 100644 => 100755 lgsm/modules/fix_ins.sh mode change 100644 => 100755 lgsm/modules/fix_kf.sh mode change 100644 => 100755 lgsm/modules/fix_kf2.sh mode change 100644 => 100755 lgsm/modules/fix_mcb.sh mode change 100644 => 100755 lgsm/modules/fix_mta.sh mode change 100644 => 100755 lgsm/modules/fix_nmrih.sh mode change 100644 => 100755 lgsm/modules/fix_onset.sh mode change 100644 => 100755 lgsm/modules/fix_pvr.sh mode change 100644 => 100755 lgsm/modules/fix_ro.sh mode change 100644 => 100755 lgsm/modules/fix_rust.sh mode change 100644 => 100755 lgsm/modules/fix_rw.sh mode change 100644 => 100755 lgsm/modules/fix_samp.sh mode change 100644 => 100755 lgsm/modules/fix_sdtd.sh mode change 100644 => 100755 lgsm/modules/fix_sfc.sh mode change 100644 => 100755 lgsm/modules/fix_sm.sh mode change 100644 => 100755 lgsm/modules/fix_sof2.sh mode change 100644 => 100755 lgsm/modules/fix_squad.sh mode change 100644 => 100755 lgsm/modules/fix_st.sh mode change 100644 => 100755 lgsm/modules/fix_steamcmd.sh mode change 100644 => 100755 lgsm/modules/fix_terraria.sh mode change 100644 => 100755 lgsm/modules/fix_tf2.sh mode change 100644 => 100755 lgsm/modules/fix_ts3.sh mode change 100644 => 100755 lgsm/modules/fix_unt.sh mode change 100644 => 100755 lgsm/modules/fix_ut.sh mode change 100644 => 100755 lgsm/modules/fix_ut2k4.sh mode change 100644 => 100755 lgsm/modules/fix_ut3.sh mode change 100644 => 100755 lgsm/modules/fix_vh.sh mode change 100644 => 100755 lgsm/modules/fix_wurm.sh mode change 100644 => 100755 lgsm/modules/fix_xnt.sh mode change 100644 => 100755 lgsm/modules/fix_zmr.sh mode change 100644 => 100755 lgsm/modules/info_distro.sh mode change 100644 => 100755 lgsm/modules/info_game.sh mode change 100644 => 100755 lgsm/modules/info_messages.sh mode change 100644 => 100755 lgsm/modules/info_stats.sh mode change 100644 => 100755 lgsm/modules/install_complete.sh mode change 100644 => 100755 lgsm/modules/install_config.sh mode change 100644 => 100755 lgsm/modules/install_dst_token.sh mode change 100644 => 100755 lgsm/modules/install_eula.sh mode change 100644 => 100755 lgsm/modules/install_factorio_save.sh mode change 100644 => 100755 lgsm/modules/install_gslt.sh mode change 100644 => 100755 lgsm/modules/install_header.sh mode change 100644 => 100755 lgsm/modules/install_logs.sh mode change 100644 => 100755 lgsm/modules/install_mta_resources.sh mode change 100644 => 100755 lgsm/modules/install_retry.sh mode change 100644 => 100755 lgsm/modules/install_server_dir.sh mode change 100644 => 100755 lgsm/modules/install_server_files.sh mode change 100644 => 100755 lgsm/modules/install_squad_license.sh mode change 100644 => 100755 lgsm/modules/install_stats.sh mode change 100644 => 100755 lgsm/modules/install_steamcmd.sh mode change 100644 => 100755 lgsm/modules/install_ts3db.sh mode change 100644 => 100755 lgsm/modules/install_ut2k4_key.sh mode change 100644 => 100755 lgsm/modules/mods_core.sh mode change 100644 => 100755 lgsm/modules/mods_list.sh mode change 100644 => 100755 lgsm/modules/query_gamedig.sh mode change 100644 => 100755 lgsm/modules/update_fctr.sh mode change 100644 => 100755 lgsm/modules/update_jk2.sh mode change 100644 => 100755 lgsm/modules/update_mc.sh mode change 100644 => 100755 lgsm/modules/update_mcb.sh mode change 100644 => 100755 lgsm/modules/update_mta.sh mode change 100644 => 100755 lgsm/modules/update_pmc.sh mode change 100644 => 100755 lgsm/modules/update_steamcmd.sh mode change 100644 => 100755 lgsm/modules/update_ts3.sh mode change 100644 => 100755 lgsm/modules/update_ut99.sh mode change 100644 => 100755 lgsm/modules/update_vints.sh mode change 100644 => 100755 lgsm/modules/update_xnt.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 506b50754..32c844ac7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,30 +1,30 @@ { - "name": "BASH Dev Container", - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", - "features": { - "ghcr.io/devcontainers-community/npm-features/prettier:1": { - "plugins": "prettier-plugin-sh" - }, - "ghcr.io/devcontainers-extra/features/actionlint:1": {}, - "ghcr.io/devcontainers-extra/features/checkov:1": {}, - "ghcr.io/devcontainers-extra/features/markdownlint-cli:1": {}, - "ghcr.io/devcontainers-extra/features/shellcheck:1": {}, - "ghcr.io/devcontainers-extra/features/yamllint:2": {}, - "ghcr.io/devcontainers/features/github-cli:1": {} - }, - "customizations": { - "vscode": { - "extensions": [ - "DavidAnson.vscode-markdownlint", - "editorconfig.editorconfig", - "esbenp.prettier-vscode", - "github.vscode-github-actions", - "GitHub.vscode-pull-request-github", - "redhat.vscode-yaml", - "timonwong.shellcheck", - "yzhang.markdown-all-in-one" - ] - } - }, - "postCreateCommand": "npm init -y >/dev/null 2>&1 || true && npm install --no-save prettier prettier-plugin-sh prettier-plugin-jinja-template" + "name": "BASH Dev Container", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "ghcr.io/devcontainers-community/npm-features/prettier:1": { + "plugins": "prettier-plugin-sh" + }, + "ghcr.io/devcontainers-extra/features/actionlint:1": {}, + "ghcr.io/devcontainers-extra/features/checkov:1": {}, + "ghcr.io/devcontainers-extra/features/markdownlint-cli:1": {}, + "ghcr.io/devcontainers-extra/features/shellcheck:1": {}, + "ghcr.io/devcontainers-extra/features/yamllint:2": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} + }, + "customizations": { + "vscode": { + "extensions": [ + "DavidAnson.vscode-markdownlint", + "editorconfig.editorconfig", + "esbenp.prettier-vscode", + "github.vscode-github-actions", + "GitHub.vscode-pull-request-github", + "redhat.vscode-yaml", + "timonwong.shellcheck", + "yzhang.markdown-all-in-one" + ] + } + }, + "postCreateCommand": "npm init -y >/dev/null 2>&1 || true && npm install --no-save prettier prettier-plugin-sh prettier-plugin-jinja-template" } diff --git a/.editorconfig b/.editorconfig index da6e5f2ca..f816affbe 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,6 +12,21 @@ insert_final_newline = true trim_trailing_whitespace = true # BASH Files -[*.{.sh}] +[*.sh] indent_size = 4 indent_style = tab + +# JSON Files (Biome formatting) +[*.json] +indent_style = tab +indent_size = 2 + +# Steam appmanifest files (Valve ACF format) +[*.acf] +indent_style = tab +indent_size = 4 + +# Python +[*.py] +indent_style = space +indent_size = 4 diff --git a/.github/linters/.codespellrc b/.github/linters/.codespellrc new file mode 100644 index 000000000..229066881 --- /dev/null +++ b/.github/linters/.codespellrc @@ -0,0 +1,11 @@ +[codespell] +# Skip data tables that contain many short server identifiers (e.g. "fof", "nd") +skip = + lgsm/data/*.csv, + package-lock.json, + */package-lock.json, + node_modules, + */node_modules/* + +# Ignore common identifiers/acronyms and extensions used throughout LinuxGSM +ignore-words-list = distroname,fof,nd,sav,parms,ThirdParty diff --git a/.github/linters/.flake8 b/.github/linters/.flake8 new file mode 100644 index 000000000..6deafc261 --- /dev/null +++ b/.github/linters/.flake8 @@ -0,0 +1,2 @@ +[flake8] +max-line-length = 120 diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml new file mode 100644 index 000000000..094bbbcd6 --- /dev/null +++ b/.github/linters/.markdown-lint.yml @@ -0,0 +1,23 @@ +# Configuration for markdownlint (used by Super Linter) + +# MD041: README starts with HTML badges in this repo. +MD041: false + +# MD051: GitHub heading anchor generation can differ (emoji, punctuation). +MD051: false + +# MD013: The project documentation frequently contains long URLs/commands. +MD013: false + +# MD033: The main README uses inline HTML for badges. +MD033: false + +# Match existing list formatting in this repo. +MD007: + indent: 4 + +MD030: + ul_single: 3 + ol_single: 2 + ul_multi: 3 + ol_multi: 2 diff --git a/.github/linters/.shellcheckrc b/.github/linters/.shellcheckrc new file mode 100644 index 000000000..d16f69e0b --- /dev/null +++ b/.github/linters/.shellcheckrc @@ -0,0 +1 @@ +disable=SC2154,SC2034 diff --git a/.github/linters/.yaml-lint.yml b/.github/linters/.yaml-lint.yml new file mode 100644 index 000000000..c42932a49 --- /dev/null +++ b/.github/linters/.yaml-lint.yml @@ -0,0 +1,25 @@ +extends: default + +rules: + document-start: disable + truthy: disable + + line-length: + max: 200 + level: warning + allow-non-breakable-words: true + allow-non-breakable-inline-mappings: true + + braces: + min-spaces-inside: 0 + max-spaces-inside: 1 + min-spaces-inside-empty: 0 + max-spaces-inside-empty: 0 + + empty-lines: + max: 2 + max-start: 0 + max-end: 0 + + comments: + min-spaces-from-content: 1 diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 4e6d08327..9f6864e57 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,30 +6,30 @@ Fixes #[issue] ## Type of change -- [ ] Bug fix (a change which fixes an issue). -- [ ] New feature (a change which adds functionality). -- [ ] New Server (new server added). -- [ ] Refactor (restructures existing code). -- [ ] Comment update (typo, spelling, explanation, examples, etc). +- [ ] Bug fix (a change which fixes an issue). +- [ ] New feature (a change which adds functionality). +- [ ] New Server (new server added). +- [ ] Refactor (restructures existing code). +- [ ] Comment update (typo, spelling, explanation, examples, etc). ## Checklist PR will not be merged until all steps are complete. -- [ ] This pull request links to an issue. -- [ ] This pull request uses the `develop` branch as its base. -- [ ] This pull request subject follows the Conventional Commits standard. -- [ ] This code follows the style guidelines of this project. -- [ ] I have performed a self-review of my code. -- [ ] I have checked that this code is commented where required. -- [ ] I have provided a detailed enough description of this PR. -- [ ] I have checked if documentation needs updating. +- [ ] This pull request links to an issue. +- [ ] This pull request uses the `develop` branch as its base. +- [ ] This pull request subject follows the Conventional Commits standard. +- [ ] This code follows the style guidelines of this project. +- [ ] I have performed a self-review of my code. +- [ ] I have checked that this code is commented where required. +- [ ] I have provided a detailed enough description of this PR. +- [ ] I have checked if documentation needs updating. ## Documentation If documentation does need updating either update it by creating a PR (preferred) or request a documentation update. -- User docs: https://github.com/GameServerManagers/LinuxGSM-Docs -- Dev docs: https://github.com/GameServerManagers/LinuxGSM-Dev-Docs +- User docs: +- Dev docs: **Thank you for your Pull Request!** diff --git a/.github/workflows/action-super-linter.yml b/.github/workflows/action-super-linter.yml index 31b2fa949..de396dcd4 100644 --- a/.github/workflows/action-super-linter.yml +++ b/.github/workflows/action-super-linter.yml @@ -27,9 +27,10 @@ jobs: - name: Checkout code uses: actions/checkout@v6 with: - # super-linter needs the full git history to get the - # list of files that changed across commits - fetch-depth: 0 + # Shallow clone reduces transient fetch failures (HTTP 500) from GitHub. + # We lint the whole codebase instead of relying on git history. + fetch-depth: 1 + fetch-tags: false persist-credentials: false - name: Install Prettier plugins (for summary formatting) @@ -48,6 +49,7 @@ jobs: VALIDATE_JSON_PRETTIER: false VALIDATE_MARKDOWN_PRETTIER: false VALIDATE_NATURAL_LANGUAGE: false + VALIDATE_PYTHON_RUFF_FORMAT: false VALIDATE_SHELL_SHFMT: false VALIDATE_TRIVY: false VALIDATE_YAML_PRETTIER: false diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml index e0b06990f..e96336264 100644 --- a/.github/workflows/add-to-project.yml +++ b/.github/workflows/add-to-project.yml @@ -5,6 +5,8 @@ on: - opened - labeled +permissions: {} + jobs: add-to-project: if: github.repository_owner == 'GameServerManagers' diff --git a/.github/workflows/details-check-generate-matrix.sh b/.github/workflows/details-check-generate-matrix.sh index bba9e8d5d..2c0803519 100755 --- a/.github/workflows/details-check-generate-matrix.sh +++ b/.github/workflows/details-check-generate-matrix.sh @@ -14,10 +14,12 @@ while read -r line; do export gamename distro=$(echo "$line" | awk -F, '{ print $4 }') export distro - echo -n "{" >> "shortnamearray.json" - echo -n "\"shortname\":" >> "shortnamearray.json" - echo -n "\"${shortname}\"" >> "shortnamearray.json" - echo -n "}," >> "shortnamearray.json" + { + echo -n "{"; + echo -n "\"shortname\":"; + echo -n "\"${shortname}\""; + echo -n "},"; + } >> "shortnamearray.json" done < <(tail -n +2 serverlist.csv) sed -i '$ s/.$//' "shortnamearray.json" echo -n "]" >> "shortnamearray.json" diff --git a/.github/workflows/details-check.yml b/.github/workflows/details-check.yml index f52d12c5a..c58aa0ae4 100644 --- a/.github/workflows/details-check.yml +++ b/.github/workflows/details-check.yml @@ -6,6 +6,9 @@ on: branches: - develop +permissions: + contents: read + concurrency: group: details-check-${{ github.ref_name }} cancel-in-progress: true @@ -28,7 +31,7 @@ jobs: run: | shortnamearray=$(cat shortnamearray.json) echo "${shortnamearray}" - echo -n "matrix=${shortnamearray}" >> $GITHUB_OUTPUT + echo -n "matrix=${shortnamearray}" >> "$GITHUB_OUTPUT" details-check: if: github.repository_owner == 'GameServerManagers' @@ -41,7 +44,7 @@ jobs: steps: - name: Download linuxgsm.sh - run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh + run: wget "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh"; chmod +x linuxgsm.sh - name: Install dependencies run: sudo apt-get install libxml2-utils jq diff --git a/.github/workflows/git-sync.yml b/.github/workflows/git-sync.yml index 544ba6892..42c660d9b 100644 --- a/.github/workflows/git-sync.yml +++ b/.github/workflows/git-sync.yml @@ -7,6 +7,8 @@ on: - master - develop +permissions: {} + jobs: gitHub-to-bitbucket: if: github.repository_owner == 'GameServerManagers' diff --git a/.github/workflows/potential-duplicates.yml b/.github/workflows/potential-duplicates.yml index ea0ba23fd..39a3189d8 100644 --- a/.github/workflows/potential-duplicates.yml +++ b/.github/workflows/potential-duplicates.yml @@ -3,6 +3,10 @@ on: issues: types: - opened + +permissions: + issues: write + jobs: potential-duplicates: if: github.repository_owner == 'GameServerManagers' diff --git a/.github/workflows/serverlist-validate-game-icons.sh b/.github/workflows/serverlist-validate-game-icons.sh index 2fdb0ff8f..b3ba7e418 100755 --- a/.github/workflows/serverlist-validate-game-icons.sh +++ b/.github/workflows/serverlist-validate-game-icons.sh @@ -2,6 +2,8 @@ cd "${datadir}" || exit +exitcode=0 + echo "" echo "Checking that all the game servers listed in serverlist.csv have a shortname-icon.png file" for shortname in $(tail -n +2 serverlist.csv | cut -d ',' -f1); do @@ -16,9 +18,11 @@ done echo "" echo "Checking if an unexpected gameicon exists" -for gameicon in $(ls -1 gameicons); do +shopt -s nullglob +for gameiconpath in gameicons/*; do + gameicon="$(basename "${gameiconpath}")" # check if $gameicon is in serverlist.csv - if ! grep -q "${gameicon%-icon.png}" serverlist.csv; then + if ! grep -q -F "${gameicon%-icon.png}" serverlist.csv; then echo "ERROR: gameicon ${gameicon} is not in serverlist.csv" exitcode=1 else @@ -28,7 +32,7 @@ done echo "" echo "Checking that the number of gameicons matches the number of servers in serverlist.csv" -gameiconcount="$(ls -1 gameicons | wc -l)" +gameiconcount="$(find gameicons -mindepth 1 -maxdepth 1 -type f | wc -l)" serverlistcount="$(tail -n +2 serverlist.csv | wc -l)" if [ "${gameiconcount}" -ne "${serverlistcount}" ]; then echo "ERROR: game icons (${gameiconcount}) does not match serverlist.csv ($serverlistcount)" @@ -37,4 +41,4 @@ else echo "OK: gameiconcount ($gameiconcount) matches serverlistcount ($serverlistcount)" fi -exit ${exitcode} +exit "${exitcode}" diff --git a/.github/workflows/serverlist-validate.sh b/.github/workflows/serverlist-validate.sh index 7d931372d..3d83d89da 100755 --- a/.github/workflows/serverlist-validate.sh +++ b/.github/workflows/serverlist-validate.sh @@ -3,12 +3,15 @@ echo "Checking that all the game servers are listed in all csv files" echo "this check will ensure serverlist.csv has the same number of lines (-2 lines) as the other csv files" # count the number of lines in the serverlist.csv cd "${datadir}" || exit + +exitcode=0 serverlistcount="$(tail -n +2 serverlist.csv | wc -l)" echo "serverlistcount: $serverlistcount" # get list of all csv files starting with ubunutu debian centos -csvlist="$(ls -1 | grep -E '^(ubuntu|debian|centos|rhel|almalinux|rocky).*\.csv$')" +shopt -s nullglob +csvlist=(ubuntu*.csv debian*.csv centos*.csv rhel*.csv almalinux*.csv rocky*.csv) # loop though each csv file and make sure the number of lines is the same as the serverlistcount -for csv in $csvlist; do +for csv in "${csvlist[@]}"; do csvcount="$(wc -l < "${csv}")" csvcount=$((csvcount - 2)) if [ "$csvcount" -ne "$serverlistcount" ]; then @@ -35,4 +38,4 @@ for shortname in $(tail -n +2 serverlist.csv | cut -d ',' -f1); do fi done -exit ${exitcode} +exit "${exitcode}" diff --git a/.github/workflows/serverlist-validate.yml b/.github/workflows/serverlist-validate.yml index f4a95a039..c2605b062 100644 --- a/.github/workflows/serverlist-validate.yml +++ b/.github/workflows/serverlist-validate.yml @@ -3,6 +3,9 @@ on: workflow_dispatch: push: +permissions: + contents: read + jobs: serverlist-validate: if: github.repository_owner == 'GameServerManagers' diff --git a/.github/workflows/trigger-docker-build.yml b/.github/workflows/trigger-docker-build.yml index ab37c882d..390123322 100644 --- a/.github/workflows/trigger-docker-build.yml +++ b/.github/workflows/trigger-docker-build.yml @@ -6,6 +6,8 @@ on: types: - published +permissions: {} + jobs: trigger_build_docker-linuxgsm: if: github.repository_owner == 'GameServerManagers' diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index 2f2f7babc..8863cedc7 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -6,6 +6,8 @@ on: branches: - develop +permissions: {} + concurrency: group: update-check-${{ github.ref_name }} cancel-in-progress: true @@ -22,7 +24,7 @@ jobs: steps: - name: Download linuxgsm.sh - run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh + run: wget "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh"; chmod +x linuxgsm.sh - name: Install dependencies run: sudo dpkg --add-architecture i386; sudo apt-get update; diff --git a/.github/workflows/update-copyright-years-in-license-file.yml b/.github/workflows/update-copyright-years-in-license-file.yml index 3301c9cb7..1123b8cce 100644 --- a/.github/workflows/update-copyright-years-in-license-file.yml +++ b/.github/workflows/update-copyright-years-in-license-file.yml @@ -4,6 +4,10 @@ on: schedule: - cron: "0 3 1 1 *" # 03:00 AM on January 1 +permissions: + contents: write + pull-requests: write + jobs: update-license-year: if: github.repository_owner == 'GameServerManagers' diff --git a/.github/workflows/version-check.sh b/.github/workflows/version-check.sh old mode 100644 new mode 100755 diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..7b065e422 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +# Prettier auto-commit runs with GITHUB_TOKEN (GitHub App). +# GitHub blocks that token from creating/updating anything under .github/workflows. +.github/workflows/** diff --git a/.prettierrc b/.prettierrc index 1902f8021..02d542d50 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,3 +1,3 @@ { - "plugins": ["prettier-plugin-sh"] + "plugins": ["prettier-plugin-sh"] } diff --git a/.prettierrc.json b/.prettierrc.json index 02d542d50..1902f8021 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,3 +1,3 @@ { - "plugins": ["prettier-plugin-sh"] + "plugins": ["prettier-plugin-sh"] } diff --git a/.shellcheckrc b/.shellcheckrc index 026ee646c..d16f69e0b 100644 --- a/.shellcheckrc +++ b/.shellcheckrc @@ -1 +1 @@ -disable=SC2154 +disable=SC2154,SC2034 diff --git a/.vscode/extensions.json b/.vscode/extensions.json index d31b65dd2..5c06a83bf 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,12 +1,12 @@ { - "recommendations": [ - "DavidAnson.vscode-markdownlint", - "editorconfig.editorconfig", - "esbenp.prettier-vscode", - "github.vscode-github-actions", - "GitHub.vscode-pull-request-github", - "redhat.vscode-yaml", - "timonwong.shellcheck", - "yzhang.markdown-all-in-one" - ] + "recommendations": [ + "DavidAnson.vscode-markdownlint", + "editorconfig.editorconfig", + "esbenp.prettier-vscode", + "github.vscode-github-actions", + "GitHub.vscode-pull-request-github", + "redhat.vscode-yaml", + "timonwong.shellcheck", + "yzhang.markdown-all-in-one" + ] } diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index a69325281..fb935a066 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -17,24 +17,24 @@ diverse, inclusive, and healthy community. Examples of behavior that contributes to a positive environment for our community include: -- Demonstrating empathy and kindness toward other people -- Being respectful of differing opinions, viewpoints, and experiences -- Giving and gracefully accepting constructive feedback -- Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -- Focusing on what is best not just for us as individuals, but for the - overall community +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +- Focusing on what is best not just for us as individuals, but for the + overall community Examples of unacceptable behavior include: -- The use of sexualized language or imagery, and sexual attention or - advances of any kind -- Trolling, insulting or derogatory comments, and personal or political attacks -- Public or private harassment -- Publishing others' private information, such as a physical or email - address, without their explicit permission -- Other conduct which could reasonably be considered inappropriate in a - professional setting +- The use of sexualized language or imagery, and sexual attention or + advances of any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email + address, without their explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting ## Enforcement Responsibilities diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7b549c795..ab17437f6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,31 +8,31 @@ The following is a set of guidelines for contributing to LinuxGSM, which are hos [Contributing to LinuxGSM](#contributing-to-linuxgsm) -- [Table of Contents](#table-of-contents) -- [Code of Conduct](#code-of-conduct) -- [🎉 Bug/Enhancement Contributions 🐛](#bug-enhancement-contributions) - - [🐛Reporting Bugs](#reporting-bugs) - - [Before Submitting A Bug Report](#before-submitting-a-bug-report) - - [How Do I Submit A (Good) Bug Report?](#how-do-i-submit-a--good--bug-report-) - - [🎉Suggesting Features](#suggesting-features) - - [Before Submitting An Feature Suggestion](#before-submitting-an-feature-suggestion) - - [How Do I Submit A (Good) Feature Suggestion?](#how-do-i-submit-a--good--feature-suggestion-) - - [🎮 Game Server Requests](#game-server-requests) - - [Before Submitting a Game Server Request](#before-submitting-a-game-server-request) - - [How Do I Submit A (Good) Game Server Request?](#how-do-i-submit-a--good--game-server-request-) - - [🎮 Game Server Specific Issues](#game-server-specific-issues) -- [💻 Code Contributions](#code-contributions) - - [Pull Requests](#pull-requests) - - [Pull Request naming convention](#pull-request-naming-convention) - - [Testing](#testing) - - [Pull Request Status Checks](#pull-request-status-checks) - - [Test Environment](#test-environment) - - [:wine_glass: Styleguides](#-wine-glass--styleguides) - - [Git Commit Messages](#git-commit-messages) - - [BASH Styleguide](#bash-styleguide) -- [:blue_book: Document Contributions](#-blue-book--document-contributions) - - [Documentation Styleguide](#documentation-styleguide) -- [Issue and Pull Request Labels](#issue-and-pull-request-labels) +- [Table of Contents](#table-of-contents) +- [Code of Conduct](#code-of-conduct) +- [🎉 Bug/Enhancement Contributions 🐛](#bug-enhancement-contributions) + - [🐛Reporting Bugs](#reporting-bugs) + - [Before Submitting A Bug Report](#before-submitting-a-bug-report) + - [How Do I Submit A (Good) Bug Report?](#how-do-i-submit-a--good--bug-report-) + - [🎉Suggesting Features](#suggesting-features) + - [Before Submitting An Feature Suggestion](#before-submitting-an-feature-suggestion) + - [How Do I Submit A (Good) Feature Suggestion?](#how-do-i-submit-a--good--feature-suggestion-) + - [🎮 Game Server Requests](#game-server-requests) + - [Before Submitting a Game Server Request](#before-submitting-a-game-server-request) + - [How Do I Submit A (Good) Game Server Request?](#how-do-i-submit-a--good--game-server-request-) + - [🎮 Game Server Specific Issues](#game-server-specific-issues) +- [💻 Code Contributions](#code-contributions) + - [Pull Requests](#pull-requests) + - [Pull Request naming convention](#pull-request-naming-convention) + - [Testing](#testing) + - [Pull Request Status Checks](#pull-request-status-checks) + - [Test Environment](#test-environment) + - [:wine_glass: Styleguides](#-wine-glass--styleguides) + - [Git Commit Messages](#git-commit-messages) + - [BASH Styleguide](#bash-styleguide) +- [:blue_book: Document Contributions](#-blue-book--document-contributions) + - [Documentation Styleguide](#documentation-styleguide) +- [Issue and Pull Request Labels](#issue-and-pull-request-labels) ## Code of Conduct @@ -48,20 +48,20 @@ Before creating bug reports, please check [this list](https://github.com/GameSer #### Before Submitting A Bug Report -- **Check the [documentation](https://docs.linuxgsm.com).** You might be able to find the cause of the problem and fix things yourself. -- **Check the** [**support page**](https://linuxgsm.com/support) for links to other support options. -- **Perform a** [**cursory search**](https://github.com/search?q=org:GameServerManagers%20type:issues&type=Issues) to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue and give it a thumbs up instead of opening a new one. +- **Check the [documentation](https://docs.linuxgsm.com).** You might be able to find the cause of the problem and fix things yourself. +- **Check the** [**support page**](https://linuxgsm.com/support) for links to other support options. +- **Perform a** [**cursory search**](https://github.com/search?q=org:GameServerManagers%20type:issues&type=Issues) to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue and give it a thumbs up instead of opening a new one. #### How Do I Submit A (Good) Bug Report? Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue and provide the following information by filling in [the issues form](https://github.com/GameServerManagers/LinuxGSM/issues/new/choose). -- **Use a clear and descriptive title** for the issue to identify the problem. -- **Complete the user story** to give a summary of the issue. -- **Provide basic info** to help us understand the context of the issue. -- **Provide further info** to give specifics and more detail. -- **Give steps to reproduce** the issue, allowing developers to follow steps that lead to the issue. -- **Explain what you expect** to happen, so we know what you think should occur. +- **Use a clear and descriptive title** for the issue to identify the problem. +- **Complete the user story** to give a summary of the issue. +- **Provide basic info** to help us understand the context of the issue. +- **Provide further info** to give specifics and more detail. +- **Give steps to reproduce** the issue, allowing developers to follow steps that lead to the issue. +- **Explain what you expect** to happen, so we know what you think should occur. ### 🎉Suggesting Features @@ -69,19 +69,19 @@ This section guides you through submitting a feature suggestion for LinuxGSM, in #### Before Submitting An Feature Suggestion -- **Check the** [**documentation**]() to confirm that the enhancement doesn’t already exist. -- **Check your** [**LinuxGSM version**](https://docs.linuxgsm.com/commands/update-lgsm)**.** A newer version of LinuxGSM may already have your enhancement. -- **Perform a** [**cursory search**](https://github.com/search?q=org:GameServerManagers%20type:issues&type=Issues) to see if the enhancement has already been suggested. If it has **and the enhancement is still open**, add a comment to the existing issue and give it a thumbs up instead of opening a new one. +- **Check the** [**documentation**]() to confirm that the enhancement doesn’t already exist. +- **Check your** [**LinuxGSM version**](https://docs.linuxgsm.com/commands/update-lgsm)**.** A newer version of LinuxGSM may already have your enhancement. +- **Perform a** [**cursory search**](https://github.com/search?q=org:GameServerManagers%20type:issues&type=Issues) to see if the enhancement has already been suggested. If it has **and the enhancement is still open**, add a comment to the existing issue and give it a thumbs up instead of opening a new one. #### How Do I Submit A (Good) Feature Suggestion? Features are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue and provide the following information by filling in [the issues form](https://github.com/GameServerManagers/LinuxGSM/issues/new/choose). -- **Use a clear and descriptive title** for the issue to identify the problem. -- **Complete the user story** to give a summary of the issue. -- **Provide basic info** to help us understand the context of the enhancement. -- **Provide further info** to give specifics and more detail. -- **Provide any further reading** materials that might assist in developing the enhancement. +- **Use a clear and descriptive title** for the issue to identify the problem. +- **Complete the user story** to give a summary of the issue. +- **Provide basic info** to help us understand the context of the enhancement. +- **Provide further info** to give specifics and more detail. +- **Provide any further reading** materials that might assist in developing the enhancement. ### 🎮 Game Server Requests @@ -89,14 +89,14 @@ This section guides you through submitting a game server request for LinuxGSM, F #### Before Submitting a Game Server Request -- **Check for existing** [**game server requests**](https://github.com/GameServerManagers/LinuxGSM/labels/type%3A%20game%20server%20request) to see if the new game server has already been suggested. If it has **and if the new game server is still open**, give it a thumbs up. -- **Check the game server is supported on Linux**, this does not include Wine servers which we do not support. +- **Check for existing** [**game server requests**](https://github.com/GameServerManagers/LinuxGSM/labels/type%3A%20game%20server%20request) to see if the new game server has already been suggested. If it has **and if the new game server is still open**, give it a thumbs up. +- **Check the game server is supported on Linux**, this does not include Wine servers which we do not support. #### How Do I Submit A (Good) Game Server Request? -- The title should be as follows: **[Server Request] Game Name** -- **Provide Steam App ID** if applicable -- **Supply any documentation/how-to guides** for the game server. +- The title should be as follows: **[Server Request] Game Name** +- **Provide Steam App ID** if applicable +- **Supply any documentation/how-to guides** for the game server. ### 🎮 Game Server Specific Issues @@ -114,10 +114,10 @@ A [list](https://docs.linuxgsm.com/support/game-server) of known game developer The process described here has several goals: -- Maintain LinuxGSM quality. -- Fix problems that are important to users. -- Engage the community in working toward the best possible LinuxGSM. -- Enable a sustainable system for LinuxGSM maintainers to review contributions. +- Maintain LinuxGSM quality. +- Fix problems that are important to users. +- Engage the community in working toward the best possible LinuxGSM. +- Enable a sustainable system for LinuxGSM maintainers to review contributions. Please follow these steps to have your contribution considered by the maintainers: @@ -139,24 +139,23 @@ If applied, this commit will _your subject line here_ For example: -- If applied, this commit will **refactor subsystem X for readability** -- If applied, this commit will **update getting started documentation** -- If applied, this commit will **remove deprecated methods** -- If applied, this commit will **release version 1.0.0** -- If applied, this commit will **merge pull request #123 from user/branch** +- If applied, this commit will **refactor subsystem X for readability** +- If applied, this commit will **update getting started documentation** +- If applied, this commit will **remove deprecated methods** +- If applied, this commit will **release version 1.0.0** +- If applied, this commit will **merge pull request #123 from user/branch** Notice how this doesn’t work for the other non-imperative forms: -- If applied, this commit will **fixed bug with Y** -- If applied, this commit will **change the behaviour of X** -- If applied, this commit will **more fixes for broken stuff** -- If applied, this commit will **sweet new API methods** +- If applied, this commit will **fixed bug with Y** +- If applied, this commit will **change the behaviour of X** +- If applied, this commit will **more fixes for broken stuff** +- If applied, this commit will **sweet new API methods** Below is an example of the subject line for a pull request: -**feat(alerts): add slack support to alerts** - -**fix(csgoserver): remove SteamCMD auth requirement 32-bit workaround** +- feat(alerts): add slack support to alerts +- fix(csgoserver): remove SteamCMD auth requirement 32-bit workaround ### Testing @@ -211,10 +210,10 @@ Labels to help pinpoint what the issue or PR relates to. variants: -- _distro_ -- _engine_ -- _game_ -- _info_ +- _distro_ +- _engine_ +- _game_ +- _info_ **outcome** Labels Labels that identify why an issue was closed. diff --git a/README.md b/README.md index 4075a4e3d..ad8847133 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@

- LinuxGSM - Codacy grade - GitHub Workflow Status - Discord - SteamCMD - MIT License + LinuxGSM + Codacy grade + GitHub Workflow Status + Discord + SteamCMD + MIT License

[LinuxGSM](https://linuxgsm.com) is the command-line tool for quick, simple deployment and management of Linux dedicated game servers. @@ -17,21 +17,21 @@ Traditionally game servers are not easy to manage yourself. Admins often have to 100+ game servers supported -- :truck: Installer -- :mag: Monitor -- :phone: Alerts -- :cloud: Updater -- :blue_book: Server Details -- :floppy_disk: Backup -- :computer: Console +- :truck: Installer +- :mag: Monitor +- :phone: Alerts +- :cloud: Updater +- :blue_book: Server Details +- :floppy_disk: Backup +- :computer: Console ## :penguin: Compatibility LinuxGSM will run on popular distros as long as the minimum requirements are met. -- Ubuntu -- Debian -- CentOS +- Ubuntu +- Debian +- CentOS Other distros are likely to work but are not fully tested. diff --git a/lgsm/config-default/config-lgsm/armarserver/_default.cfg b/lgsm/config-default/config-lgsm/armarserver/_default.cfg index d5b6d0e18..e7e8c24f4 100644 --- a/lgsm/config-default/config-lgsm/armarserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/armarserver/_default.cfg @@ -9,7 +9,7 @@ #### Game Server Settings #### # https://community.bistudio.com/wiki/Arma_Reforger:Server_Hosting -# MaxFPS to limit the used Server resouces +# MaxFPS to limit the used Server resources maxfps="60" # Profile Name diff --git a/lgsm/config-default/config-lgsm/necserver/_default.cfg b/lgsm/config-default/config-lgsm/necserver/_default.cfg index 6c1f65a39..648e0a40c 100644 --- a/lgsm/config-default/config-lgsm/necserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/necserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Pre-defined Paramters | https://docs.linuxgsm.com/configuration/start-parameters#predefined-parameters +## Pre-defined Parameters | https://docs.linuxgsm.com/configuration/start-parameters#predefined-parameters worldname="MyWorld" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters diff --git a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg index 7f4aeb9bc..565187394 100644 --- a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg @@ -19,7 +19,7 @@ httppassword="CHANGE_ME" httpport="8080" mods="" serverpassword="" -# Add the following line to the parms if you want a private server. Ensuring +# Add the following line to the params if you want a private server. Ensuring # that the password variable above is not left empty. # -password \"${serverpassword}\" diff --git a/lgsm/config-default/config-lgsm/ns2server/_default.cfg b/lgsm/config-default/config-lgsm/ns2server/_default.cfg index 69aa2486a..8964f1dfd 100644 --- a/lgsm/config-default/config-lgsm/ns2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2server/_default.cfg @@ -20,7 +20,7 @@ httppassword="CHANGE_ME" httpport="8080" modserverport="27031" serverpassword="" -# Add the following line to the parms if you want a private server. Ensuring +# Add the following line to the params if you want a private server. Ensuring # that the password variable above is not left empty. # -password '${serverpassword}' diff --git a/lgsm/config-default/config-lgsm/pwserver/_default.cfg b/lgsm/config-default/config-lgsm/pwserver/_default.cfg index 7359064a0..c9052958a 100644 --- a/lgsm/config-default/config-lgsm/pwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pwserver/_default.cfg @@ -11,7 +11,7 @@ ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters servername="LinuxGSM" -# For community servers (serverlist) you need to change these settings (publicip & publicport) in the gameserver config file aswell +# For community servers (serverlist) you need to change these settings (publicip & publicport) in the gameserver config file as well port="8211" steamport="27015" diff --git a/lgsm/data/name-left.csv b/lgsm/data/name-left.csv index 9a47b4baf..2a95f7106 100644 --- a/lgsm/data/name-left.csv +++ b/lgsm/data/name-left.csv @@ -105,4 +105,4 @@ wonderful xenodochial youthful zealous -zen \ No newline at end of file +zen diff --git a/lgsm/data/name-right.csv b/lgsm/data/name-right.csv index 8e04d85b4..3fdbb9278 100644 --- a/lgsm/data/name-right.csv +++ b/lgsm/data/name-right.csv @@ -234,4 +234,4 @@ wright wu yalow yonath -zhukovsky \ No newline at end of file +zhukovsky diff --git a/lgsm/modules/README.md b/lgsm/modules/README.md index de008ecfa..a0aee384c 100644 --- a/lgsm/modules/README.md +++ b/lgsm/modules/README.md @@ -6,12 +6,12 @@ These modules are scripts that are called upon by the primary script linuxgsm.sh Modules have been named to give an idea of what the function does. -- core: Essential modules that will always run first. -- command: Primary command function. -- check: Runs checks that will either halt on or fix an issue. -- dev: development modules. -- fix: Applies a game server specific fix. -- info: retrieves information from a source such as config file or the OS. -- install: modules related to the installer. -- monitor: modules related to monitor. -- update: modules that update the game server. +- core: Essential modules that will always run first. +- command: Primary command function. +- check: Runs checks that will either halt on or fix an issue. +- dev: development modules. +- fix: Applies a game server specific fix. +- info: retrieves information from a source such as config file or the OS. +- install: modules related to the installer. +- monitor: modules related to monitor. +- update: modules that update the game server. diff --git a/lgsm/modules/alert.sh b/lgsm/modules/alert.sh old mode 100644 new mode 100755 index 16ba7e939..ac7d92d83 --- a/lgsm/modules/alert.sh +++ b/lgsm/modules/alert.sh @@ -10,13 +10,9 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Generates alert log of the details at the time of the alert. # Used with email alerts. fn_alert_log() { - info_distro.sh - info_game.sh - info_messages.sh if [ -f "${alertlog}" ]; then rm -f "${alertlog:?}" fi - { fn_info_messages_head fn_info_messages_distro @@ -24,7 +20,7 @@ fn_alert_log() { fn_info_messages_gameserver_resource fn_info_messages_gameserver fn_info_logs - } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | tee -a "${alertlog}" >/dev/null 2>&1 + } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | tee -a "${alertlog}" > /dev/null 2>&1 } fn_alert_test() { @@ -97,45 +93,66 @@ fn_alert_monitor_query() { # Update alerts fn_alert_update() { - fn_script_log_info "Sending alert: ${selfname} has received a game server update: ${localbuild}" + # If previousbuild is set show transition, else fallback to single version. + if [ -n "${previousbuild:-}" ] && [ -n "${localbuild:-}" ]; then + fn_script_log_info "Sending alert: ${selfname} updated: ${previousbuild} -> ${localbuild}" + alertmessage="${selfname} updated: ${previousbuild} -> ${localbuild}." + else + fn_script_log_info "Sending alert: ${selfname} updated to ${localbuild}" + alertmessage="${selfname} updated to ${localbuild}." + fi alertaction="Updated" alertemoji="🎉" alertsound="1" - alertmessage="${selfname} has received a game server update: ${localbuild}." # Green alertcolourhex="#00cd00" alertcolourdec="52480" } -fn_alert_update_request() { - fn_script_log_info "Sending alert: ${selfname} has requested an update and needs to be restarted." - alertaction="Updating" +# Update failure alert +fn_alert_update_failed() { + # Expect updatefailureexpected (target version) and updatefailuregot (actual localbuild) if set + local updateexpected="${updatefailureexpected:-${remotebuild:-unknown}}" + local updategot="${updatefailuregot:-${localbuild:-unknown}}" + fn_script_log_error "Sending alert: ${selfname} update failed: expected ${updateexpected}, got ${updategot}" + alertaction="Update Failed" + alertemoji="❌" + alertsound="2" + alertmessage="${selfname} update failed: expected ${updateexpected}, got ${updategot}. Manual intervention required." + # Red + alertcolourhex="#cd0000" + alertcolourdec="13434880" +} + +fn_alert_update_restart_request() { + fn_script_log_info "Sending alert: ${selfname} restart requested" + alertaction="Restart Requested" alertemoji="🎉" alertsound="1" - alertmessage="${selfname} has requested an update and needs to be restarted." + alertmessage="${selfname} has requested a restart for an update to be applied. Restarting now." # Blue alertcolourhex="#1e90ff" alertcolourdec="2003199" } fn_alert_check_update() { - fn_script_log_info "Sending alert: ${gamename} update available: ${remotebuildversion}" - alertaction="Update available" + fn_script_log_info "Sending alert: ${gamename} update available: ${localbuild} -> ${remotebuild}" + alertaction="Update Available" alertemoji="🎉" alertsound="1" - alertmessage="${gamename} update available: ${remotebuildversion}" + alertmessage="${gamename} update available: ${localbuild} -> ${remotebuild}" # Blue alertcolourhex="#1e90ff" alertcolourdec="2003199" } fn_alert_update_linuxgsm() { - fn_script_log_info "Sending alert: ${selfname} has received an LinuxGSM update" + fn_script_log_info "Sending alert: ${selfname} has received a LinuxGSM update" alertaction="Updated" alertemoji="🎉" alertsound="1" alertbody="${gamename} update available" - alertmessage="${selfname} has received an LinuxGSM update and been restarted." + alertmessage="${selfname} has received a LinuxGSM update and been restarted." # Green alertcolourhex="#00cd00" alertcolourdec="52480" @@ -197,8 +214,9 @@ fn_alert_info() { alertcolourdec="2003199" } -# Images -alerticon="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/gameicons/${shortname}-icon.png" +info_distro.sh +info_game.sh +info_messages.sh if [ "${alert}" == "permissions" ]; then fn_alert_permissions @@ -210,8 +228,10 @@ elif [ "${alert}" == "test" ]; then fn_alert_test elif [ "${alert}" == "update" ]; then fn_alert_update -elif [ "${alert}" == "update-request" ]; then - fn_alert_update_request +elif [ "${alert}" == "update-failed" ]; then + fn_alert_update_failed +elif [ "${alert}" == "update-restart-request" ]; then + fn_alert_update_restart_request elif [ "${alert}" == "check-update" ]; then fn_alert_check_update elif [ "${alert}" == "config" ]; then @@ -237,6 +257,7 @@ else fi alerttitle="${alertemoji} ${alertaction} - ${servername} ${alertemoji}" +alerticon="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/gameicons/${shortname}-icon.png" # Generate alert log. fn_alert_log diff --git a/lgsm/modules/alert_discord.sh b/lgsm/modules/alert_discord.sh old mode 100644 new mode 100755 index 1440b6a96..e4bf6307f --- a/lgsm/modules/alert_discord.sh +++ b/lgsm/modules/alert_discord.sh @@ -43,39 +43,38 @@ json=$( "inline": true }, { - "name": "Server Time", - "value": "$(date)", + "name": "Server IP", + "value": "\`${alertip}:${port}\`", "inline": true }, { - "name": "More info", - "value": "${alerturl}", + "name": "Server Time", + "value": "$(date)", "inline": true } EOF ) -if [ -n "${querytype}" ]; then +if [ -n "${alerturl}" ]; then json+=$( cat << EOF , { - "name": "Is my Game Server Online?", - "value": "https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}", + "name": "More info", + "value": "${alerturl}", "inline": true } EOF ) fi -if [ -n "${alerturl}" ]; then +if [ -n "${querytype}" ]; then json+=$( cat << EOF , { - "name": "More info", - "value": "${alerturl}", - "inline": true + "name": "Is my Game Server Online?", + "value": "https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}" } EOF ) diff --git a/lgsm/modules/alert_email.sh b/lgsm/modules/alert_email.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/alert_gotify.sh b/lgsm/modules/alert_gotify.sh old mode 100644 new mode 100755 index 2f627c774..647445746 --- a/lgsm/modules/alert_gotify.sh +++ b/lgsm/modules/alert_gotify.sh @@ -11,7 +11,7 @@ json=$( cat << EOF { "title": "${alerttitle}", - "message": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\n + "message": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\n EOF ) diff --git a/lgsm/modules/alert_ifttt.sh b/lgsm/modules/alert_ifttt.sh old mode 100644 new mode 100755 index aaae3b4e8..59bb8d965 --- a/lgsm/modules/alert_ifttt.sh +++ b/lgsm/modules/alert_ifttt.sh @@ -12,7 +12,7 @@ json=$( { "value1": "${selfname}", "value2": "${alerttitle}", - "value3": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\n + "value3": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\n EOF ) diff --git a/lgsm/modules/alert_ntfy.sh b/lgsm/modules/alert_ntfy.sh old mode 100644 new mode 100755 index 35e3f4c55..3f9b0159e --- a/lgsm/modules/alert_ntfy.sh +++ b/lgsm/modules/alert_ntfy.sh @@ -35,23 +35,31 @@ else tags="${alertemoji}" fi -# Construct the message body -message="Server Name: ${servername} -Information: ${alertmessage} -Game: ${gamename} -Server IP: ${alertip}:${port} -Hostname: ${HOSTNAME} -Server Time: $(date)" +# Construct the message body (keep formatting consistent with other plain-text alerts) +message="Server Name +${servername} + +Information +${alertmessage} + +Game +${gamename} + +Server IP +${alertip}:${port} + +Server Time +$(date)" # Add optional links if available if [ -n "${querytype}" ]; then - message+="\nIs my Game Server Online?: https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}" + message+="\n\nIs my Game Server Online?\nhttps://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}" fi # Use alerturl for the click action if available clickurl="" if [ -n "${alerturl}" ]; then - message+="\nMore info: ${alerturl}" + message+="\n\nMore info\n${alerturl}" clickurl="${alerturl}" fi diff --git a/lgsm/modules/alert_pushbullet.sh b/lgsm/modules/alert_pushbullet.sh old mode 100644 new mode 100755 index abdfa0bb2..62937b3a7 --- a/lgsm/modules/alert_pushbullet.sh +++ b/lgsm/modules/alert_pushbullet.sh @@ -13,7 +13,7 @@ json=$( "channel_tag": "${channeltag}", "type": "note", "title": "${alerttitle}", - "body": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\n + "body": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\n EOF ) diff --git a/lgsm/modules/alert_pushover.sh b/lgsm/modules/alert_pushover.sh old mode 100644 new mode 100755 index 8dc0ce2dc..3437ba83e --- a/lgsm/modules/alert_pushover.sh +++ b/lgsm/modules/alert_pushover.sh @@ -22,7 +22,7 @@ else alertpriority="0" fi -message=" Server name
${servername}

Information
${alertmessage}

Game
${gamename}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

" +message=" Server Name
${servername}

Information
${alertmessage}

Game
${gamename}

Server IP
${alertip}:${port}

" if [ -n "${querytype}" ]; then message+="Is my Game Server Online?
Check here

" @@ -32,7 +32,7 @@ if [ -n "${alerturl}" ]; then message+="More info
${alerturl}

" fi -message+="Server Time
$(date)" +message+="Server Time
$(date)" pushoversend=$(curl --connect-timeout 3 -sS \ -F token="${pushovertoken}" \ diff --git a/lgsm/modules/alert_rocketchat.sh b/lgsm/modules/alert_rocketchat.sh old mode 100644 new mode 100755 index 35bcf4928..68045221e --- a/lgsm/modules/alert_rocketchat.sh +++ b/lgsm/modules/alert_rocketchat.sh @@ -40,38 +40,20 @@ json=$( { "short": false, "title": "Server IP", - "value": "${alertip}:${port}" - }, - { - "short": false, - "title": "Hostname", - "value": "${HOSTNAME}" - }, - { - "short": false, - "title": "More info", - "value": "${alerturl}" - }, - { - "short": false, - "title": "Server Time", - "value": "$(date)" + "value": "\`${alertip}:${port}\`" } - ] - } - ] -} EOF ) if [ -n "${querytype}" ]; then json+=$( cat << EOF + , { "short": false, "title": "Is my Game Server Online?", "value": "" - }, + } EOF ) fi @@ -79,55 +61,19 @@ fi if [ -n "${alerturl}" ]; then json+=$( cat << EOF + , { "short": false, "title": "More info", "value": "${alerturl}" - }, + } EOF ) fi json+=$( cat << EOF -{ - "alias": "LinuxGSM", - "text": "*${alerttitle}*", - "attachments": [ - { - "title": "", - "color": "${alertcolourhex}", - "author_name": "LinuxGSM Alert", - "author_link": "https://linuxgsm.com", - "author_icon": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", - "thumb_url": "${alerticon}", - "text": "", - "fields": [ - { - "short": false, - "title": "Server Name", - "value": "${servername}" - }, - { - "short": false, - "title": "Information", - "value": "${alertmessage}" - }, - { - "short": false, - "title": "Game", - "value": "${gamename}" - }, - { - "short": false, - "title": "Server IP", - "value": "${alertip}:${port}" - }, - { - "short": false, - "title": "Hostname", - "value": "${HOSTNAME}" - }, + , { "short": false, "title": "Server Time", diff --git a/lgsm/modules/alert_slack.sh b/lgsm/modules/alert_slack.sh old mode 100644 new mode 100755 index 0a1e9015e..defb1f77f --- a/lgsm/modules/alert_slack.sh +++ b/lgsm/modules/alert_slack.sh @@ -50,10 +50,6 @@ json=$( "type": "mrkdwn", "text": "*Server IP*\n\`${alertip}:${port}\`" }, - { - "type": "mrkdwn", - "text": "*Hostname*\n${HOSTNAME}" - }, { "type": "mrkdwn", "text": "*Server Time*\n$(date)" @@ -62,41 +58,22 @@ json=$( "accessory": { "type": "image", "image_url": "${alerticon}", - "alt_text": "cute cat" + "alt_text": "LinuxGSM game icon" } - }, - { - "type": "context", - "elements": [ - { - "type": "image", - "image_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", - "alt_text": "LinuxGSM icon" - }, - { - "type": "plain_text", - "text": "Sent by LinuxGSM ${version}", - "emoji": true - } - ] - } - ] - } - ] -} EOF ) if [ -n "${querytype}" ]; then json+=$( cat << EOF + , { "type": "section", "text": { "type": "mrkdwn", "text": "*Is my Game Server Online?*\n" } - }, + } EOF ) fi @@ -104,82 +81,21 @@ fi if [ -n "${alerturl}" ]; then json+=$( cat << EOF + , { "type": "section", "text": { "type": "mrkdwn", "text": "*More info*\n<${alerturl}|${alerturl}>" } - }, + } EOF ) fi json+=$( cat << EOF -{ - "attachments": [ - { - "color": "${alertcolourhex}", - "blocks": [ - { - "type": "header", - "text": { - "type": "mrkdwn", - "text": "${alerttitle}", - "emoji": true - } - }, - { - "type": "divider" - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*Server Name*\n${servername}" - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*Information*\n${alertmessage}" - } - }, - { - "type": "section", - "fields": [ - { - "type": "mrkdwn", - "text": "*Game*\n${gamename}" - }, - { - "type": "mrkdwn", - "text": "*Server IP*\n\`${alertip}:${port}\`" - }, - { - "type": "mrkdwn", - "text": "*Hostname*\n${HOSTNAME}" - }, - { - "type": "mrkdwn", - "text": "*Server Time*\n$(date)" - } - ], - "accessory": { - "type": "image", - "image_url": "${alerticon}", - "alt_text": "cute cat" - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*Server Time*\n${alertmessage}" - } - }, + , { "type": "context", "elements": [ diff --git a/lgsm/modules/alert_telegram.sh b/lgsm/modules/alert_telegram.sh old mode 100644 new mode 100755 index d7c9b8447..ace95d4db --- a/lgsm/modules/alert_telegram.sh +++ b/lgsm/modules/alert_telegram.sh @@ -14,7 +14,7 @@ json=$( "message_thread_id": "${telegramthreadid}", "parse_mode": "HTML", "disable_notification": "${telegramdisablenotification}", - "text": "${alerttitle}\n\nServer name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\n + "text": "${alerttitle}\n\nServer Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\n EOF ) @@ -43,7 +43,13 @@ EOF ) fn_print_dots "Sending Telegram alert" -telegramsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" ${curlcustomstring} "https://${telegramapi}/bot${telegramtoken}/sendMessage" | grep "error_code") + +curlcustomargs=() +if [ -n "${curlcustomstring}" ]; then + read -r -a curlcustomargs <<< "${curlcustomstring}" +fi + +telegramsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${curlcustomargs[@]}" "https://${telegramapi}/bot${telegramtoken}/sendMessage" | grep "error_code") if [ -n "${telegramsend}" ]; then fn_print_fail_nl "Sending Telegram alert: ${telegramsend}" diff --git a/lgsm/modules/check.sh b/lgsm/modules/check.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/check_config.sh b/lgsm/modules/check_config.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh old mode 100644 new mode 100755 index edcdb6c7b..6d572fd40 --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -75,11 +75,11 @@ fn_install_mono_repo() { # Run the mono repo install. eval "${cmd}" + monorepoexitcode=$? # Did Mono repo install correctly? if [ "${monoautoinstall}" != "1" ]; then - exitcode=$? - if [ "${exitcode}" -ne 0 ]; then + if [ "${monorepoexitcode}" -ne 0 ]; then fn_print_failure_nl "Unable to install Mono repository." fn_script_log_fail "Unable to install Mono repository." else @@ -234,7 +234,7 @@ fn_install_missing_deps() { } fn_check_loop() { - # Loop though required depenencies checking if they are installed. + # Loop though required dependencies checking if they are installed. for deptocheck in "${array_deps_required[@]}"; do fn_deps_detector done diff --git a/lgsm/modules/check_executable.sh b/lgsm/modules/check_executable.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/check_gamedig.sh b/lgsm/modules/check_gamedig.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/check_glibc.sh b/lgsm/modules/check_glibc.sh old mode 100644 new mode 100755 index 8b3d00658..e49b461f6 --- a/lgsm/modules/check_glibc.sh +++ b/lgsm/modules/check_glibc.sh @@ -17,7 +17,7 @@ elif [ -z "${glibc}" ]; then fn_print_error_nl "Checking glibc: requirement unknown" fn_script_log_error "Checking glibc: requirement unknown" fn_sleep_time_5 -elif [ "$(printf '%s\n'${glibc}'\n' "${glibcversion}" | sort -V | head -n 1)" != "${glibc}" ]; then +elif [ "$(printf '%s\n' "${glibc}" "${glibcversion}" | sort -V | head -n 1)" != "${glibc}" ]; then fn_print_dots "Checking glibc" fn_print_error_nl "Checking glibc: requirements not met" fn_script_log_error "Checking glibc: requirements not met" diff --git a/lgsm/modules/check_ip.sh b/lgsm/modules/check_ip.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/check_last_update.sh b/lgsm/modules/check_last_update.sh old mode 100644 new mode 100755 index 2686c6507..a68285344 --- a/lgsm/modules/check_last_update.sh +++ b/lgsm/modules/check_last_update.sh @@ -11,6 +11,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ -f "${lockdir}/${selfname}-last-started.lock" ]; then laststart=$(cat "${lockdir}/${selfname}-last-started.lock") fi + if [ -f "${lockdir}/last-updated.lock" ]; then lastupdate=$(cat "${lockdir}/last-updated.lock") fi diff --git a/lgsm/modules/check_logs.sh b/lgsm/modules/check_logs.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/check_permissions.sh b/lgsm/modules/check_permissions.sh old mode 100644 new mode 100755 index 4004732f2..73fba983d --- a/lgsm/modules/check_permissions.sh +++ b/lgsm/modules/check_permissions.sh @@ -249,7 +249,7 @@ fn_sys_perm_error_process() { fi } -## Run permisions checks when not root. +## Run permissions checks when not root. if [ "$(whoami)" != "root" ]; then fn_check_ownership fn_check_permissions diff --git a/lgsm/modules/check_root.sh b/lgsm/modules/check_root.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/check_status.sh b/lgsm/modules/check_status.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/check_steamcmd.sh b/lgsm/modules/check_steamcmd.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/check_system_dir.sh b/lgsm/modules/check_system_dir.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/check_system_requirements.sh b/lgsm/modules/check_system_requirements.sh old mode 100644 new mode 100755 index 39cef3a42..f34190fec --- a/lgsm/modules/check_system_requirements.sh +++ b/lgsm/modules/check_system_requirements.sh @@ -71,7 +71,7 @@ fi if [ "${ramrequirementgb}" ]; then if (($(echo "${physmemtotalgb} < ${ramrequirementgb}" | bc -l))); then fn_print_dots "Checking RAM" - fn_print_warn_nl "Checking RAM: Minumum RAM requirements not met" + fn_print_warn_nl "Checking RAM: Minimum RAM requirements not met" fn_print_nl "* ${ramrequirementgb}G is required, but only ${physmemtotal} is available." fn_print_nl "* ${gamename} server may fail to run or experience poor performance." fn_sleep_time_5 diff --git a/lgsm/modules/check_tmuxception.sh b/lgsm/modules/check_tmuxception.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/check_version.sh b/lgsm/modules/check_version.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_backup.sh b/lgsm/modules/command_backup.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_check_update.sh b/lgsm/modules/command_check_update.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_console.sh b/lgsm/modules/command_console.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_debug.sh b/lgsm/modules/command_debug.sh old mode 100644 new mode 100755 index a5dae7615..e502605f2 --- a/lgsm/modules/command_debug.sh +++ b/lgsm/modules/command_debug.sh @@ -49,7 +49,7 @@ if [ -n "${glibc}" ]; then : elif [ -z "${glibc}" ]; then echo -e "${lightblue}glibc required:\t${red}UNKNOWN${default}" - elif [ "$(printf '%s\n'${glibc}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibc}" ]; then + elif [ "$(printf '%s\n' "${glibc}" "${glibcversion}" | sort -V | head -n 1)" != "${glibc}" ]; then echo -e "${lightblue}glibc required:\t${red}${glibc} ${default}(${red}distro glibc ${glibcversion} too old${default})" else echo -e "${lightblue}glibc required:\t${green}${glibc}${default}" diff --git a/lgsm/modules/command_details.sh b/lgsm/modules/command_details.sh old mode 100644 new mode 100755 index 8de2ddeb5..047f50c6f --- a/lgsm/modules/command_details.sh +++ b/lgsm/modules/command_details.sh @@ -29,7 +29,7 @@ fn_info_messages_gameserver_resource fn_info_messages_gameserver fn_info_messages_script fn_info_messages_backup -# Some game servers do not have parms. +# Some game servers do not have params. if [ "${shortname}" != "jc2" ] && [ "${shortname}" != "dst" ] && [ "${shortname}" != "pz" ] && [ "${engine}" != "renderware" ]; then fn_info_messages_commandlineparms fi diff --git a/lgsm/modules/command_dev_clear_modules.sh b/lgsm/modules/command_dev_clear_modules.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_dev_debug.sh b/lgsm/modules/command_dev_debug.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_dev_detect_deps.sh b/lgsm/modules/command_dev_detect_deps.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_dev_detect_glibc.sh b/lgsm/modules/command_dev_detect_glibc.sh old mode 100644 new mode 100755 index 20398bd47..5af93466b --- a/lgsm/modules/command_dev_detect_glibc.sh +++ b/lgsm/modules/command_dev_detect_glibc.sh @@ -63,7 +63,7 @@ for glibc_check_var in "${glibc_check_dir_array[@]}"; do cat "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" | sort | uniq | sort -r --version-sort | head -1 | tee -a "${tmpdir}/detect_glibc_highest.tmp" echo -e "" echo -e "Files requiring GLIBC" - echo -e "Highest verion required: filename" + echo -e "Highest version required: filename" cat "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" echo -e "" echo -e "All required GLIBC versions" diff --git a/lgsm/modules/command_dev_detect_ldd.sh b/lgsm/modules/command_dev_detect_ldd.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_dev_parse_distro_details.sh b/lgsm/modules/command_dev_parse_distro_details.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_dev_parse_game_details.sh b/lgsm/modules/command_dev_parse_game_details.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_dev_query_raw.sh b/lgsm/modules/command_dev_query_raw.sh old mode 100644 new mode 100755 index b95ef6c33..61b4d7a70 --- a/lgsm/modules/command_dev_query_raw.sh +++ b/lgsm/modules/command_dev_query_raw.sh @@ -249,9 +249,9 @@ echo -e "${bold}${lightyellow}Query Port (${queryport}) - TCP Output${default}" fn_messages_separator echo -e "" for queryip in "${queryips[@]}"; do - echo -e "${italic}bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}''${default}" + echo -e "${italic}bash -c 'exec 3<> /dev/tcp/'\"${queryip}\"'/'\"${queryport}\"''${default}" echo -e "" - timeout 3 bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}'' + timeout 3 bash -c 'exec 3<> /dev/tcp/'"${queryip}"'/'"${queryport}"'' querystatus="$?" echo -e "" if [ "${querystatus}" == "0" ]; then @@ -268,9 +268,9 @@ echo -e "${lightgreen}TCP Raw Output${default}" fn_messages_separator echo -e "" for queryip in "${queryips[@]}"; do - echo -e "${italic}bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}''${default}" + echo -e "${italic}bash -c 'exec 3<> /dev/tcp/'\"${queryip}\"'/'\"${port}\"''${default}" echo -e "" - timeout 3 bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}'' + timeout 3 bash -c 'exec 3<> /dev/tcp/'"${queryip}"'/'"${port}"'' querystatus="$?" echo -e "" if [ "${querystatus}" == "0" ]; then diff --git a/lgsm/modules/command_dev_ui.sh b/lgsm/modules/command_dev_ui.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_fastdl.sh b/lgsm/modules/command_fastdl.sh old mode 100644 new mode 100755 index 3b8165444..dfdcc9ec8 --- a/lgsm/modules/command_fastdl.sh +++ b/lgsm/modules/command_fastdl.sh @@ -219,7 +219,7 @@ fn_fastdl_preview() { core_exit.sh fi - if [ "${engine}" == "source" ]; then + if [ "${engine}" == "source" ]; then echo -e "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)" elif [ "${engine}" == "goldsrc" ]; then echo -e "about to copy ${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)" diff --git a/lgsm/modules/command_install.sh b/lgsm/modules/command_install.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_install_resources_mta.sh b/lgsm/modules/command_install_resources_mta.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_mods_install.sh b/lgsm/modules/command_mods_install.sh old mode 100644 new mode 100755 index e76f3f1fa..a8f90293b --- a/lgsm/modules/command_mods_install.sh +++ b/lgsm/modules/command_mods_install.sh @@ -47,7 +47,7 @@ while [ "${compatiblemodslistindex}" -lt "${#compatiblemodslist[@]}" ]; do echo -e "${displayedmodname} - ${displayedmoddescription} - ${displayedmodsite}" echo -e " * ${cyan}${displayedmodcommand}${default}" # Increment index from the amount of values we just displayed. - let "compatiblemodslistindex+=4" + ((compatiblemodslistindex += 4)) ((totalmodsavailable++)) done @@ -61,16 +61,29 @@ fn_script_log_info "${totalmodsavailable} addons/mods are available for install" ## User selects a mod. echo -e "" -while [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; do + +while :; do echo -en "Enter an ${cyan}addon/mod${default} to ${green}install${default} (or exit to abort): " read -r usermodselect # Exit if user says exit or abort. if [ "${usermodselect}" == "exit" ] || [ "${usermodselect}" == "abort" ]; then core_exit.sh - # Supplementary output upon invalid user input. - elif [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; then - fn_print_error2_nl "${usermodselect} is not a valid addon/mod." fi + + validselection=0 + for availablemodcommand in "${availablemodscommands[@]}"; do + if [ "${availablemodcommand}" == "${usermodselect}" ]; then + validselection=1 + break + fi + done + + if [ "${validselection}" -eq 1 ]; then + break + fi + + # Supplementary output upon invalid user input. + fn_print_error2_nl "${usermodselect} is not a valid addon/mod." done # Get mod info. currentmod="${usermodselect}" diff --git a/lgsm/modules/command_mods_remove.sh b/lgsm/modules/command_mods_remove.sh old mode 100644 new mode 100755 index 589046b11..04240eb60 --- a/lgsm/modules/command_mods_remove.sh +++ b/lgsm/modules/command_mods_remove.sh @@ -32,16 +32,29 @@ done echo -e "" # Keep prompting as long as the user input doesn't correspond to an available mod. -while [[ ! " ${installedmodslist[@]} " =~ " ${usermodselect} " ]]; do + +while :; do echo -en "Enter an ${cyan}addon/mod${default} to ${red}remove${default} (or exit to abort): " read -r usermodselect # Exit if user says exit or abort. if [ "${usermodselect}" == "exit" ] || [ "${usermodselect}" == "abort" ]; then core_exit.sh - # Supplementary output upon invalid user input. - elif [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; then - fn_print_error2_nl "${usermodselect} is not a valid addon/mod." fi + + validselection=0 + for installedmodcommand in "${installedmodslist[@]}"; do + if [ "${installedmodcommand}" == "${usermodselect}" ]; then + validselection=1 + break + fi + done + + if [ "${validselection}" -eq 1 ]; then + break + fi + + # Supplementary output upon invalid user input. + fn_print_error2_nl "${usermodselect} is not a valid addon/mod." done fn_print_warning_nl "You are about to remove ${cyan}${usermodselect}${default}." diff --git a/lgsm/modules/command_mods_update.sh b/lgsm/modules/command_mods_update.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh old mode 100644 new mode 100755 index 5fa3c3000..7c813aed7 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -164,8 +164,8 @@ fn_monitor_check_update_source() { fn_script_log_info "Checking update: CHECKING" fn_print_ok "Checking update" fn_print_ok_eol_nl - fn_script_log_info "Checking update: ${selfname} has requested an update and needs to be restarted" - alert="update-request" + fn_script_log_info "Checking update: ${selfname} has requested a restart for an update to be applied" + alert="update-restart-request" alert.sh command_restart.sh core_exit.sh diff --git a/lgsm/modules/command_postdetails.sh b/lgsm/modules/command_postdetails.sh old mode 100644 new mode 100755 index 7f5f67304..d029093b5 --- a/lgsm/modules/command_postdetails.sh +++ b/lgsm/modules/command_postdetails.sh @@ -46,7 +46,7 @@ else fn_info_messages_gameserver fn_info_messages_script fn_info_messages_backup - # Some game servers do not have parms. + # Some game servers do not have params. if [ "${shortname}" != "jc2" ] && [ "${shortname}" != "jc3" ] && [ "${shortname}" != "dst" ] && [ "${shortname}" != "pz" ] && [ "${engine}" != "renderware" ]; then fn_info_messages_commandlineparms fi @@ -59,7 +59,7 @@ fi fn_print_dots "termbin.com" link=$(cat "${postdetailslog}" | { - nc -w 3 termbin.com 9999 + nc -w 10 termbin.com 9999 echo $? > /tmp/nc_exit_status } | tr -d '\n\0') nc_exit_status=$(cat /tmp/nc_exit_status) diff --git a/lgsm/modules/command_restart.sh b/lgsm/modules/command_restart.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_send.sh b/lgsm/modules/command_send.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_skeleton.sh b/lgsm/modules/command_skeleton.sh old mode 100644 new mode 100755 index b9f51205a..687790a37 --- a/lgsm/modules/command_skeleton.sh +++ b/lgsm/modules/command_skeleton.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Creates an copy of a game servers directorys. +# Description: Creates an copy of a game servers directories. commandname="SKELETON" commandaction="Skeleton" @@ -13,7 +13,7 @@ fn_firstcommand_set fn_print_dots "Creating skeleton directory" check.sh -# Find all directorys and create them in the skel directory +# Find all directories and create them in the skel directory find "${rootdir}" -type d -not \( -path ./skel -prune \) | cpio -pdvm skel 2> /dev/null exitcode=$? if [ "${exitcode}" -ne 0 ]; then diff --git a/lgsm/modules/command_start.sh b/lgsm/modules/command_start.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_stop.sh b/lgsm/modules/command_stop.sh old mode 100644 new mode 100755 index f1edc3544..ab827314d --- a/lgsm/modules/command_stop.sh +++ b/lgsm/modules/command_stop.sh @@ -16,7 +16,7 @@ fn_stop_graceful_ctrlc() { fn_script_log_info "Graceful: CTRL+c" # Sends CTRL+c. tmux -L "${socketname}" send-keys -t "${sessionname}" C-c > /dev/null 2>&1 - # Waits up to 30 seconds giving the server time to shutdown gracefuly. + # Waits up to 30 seconds giving the server time to shutdown gracefully. for seconds in {1..30}; do check_status.sh if [ "${status}" == "0" ]; then @@ -293,7 +293,7 @@ fn_stop_graceful_avorion() { fn_sleep_time_5 # Sends /quit. tmux -L "${socketname}" send-keys -t "${sessionname}" /stop ENTER > /dev/null 2>&1 - # Waits up to 30 seconds giving the server time to shutdown gracefuly. + # Waits up to 30 seconds giving the server time to shutdown gracefully. for seconds in {1..30}; do check_status.sh if [ "${status}" == "0" ]; then diff --git a/lgsm/modules/command_test_alert.sh b/lgsm/modules/command_test_alert.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_ts3_server_pass.sh b/lgsm/modules/command_ts3_server_pass.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_update.sh b/lgsm/modules/command_update.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_update_linuxgsm.sh b/lgsm/modules/command_update_linuxgsm.sh old mode 100644 new mode 100755 index 3299be509..3fd4cc681 --- a/lgsm/modules/command_update_linuxgsm.sh +++ b/lgsm/modules/command_update_linuxgsm.sh @@ -16,8 +16,9 @@ info_distro.sh info_game.sh # Prevent github from using a cached version of the file if dev-debug is enabled. +nocache=() if [ -f "${rootdir}/.dev-debug" ]; then - nocache="-H \"Cache-Control: no-cache\" -H \"Pragma: no-cache\"" + nocache=(-H "Cache-Control: no-cache" -H "Pragma: no-cache") fi fn_script_log_info "Updating LinuxGSM" @@ -26,10 +27,10 @@ fn_print_dots "Selecting repo" fn_script_log_info "Selecting repo" # Select remotereponame -curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null +curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null exitcode=$? if [ "${exitcode}" -ne "0" ]; then - curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null + curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null exitcode=$? if [ "${exitcode}" -ne "0" ]; then fn_print_fail_nl "Selecting repo: Unable to to access GitHub or Bitbucket repositories" @@ -47,9 +48,9 @@ fi # Check linuxsm.sh echo -en "checking ${remotereponame} script [ ${italic}linuxgsm.sh${default} ]\c" if [ "${remotereponame}" == "GitHub" ]; then - curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null + curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null else - curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null + curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null fi exitcode=$? if [ "${exitcode}" -ne 0 ]; then @@ -60,9 +61,9 @@ if [ "${exitcode}" -ne 0 ]; then fi if [ "${remotereponame}" == "GitHub" ]; then - tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl ${nocache} --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh")) + tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl "${nocache[@]}" --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh")) else - tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl ${nocache} --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh")) + tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl "${nocache[@]}" --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh")) fi if [ "${tmp_script_diff}" != "" ]; then @@ -130,9 +131,9 @@ fi echo -en "checking ${remotereponame} config [ ${italic}_default.cfg${default} ]\c" fn_script_log_info "Checking ${remotereponame} config _default.cfg" if [ "${remotereponame}" == "GitHub" ]; then - curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null + curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null else - curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null + curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null fi exitcode=$? if [ "${exitcode}" -ne 0 ]; then @@ -143,9 +144,9 @@ if [ "${exitcode}" -ne 0 ]; then fi if [ "${remotereponame}" == "GitHub" ]; then - config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl ${nocache} --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) + config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl "${nocache[@]}" --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) else - config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl ${nocache} --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) + config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl "${nocache[@]}" --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) fi if [ "${config_file_diff}" != "" ]; then @@ -165,9 +166,9 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then echo -en "checking ${remotereponame} config [ ${italic}${distroid}-${distroversioncsv}.csv${default} ]\c" fn_script_log_info "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" if [ "${remotereponame}" == "GitHub" ]; then - curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null + curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null else - curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null + curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null fi exitcode=$? if [ "${exitcode}" -ne 0 ]; then @@ -178,9 +179,9 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then fi if [ "${remotereponame}" == "GitHub" ]; then - config_file_diff=$(diff "${datadir}/${distroid}-${distroversioncsv}.csv" <(curl ${nocache} --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv")) + config_file_diff=$(diff "${datadir}/${distroid}-${distroversioncsv}.csv" <(curl "${nocache[@]}" --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv")) else - config_file_diff=$(diff "${datadir}/${distroid}-${distroversioncsv}.csv" <(curl ${nocache} --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv")) + config_file_diff=$(diff "${datadir}/${distroid}-${distroversioncsv}.csv" <(curl "${nocache[@]}" --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv")) fi if [ "${config_file_diff}" != "" ]; then @@ -204,9 +205,9 @@ if [ -n "${modulesdir}" ]; then echo -en "checking ${remotereponame} module [ ${italic}${modulefile}${default} ]\c" github_file_url_dir="lgsm/modules" if [ "${remotereponame}" == "GitHub" ]; then - curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null + curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null else - curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null + curl "${nocache[@]}" --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null fi exitcode=$? if [ "${exitcode}" -ne 0 ]; then @@ -224,9 +225,9 @@ if [ -n "${modulesdir}" ]; then else # compare file if [ "${remotereponame}" == "GitHub" ]; then - module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl ${nocache} --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}")) + module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl "${nocache[@]}" --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}")) else - module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl ${nocache} --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}")) + module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl "${nocache[@]}" --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}")) fi # results diff --git a/lgsm/modules/command_validate.sh b/lgsm/modules/command_validate.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/command_wipe.sh b/lgsm/modules/command_wipe.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/compress_unreal_maps.sh b/lgsm/modules/compress_unreal_maps.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh old mode 100644 new mode 100755 index 3b9ec9945..0a0dacb29 --- a/lgsm/modules/core_dl.sh +++ b/lgsm/modules/core_dl.sh @@ -46,6 +46,18 @@ fn_dl_steamcmd() { validate="validate" fi + # steamcmdcommand can contain multiple arguments; treat it as an argv array. + steamcmdcommandarray=() + read -r -a steamcmdcommandarray <<< "${steamcmdcommand}" + unbuffercommand=() + if [ -n "${unbuffer}" ]; then + unbuffercommand=("${unbuffer}") + fi + validateparam=() + if [ -n "${validate}" ]; then + validateparam=("${validate}") + fi + # To do error checking for SteamCMD the output of steamcmd will be saved to a log. steamcmdlog="${lgsmlogdir}/${selfname}-steamcmd.log" @@ -61,29 +73,29 @@ fn_dl_steamcmd() { if [ "${appid}" == "90" ]; then # If using a specific branch. if [ -n "${branch}" ] && [ -n "${betapassword}" ]; then - ${unbuffer} ${steamcmdcommand} +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" elif [ -n "${branch}" ]; then - ${unbuffer} ${steamcmdcommand} +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" else - ${unbuffer} ${steamcmdcommand} +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" fi # Force Windows Platform type. elif [ "${steamcmdforcewindows}" == "yes" ]; then if [ -n "${branch}" ] && [ -n "${betapassword}" ]; then - ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" elif [ -n "${branch}" ]; then - ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" else - ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" fi # All other servers. else if [ -n "${branch}" ] && [ -n "${betapassword}" ]; then - ${unbuffer} ${steamcmdcommand} +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" elif [ -n "${branch}" ]; then - ${unbuffer} ${steamcmdcommand} +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" else - ${unbuffer} ${steamcmdcommand} +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" fi fi @@ -132,9 +144,9 @@ fn_dl_steamcmd() { fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Corrupt update files" fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Corrupt update files" else - fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured" + fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Unknown error occurred" fn_print_nl "Please provide content log to LinuxGSM developers https://linuxgsm.com/steamcmd-error" - fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured" + fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Unknown error occurred" fi elif [ "${exitcode}" -ne 0 ]; then fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Exit code: ${exitcode}" @@ -188,8 +200,8 @@ fn_dl_hash() { hashbin="sha512sum" hashtype="SHA512" else - fn_script_log_error "hash lengh not known for hash type" - fn_print_error_nl "hash lengh not known for hash type" + fn_script_log_error "hash length not known for hash type" + fn_print_error_nl "hash length not known for hash type" core_exit.sh fi echo -en "verifying ${local_filename} with ${hashtype}..." diff --git a/lgsm/modules/core_exit.sh b/lgsm/modules/core_exit.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/core_getopt.sh b/lgsm/modules/core_getopt.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/core_github.sh b/lgsm/modules/core_github.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/core_legacy.sh b/lgsm/modules/core_legacy.sh old mode 100644 new mode 100755 index 1d5bc430c..55c2172d4 --- a/lgsm/modules/core_legacy.sh +++ b/lgsm/modules/core_legacy.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Code for backwards compatability with older versions of LinuxGSM. +# Description: Code for backwards compatibility with older versions of LinuxGSM. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/core_logs.sh b/lgsm/modules/core_logs.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/core_messages.sh b/lgsm/modules/core_messages.sh old mode 100644 new mode 100755 index 37c2e98b5..da5fd43e3 --- a/lgsm/modules/core_messages.sh +++ b/lgsm/modules/core_messages.sh @@ -560,7 +560,7 @@ fn_print_restart_warning() { } # Functions below are used to ensure that logs and UI correctly reflect the command it is actually running. -# Useful when a command has to call upon another command causing the other command to overrite commandname variables +# Useful when a command has to call upon another command causing the other command to overwrite commandname variables # Used to remember the command that ran first. fn_firstcommand_set() { diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh old mode 100644 new mode 100755 index 614f5d019..2cc635888 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -14,31 +14,13 @@ modulesversion="v25.2.0" core_dl.sh() { modulefile="${FUNCNAME[0]}" - if [ "$(type fn_fetch_core_dl 2>/dev/null)" ]; then + 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 @@ -54,17 +36,35 @@ core_getopt.sh() { fn_fetch_module } -core_trap.sh() { +core_github.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } +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_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_steamcmd.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -core_github.sh() { +core_trap.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -91,87 +91,87 @@ command_details.sh() { fn_fetch_module } -command_sponsor.sh() { +command_fastdl.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_postdetails.sh() { +command_install.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_test_alert.sh() { +command_install_resources_mta.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_monitor.sh() { +command_mods_install.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_start.sh() { +command_mods_remove.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_stop.sh() { +command_mods_update.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_validate.sh() { +command_monitor.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_install.sh() { +command_postdetails.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_install_resources_mta.sh() { +command_restart.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -install_squad_license.sh() { +command_send.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_mods_install.sh() { +command_skeleton.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_mods_update.sh() { +command_sponsor.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_mods_remove.sh() { +command_start.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_fastdl.sh() { +command_stop.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_ts3_server_pass.sh() { +command_test_alert.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_restart.sh() { +command_ts3_server_pass.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_skeleton.sh() { +command_validate.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -181,7 +181,7 @@ command_wipe.sh() { fn_fetch_module } -command_send.sh() { +install_squad_license.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -277,12 +277,12 @@ compress_unreal2_maps.sh() { # Mods -mods_list.sh() { +mods_core.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -mods_core.sh() { +mods_list.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -299,37 +299,37 @@ command_dev_debug.sh() { fn_fetch_module } -command_dev_parse_game_details.sh() { +command_dev_detect_deps.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_dev_parse_distro_details.sh() { +command_dev_detect_glibc.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_dev_detect_deps.sh() { +command_dev_detect_ldd.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_dev_detect_glibc.sh() { +command_dev_parse_distro_details.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_dev_detect_ldd.sh() { +command_dev_parse_game_details.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_dev_ui.sh() { +command_dev_query_raw.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_dev_query_raw.sh() { +command_dev_ui.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -346,27 +346,27 @@ fix_ark.sh() { fn_fetch_module } -fix_av.sh() { +fix_arma3.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_arma3.sh() { +fix_armar.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_armar.sh() { +fix_av.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_bt.sh() { +fix_bo.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_bo.sh() { +fix_bt.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -446,67 +446,62 @@ fix_rw.sh() { fn_fetch_module } -fix_sfc.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_sm.sh() { +fix_samp.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_st.sh() { +fix_sfc.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_steamcmd.sh() { +fix_sm.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_terraria.sh() { +fix_sof2.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_tf2.sh() { +fix_squad.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_ut3.sh() { +fix_st.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_rust.sh() { +fix_steamcmd.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_samp.sh() { +fix_terraria.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_sdtd.sh() { +fix_tf2.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_sof2.sh() { +fix_ts3.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_squad.sh() { +fix_unt.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fix_ts3.sh() { +fix_ut.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -516,12 +511,7 @@ fix_ut2k4.sh() { fn_fetch_module } -fix_ut.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_unt.sh() { +fix_ut3.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -585,27 +575,27 @@ alert_email.sh() { fn_fetch_module } -alert_ifttt.sh() { +alert_gotify.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -alert_pushbullet.sh() { +alert_ifttt.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -alert_pushover.sh() { +alert_ntfy.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -alert_gotify.sh() { +alert_pushbullet.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -alert_telegram.sh() { +alert_pushover.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -620,10 +610,11 @@ alert_slack.sh() { fn_fetch_module } -alert_ntfy.sh() { +alert_telegram.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } + # Logs core_logs.sh() { @@ -639,58 +630,57 @@ query_gamedig.sh() { } # Update - -command_update_modules.sh() { +command_check_update.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_update_linuxgsm.sh() { +command_update.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_update.sh() { +command_update_linuxgsm.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -command_check_update.sh() { +command_update_modules.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_ts3.sh() { +fn_update_modules.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_mc.sh() { +update_fctr.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_mcb.sh() { +update_jk2.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_pmc.sh() { +update_mc.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_mta.sh() { +update_mcb.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_fctr.sh() { +update_mta.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_jk2.sh() { +update_pmc.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -700,7 +690,7 @@ update_steamcmd.sh() { fn_fetch_module } -update_vints.sh() { +update_ts3.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -710,12 +700,12 @@ update_ut99.sh() { fn_fetch_module } -update_xnt.sh() { +update_vints.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -fn_update_modules.sh() { +update_xnt.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -723,6 +713,10 @@ fn_update_modules.sh() { # ## Installer modules # +check_gamedig.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} fn_autoinstall() { autoinstall=1 @@ -739,32 +733,32 @@ install_config.sh() { fn_fetch_module } -install_factorio_save.sh() { +install_dl_ut2k4.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -check_gamedig.sh() { +install_dst_token.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -install_dst_token.sh() { +install_eula.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -install_eula.sh() { +install_factorio_save.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -install_gsquery.sh() { +install_gslt.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -install_gslt.sh() { +install_gsquery.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -788,6 +782,7 @@ install_server_dir.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } + install_server_files.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module @@ -818,11 +813,6 @@ install_ut2k4.sh() { fn_fetch_module } -install_dl_ut2k4.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - install_ut2k4_key.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh old mode 100644 new mode 100755 index bf9790132..d265f577d --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -185,12 +185,12 @@ fn_update_steamcmd_remotebuild() { fi # password for branch not needed to check the buildid - remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_request "${appid}" +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]') + remotebuild=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_request "${appid}" +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -200,7 +200,7 @@ fn_update_steamcmd_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -211,14 +211,14 @@ fn_update_steamcmd_remotebuild() { fn_update_steamcmd_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" fn_print "\n" fn_print_nl "${bold}${underline}Update${default} available" fn_print_nl "* Local build: ${red}${localbuild}${default}" - fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then fn_print_nl "* Branch: ${branch}" fi @@ -229,16 +229,17 @@ fn_update_steamcmd_compare() { fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -n "${betapassword}" ]; then fn_script_log_info "Branch password: ${betapassword}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -257,7 +258,6 @@ fn_update_steamcmd_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir:?}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" @@ -268,7 +268,7 @@ fn_update_steamcmd_compare() { fn_print "\n" fn_print_nl "${bold}${underline}No update${default} available" fn_print_nl "* Local build: ${green}${localbuild}${default}" - fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then fn_print_nl "* Branch: ${branch}" fi @@ -279,7 +279,7 @@ fn_update_steamcmd_compare() { fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi diff --git a/lgsm/modules/core_trap.sh b/lgsm/modules/core_trap.sh old mode 100644 new mode 100755 index 4b66b3937..f9ff17ff1 --- a/lgsm/modules/core_trap.sh +++ b/lgsm/modules/core_trap.sh @@ -8,10 +8,12 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_exit_trap() { + local saved_exit_status=$? + echo -e "" if [ -z "${exitcode}" ]; then - exitcode=$? + exitcode=${saved_exit_status} fi - echo -e "" + if [ -z "${exitcode}" ]; then exitcode=0 fi diff --git a/lgsm/modules/fix.sh b/lgsm/modules/fix.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_ark.sh b/lgsm/modules/fix_ark.sh old mode 100644 new mode 100755 index 366d137dd..3d6913d00 --- a/lgsm/modules/fix_ark.sh +++ b/lgsm/modules/fix_ark.sh @@ -7,7 +7,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -# removes mulitple appworkshop_346110.acf if found. +# removes multiple appworkshop_346110.acf if found. steamappsfilewc="$(find "${HOME}" -name appworkshop_346110.acf | wc -l)" if [ "${steamappsfilewc}" -gt "1" ]; then fixname="multiple appworkshop acf files" @@ -15,7 +15,7 @@ if [ "${steamappsfilewc}" -gt "1" ]; then find "${HOME}" -name appworkshop_346110.acf -exec rm -f {} \; fn_fix_msg_end elif [ "${steamappsfilewc}" -eq "1" ]; then - # Steam mods directory selecter + # Steam mods directory selector # This allows LinxuGSM to select either ~/.steam or ~/Steam. depending on what is being used steamappsfile=$(find "${HOME}" -name appworkshop_346110.acf) steamappsdir=$(dirname "${steamappsfile}") diff --git a/lgsm/modules/fix_arma3.sh b/lgsm/modules/fix_arma3.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_av.sh b/lgsm/modules/fix_av.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_bo.sh b/lgsm/modules/fix_bo.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_cmw.sh b/lgsm/modules/fix_cmw.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_csgo.sh b/lgsm/modules/fix_csgo.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_dst.sh b/lgsm/modules/fix_dst.sh old mode 100644 new mode 100755 index 2848fa5bb..e4fcc5a1c --- a/lgsm/modules/fix_dst.sh +++ b/lgsm/modules/fix_dst.sh @@ -8,7 +8,7 @@ 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. +# Issue only occurs on CentOS as libcurl-gnutls.so.4 is called libcurl.so.4 on CentOS. if [ -f "/etc/redhat-release" ] && [ ! -f "${serverfiles}/bin/lib32/libcurl-gnutls.so.4" ]; then fixname="libcurl-gnutls.so.4" fn_fix_msg_start diff --git a/lgsm/modules/fix_hw.sh b/lgsm/modules/fix_hw.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_ins.sh b/lgsm/modules/fix_ins.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_kf.sh b/lgsm/modules/fix_kf.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_kf2.sh b/lgsm/modules/fix_kf2.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_mcb.sh b/lgsm/modules/fix_mcb.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_mta.sh b/lgsm/modules/fix_mta.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_nmrih.sh b/lgsm/modules/fix_nmrih.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_onset.sh b/lgsm/modules/fix_onset.sh old mode 100644 new mode 100755 index 6430e5d6b..eeb18f0e2 --- a/lgsm/modules/fix_onset.sh +++ b/lgsm/modules/fix_onset.sh @@ -10,7 +10,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" # Fixes: Failed loading "mariadb": libmariadbclient.so.18: cannot open shared object file: No such file or directory -# Issue only occures on CentOS as libmariadbclient.so.18 is called libmariadb.so.3 on CentOS. +# Issue only occurs on CentOS as libmariadbclient.so.18 is called libmariadb.so.3 on CentOS. if [ -f "/etc/redhat-release" ] && [ ! -f "${serverfiles}/libmariadbclient.so.18" ] && [ -f "/usr/lib64/libmariadb.so.3" ]; then fixname="libmariadbclient.so.18" fn_fix_msg_start diff --git a/lgsm/modules/fix_pvr.sh b/lgsm/modules/fix_pvr.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_ro.sh b/lgsm/modules/fix_ro.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_rust.sh b/lgsm/modules/fix_rust.sh old mode 100644 new mode 100755 index 80c790a59..167a5183d --- a/lgsm/modules/fix_rust.sh +++ b/lgsm/modules/fix_rust.sh @@ -23,7 +23,7 @@ if [ -z "${seed}" ] || [ "${seed}" == "0" ]; then randomseed=1 fi -# If Carbon mod is installed, run enviroment.sh +# If Carbon mod is installed, run environment.sh if [ -f "${serverfiles}/carbon/tools/environment.sh" ]; then fn_print_info_nl "Running Carbon environment.sh" fn_script_log_info "Running Carbon environment.sh" diff --git a/lgsm/modules/fix_rw.sh b/lgsm/modules/fix_rw.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_samp.sh b/lgsm/modules/fix_samp.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_sdtd.sh b/lgsm/modules/fix_sdtd.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_sfc.sh b/lgsm/modules/fix_sfc.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_sm.sh b/lgsm/modules/fix_sm.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_sof2.sh b/lgsm/modules/fix_sof2.sh old mode 100644 new mode 100755 index 45e3b299c..3eb95bc9f --- a/lgsm/modules/fix_sof2.sh +++ b/lgsm/modules/fix_sof2.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM fix_rust.sh module +# LinuxGSM fix_sof2.sh module # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com diff --git a/lgsm/modules/fix_squad.sh b/lgsm/modules/fix_squad.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_st.sh b/lgsm/modules/fix_st.sh old mode 100644 new mode 100755 index bbd9890bd..598d971b0 --- a/lgsm/modules/fix_st.sh +++ b/lgsm/modules/fix_st.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM fix_rust.sh module +# LinuxGSM fix_ts.sh module # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com diff --git a/lgsm/modules/fix_steamcmd.sh b/lgsm/modules/fix_steamcmd.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_terraria.sh b/lgsm/modules/fix_terraria.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_tf2.sh b/lgsm/modules/fix_tf2.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_ts3.sh b/lgsm/modules/fix_ts3.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_unt.sh b/lgsm/modules/fix_unt.sh old mode 100644 new mode 100755 index dbe64ffd6..f32737285 --- a/lgsm/modules/fix_unt.sh +++ b/lgsm/modules/fix_unt.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM fix_rust.sh module +# LinuxGSM fix_unt.sh module # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com diff --git a/lgsm/modules/fix_ut.sh b/lgsm/modules/fix_ut.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_ut2k4.sh b/lgsm/modules/fix_ut2k4.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_ut3.sh b/lgsm/modules/fix_ut3.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_vh.sh b/lgsm/modules/fix_vh.sh old mode 100644 new mode 100755 index 7c1455443..c6564eb19 --- a/lgsm/modules/fix_vh.sh +++ b/lgsm/modules/fix_vh.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM fix_rust.sh module +# LinuxGSM fix_vh.sh module # Author: Alasdair Haig # Website: https://linuxgsm.com # Description: Resolves issues with Valheim. @@ -21,8 +21,8 @@ if [ -f "${modsinstalledlistfullpath}" ]; then rm -rf "${serverfiles}/unstripped_corlib" fi sed -i "s/^dllSearchPathOverride=unstripped_corlib/# &/" "${serverfiles}/doorstop_config.ini" - sed -i "s/^export DOORSTOP_CORLIB_OVERRIDE_PATH="$BASEDIR\/unstripped_corlib"/# &/" "${serverfiles}/start_game_bepinex.sh" - sed -i "s/^export DOORSTOP_CORLIB_OVERRIDE_PATH="${VALHEIM_PLUS_PATH}\/unstripped_corlib"/# &/" "${serverfiles}/start_server_bepinex.sh" + sed -i "s|^export DOORSTOP_CORLIB_OVERRIDE_PATH=\"\\\$BASEDIR/unstripped_corlib\"|# &|" "${serverfiles}/start_game_bepinex.sh" + sed -i "s|^export DOORSTOP_CORLIB_OVERRIDE_PATH=\"\\\${VALHEIM_PLUS_PATH}/unstripped_corlib\"|# &|" "${serverfiles}/start_server_bepinex.sh" fi # special exports for BepInEx if installed if grep -qE "^bepinexvh" "${modsinstalledlistfullpath}"; then diff --git a/lgsm/modules/fix_wurm.sh b/lgsm/modules/fix_wurm.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_xnt.sh b/lgsm/modules/fix_xnt.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/fix_zmr.sh b/lgsm/modules/fix_zmr.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/info_distro.sh b/lgsm/modules/info_distro.sh old mode 100644 new mode 100755 index a986edf1f..1d74ac635 --- a/lgsm/modules/info_distro.sh +++ b/lgsm/modules/info_distro.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Variables providing useful info on the Operating System such as disk and performace info. +# Description: Variables providing useful info on the Operating System such as disk and performance info. # Used for command_details.sh, command_debug.sh and alert.sh. # !Note: When adding variables to this script, ensure that they are also added to the command_dev_parse_distro_details.sh script. @@ -13,9 +13,9 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "${status}" == "1" ]; then gameserverpid="$(tmux -L "${socketname}" list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}')" if [ "${engine}" == "source" ]; then - srcdslinuxpid="$(ps -ef | grep -v grep | grep "${gameserverpid}" | grep srcds_linux | awk '{print $2}')" + srcdslinuxpid="$(pgrep -P "${gameserverpid}" -x srcds_linux 2> /dev/null | head -n 1)" elif [ "${engine}" == "goldsrc" ]; then - hldslinuxpid="$(ps -ef | grep -v grep | grep "${gameserverpid}" | grep hlds_linux | awk '{print $2}')" + hldslinuxpid="$(pgrep -P "${gameserverpid}" -x hlds_linux 2> /dev/null | head -n 1)" fi fi ### Distro information @@ -252,11 +252,11 @@ if [ -d "${backupdir}" ]; then backupcount=0 # If there are backups in backup dir. - if [ "$(find "${backupdir}" -name "*.tar.*" | wc -l)" -ne "0" ]; then + if [ "$(find "${backupdir}" -maxdepth 1 -type f -name "*.tar.*" | wc -l)" -ne "0" ]; then # number of backups. - backupcount="$(find "${backupdir}"/*.tar.* | wc -l)" # integer + backupcount="$(find "${backupdir}" -maxdepth 1 -type f -name "*.tar.*" | wc -l)" # integer # most recent backup. - lastbackup="$(ls -1t "${backupdir}"/*.tar.* | head -1)" # string + lastbackup="$(find "${backupdir}" -maxdepth 1 -type f -name "*.tar.*" -printf '%T@ %p\n' 2> /dev/null | sort -nr | head -n 1 | cut -d' ' -f2-)" # string # date of most recent backup. lastbackupdate="$(date -r "${lastbackup}")" # string # no of days since last backup. @@ -272,7 +272,7 @@ netlink=$(${ethtoolcommand} "${netint}" 2> /dev/null | grep Speed | awk '{print # Sets the SteamCMD glibc requirement if the game server requirement is less or not required. if [ "${appid}" ]; then - if [ "${glibc}" = "null" ] || [ -z "${glibc}" ] || [ "$(printf '%s\n'${glibc}'\n' "2.14" | sort -V | head -n 1)" != "2.14" ]; then + if [ "${glibc}" = "null" ] || [ -z "${glibc}" ] || [ "$(printf '%s\n' "${glibc}" "2.14" | sort -V | head -n 1)" != "2.14" ]; then glibc="2.14" fi fi diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh old mode 100644 new mode 100755 index 0b43ba626..d39e2d143 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -350,7 +350,7 @@ fn_info_game_av() { rconenabled="${rconenabled:-"false"}" rconpassword="${rconpassword:-"NOT SET"}" rconport="${rconport:-"0"}" - # queryport doesnt respond to any queries, using session only. + # queryport doesn't respond to any queries, using session only. queryport=""$((port + 3))"" servername="${servername:-"NOT SET"}" serverpassword="${serverpassword:-"NOT SET"}" @@ -2514,7 +2514,7 @@ if [ ! -f "${tmpdir}/publicip.json" ] || [ "$(find "${tmpdir}/publicip.json" -mm ipresponse=$(curl -s --max-time 3 "${apiurl}") # Attempt to query ip-api.com with a 3 second timeout exitcode=$? - # Check if the first request was successfull + # Check if the first request was successful if [ "${exitcode}" -eq 0 ]; then fn_script_log_pass "Queried ${apiurl} for public IP address" @@ -2532,7 +2532,7 @@ if [ ! -f "${tmpdir}/publicip.json" ] || [ "$(find "${tmpdir}/publicip.json" -mm ipresponse=$(curl -s --max-time 3 "${apiurl}") # Attempt to query myip.wtf with a 3 second timeout as a backup exitcode=$? - # Check if the backup request was successfull + # Check if the backup request was successful if [ "${exitcode}" -eq 0 ]; then fn_script_log_pass "Queried ${apiurl} for public IP address" diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh old mode 100644 new mode 100755 index 242c6b337..1ef950830 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -369,7 +369,7 @@ fn_info_messages_gameserver() { fi fi - # Reverved Slots + # Reserved Slots if [ -n "${statspassword}" ]; then echo -e "${lightblue}Reserved Slots:\t${default}${reservedslots}" fi @@ -578,7 +578,7 @@ fn_info_messages_script() { : elif [ -z "${glibc}" ]; then echo -e "${lightblue}glibc required:\t${red}UNKNOWN${default}" - elif [ "$(printf '%s\n'${glibc}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibc}" ]; then + elif [ "$(printf '%s\n' "${glibc}" "${glibcversion}" | sort -V | head -n 1)" != "${glibc}" ]; then echo -e "${lightblue}glibc required:\t${red}${glibc} ${default}(${red}distro glibc ${glibcversion} too old${default})" else echo -e "${lightblue}glibc required:\t${green}${glibc}${default}" @@ -598,7 +598,7 @@ fn_info_messages_script() { echo -e "${lightblue}Gotify alert:\t${default}${gotifyalert}" fi # IFTTT alert - if [ "${iftttalert}" == "on" ]; then + if [ "${iftttalert}" == "on" ]; then echo -e "${lightblue}IFTTT alert:\t${default}${iftttalert}" fi # Pushbullet alert diff --git a/lgsm/modules/info_stats.sh b/lgsm/modules/info_stats.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_complete.sh b/lgsm/modules/install_complete.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh old mode 100644 new mode 100755 index b73e7b4b2..41d4ad866 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -16,7 +16,7 @@ fn_check_cfgdir() { fi } -# Copys default configs from Game-Server-Configs repo to server config location. +# Copies default configs from Game-Server-Configs repo to server config location. fn_default_config_remote() { echo -e "" echo -e "${bold}${lightyellow}Downloading ${gamename} Configs${default}" @@ -88,7 +88,7 @@ fn_default_config_remote() { done } -# Copys local default config to server config location. +# Copies local default config to server config location. fn_default_config_local() { echo -e "" echo -e "${bold}${lightyellow}Copying ${gamename} Configs${default}" diff --git a/lgsm/modules/install_dst_token.sh b/lgsm/modules/install_dst_token.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_eula.sh b/lgsm/modules/install_eula.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_factorio_save.sh b/lgsm/modules/install_factorio_save.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_gslt.sh b/lgsm/modules/install_gslt.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_header.sh b/lgsm/modules/install_header.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_logs.sh b/lgsm/modules/install_logs.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_mta_resources.sh b/lgsm/modules/install_mta_resources.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_retry.sh b/lgsm/modules/install_retry.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_server_dir.sh b/lgsm/modules/install_server_dir.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_server_files.sh b/lgsm/modules/install_server_files.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_squad_license.sh b/lgsm/modules/install_squad_license.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_stats.sh b/lgsm/modules/install_stats.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_steamcmd.sh b/lgsm/modules/install_steamcmd.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_ts3db.sh b/lgsm/modules/install_ts3db.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/install_ut2k4_key.sh b/lgsm/modules/install_ut2k4_key.sh old mode 100644 new mode 100755 index 963a52f10..4c62422d0 --- a/lgsm/modules/install_ut2k4_key.sh +++ b/lgsm/modules/install_ut2k4_key.sh @@ -18,7 +18,7 @@ if [ -z "${autoinstall}" ]; then echo -e "Once you have the key enter it below" echo -n "KEY: " read -r CODE - echo -e ""\""CDKey"\""="\""${CODE}"\""" > "${systemdir}/cdkey" + printf '"CDKey"="%s"\n' "${CODE}" > "${systemdir}/cdkey" if [ -f "${systemdir}/cdkey" ]; then fn_script_log_info "UT2K4 Server CD Key created" fi diff --git a/lgsm/modules/mods_core.sh b/lgsm/modules/mods_core.sh old mode 100644 new mode 100755 index b88e0c05e..bed0f9f49 --- a/lgsm/modules/mods_core.sh +++ b/lgsm/modules/mods_core.sh @@ -197,14 +197,15 @@ fn_mod_get_info() { # Variable to know when job is done. modinfocommand="0" # Find entry in global array. - for ((index = 0; index <= ${#mods_global_array[@]}; index++)); do + for ((index = 0; index < ${#mods_global_array[@]}; index++)); do # When entry is found. if [ "${mods_global_array[index]}" == "${currentmod}" ]; then # Go back to the previous "MOD" separator. - for ((index = index; index <= ${#mods_global_array[@]}; index--)); do + for ((index_search = index; index_search >= 0; index_search--)); do # When "MOD" is found. - if [ "${mods_global_array[index]}" == "MOD" ]; then + if [ "${mods_global_array[index_search]}" == "MOD" ]; then # Get info. + index=${index_search} fn_mods_define modinfocommand="1" break @@ -249,7 +250,7 @@ fn_mods_define() { } # Builds list of installed mods. -# using installed-mods.txt grabing mod info from mods_list.sh. +# using installed-mods.txt grabbing mod info from mods_list.sh. fn_mods_installed_list() { fn_mods_count_installed # Set/reset variables. @@ -331,7 +332,7 @@ fn_compatible_mod_engines() { # How many engines we need to test. enginesamount=$(echo -e "${modengines}" | awk -F ';' '{ print NF }') # Test all subvalue of "modengines" using the ";" separator. - for ((gamevarindex = 1; gamevarindex < ${enginesamount}; gamevarindex++)); do + for ((gamevarindex = 1; gamevarindex < enginesamount; gamevarindex++)); do # Put current engine name into modtest variable. enginemodtest=$(echo -e "${modengines}" | awk -F ';' -v x=${gamevarindex} '{ print $x }') # If engine name matches. @@ -472,7 +473,7 @@ fn_mods_check_installed() { # Count installed mods. fn_mods_count_installed # If no mods are found. - if [ ${installedmodscount} -eq 0 ]; then + if [ "${installedmodscount}" -eq 0 ]; then echo -e "" fn_print_failure_nl "No installed mods or addons were found" echo -e " * Install mods using LinuxGSM first with: ./${selfname} mods-install" @@ -566,7 +567,7 @@ fn_mod_liblist_gam_filenames() { esac } -# modifers for liblist.gam to add/remote metamod binaries +# modifiers for liblist.gam to add/remote metamod binaries fn_mod_install_liblist_gam_file() { fn_mod_liblist_gam_filenames @@ -689,13 +690,9 @@ fn_mod_install_amxmodx_file() { # since it does exist, is the entry already in plugins.ini logentry="line (linux addons/amxmodx/dlls/amxmodx_mm_i386.so) inserted into ${modinstalldir}/addons/metamod/plugins.ini" echo -en "adding amxmodx_mm_i386.so in plugins.ini..." - grep -q "amxmodx_mm_i386.so" "${modinstalldir}/addons/metamod/plugins.ini" - exitcode=$? - if [ "${exitcode}" -ne 0 ]; then + if ! grep -q "amxmodx_mm_i386.so" "${modinstalldir}/addons/metamod/plugins.ini"; then # file exists but the entry does not, let's add it - echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" >> "${modinstalldir}/addons/metamod/plugins.ini" - exitcode=$? - if [ "${exitcode}" -ne 0 ]; then + if ! echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" >> "${modinstalldir}/addons/metamod/plugins.ini"; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else @@ -705,9 +702,7 @@ fn_mod_install_amxmodx_file() { fi else # create new file and add the mod to it - echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" > "${modinstalldir}/addons/metamod/plugins.ini" - exitcode=$? - if [ "${exitcode}" -ne 0 ]; then + if ! echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" > "${modinstalldir}/addons/metamod/plugins.ini"; then fn_script_log_fail "${logentry}" fn_print_fail_eol_nl core_exit.sh @@ -723,10 +718,8 @@ fn_mod_remove_amxmodx_file() { # since it does exist, is the entry already in plugins.ini logentry="line (linux addons/amxmodx/dlls/amxmodx_mm_i386.so) removed from ${modinstalldir}/addons/metamod/plugins.ini" echo -en "removing amxmodx_mm_i386.so in plugins.ini..." - grep -q "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" "${modinstalldir}/addons/metamod/plugins.ini" - # iIs it found? If so remove it and clean up - exitcode=$? - if [ "${exitcode}" -eq 0 ]; then + # is it found? If so remove it and clean up + if grep -q "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" "${modinstalldir}/addons/metamod/plugins.ini"; then # delete the line we inserted sed -i '/linux addons\/amxmodx\/dlls\/amxmodx_mm_i386.so/d' "${modinstalldir}/addons/metamod/plugins.ini" # remove empty lines diff --git a/lgsm/modules/mods_list.sh b/lgsm/modules/mods_list.sh old mode 100644 new mode 100755 index bbefc5ea2..b3f9877f1 --- a/lgsm/modules/mods_list.sh +++ b/lgsm/modules/mods_list.sh @@ -129,7 +129,7 @@ modseparator="MOD" # [9] | "Supported Engines;": list them according to LGSM ${engine} variables, separated and ended with a semicolon, or use ENGINES to ignore the value # [10] | "Supported Games;": list them according to LGSM ${gamename} variables, separated and ended with a semicolon, or use GAMES to ignore the value # [11] | "Unsupported Games;": list them according to LGSM ${gamename} variables, separated and ended with a semicolon, or use NOTGAMES to ignore the value (useful to exclude a game when using Supported Engines) -# [12] | "AUTHOR_URL" is the author's website, displayed to the user when chosing mods to install +# [12] | "AUTHOR_URL" is the author's website, displayed to the user when choosing mods to install # [13] | "Short Description" a description showed to the user upon installation/removal # Half-life 1 Engine Mods @@ -172,7 +172,7 @@ mod_info_ulib=(MOD "ulib" "ULib" "https://codeload.github.com/TeamUlysses/ulib/z mod_info_ulx=(MOD "ulx" "ULX" "https://codeload.github.com/TeamUlysses/ulx/zip/master" "ulx-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "Admin Panel (requires ULib)") mod_info_utime=(MOD "utime" "UTime" "https://github.com/TeamUlysses/utime/archive/master.zip" "utime-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "Keep track of players play time") mod_info_uclip=(MOD "uclip" "UClip" "https://github.com/TeamUlysses/uclip/archive/master.zip" "uclip-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "An alternative to noclip") -mod_info_acf=(MOD "acf" "Armoured Combat Framework" "https://github.com/nrlulz/ACF/archive/master.zip" "acf-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "acf-master/lua/acf/shared/guns;" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/nrlulz/ACF" "Realistic Wepons & Engines") +mod_info_acf=(MOD "acf" "Armoured Combat Framework" "https://github.com/nrlulz/ACF/archive/master.zip" "acf-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "acf-master/lua/acf/shared/guns;" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/nrlulz/ACF" "Realistic Weapons & Engines") mod_info_acf_missiles=(MOD "acfmissiles" "ACF Missiles" "https://github.com/Bubbus/ACF-Missiles/archive/master.zip" "acf-missiles-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Bubbus/ACF-Missiles" "More missiles for ACF") mod_info_advdupe2=(MOD "advdupe2" "Advanced Duplicator 2" "https://github.com/wiremod/advdupe2/archive/master.zip" "advdupe2-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://www.wiremod.com" "Save your constructions. Second version") mod_info_pac3=(MOD "pac3" "PAC3" "https://github.com/CapsAdmin/pac3/archive/master.zip" "pac3-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/CapsAdmin/pac3" "Advanced player model customization") @@ -191,7 +191,7 @@ mod_info_magneticdipole=(MOD "magneticdipole" "Magnetic Dipole" "https://github. mod_info_environmentorganizer=(MOD "environmentorganizer" "Environment Organizer" "https://github.com/dvdvideo1234/environmentorganizer/archive/master.zip" "environmentorganizer-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/EnvironmentOrganizer" "Installs routines designed for server settings adjustment") mod_info_improved_stacker=(MOD "improved-stacker" "Improved Stacker" "https://github.com/Mista-Tea/improved-stacker/archive/master.zip" "improved-stacker-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-stacker" "Stacks entities in the direction chosen") mod_info_improved_weight=(MOD "improved-weight" "Improved Weight" "https://github.com/Mista-Tea/improved-weight/archive/master.zip" "improved-weight-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-weight" "Weight tool but with more features") -mod_info_improved_antinoclip=(MOD "improved-antinoclip" "Improved Antinoclip" "https://github.com/Mista-Tea/improved-antinoclip/archive/master.zip" "improved-antinoclip-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-antinoclip" "Controls clipping trough an object") +mod_info_improved_antinoclip=(MOD "improved-antinoclip" "Improved Antinoclip" "https://github.com/Mista-Tea/improved-antinoclip/archive/master.zip" "improved-antinoclip-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-antinoclip" "Controls clipping through an object") mod_info_darkrp=(MOD "darkrp" "DarkRP" "https://github.com/FPtje/DarkRP/archive/master.zip" "darkrp-master.zip" "0" "LowercaseOn" "${systemdir}/gamemodes" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://darkrp.com" "Most popular gamemode") mod_info_darkrpmodification=(MOD "darkrpmodification" "DarkRP Modification" "https://github.com/FPtje/darkrpmodification/archive/master.zip" "darkrpmodification-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "NOUPDATE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://darkrp.com" "Customize DarkRP settings") mod_info_laserstool=(MOD "laserstool" "Laser STool" "https://github.com/dvdvideo1234/laserstool/archive/main.zip" "laserstool-main.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/LaserSTool" "Scripted tool that spawns laser entities, simulates light rays and even kill players") diff --git a/lgsm/modules/query_gamedig.sh b/lgsm/modules/query_gamedig.sh old mode 100644 new mode 100755 index d8c3c6a7f..1fa74a823 --- a/lgsm/modules/query_gamedig.sh +++ b/lgsm/modules/query_gamedig.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Querys a gameserver using node-gamedig. +# Description: Queries a gameserver using node-gamedig. # https://github.com/gamedig/node-gamedig moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/query_gsquery.py b/lgsm/modules/query_gsquery.py index 4dbde90dd..c4b8c3ddc 100644 --- a/lgsm/modules/query_gsquery.py +++ b/lgsm/modules/query_gsquery.py @@ -6,154 +6,206 @@ # Website: https://linuxgsm.com # Description: Allows querying of various game servers. +"""Query game servers using a set of lightweight UDP protocols.""" + import argparse import socket import sys -engine_types = ('protocol-valve', 'protocol-quake2', 'protocol-quake3', 'protocol-gamespy1', - 'protocol-unreal2', 'ut3', 'minecraft', 'minecraftbe', 'jc2m', 'mumbleping', 'soldat', 'teeworlds') +engine_types = ( + "protocol-valve", + "protocol-quake2", + "protocol-quake3", + "protocol-gamespy1", + "protocol-unreal2", + "ut3", + "minecraft", + "minecraftbe", + "jc2m", + "mumbleping", + "soldat", + "teeworlds", +) + +class GSQuery: + """Game server query dispatcher.""" -class gsquery: server_response_timeout = 2 default_buffer_length = 1024 - sourcequery = ('protocol-valve', 'avalanche3.0', 'barotrauma', 'madness', 'quakelive', 'realvirtuality', - 'refractor', 'source', 'goldsrc', 'spark', 'starbound', 'unity3d', 'unreal4', 'wurm') - idtech2query = ('protocol-quake2', 'idtech2', 'quake', 'iw2.0') - idtech3query = ('protocol-quake3', 'iw3.0', 'ioquake3', 'qfusion') - minecraftquery = ('minecraft', 'lwjgl2') - minecraftbequery = ('minecraftbe') - jc2mquery = ('jc2m') - mumblequery = ('mumbleping') - soldatquery = ('soldat') - twquery = ('teeworlds') - unrealquery = ('protocol-gamespy1', 'unreal') - unreal2query = ('protocol-unreal2', 'unreal2') - unreal3query = ('ut3', 'unreal3') + sourcequery = ( + "protocol-valve", + "avalanche3.0", + "barotrauma", + "madness", + "quakelive", + "realvirtuality", + "refractor", + "source", + "goldsrc", + "spark", + "starbound", + "unity3d", + "unreal4", + "wurm", + ) + idtech2query = ("protocol-quake2", "idtech2", "quake", "iw2.0") + idtech3query = ("protocol-quake3", "iw3.0", "ioquake3", "qfusion") + minecraftquery = ("minecraft", "lwjgl2") + minecraftbequery = ("minecraftbe",) + jc2mquery = ("jc2m",) + mumblequery = ("mumbleping",) + soldatquery = ("soldat",) + twquery = ("teeworlds",) + unrealquery = ("protocol-gamespy1", "unreal") + unreal2query = ("protocol-unreal2", "unreal2") + unreal3query = ("ut3", "unreal3") def __init__(self, arguments): + """Create a query instance from parsed CLI args.""" + self.argument = arguments # if self.argument.engine in self.sourcequery: - self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0' + self.query_prompt_string = b"\xff\xff\xff\xffTSource Engine Query\0" elif self.argument.engine in self.idtech2query: - self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00' + self.query_prompt_string = b"\xff\xff\xff\xffstatus\x00" elif self.argument.engine in self.idtech3query: - self.query_prompt_string = b'\xff\xff\xff\xffgetstatus' + self.query_prompt_string = b"\xff\xff\xff\xffgetstatus" elif self.argument.engine in self.jc2mquery: - self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40' + self.query_prompt_string = b"\xfe\xfd\x09\x10\x20\x30\x40" elif self.argument.engine in self.minecraftquery: - self.query_prompt_string = b'\xFE\xFD\x09\x3d\x54\x1f\x93' + self.query_prompt_string = b"\xfe\xfd\x09\x3d\x54\x1f\x93" elif self.argument.engine in self.minecraftbequery: - self.query_prompt_string = b'\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x12\x34\x56\x78\x00\x00\x00\x00\x00\x00\x00\x00' + self.query_prompt_string = ( + b"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00" + b"\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x12\x34\x56\x78" + b"\x00\x00\x00\x00\x00\x00\x00\x00" + ) elif self.argument.engine in self.mumblequery: - self.query_prompt_string = b'\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08' + self.query_prompt_string = ( + b"\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08" + ) elif self.argument.engine in self.soldatquery: - self.query_prompt_string = b'\x69\x00' + self.query_prompt_string = b"\x69\x00" elif self.argument.engine in self.twquery: - self.query_prompt_string = b'\x04\x00\x00\xff\xff\xff\xff\x05' + \ - bytearray(511) + self.query_prompt_string = b"\x04\x00\x00\xff\xff\xff\xff\x05" + bytearray( + 511 + ) elif self.argument.engine in self.unrealquery: - self.query_prompt_string = b'\x5C\x69\x6E\x66\x6F\x5C' + self.query_prompt_string = b"\x5c\x69\x6e\x66\x6f\x5c" elif self.argument.engine in self.unreal2query: - self.query_prompt_string = b'\x79\x00\x00\x00\x00' + self.query_prompt_string = b"\x79\x00\x00\x00\x00" elif self.argument.engine in self.unreal3query: - self.query_prompt_string = b'\xFE\xFD\x09\x00\x00\x00\x00' + self.query_prompt_string = b"\xfe\xfd\x09\x00\x00\x00\x00" self.connected = False self.response = None @staticmethod def fatal_error(error_message, error_code=1): - sys.stderr.write('ERROR: ' + str(error_message) + '\n') + """Write an error message to stderr and exit.""" + + sys.stderr.write("ERROR: " + str(error_message) + "\n") sys.exit(error_code) @staticmethod - def exit_success(success_message=''): - sys.stdout.write('OK: ' + str(success_message) + '\n') + def exit_success(success_message=""): + """Write a success message to stdout and exit.""" + + sys.stdout.write("OK: " + str(success_message) + "\n") sys.exit(0) def responding(self): + """Send a single UDP query and print the response.""" + # Connect. connection = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) connection.settimeout(self.server_response_timeout) try: self.connected = connection.connect( - (self.argument.address, int(self.argument.port))) + (self.argument.address, int(self.argument.port)) + ) except socket.timeout: - self.fatal_error('Request timed out', 1) - except Exception: - self.fatal_error('Unable to connect', 1) + self.fatal_error("Request timed out", 1) + except OSError: + self.fatal_error("Unable to connect", 1) # Send. connection.send(self.query_prompt_string) # Receive. try: self.response = connection.recv(self.default_buffer_length) except socket.error: - self.fatal_error('Unable to receive', 2) + self.fatal_error("Unable to receive", 2) connection.close() # Response. if self.response is None: - self.fatal_error('No response', 3) + self.fatal_error("No response", 3) if len(self.response) < 5: - sys.exit('Short response.', 3) + sys.exit("Short response.", 3) else: self.exit_success(str(self.response)) def parse_args(): + """Parse command-line arguments.""" + parser = argparse.ArgumentParser( - description='Allows querying of various game servers.', - usage='usage: python3 %(prog)s [options]', - add_help=False + description="Allows querying of various game servers.", + usage="usage: python3 %(prog)s [options]", + add_help=False, ) parser.add_argument( - '-a', '--address', + "-a", + "--address", type=str, required=True, - help='The IPv4 address of the server.' + help="The IPv4 address of the server.", ) parser.add_argument( - '-p', '--port', + "-p", + "--port", type=int, required=True, - help='The IPv4 port of the server.' + help="The IPv4 port of the server.", ) parser.add_argument( - '-e', '--engine', - metavar='ENGINE', + "-e", + "--engine", + metavar="ENGINE", choices=engine_types, - help='Engine type: ' + ' '.join(engine_types) + help="Engine type: " + " ".join(engine_types), ) parser.add_argument( - '-v', '--verbose', - action='store_true', - help='Display verbose output.' + "-v", + "--verbose", + action="store_true", + help="Display verbose output.", ) parser.add_argument( - '-d', '--debug', - action='store_true', - help='Display debugging output.' + "-d", + "--debug", + action="store_true", + help="Display debugging output.", ) parser.add_argument( - '-V', '--version', - action='version', - version='%(prog)s 0.0.1', - help='Display version and exit.' - ) - parser.add_argument( - '-h', '--help', - action='help', - help='Display help and exit.' + "-V", + "--version", + action="version", + version="%(prog)s 0.0.1", + help="Display version and exit.", ) + parser.add_argument("-h", "--help", action="help", help="Display help and exit.") return parser.parse_args() def main(): + """CLI entrypoint.""" + arguments = parse_args() - server = gsquery(arguments) + server = GSQuery(arguments) server.responding() -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/lgsm/modules/update_fctr.sh b/lgsm/modules/update_fctr.sh old mode 100644 new mode 100755 index 3418c7424..5de789cdb --- a/lgsm/modules/update_fctr.sh +++ b/lgsm/modules/update_fctr.sh @@ -10,25 +10,32 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles. fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "nohash" - fn_dl_extract "${tmpdir}" "factorio_headless_${factorioarch}-${remotebuildversion}.tar.xz" "${serverfiles}" "factorio" + fn_dl_extract "${tmpdir}" "factorio_headless_${factorioarch}-${remotebuild}.tar.xz" "${serverfiles}" "factorio" fn_clear_tmp } fn_update_localbuild() { - # Gets local build info. - fn_print_dots "Checking local build: ${remotelocation}" + # Optional arg1: 'silent' to suppress user-facing output + local mode="${1:-}" + if [ "${mode}" != "silent" ]; then + fn_print_dots "Checking local build: ${remotelocation}" + fi # Uses executable to get local build. if [ -d "${executabledir}" ]; then cd "${executabledir}" || exit localbuild=$(${executable} --version | grep -m 1 "Version:" | awk '{print $2}') fi if [ -z "${localbuild}" ]; then - fn_print_error "Checking local build: ${remotelocation}: missing local build info" + if [ "${mode}" != "silent" ]; then + fn_print_error "Checking local build: ${remotelocation}: missing local build info" + fi fn_script_log_error "Missing local build info" fn_script_log_error "Set localbuild to 0" localbuild="0" else - fn_print_ok "Checking local build: ${remotelocation}" + if [ "${mode}" != "silent" ]; then + fn_print_ok "Checking local build: ${remotelocation}" + fi fn_script_log_pass "Checking local build" fi } @@ -37,14 +44,14 @@ fn_update_remotebuild() { # Gets remote build info. apiurl="https://factorio.com/get-download/${branch}/headless/${factorioarch}" remotebuildresponse=$(curl -s "${apiurl}") - remotebuildversion=$(echo "${remotebuildresponse}" | grep -o '[0-9]\.[0-9]\{1,\}\.[0-9]\{1,\}' | head -1) + remotebuild=$(echo "${remotebuildresponse}" | grep -o '[0-9]\.[0-9]\{1,\}\.[0-9]\{1,\}' | head -1) remotebuildurl="https://factorio.com/get-download/${branch}/headless/${factorioarch}" - remotebuildfilename="factorio_headless_${factorioarch}-${remotebuildversion}.tar.xz" + remotebuildfilename="factorio_headless_${factorioarch}-${remotebuild}.tar.xz" if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -54,7 +61,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -65,35 +72,37 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild} ${factorioarch}${default}" - echo -e "* Remote build: ${green}${remotebuildversion} ${factorioarch}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild} ${factorioarch}" - fn_script_log_info "Remote build: ${remotebuildversion} ${factorioarch}" + fn_script_log_info "Remote build: ${remotebuild} ${factorioarch}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then - date +%s > "${lockdir}/last-updated.lock" + # Keep track of the build before updating for alert purposes. + previousbuild="${localbuild}" + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -120,6 +129,23 @@ fn_update_compare() { command_start.sh fn_firstcommand_reset fi + # Refresh local build value after update (silent) so alerts show new version. + fn_update_localbuild silent + # Verify the update applied correctly unless forced update to same version. + if [ "${localbuild}" != "${remotebuild}" ]; then + # If forced update and version unchanged treat as acceptable; otherwise failure. + if [ "${forceupdate}" != "1" ] || [ "${previousbuild}" = "${localbuild}" ]; then + fn_script_log_error "Update verification failed: expected ${remotebuild}, got ${localbuild}" + fn_print_fail_nl "Update verification failed: expected ${remotebuild}, got ${localbuild}" + updatefailureexpected="${remotebuild}" + updatefailuregot="${localbuild}" + alert="update-failed" + alert.sh + core_exit.sh + fi + else + fn_script_log_pass "Update verification success: ${previousbuild} -> ${localbuild}" + fi unset exitbypass alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then @@ -128,26 +154,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild} ${factorioarch}${default}" - echo -e "* Remote build: ${green}${remotebuildversion} ${factorioarch}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild} ${factorioarch}" - fn_script_log_info "Remote build: ${remotebuildversion} ${factorioarch}" + fn_script_log_info "Remote build: ${remotebuild} ${factorioarch}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } diff --git a/lgsm/modules/update_jk2.sh b/lgsm/modules/update_jk2.sh old mode 100644 new mode 100755 index 5fdd54c65..ee40988d9 --- a/lgsm/modules/update_jk2.sh +++ b/lgsm/modules/update_jk2.sh @@ -36,12 +36,12 @@ fn_update_remotebuild() { remotebuildresponse=$(curl -s "${apiurl}") remotebuildfilename=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("dedicated.zip")) | .name') remotebuildurl=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("dedicated.zip")) | .browser_download_url') - remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '.tag_name') + remotebuild=$(echo "${remotebuildresponse}" | jq -r '.tag_name') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -51,7 +51,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -62,34 +62,35 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -117,7 +118,6 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" @@ -125,26 +125,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } @@ -152,12 +152,6 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="github.com" -if [ ! "$(command -v jq 2> /dev/null)" ]; then - fn_print_fail_nl "jq is not installed" - fn_script_log_fail "jq is not installed" - core_exit.sh -fi - if [ "${firstcommandname}" == "INSTALL" ]; then fn_update_remotebuild fn_update_dl diff --git a/lgsm/modules/update_mc.sh b/lgsm/modules/update_mc.sh old mode 100644 new mode 100755 index a9be77576..81540f002 --- a/lgsm/modules/update_mc.sh +++ b/lgsm/modules/update_mc.sh @@ -39,24 +39,24 @@ fn_update_remotebuild() { remotebuildresponse=$(curl -s "${apiurl}") # Latest release. if [ "${branch}" == "release" ] && [ "${mcversion}" == "latest" ]; then - remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '.latest.release') + remotebuild=$(echo "${remotebuildresponse}" | jq -r '.latest.release') # Latest snapshot. elif [ "${branch}" == "snapshot" ] && [ "${mcversion}" == "latest" ]; then - remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '.latest.snapshot') + remotebuild=$(echo "${remotebuildresponse}" | jq -r '.latest.snapshot') # Specific release/snapshot. else - remotebuildversion=$(echo "${remotebuildresponse}" | jq -r --arg branch "${branch}" --arg mcversion "${mcversion}" '.versions | .[] | select(.type==$branch and .id==$mcversion) | .id') + remotebuild=$(echo "${remotebuildresponse}" | jq -r --arg branch "${branch}" --arg mcversion "${mcversion}" '.versions | .[] | select(.type==$branch and .id==$mcversion) | .id') fi - remotebuildfilename="minecraft_server.${remotebuildversion}.jar" + remotebuildfilename="minecraft_server.${remotebuild}.jar" # Generate link to version manifest json. - remotebuildmanifest=$(echo "${remotebuildresponse}" | jq -r --arg branch "${branch}" --arg mcversion "${remotebuildversion}" '.versions | .[] | select(.type==$branch and .id==$mcversion) | .url') + remotebuildmanifest=$(echo "${remotebuildresponse}" | jq -r --arg branch "${branch}" --arg mcversion "${remotebuild}" '.versions | .[] | select(.type==$branch and .id==$mcversion) | .url') # Generate link to server.jar remotebuildurl=$(curl -s "${remotebuildmanifest}" | jq -r '.downloads.server.url') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -66,7 +66,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -77,35 +77,35 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then - date +%s > "${lockdir}/last-updated.lock" + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -140,26 +140,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } @@ -167,12 +167,6 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="mojang.com" -if [ ! "$(command -v jq 2> /dev/null)" ]; then - fn_print_fail_nl "jq is not installed" - fn_script_log_fail "jq is not installed" - core_exit.sh -fi - if [ "${firstcommandname}" == "INSTALL" ]; then fn_update_remotebuild fn_update_dl diff --git a/lgsm/modules/update_mcb.sh b/lgsm/modules/update_mcb.sh old mode 100644 new mode 100755 index a8616c3b8..9940415a1 --- a/lgsm/modules/update_mcb.sh +++ b/lgsm/modules/update_mcb.sh @@ -8,12 +8,12 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { - fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "bedrock_server.${remotebuildversion}.zip" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "bedrock_server.${remotebuild}.zip" "nochmodx" "norun" "noforce" "nohash" echo -e "Extracting to ${serverfiles}...\c" if [ "${firstcommandname}" == "INSTALL" ]; then - unzip -oq "${tmpdir}/bedrock_server.${remotebuildversion}.zip" -x "server.properties" -d "${serverfiles}" + unzip -oq "${tmpdir}/bedrock_server.${remotebuild}.zip" -x "server.properties" -d "${serverfiles}" else - unzip -oq "${tmpdir}/bedrock_server.${remotebuildversion}.zip" -x "permissions.json" "server.properties" "allowlist.json" -d "${serverfiles}" + unzip -oq "${tmpdir}/bedrock_server.${remotebuild}.zip" -x "permissions.json" "server.properties" "allowlist.json" -d "${serverfiles}" fi exitcode=$? if [ "${exitcode}" -ne 0 ]; then @@ -61,13 +61,13 @@ fn_update_remotebuild() { else remotebuildurl=$(echo "${remotebuildresponse}" | jq -r 'select(.downloadType == "serverBedrockLinux") | .downloadUrl') fi - remotebuildversion=$(echo "${remotebuildurl}" | grep -Eo "[.0-9]+[0-9]") - remotebuildfilename="bedrock-server-${remotebuildversion}.zip" + remotebuild=$(echo "${remotebuildurl}" | grep -Eo "[.0-9]+[0-9]") + remotebuildfilename="bedrock-server-${remotebuild}.zip" if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -77,7 +77,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -88,35 +88,35 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then - date +%s > "${lockdir}/last-updated.lock" + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -151,26 +151,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } @@ -178,12 +178,6 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="minecraft.net" -if [ ! "$(command -v jq 2> /dev/null)" ]; then - fn_print_fail_nl "jq is not installed" - fn_script_log_fail "jq is not installed" - core_exit.sh -fi - if [ "${firstcommandname}" == "INSTALL" ]; then fn_update_remotebuild fn_update_dl diff --git a/lgsm/modules/update_mta.sh b/lgsm/modules/update_mta.sh old mode 100644 new mode 100755 index 50a3fb895..b1ba0459c --- a/lgsm/modules/update_mta.sh +++ b/lgsm/modules/update_mta.sh @@ -39,11 +39,11 @@ fn_update_remotebuild() { remotebuildresponse=$(curl -s "${apiurl}") remotebuildfilename="multitheftauto_linux_x64.tar.gz" remotebuildurl="http://linux.mtasa.com/dl/multitheftauto_linux_x64.tar.gz" - remotebuildversion=$(echo "${remotebuildresponse}") + remotebuild="${remotebuildresponse}" if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -53,7 +53,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -64,7 +64,7 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" if [ "${forceupdate}" == "1" ]; then @@ -74,30 +74,31 @@ fn_update_compare() { mtaupdatestatus="available" fi fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -125,7 +126,6 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" @@ -133,26 +133,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } @@ -160,12 +160,6 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="linux.mtasa.com" -if [ ! "$(command -v jq 2> /dev/null)" ]; then - fn_print_fail_nl "jq is not installed" - fn_script_log_fail "jq is not installed" - core_exit.sh -fi - if [ "${firstcommandname}" == "INSTALL" ]; then fn_update_remotebuild fn_update_dl diff --git a/lgsm/modules/update_pmc.sh b/lgsm/modules/update_pmc.sh old mode 100644 new mode 100755 index c38911d4e..e0bbfa05a --- a/lgsm/modules/update_pmc.sh +++ b/lgsm/modules/update_pmc.sh @@ -11,7 +11,7 @@ fn_update_dl() { # Download and extract files to serverfiles. fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "chmodx" "norun" "force" "${remotebuildhash}" cp -f "${tmpdir}/${remotebuildfilename}" "${serverfiles}/${executable#./}" - echo "${remotebuildversion}" > "${serverfiles}/build.txt" + echo "${remotebuild}" > "${serverfiles}/build.txt" fn_clear_tmp } @@ -61,12 +61,12 @@ fn_update_remotebuild() { remotebuildhash=$(echo "${remotebuildresponseversion}" | jq -r '.downloads.application.sha256') remotebuildurl="${apiurl}/${paperproject}/versions/${remotebuildmcversion}/builds/${remotebuildpaperversion}/downloads/${remotebuildfilename}" # Combines Minecraft: Java Edition version and paper build. e.g 1.16.5-456 - remotebuildversion="${remotebuildmcversion}-${remotebuildpaperversion}" + remotebuild="${remotebuildmcversion}-${remotebuildpaperversion}" if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -76,7 +76,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -87,35 +87,35 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then - date +%s > "${lockdir}/last-updated.lock" + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -150,26 +150,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } @@ -177,12 +177,6 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="papermc.io" -if [ ! "$(command -v jq 2> /dev/null)" ]; then - fn_print_fail_nl "jq is not installed" - fn_script_log_fail "jq is not installed" - core_exit.sh -fi - if [ "${shortname}" == "pmc" ]; then paperproject="paper" elif [ "${shortname}" == "vpmc" ]; then diff --git a/lgsm/modules/update_steamcmd.sh b/lgsm/modules/update_steamcmd.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/update_ts3.sh b/lgsm/modules/update_ts3.sh old mode 100644 new mode 100755 index e1917e5e1..ec3bc0060 --- a/lgsm/modules/update_ts3.sh +++ b/lgsm/modules/update_ts3.sh @@ -43,12 +43,12 @@ fn_update_remotebuild() { remotebuildhash=$(echo -e "${remotebuildresponse}" | jq -r '.linux.x86.checksum') fi remotebuildfilename=$(basename "${remotebuildurl}") - remotebuildversion=$(echo -e "${remotebuildresponse}" | jq -r '.linux.x86_64.version') + remotebuild=$(echo -e "${remotebuildresponse}" | jq -r '.linux.x86_64.version') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -58,7 +58,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -69,35 +69,35 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then - date +%s > "${lockdir}/last-updated.lock" + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -132,26 +132,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } @@ -171,12 +171,6 @@ fi # The location where the builds are checked and downloaded. remotelocation="teamspeak.com" -if [ ! "$(command -v jq 2> /dev/null)" ]; then - fn_print_fail_nl "jq is not installed" - fn_script_log_fail "jq is not installed" - core_exit.sh -fi - if [ "${firstcommandname}" == "INSTALL" ]; then fn_update_remotebuild fn_update_dl diff --git a/lgsm/modules/update_ut99.sh b/lgsm/modules/update_ut99.sh old mode 100644 new mode 100755 index bdfb96f0b..4e3f93b31 --- a/lgsm/modules/update_ut99.sh +++ b/lgsm/modules/update_ut99.sh @@ -11,7 +11,7 @@ fn_update_dl() { # Download and extract files to serverfiles. fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "nohash" fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" - echo "${remotebuildversion}" > "${serverfiles}/build.txt" + echo "${remotebuild}" > "${serverfiles}/build.txt" fn_clear_tmp } @@ -37,12 +37,12 @@ fn_update_remotebuild() { remotebuildresponse=$(curl -s "${apiurl}") remotebuildfilename=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("Linux-amd64")) | .name') remotebuildurl=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("Linux-amd64")) | .browser_download_url') - remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '.tag_name') + remotebuild=$(echo "${remotebuildresponse}" | jq -r '.tag_name') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -52,7 +52,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -63,35 +63,35 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then - date +%s > "${lockdir}/last-updated.lock" + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -126,26 +126,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } @@ -153,12 +153,6 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="github.com" -if [ ! "$(command -v jq 2> /dev/null)" ]; then - fn_print_fail_nl "jq is not installed" - fn_script_log_fail "jq is not installed" - core_exit.sh -fi - if [ "${firstcommandname}" == "INSTALL" ]; then fn_update_remotebuild fn_update_dl diff --git a/lgsm/modules/update_vints.sh b/lgsm/modules/update_vints.sh old mode 100644 new mode 100755 index a300b87eb..86a7156ee --- a/lgsm/modules/update_vints.sh +++ b/lgsm/modules/update_vints.sh @@ -20,6 +20,7 @@ fn_update_localbuild() { # Uses executable to get local build. if [ -d "${executabledir}" ]; then cd "${executabledir}" || exit + # shellcheck disable=SC2086 # Intentional: preexecutable may be empty; unquoted to drop it without producing an empty arg. localbuild="$(${preexecutable} ${executable} --version 2> /dev/null | sed '/^[[:space:]]*$/d')" fi if [ -z "${localbuild}" ]; then @@ -44,14 +45,14 @@ fn_update_remotebuild() { else remotebuildversion="${branch}" fi - remotebuildfilename=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].linuxserver.filename') - remotebuildurl=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].linuxserver.urls.cdn') - remotebuildhash=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].linuxserver.md5') + remotebuildfilename=$(echo "${remotebuildresponse}" | jq --arg remotebuild "${remotebuild}" -r '.[$remotebuild].linuxserver.filename') + remotebuildurl=$(echo "${remotebuildresponse}" | jq --arg remotebuild "${remotebuild}" -r '.[$remotebuild].linuxserver.urls.cdn') + remotebuildhash=$(echo "${remotebuildresponse}" | jq --arg remotebuild "${remotebuild}" -r '.[$remotebuild].linuxserver.md5') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -61,7 +62,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -72,35 +73,35 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then - date +%s > "${lockdir}/last-updated.lock" + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -135,26 +136,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } @@ -162,12 +163,6 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="vintagestory.at" -if [ ! "$(command -v jq 2> /dev/null)" ]; then - fn_print_fail_nl "jq is not installed" - fn_script_log_fail "jq is not installed" - core_exit.sh -fi - if [ "${firstcommandname}" == "INSTALL" ]; then fn_update_remotebuild fn_update_dl diff --git a/lgsm/modules/update_xnt.sh b/lgsm/modules/update_xnt.sh old mode 100644 new mode 100755 index c00233aa7..3a937a9f6 --- a/lgsm/modules/update_xnt.sh +++ b/lgsm/modules/update_xnt.sh @@ -54,13 +54,12 @@ fn_update_remotebuild() { remotebuildfilename=$(echo "${remotebuildtag}" | tr -d 'v') remotebuildfilename="${remotebuildfilename}.zip" remotebuildurl="https://dl.xonotic.org/${remotebuildfilename}" - - remotebuildversion="${remotebuildtag}" + remotebuild="${remotebuildtag}" if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuildversion variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fail "Checking remote build" core_exit.sh @@ -70,7 +69,7 @@ fn_update_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fail "Unable to get remote build" core_exit.sh @@ -81,35 +80,35 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Update has been found or force update. - if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then # Create update lockfile. date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuildversion}" + fn_script_log_info "${localbuild} > ${remotebuild}" if [ "${commandname}" == "UPDATE" ]; then - date +%s > "${lockdir}/last-updated.lock" + date +%s > "${lockdir:?}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -144,26 +143,26 @@ fn_update_compare() { alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuildversion}${default}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" + fn_print_nl "* Branch: ${branch}" fi - echo -en "\n" + fn_print "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuildversion}" + fn_script_log_info "Remote build: ${remotebuild}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "Remote build info" - echo -e "* apiurl: ${apiurl}" - echo -e "* remotebuildfilename: ${remotebuildfilename}" - echo -e "* remotebuildurl: ${remotebuildurl}" - echo -e "* remotebuildversion: ${remotebuildversion}" + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" fi fi } @@ -171,12 +170,6 @@ fn_update_compare() { # The location where the builds are checked and downloaded. remotelocation="github.com" -if [ ! "$(command -v jq 2> /dev/null)" ]; then - fn_print_fail_nl "jq is not installed" - fn_script_log_fail "jq is not installed" - core_exit.sh -fi - if [ "${firstcommandname}" == "INSTALL" ]; then fn_update_remotebuild fn_update_dl diff --git a/linuxgsm.sh b/linuxgsm.sh index 997bc30c8..443e1d8bf 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -330,7 +330,8 @@ fn_install_menu() { # Gets server info from serverlist.csv and puts in to array. fn_server_info() { IFS="," - server_info_array=($(grep -aw "${userinput}" "${serverlist}")) + server_info_line="$(grep -aw "${userinput}" "${serverlist}" | head -n 1)" + read -r -a server_info_array <<< "${server_info_line}" shortname="${server_info_array[0]}" # csgo gameservername="${server_info_array[1]}" # csgoserver gamename="${server_info_array[2]}" # Counter Strike: Global Offensive diff --git a/package.json b/package.json index 404356e5e..b9a348507 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,27 @@ { - "name": "linuxgsm", - "description": "


\"LinuxGSM\"

", - "directories": { - "test": "tests" - }, - "devDependencies": { - "prettier": "^3.4.2", - "prettier-plugin-sh": "^0.14.0" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/GameServerManagers/LinuxGSM.git" - }, - "author": "", - "license": "MIT", - "bugs": { - "url": "https://github.com/GameServerManagers/LinuxGSM/issues" - }, - "homepage": "https://github.com/GameServerManagers/LinuxGSM#readme", - "dependencies": { - "gamedig": "^5.1.4" - } + "name": "linuxgsm", + "description": "


\"LinuxGSM\"

", + "directories": { + "test": "tests" + }, + "devDependencies": { + "prettier": "^3.4.2", + "prettier-plugin-sh": "^0.14.0" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/GameServerManagers/LinuxGSM.git" + }, + "author": "", + "license": "MIT", + "bugs": { + "url": "https://github.com/GameServerManagers/LinuxGSM/issues" + }, + "homepage": "https://github.com/GameServerManagers/LinuxGSM#readme", + "dependencies": { + "gamedig": "^5.1.4" + } } From 82b820879266736d879a64b082988900422390a8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 22:41:14 +0000 Subject: [PATCH 099/132] docs(license): update copyright year(s) (#4866) Co-authored-by: github-actions Co-authored-by: Daniel Gibbs --- LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index c8ab9fa34..c138f4071 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ # The MIT License (MIT) -Copyright (c) 2012-2025 Daniel Gibbs +Copyright (c) 2012-2026 Daniel Gibbs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From b930161f1dffa038c95dd002dad327f0de6bf1db Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 13 Mar 2026 21:10:17 +0000 Subject: [PATCH 100/132] fix: re-add missing module --- lgsm/modules/core_modules.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 2cc635888..b2bd522a8 100755 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -451,6 +451,11 @@ fix_samp.sh() { fn_fetch_module } +fix_sdtd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + fix_sfc.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module From 397f26e9bac2904067a6305535c44ae4bd36b40d Mon Sep 17 00:00:00 2001 From: Anton Siuvaev Date: Sun, 19 Apr 2026 01:41:21 +0300 Subject: [PATCH 101/132] Update papermc.io API usage to new format (#4895) Co-authored-by: Anton Siuvaev --- lgsm/modules/update_pmc.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lgsm/modules/update_pmc.sh b/lgsm/modules/update_pmc.sh index e0bbfa05a..9273a567a 100755 --- a/lgsm/modules/update_pmc.sh +++ b/lgsm/modules/update_pmc.sh @@ -32,18 +32,19 @@ fn_update_localbuild() { } fn_update_remotebuild() { + jq_versions_all='.versions | to_entries | map(.value[])' # Gets remote build info. - apiurl="https://api.papermc.io/v2/projects" + apiurl="https://fill.papermc.io/v3/projects" # Get list of projects. remotebuildresponse=$(curl -s "${apiurl}") # Get list of Minecraft versions for project. remotebuildresponseproject=$(curl -s "${apiurl}/${paperproject}") # Get latest Minecraft: Java Edition version or user specified version. if [ "${mcversion}" == "latest" ]; then - remotebuildmcversion=$(echo "${remotebuildresponseproject}" | jq -r '.versions[-1]') + remotebuildmcversion=$(echo "${remotebuildresponseproject}" | jq -r "$jq_versions_all | first") else # Checks if user specified version exists. - remotebuildmcversion=$(echo "${remotebuildresponseproject}" | jq -r -e --arg mcversion "${mcversion}" '.versions[]|select(. == $mcversion)') + remotebuildmcversion=$(echo "${remotebuildresponseproject}" | jq -r -e --arg mcversion "${mcversion}" "$jq_versions_all | .[] | select(. == \$mcversion)") if [ -z "${remotebuildmcversion}" ]; then # user passed version does not exist fn_print_error_nl "Version ${mcversion} not available from ${remotelocation}" @@ -54,12 +55,12 @@ fn_update_remotebuild() { # Get list of paper builds for specific Minecraft: Java Edition version. remotebuildresponsemcversion=$(curl -s "${apiurl}/${paperproject}/versions/${remotebuildmcversion}") # Get latest paper build for specific Minecraft: Java Edition version. - remotebuildpaperversion=$(echo "${remotebuildresponsemcversion}" | jq -r '.builds[-1]') + remotebuildpaperversion=$(echo "${remotebuildresponsemcversion}" | jq -r '.builds[0]') # Get various info about the paper build. remotebuildresponseversion=$(curl -s "${apiurl}/${paperproject}/versions/${remotebuildmcversion}/builds/${remotebuildpaperversion}") - remotebuildfilename=$(echo "${remotebuildresponseversion}" | jq -r '.downloads.application.name') - remotebuildhash=$(echo "${remotebuildresponseversion}" | jq -r '.downloads.application.sha256') - remotebuildurl="${apiurl}/${paperproject}/versions/${remotebuildmcversion}/builds/${remotebuildpaperversion}/downloads/${remotebuildfilename}" + remotebuildfilename=$(echo "${remotebuildresponseversion}" | jq -r '.downloads["server:default"].name') + remotebuildhash=$(echo "${remotebuildresponseversion}" | jq -r '.downloads["server:default"].checksums.sha256') + remotebuildurl=$(echo "${remotebuildresponseversion}" | jq -r '.downloads["server:default"].url') # Combines Minecraft: Java Edition version and paper build. e.g 1.16.5-456 remotebuild="${remotebuildmcversion}-${remotebuildpaperversion}" From f45456e32d687f9a43da7c87715d5ea9812db8eb Mon Sep 17 00:00:00 2001 From: Hugo Maurin <148004075+Huguiz@users.noreply.github.com> Date: Sun, 19 Apr 2026 00:45:40 +0200 Subject: [PATCH 103/132] fix(mcserver): update Ubuntu 24.04 Java dependency to OpenJDK 25 (#4890) Co-authored-by: Daniel Gibbs --- lgsm/data/ubuntu-24.04.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index d130d68c4..ff95bec14 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -65,7 +65,7 @@ kf kf2 l4d l4d2 -mc,openjdk-21-jre +mc,openjdk-25-jre mcb mh mohaa,libstdc++5:i386 From cba689ab4b60b958cae7a9fc61800e7d16058b8d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Apr 2026 11:12:51 +0100 Subject: [PATCH 105/132] feat(etl): add ET: Legacy downloader and update module (#4896) * feat(etl): add downloader and update support for ET: Legacy Refactors ET: Legacy to use a dedicated update module instead of hardcoded installation files. The new update_etl.sh module leverages the GitHub API to check for, download, and apply the latest builds from GameServerManagers/etlserver-build. * feat(etl): add update_etl module to core modules Registers the update_etl.sh module within the core modules to enable the fetching and execution of ET: Legacy updates. * feat(etl): add update commands to core_getopt Ensures that the update and check-update commands are available for ET: Legacy by including the etl shortname in the getopt command registration logic. * feat(etl): improve local build detection Updates the game log directory to the "legacy" folder and enhances local build detection by parsing etconsole.log for version information, falling back to build.txt if necessary. * feat(etl): update glibc requirement and log path detection Updates the minimum glibc requirement to 2.17 and switches the local build detection to use the gamelogdir variable instead of a hardcoded path. * feat(etl): improve MD5 hash extraction Updates the MD5 hash parsing to use a specific regex for 32-character hexadecimal strings, providing a more robust extraction from the release body than relying on the last field of the line. * feat(xnt): add SHA512 hash extraction for remote builds Updates the Xonotic update module to fetch the SHA512 hash from the remote download server, allowing for build verification and identification. * fix(xnt): derive sha512 URL from remotebuildfilename not remotebuildtag Tag format is xonotic-v0.8.6 but the sha512 file is named xonotic-0.8.6.sha512 (without the v). Using remotebuildtag directly produced a 404. Deriving from remotebuildfilename (which already has the v stripped by tr -d v) gives the correct URL. * fix(core_dl): fix zip extraction with extractsrc across devices and non-empty dirs Using mv to move extracted directories fails in two cases: - Cross-device moves (e.g. tmp and serverfiles on different Docker volumes) - Target directory already exists and is non-empty (update scenario) Replace find+mv with cp -a which handles both cases by copying recursively and merging into the destination. Also replace the hardcoded 'Xonotic' temp_extractdir with ${extractsrc} to be generic. * fix(core_dl): remove duplicate ellipsis in hash verification message --- .../config-lgsm/etlserver/_default.cfg | 4 +- lgsm/modules/command_check_update.sh | 2 + lgsm/modules/command_update.sh | 2 + lgsm/modules/core_dl.sh | 6 +- lgsm/modules/core_getopt.sh | 2 +- lgsm/modules/core_modules.sh | 5 + lgsm/modules/install_server_files.sh | 10 +- lgsm/modules/update_etl.sh | 173 ++++++++++++++++++ lgsm/modules/update_xnt.sh | 1 + 9 files changed, 191 insertions(+), 14 deletions(-) create mode 100644 lgsm/modules/update_etl.sh diff --git a/lgsm/config-default/config-lgsm/etlserver/_default.cfg b/lgsm/config-default/config-lgsm/etlserver/_default.cfg index 04ebe4e23..9679a8f44 100644 --- a/lgsm/config-default/config-lgsm/etlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/etlserver/_default.cfg @@ -141,7 +141,7 @@ consoleinteract="yes" # Do not edit gamename="ET: Legacy" engine="idtech3" -glibc="2.7" +glibc="2.17" #### Directories #### # Edit with care @@ -160,7 +160,7 @@ backupdir="${lgsmdir}/backup" ## Logging Directories [ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" -gamelogdir="${serverfiles}/Logs" +gamelogdir="${serverfiles}/legacy" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" lgsmlog="${lgsmlogdir}/${selfname}-script.log" diff --git a/lgsm/modules/command_check_update.sh b/lgsm/modules/command_check_update.sh index 38f8b4ddc..6e429512a 100755 --- a/lgsm/modules/command_check_update.sh +++ b/lgsm/modules/command_check_update.sh @@ -34,6 +34,8 @@ elif [ "${shortname}" == "ut99" ]; then update_ut99.sh elif [ "${shortname}" == "xnt" ]; then update_xnt.sh +elif [ "${shortname}" == "etl" ]; then + update_etl.sh else update_steamcmd.sh fi diff --git a/lgsm/modules/command_update.sh b/lgsm/modules/command_update.sh index 6bb30a4c8..996d402a4 100755 --- a/lgsm/modules/command_update.sh +++ b/lgsm/modules/command_update.sh @@ -35,6 +35,8 @@ elif [ "${shortname}" == "ut99" ]; then update_ut99.sh elif [ "${shortname}" == "xnt" ]; then update_xnt.sh +elif [ "${shortname}" == "etl" ]; then + update_etl.sh else update_steamcmd.sh fi diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh index 0a0dacb29..1c27c58d7 100755 --- a/lgsm/modules/core_dl.sh +++ b/lgsm/modules/core_dl.sh @@ -204,7 +204,7 @@ fn_dl_hash() { fn_print_error_nl "hash length not known for hash type" core_exit.sh fi - echo -en "verifying ${local_filename} with ${hashtype}..." + echo -en "verifying ${local_filename} with ${hashtype}" fn_sleep_time hashsumcmd=$(${hashbin} "${local_filedir}/${local_filename}" | awk '{print $1}') if [ "${hashsumcmd}" != "${hash}" ]; then @@ -267,9 +267,9 @@ fn_dl_extract() { fi elif [ "${mime}" == "application/zip" ]; then if [ -n "${extractsrc}" ]; then - temp_extractdir="${tmpdir}/Xonotic" + temp_extractdir="${tmpdir}/${extractsrc}" extractcmd=$(unzip -qo "${local_filedir}/${local_filename}" "${extractsrc}/*" -d "${temp_extractdir}") - find "${temp_extractdir}/${extractsrc}" -mindepth 1 -maxdepth 1 -exec mv -t "${extractdest}" {} + + cp -a "${temp_extractdir}/${extractsrc}/." "${extractdest}/" rm -rf "${temp_extractdir}" else extractcmd=$(unzip -qo -d "${extractdest}" "${local_filedir}/${local_filename}") diff --git a/lgsm/modules/core_getopt.sh b/lgsm/modules/core_getopt.sh index 295f9900b..ad09bf1df 100755 --- a/lgsm/modules/core_getopt.sh +++ b/lgsm/modules/core_getopt.sh @@ -66,7 +66,7 @@ currentopt=("${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monito currentopt+=("${cmd_update_linuxgsm[@]}") # Exclude noupdate games here. -if [ "${shortname}" == "jk2" ] || [ "${engine}" != "idtech3" ]; then +if [ "${shortname}" == "jk2" ] || [ "${shortname}" == "etl" ] || [ "${engine}" != "idtech3" ]; then if [ "${shortname}" != "bf1942" ] && [ "${shortname}" != "bfv" ] && [ "${engine}" != "idtech2" ] && [ "${engine}" != "iw2.0" ] && [ "${engine}" != "iw3.0" ] && [ "${engine}" != "quake" ] && [ "${shortname}" != "samp" ] && [ "${shortname}" != "ut2k4" ]; then currentopt+=("${cmd_update[@]}" "${cmd_check_update[@]}") # force update for SteamCMD or Multi Theft Auto only. diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index b2bd522a8..7c717d0ad 100755 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -660,6 +660,11 @@ fn_update_modules.sh() { fn_fetch_module } +update_etl.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + update_fctr.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module diff --git a/lgsm/modules/install_server_files.sh b/lgsm/modules/install_server_files.sh index c667a7fe4..8a993b45c 100755 --- a/lgsm/modules/install_server_files.sh +++ b/lgsm/modules/install_server_files.sh @@ -80,14 +80,6 @@ fn_install_server_files() { run="norun" force="noforce" md5="2c6be1bb66ea631b9b2e7ae6216c6680" - elif [ "${shortname}" == "etl" ]; then - remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/etlegacy-v2.78.1-i386-et-260b.tar.xz" - local_filedir="${tmpdir}" - local_filename="etlegacy-v2.78.1-i386-et-260b.tar.xz" - chmodx="nochmodx" - run="norun" - force="noforce" - md5="7c08b52cb09b30eadb98ea05ef780fc7" elif [ "${shortname}" == "mohaa" ]; then remote_fileurl="http://linuxgsm.download/MedalofHonorAlliedAssault/moh_revival_v1.12_RC3.5.1.tar.xz" local_filedir="${tmpdir}" @@ -280,6 +272,8 @@ elif [ "${shortname}" == "ut99" ]; then update_ut99.sh elif [ "${shortname}" == "xnt" ]; then update_xnt.sh +elif [ "${shortname}" == "etl" ]; then + update_etl.sh elif [ -z "${appid}" ] || [ "${shortname}" == "ahl" ] || [ "${shortname}" == "bb" ] || [ "${shortname}" == "q4" ] || [ "${shortname}" == "ns" ] || [ "${shortname}" == "sfc" ] || [ "${shortname}" == "ts" ] || [ "${shortname}" == "vs" ] || [ "${shortname}" == "zmr" ]; then if [ "${shortname}" == "ut" ]; then install_eula.sh diff --git a/lgsm/modules/update_etl.sh b/lgsm/modules/update_etl.sh new file mode 100644 index 000000000..8486343e2 --- /dev/null +++ b/lgsm/modules/update_etl.sh @@ -0,0 +1,173 @@ +#!/bin/bash +# LinuxGSM update_etl.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of ET: Legacy servers. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_dl() { + # Download and extract files to serverfiles. + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "${remotebuildhash}" + fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" + echo "${remotebuild}" > "${serverfiles}/build.txt" + fn_clear_tmp +} + +fn_update_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Try to get build version from etconsole.log. + if [ -f "${gamelogdir}/etconsole.log" ]; then + localbuild=$(grep "Initializing legacy game" "${gamelogdir}/etconsole.log" | sed -n 's/.*\^2\(v[0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p' | tail -1) + fi + # Fall back to build.txt if log parse failed or log does not exist. + if [ -z "${localbuild}" ]; then + localbuild=$(head -n 1 "${serverfiles}/build.txt" 2> /dev/null) + fi + if [ -z "${localbuild}" ]; then + fn_print_error "Checking local build: ${remotelocation}: missing local build info" + fn_script_log_error "Missing local build info" + fn_script_log_error "Set localbuild to 0" + localbuild="0" + else + fn_print_ok "Checking local build: ${remotelocation}" + fn_script_log_pass "Checking local build" + fi +} + +fn_update_remotebuild() { + # Gets remote build info. + apiurl="https://api.github.com/repos/GameServerManagers/etlserver-build/releases/latest" + remotebuildresponse=$(curl -s "${apiurl}") + remotebuildfilename=$(echo "${remotebuildresponse}" | jq -r '.assets[] | select(.browser_download_url | contains("i386-et-260b")) | .name') + remotebuildurl=$(echo "${remotebuildresponse}" | jq -r '.assets[] | select(.browser_download_url | contains("i386-et-260b")) | .browser_download_url') + remotebuild=$(echo "${remotebuildresponse}" | jq -r '.tag_name') + remotebuildhash=$(echo "${remotebuildresponse}" | jq -r '.body' | grep 'MD5' | grep -oE '[a-f0-9]{32}') + + if [ "${firstcommandname}" != "INSTALL" ]; then + fn_print_dots "Checking remote build: ${remotelocation}" + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + fn_print_fail "Checking remote build: ${remotelocation}" + fn_script_log_fail "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking remote build: ${remotelocation}" + fn_script_log_pass "Checking remote build" + fi + else + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + fn_print_failure "Unable to get remote build" + fn_script_log_fail "Unable to get remote build" + core_exit.sh + fi + fi +} + +fn_update_compare() { + fn_print_dots "Checking for update: ${remotelocation}" + # Update has been found or force update. + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then + # Create update lockfile. + date '+%s' > "${lockdir:?}/update.lock" + fn_print_ok_nl "Checking for update: ${remotelocation}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" + if [ -n "${branch}" ]; then + fn_print_nl "* Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" + fi + fn_print "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuild}" + + if [ "${commandname}" == "UPDATE" ]; then + date +%s > "${lockdir:?}/last-updated.lock" + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + fn_update_dl + if [ "${localbuild}" == "0" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + fn_sleep_time_5 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + fn_update_dl + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi + unset exitbypass + alert="update" + elif [ "${commandname}" == "CHECK-UPDATE" ]; then + alert="check-update" + fi + alert.sh + else + fn_print_ok_nl "Checking for update: ${remotelocation}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" + if [ -n "${branch}" ]; then + fn_print_nl "* Branch: ${branch}" + fi + fn_print "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuild: ${remotebuild}" + fi + fi +} + +# The location where the builds are checked and downloaded. +remotelocation="github.com" + +if [ "${firstcommandname}" == "INSTALL" ]; then + fn_update_remotebuild + fn_update_dl +else + fn_print_dots "Checking for update" + fn_print_dots "Checking for update: ${remotelocation}" + fn_script_log_info "Checking for update: ${remotelocation}" + fn_update_localbuild + fn_update_remotebuild + fn_update_compare +fi diff --git a/lgsm/modules/update_xnt.sh b/lgsm/modules/update_xnt.sh index 3a937a9f6..501f91c8d 100755 --- a/lgsm/modules/update_xnt.sh +++ b/lgsm/modules/update_xnt.sh @@ -55,6 +55,7 @@ fn_update_remotebuild() { remotebuildfilename="${remotebuildfilename}.zip" remotebuildurl="https://dl.xonotic.org/${remotebuildfilename}" remotebuild="${remotebuildtag}" + remotebuildhash=$(curl -s "https://dl.xonotic.org/${remotebuildfilename%.zip}.sha512" | grep "${remotebuildfilename}$" | grep -oE '[a-f0-9]{128}') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" From 9dfbb8eeed4dc49f3979c53ce98d659532606611 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Apr 2026 11:15:31 +0100 Subject: [PATCH 106/132] fix(install_config): replace cp -nv with explicit file existence check (#4897) * fix(install_config): replace cp -nv with explicit file existence check Newer coreutils (Ubuntu 24.04+, Debian 13+) emit a portability warning when using cp -n: 'behavior of -n is non-portable and may change in future'. Replace all cp -nv usages with an explicit [ ! -f dest ] guard, which is portable across all distros and preserves the same OK/SKIP/FAIL behaviour. * fix(install_config): use -e and -L checks to handle broken symlinks Using only -f missed broken symlinks (-e returns false for them but -L returns true). Use both checks to match the skip behaviour of cp -n. --- lgsm/modules/install_config.sh | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index 41d4ad866..ddfc13794 100755 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -34,8 +34,13 @@ fn_default_config_remote() { if [ "${config}" == "${servercfgdefault}" ]; then mkdir -p "${servercfgdir}" echo -en "copying config file [ ${italic}${servercfgfullpath}${default} ]" - changes+=$(cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}") - exitcode=$? + if [ ! -e "${servercfgfullpath}" ] && [ ! -L "${servercfgfullpath}" ]; then + cp "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}" + exitcode=$? + [ "${exitcode}" -eq 0 ] && changes="copied" + else + exitcode=0 + fi if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "copying config file ${servercfgfullpath}" @@ -48,7 +53,13 @@ fn_default_config_remote() { elif [ "${shortname}" == "arma3" ] && [ "${config}" == "${networkcfgdefault}" ]; then mkdir -p "${servercfgdir}" echo -en "copying config file [ ${italic}${networkcfgfullpath}${default} ]" - changes+=$(cp -nv "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}") + if [ ! -e "${networkcfgfullpath}" ] && [ ! -L "${networkcfgfullpath}" ]; then + cp "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}" + exitcode=$? + [ "${exitcode}" -eq 0 ] && changes="copied" + else + exitcode=0 + fi if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "copying config file ${networkcfgdefault}" @@ -60,7 +71,13 @@ fn_default_config_remote() { fi elif [ "${shortname}" == "dst" ] && [ "${config}" == "${clustercfgdefault}" ]; then echo -en "copying config file [ ${italic}${clustercfgfullpath}${default} ]" - changes+=$(cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}") + if [ ! -e "${clustercfgfullpath}" ] && [ ! -L "${clustercfgfullpath}" ]; then + cp "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}" + exitcode=$? + [ "${exitcode}" -eq 0 ] && changes="copied" + else + exitcode=0 + fi if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "copying config file ${clustercfgfullpath}" @@ -72,7 +89,13 @@ fn_default_config_remote() { fi else echo -en "copying config file [ ${italic}${servercfgdir}/${config}${default} ]" - changes+=$(cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgdir}/${config}") + if [ ! -e "${servercfgdir}/${config}" ] && [ ! -L "${servercfgdir}/${config}" ]; then + cp "${lgsmdir}/config-default/config-game/${config}" "${servercfgdir}/${config}" + exitcode=$? + [ "${exitcode}" -eq 0 ] && changes="copied" + else + exitcode=0 + fi if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl fn_script_log_fail "copying config file ${servercfgdir}/${config}" From 0b7aa627c51ea56e39bab8518af4024c50caa009 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Apr 2026 20:49:03 +0100 Subject: [PATCH 107/132] feat(tf2c): add Team Fortress 2 Classified server (#4898) --- .../config-lgsm/tf2cserver/_default.cfg | 197 ++++++++++++++++++ lgsm/data/serverlist.csv | 1 + lgsm/modules/core_dl.sh | 26 +++ lgsm/modules/install_config.sh | 5 + 4 files changed, 229 insertions(+) create mode 100644 lgsm/config-default/config-lgsm/tf2cserver/_default.cfg diff --git a/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg b/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg new file mode 100644 index 000000000..baa8c4328 --- /dev/null +++ b/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg @@ -0,0 +1,197 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +# Note that for TF2, maxplayers > 33 must be specified like so: +# maxplayers="101 -unrestricted_maxplayers" +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="4koth_frigid" +maxplayers="16" + +## Game Server Login Token (GSLT): Optional +# GSLT can be used for running a public server. +# More info: https://docs.linuxgsm.com/steamcmd/gslt +gslt="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game tf2classified -tf_path ${supportdir} -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# Alert on Start/Stop/Restart +statusalert="off" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify +gotifyalert="off" +gotifytoken="token" +gotifywebhook="webhook" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" +pushoveruserkey="userkey" + +# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat +rocketchatalert="off" +rocketchatwebhook="webhook" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help all". +telegramapi="api.telegram.org" +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +telegramthreadid="" +telegramsilentnotification="false" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +baseappid="232250" +appid="3557020" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Team Fortress 2 Classified" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/tf2classified" +supportdir="${serverfiles}/tf2" +executabledir="${serverfiles}" +executable="./srcds.sh" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 49d7b1d10..2f964a30d 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -114,6 +114,7 @@ sven,svenserver,Sven Co-op,ubuntu-24.04 terraria,terrariaserver,Terraria,ubuntu-24.04 tf,tfserver,The Front,ubuntu-24.04 tf2,tf2server,Team Fortress 2,ubuntu-24.04 +tf2c,tf2cserver,Team Fortress 2 Classified,ubuntu-24.04 tfc,tfcserver,Team Fortress Classic,ubuntu-24.04 ti,tiserver,The Isle,ubuntu-24.04 ts,tsserver,The Specialists,ubuntu-24.04 diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh index 1c27c58d7..dcbd88e9b 100755 --- a/lgsm/modules/core_dl.sh +++ b/lgsm/modules/core_dl.sh @@ -81,6 +81,19 @@ fn_dl_steamcmd() { fi # Force Windows Platform type. elif [ "${steamcmdforcewindows}" == "yes" ]; then + # If a base app is required, install it first. + if [ -n "${baseappid}" ]; then + if [ -z "${supportdir}" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: baseappid is set but supportdir is not defined" + fn_script_log_fail "${commandaction} ${selfname}: baseappid is set but supportdir is not defined" + core_exit.sh + fi + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${supportdir}" +login "${steamuser}" "${steampass}" +app_update "${baseappid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + exitcode="${PIPESTATUS[0]}" + if [ "${exitcode}" -ne 0 ]; then + continue + fi + fi if [ -n "${branch}" ] && [ -n "${betapassword}" ]; then "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" elif [ -n "${branch}" ]; then @@ -90,6 +103,19 @@ fn_dl_steamcmd() { fi # All other servers. else + # If a base app is required, install it first. + if [ -n "${baseappid}" ]; then + if [ -z "${supportdir}" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: baseappid is set but supportdir is not defined" + fn_script_log_fail "${commandaction} ${selfname}: baseappid is set but supportdir is not defined" + core_exit.sh + fi + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${supportdir}" +login "${steamuser}" "${steampass}" +app_update "${baseappid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + exitcode="${PIPESTATUS[0]}" + if [ "${exitcode}" -ne 0 ]; then + continue + fi + fi if [ -n "${branch}" ] && [ -n "${betapassword}" ]; then "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" elif [ -n "${branch}" ]; then diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index ddfc13794..4b8148ce9 100755 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -724,6 +724,11 @@ elif [ "${shortname}" == "tf2" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "tf2c" ]; then + array_configs+=(server.cfg) + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations elif [ "${shortname}" == "tfc" ]; then array_configs+=(server.cfg) fn_default_config_remote From 7e472ba9accefa06267211b23b7e1fa13a38c02a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Apr 2026 19:54:24 +0000 Subject: [PATCH 108/132] Release v26.1.0 --- lgsm/modules/core_modules.sh | 2 +- linuxgsm.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 7c717d0ad..10d408449 100755 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v25.2.0" +modulesversion="v26.1.0" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 443e1d8bf..f664749e6 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -24,7 +24,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v25.2.0" +version="v26.1.0" shortname="core" gameservername="core" commandname="CORE" From a7186b8f7f44b3448b18ce5d3adf54c29f9258fe Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Apr 2026 20:12:16 +0000 Subject: [PATCH 109/132] fix(alert_slack): add missing closing brace on section object The 'section' block containing 'fields' and 'accessory' was missing its closing '}' before EOF, producing malformed JSON and breaking all Slack alerts silently (jq -c . would fail on the payload). Also add missing ntfy alert settings to tf2cserver _default.cfg for consistency with other server configs. --- .../config-default/config-lgsm/tf2cserver/_default.cfg | 10 ++++++++++ lgsm/modules/alert_slack.sh | 1 + 2 files changed, 11 insertions(+) diff --git a/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg b/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg index baa8c4328..fdbcc2cba 100644 --- a/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg @@ -65,6 +65,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/modules/alert_slack.sh b/lgsm/modules/alert_slack.sh index defb1f77f..0cd7106ff 100755 --- a/lgsm/modules/alert_slack.sh +++ b/lgsm/modules/alert_slack.sh @@ -60,6 +60,7 @@ json=$( "image_url": "${alerticon}", "alt_text": "LinuxGSM game icon" } + } EOF ) From d04d5b6dfdcc34d844fc92b5bc1ab9c3b4f1de46 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Apr 2026 20:16:40 +0000 Subject: [PATCH 110/132] fix: address review feedback - core_dl.sh: use array assignment for steamcmdcommand instead of read -r -a to avoid word-splitting on paths - fix_st.sh: correct module header typo (fix_ts.sh -> fix_st.sh) - command_skeleton.sh: fix grammar 'Creates an copy' -> 'Creates a copy' - serverlist-validate-game-icons.sh: anchor grep to start-of-line and require trailing comma to prevent false positives (e.g. 'tf' matching 'tf2' entries) - cs2server/_default.cfg: remove duplicate ntfy alert settings block --- .github/workflows/serverlist-validate-game-icons.sh | 2 +- lgsm/config-default/config-lgsm/cs2server/_default.cfg | 10 ---------- lgsm/modules/command_skeleton.sh | 2 +- lgsm/modules/core_dl.sh | 6 +++--- lgsm/modules/fix_st.sh | 2 +- 5 files changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/workflows/serverlist-validate-game-icons.sh b/.github/workflows/serverlist-validate-game-icons.sh index b3ba7e418..8d35aa906 100755 --- a/.github/workflows/serverlist-validate-game-icons.sh +++ b/.github/workflows/serverlist-validate-game-icons.sh @@ -22,7 +22,7 @@ shopt -s nullglob for gameiconpath in gameicons/*; do gameicon="$(basename "${gameiconpath}")" # check if $gameicon is in serverlist.csv - if ! grep -q -F "${gameicon%-icon.png}" serverlist.csv; then + if ! grep -q -E "^${gameicon%-icon.png}," serverlist.csv; then echo "ERROR: gameicon ${gameicon} is not in serverlist.csv" exitcode=1 else diff --git a/lgsm/config-default/config-lgsm/cs2server/_default.cfg b/lgsm/config-default/config-lgsm/cs2server/_default.cfg index 56948c77f..8d65b5364 100644 --- a/lgsm/config-default/config-lgsm/cs2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cs2server/_default.cfg @@ -72,16 +72,6 @@ ntfypassword="" ntfypriority="" ntfytags="" -# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy -ntfyalert="off" -ntfytopic="LinuxGSM" -ntfyserver="https://ntfy.sh" -ntfytoken="" -ntfyusername="" -ntfypassword="" -ntfypriority="" -ntfytags="" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/modules/command_skeleton.sh b/lgsm/modules/command_skeleton.sh index 687790a37..3e07edc3a 100755 --- a/lgsm/modules/command_skeleton.sh +++ b/lgsm/modules/command_skeleton.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Creates an copy of a game servers directories. +# Description: Creates a copy of a game server directories. commandname="SKELETON" commandaction="Skeleton" diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh index dcbd88e9b..4730c0cff 100755 --- a/lgsm/modules/core_dl.sh +++ b/lgsm/modules/core_dl.sh @@ -46,9 +46,9 @@ fn_dl_steamcmd() { validate="validate" fi - # steamcmdcommand can contain multiple arguments; treat it as an argv array. - steamcmdcommandarray=() - read -r -a steamcmdcommandarray <<< "${steamcmdcommand}" + # Wrap steamcmdcommand as a single-element array to avoid word-splitting + # on paths/commands that should not be tokenised. + steamcmdcommandarray=("${steamcmdcommand}") unbuffercommand=() if [ -n "${unbuffer}" ]; then unbuffercommand=("${unbuffer}") diff --git a/lgsm/modules/fix_st.sh b/lgsm/modules/fix_st.sh index 598d971b0..887ea987f 100755 --- a/lgsm/modules/fix_st.sh +++ b/lgsm/modules/fix_st.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM fix_ts.sh module +# LinuxGSM fix_st.sh module # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com From 329660d8b97b75c18ba579b925161ae5978ebb80 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Apr 2026 20:51:10 +0000 Subject: [PATCH 111/132] fix(vints): assign remotebuild instead of unused remotebuildversion The API version lookup was setting remotebuildversion but all subsequent jq queries used ${remotebuild}, which was never populated. This caused 'Unable to get remote build' on every install/update. --- lgsm/modules/update_vints.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/modules/update_vints.sh b/lgsm/modules/update_vints.sh index 86a7156ee..5bf3df25d 100755 --- a/lgsm/modules/update_vints.sh +++ b/lgsm/modules/update_vints.sh @@ -39,11 +39,11 @@ fn_update_remotebuild() { apiurl="http://api.vintagestory.at/stable-unstable.json" remotebuildresponse=$(curl -s "${apiurl}") if [ "${branch}" == "stable" ]; then - remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -Ev "\-rc|\-pre" | sort -r -V | head -1) + remotebuild=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -Ev "\-rc|\-pre" | sort -r -V | head -1) elif [ "${branch}" == "unstable" ]; then - remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -E "\-rc|\-pre" | sort -r -V | head -1) + remotebuild=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -E "\-rc|\-pre" | sort -r -V | head -1) else - remotebuildversion="${branch}" + remotebuild="${branch}" fi remotebuildfilename=$(echo "${remotebuildresponse}" | jq --arg remotebuild "${remotebuild}" -r '.[$remotebuild].linuxserver.filename') remotebuildurl=$(echo "${remotebuildresponse}" | jq --arg remotebuild "${remotebuild}" -r '.[$remotebuild].linuxserver.urls.cdn') From a14433c2f0f62c593bccab58e4668eb114eb0423 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Apr 2026 21:01:35 +0000 Subject: [PATCH 112/132] fix(xnt): unset exitbypass after command_stop.sh in fn_update_localbuild --- lgsm/modules/update_xnt.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lgsm/modules/update_xnt.sh b/lgsm/modules/update_xnt.sh index 501f91c8d..904b7b1a4 100755 --- a/lgsm/modules/update_xnt.sh +++ b/lgsm/modules/update_xnt.sh @@ -29,7 +29,9 @@ fn_update_localbuild() { exitbypass=1 fn_sleep_time_5 tmux -L "${socketname}" send-keys -t "${sessionname}" "version" C-m > /dev/null 2>&1 + exitbypass=1 command_stop.sh + unset exitbypass fn_firstcommand_reset fi From db4253f002209b9cb1b489ea38a2de93f4553071 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Apr 2026 21:06:52 +0000 Subject: [PATCH 113/132] fix(ci): resolve super-linter failures - Set DEFAULT_BRANCH to current branch to fix 'master not found' error - Use fetch-depth: 0 so GITHUB_BEFORE_SHA can be resolved - Set update_etl.sh executable bit (BASH_EXEC) - Fix .codespellrc tab indentation (EDITORCONFIG) - Add .gitleaks.toml allowlist for GA4 Measurement Protocol API secret (GITLEAKS) - Fix .markdown-lint.yml: disable MD030/MD013/MD033/MD041/MD051 to match existing repo style (MARKDOWN) --- .github/linters/.codespellrc | 10 +++++----- .github/linters/.gitleaks.toml | 9 +++++++++ .github/linters/.markdown-lint.yml | 11 ++++------- .github/workflows/action-super-linter.yml | 6 +++--- lgsm/modules/update_etl.sh | 0 5 files changed, 21 insertions(+), 15 deletions(-) create mode 100644 .github/linters/.gitleaks.toml mode change 100644 => 100755 lgsm/modules/update_etl.sh diff --git a/.github/linters/.codespellrc b/.github/linters/.codespellrc index 229066881..47dd5ccea 100644 --- a/.github/linters/.codespellrc +++ b/.github/linters/.codespellrc @@ -1,11 +1,11 @@ [codespell] # Skip data tables that contain many short server identifiers (e.g. "fof", "nd") skip = - lgsm/data/*.csv, - package-lock.json, - */package-lock.json, - node_modules, - */node_modules/* + lgsm/data/*.csv, + package-lock.json, + */package-lock.json, + node_modules, + */node_modules/* # Ignore common identifiers/acronyms and extensions used throughout LinuxGSM ignore-words-list = distroname,fof,nd,sav,parms,ThirdParty diff --git a/.github/linters/.gitleaks.toml b/.github/linters/.gitleaks.toml new file mode 100644 index 000000000..b61845ba6 --- /dev/null +++ b/.github/linters/.gitleaks.toml @@ -0,0 +1,9 @@ +title = "LinuxGSM Gitleaks Config" + +[allowlist] + description = "Known false positives" + regexes = [ + # Google Analytics 4 Measurement Protocol API secret - not a sensitive credential, + # it is intentionally embedded in client-side code and is safe to be public. + '''apisecret="[A-Za-z0-9_\-]+"''', + ] diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml index 094bbbcd6..62d421814 100644 --- a/.github/linters/.markdown-lint.yml +++ b/.github/linters/.markdown-lint.yml @@ -12,12 +12,9 @@ MD013: false # MD033: The main README uses inline HTML for badges. MD033: false -# Match existing list formatting in this repo. +# MD007: Repo uses 2-space indentation for nested lists. MD007: - indent: 4 + indent: 2 -MD030: - ul_single: 3 - ol_single: 2 - ul_multi: 3 - ol_multi: 2 +# MD030: Repo mixes 1-space unordered and 2-space ordered list markers. +MD030: false diff --git a/.github/workflows/action-super-linter.yml b/.github/workflows/action-super-linter.yml index de396dcd4..e2755e20a 100644 --- a/.github/workflows/action-super-linter.yml +++ b/.github/workflows/action-super-linter.yml @@ -27,9 +27,8 @@ jobs: - name: Checkout code uses: actions/checkout@v6 with: - # Shallow clone reduces transient fetch failures (HTTP 500) from GitHub. - # We lint the whole codebase instead of relying on git history. - fetch-depth: 1 + # Full clone required so super-linter can resolve GITHUB_BEFORE_SHA. + fetch-depth: 0 fetch-tags: false persist-credentials: false @@ -42,6 +41,7 @@ jobs: env: # To report GitHub Actions status checks GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DEFAULT_BRANCH: ${{ github.ref_name }} VALIDATE_BIOME_FORMAT: false VALIDATE_BIOME_LINT: false VALIDATE_GITHUB_ACTIONS_ZIZMOR: false diff --git a/lgsm/modules/update_etl.sh b/lgsm/modules/update_etl.sh old mode 100644 new mode 100755 From a974fa2f70d01b2deca022c7c32e7122ad9ff0f7 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Apr 2026 20:49:03 +0100 Subject: [PATCH 114/132] feat(tf2c): add Team Fortress 2 Classified server (#4898) --- .../config-lgsm/tf2cserver/_default.cfg | 197 ++++++++++++++++++ lgsm/data/serverlist.csv | 1 + lgsm/modules/core_dl.sh | 26 +++ lgsm/modules/install_config.sh | 5 + 4 files changed, 229 insertions(+) create mode 100644 lgsm/config-default/config-lgsm/tf2cserver/_default.cfg diff --git a/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg b/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg new file mode 100644 index 000000000..baa8c4328 --- /dev/null +++ b/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg @@ -0,0 +1,197 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +# Note that for TF2, maxplayers > 33 must be specified like so: +# maxplayers="101 -unrestricted_maxplayers" +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="4koth_frigid" +maxplayers="16" + +## Game Server Login Token (GSLT): Optional +# GSLT can be used for running a public server. +# More info: https://docs.linuxgsm.com/steamcmd/gslt +gslt="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game tf2classified -tf_path ${supportdir} -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# Alert on Start/Stop/Restart +statusalert="off" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify +gotifyalert="off" +gotifytoken="token" +gotifywebhook="webhook" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" +pushoveruserkey="userkey" + +# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat +rocketchatalert="off" +rocketchatwebhook="webhook" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help all". +telegramapi="api.telegram.org" +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +telegramthreadid="" +telegramsilentnotification="false" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +baseappid="232250" +appid="3557020" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Team Fortress 2 Classified" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/tf2classified" +supportdir="${serverfiles}/tf2" +executabledir="${serverfiles}" +executable="./srcds.sh" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 49d7b1d10..2f964a30d 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -114,6 +114,7 @@ sven,svenserver,Sven Co-op,ubuntu-24.04 terraria,terrariaserver,Terraria,ubuntu-24.04 tf,tfserver,The Front,ubuntu-24.04 tf2,tf2server,Team Fortress 2,ubuntu-24.04 +tf2c,tf2cserver,Team Fortress 2 Classified,ubuntu-24.04 tfc,tfcserver,Team Fortress Classic,ubuntu-24.04 ti,tiserver,The Isle,ubuntu-24.04 ts,tsserver,The Specialists,ubuntu-24.04 diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh index 1c27c58d7..dcbd88e9b 100755 --- a/lgsm/modules/core_dl.sh +++ b/lgsm/modules/core_dl.sh @@ -81,6 +81,19 @@ fn_dl_steamcmd() { fi # Force Windows Platform type. elif [ "${steamcmdforcewindows}" == "yes" ]; then + # If a base app is required, install it first. + if [ -n "${baseappid}" ]; then + if [ -z "${supportdir}" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: baseappid is set but supportdir is not defined" + fn_script_log_fail "${commandaction} ${selfname}: baseappid is set but supportdir is not defined" + core_exit.sh + fi + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${supportdir}" +login "${steamuser}" "${steampass}" +app_update "${baseappid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + exitcode="${PIPESTATUS[0]}" + if [ "${exitcode}" -ne 0 ]; then + continue + fi + fi if [ -n "${branch}" ] && [ -n "${betapassword}" ]; then "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" elif [ -n "${branch}" ]; then @@ -90,6 +103,19 @@ fn_dl_steamcmd() { fi # All other servers. else + # If a base app is required, install it first. + if [ -n "${baseappid}" ]; then + if [ -z "${supportdir}" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: baseappid is set but supportdir is not defined" + fn_script_log_fail "${commandaction} ${selfname}: baseappid is set but supportdir is not defined" + core_exit.sh + fi + "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${supportdir}" +login "${steamuser}" "${steampass}" +app_update "${baseappid}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + exitcode="${PIPESTATUS[0]}" + if [ "${exitcode}" -ne 0 ]; then + continue + fi + fi if [ -n "${branch}" ] && [ -n "${betapassword}" ]; then "${unbuffercommand[@]}" "${steamcmdcommandarray[@]}" +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" "${validateparam[@]}" +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" elif [ -n "${branch}" ]; then diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index ddfc13794..4b8148ce9 100755 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -724,6 +724,11 @@ elif [ "${shortname}" == "tf2" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "tf2c" ]; then + array_configs+=(server.cfg) + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations elif [ "${shortname}" == "tfc" ]; then array_configs+=(server.cfg) fn_default_config_remote From 96acbd779a7cf2193bfb9261c4a7e7104edbebc5 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Apr 2026 19:54:24 +0000 Subject: [PATCH 115/132] Release v26.1.0 --- lgsm/modules/core_modules.sh | 2 +- linuxgsm.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 7c717d0ad..10d408449 100755 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v25.2.0" +modulesversion="v26.1.0" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 443e1d8bf..f664749e6 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -24,7 +24,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v25.2.0" +version="v26.1.0" shortname="core" gameservername="core" commandname="CORE" From ec63aae5ef59fd6f134fa95ecf53c5a046f1dba6 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Apr 2026 20:12:16 +0000 Subject: [PATCH 116/132] fix(alert_slack): add missing closing brace on section object The 'section' block containing 'fields' and 'accessory' was missing its closing '}' before EOF, producing malformed JSON and breaking all Slack alerts silently (jq -c . would fail on the payload). Also add missing ntfy alert settings to tf2cserver _default.cfg for consistency with other server configs. --- .../config-default/config-lgsm/tf2cserver/_default.cfg | 10 ++++++++++ lgsm/modules/alert_slack.sh | 1 + 2 files changed, 11 insertions(+) diff --git a/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg b/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg index baa8c4328..fdbcc2cba 100644 --- a/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tf2cserver/_default.cfg @@ -65,6 +65,16 @@ iftttalert="off" ifttttoken="accesstoken" iftttevent="linuxgsm_alert" +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/modules/alert_slack.sh b/lgsm/modules/alert_slack.sh index defb1f77f..0cd7106ff 100755 --- a/lgsm/modules/alert_slack.sh +++ b/lgsm/modules/alert_slack.sh @@ -60,6 +60,7 @@ json=$( "image_url": "${alerticon}", "alt_text": "LinuxGSM game icon" } + } EOF ) From 6e4480c6567308e858befa4b0c83cc5a14d0829d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Apr 2026 20:16:40 +0000 Subject: [PATCH 117/132] fix: address review feedback - core_dl.sh: use array assignment for steamcmdcommand instead of read -r -a to avoid word-splitting on paths - fix_st.sh: correct module header typo (fix_ts.sh -> fix_st.sh) - command_skeleton.sh: fix grammar 'Creates an copy' -> 'Creates a copy' - serverlist-validate-game-icons.sh: anchor grep to start-of-line and require trailing comma to prevent false positives (e.g. 'tf' matching 'tf2' entries) - cs2server/_default.cfg: remove duplicate ntfy alert settings block --- .github/workflows/serverlist-validate-game-icons.sh | 2 +- lgsm/config-default/config-lgsm/cs2server/_default.cfg | 10 ---------- lgsm/modules/command_skeleton.sh | 2 +- lgsm/modules/core_dl.sh | 6 +++--- lgsm/modules/fix_st.sh | 2 +- 5 files changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/workflows/serverlist-validate-game-icons.sh b/.github/workflows/serverlist-validate-game-icons.sh index b3ba7e418..8d35aa906 100755 --- a/.github/workflows/serverlist-validate-game-icons.sh +++ b/.github/workflows/serverlist-validate-game-icons.sh @@ -22,7 +22,7 @@ shopt -s nullglob for gameiconpath in gameicons/*; do gameicon="$(basename "${gameiconpath}")" # check if $gameicon is in serverlist.csv - if ! grep -q -F "${gameicon%-icon.png}" serverlist.csv; then + if ! grep -q -E "^${gameicon%-icon.png}," serverlist.csv; then echo "ERROR: gameicon ${gameicon} is not in serverlist.csv" exitcode=1 else diff --git a/lgsm/config-default/config-lgsm/cs2server/_default.cfg b/lgsm/config-default/config-lgsm/cs2server/_default.cfg index 56948c77f..8d65b5364 100644 --- a/lgsm/config-default/config-lgsm/cs2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cs2server/_default.cfg @@ -72,16 +72,6 @@ ntfypassword="" ntfypriority="" ntfytags="" -# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy -ntfyalert="off" -ntfytopic="LinuxGSM" -ntfyserver="https://ntfy.sh" -ntfytoken="" -ntfyusername="" -ntfypassword="" -ntfypriority="" -ntfytags="" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" diff --git a/lgsm/modules/command_skeleton.sh b/lgsm/modules/command_skeleton.sh index 687790a37..3e07edc3a 100755 --- a/lgsm/modules/command_skeleton.sh +++ b/lgsm/modules/command_skeleton.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Creates an copy of a game servers directories. +# Description: Creates a copy of a game server directories. commandname="SKELETON" commandaction="Skeleton" diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh index dcbd88e9b..4730c0cff 100755 --- a/lgsm/modules/core_dl.sh +++ b/lgsm/modules/core_dl.sh @@ -46,9 +46,9 @@ fn_dl_steamcmd() { validate="validate" fi - # steamcmdcommand can contain multiple arguments; treat it as an argv array. - steamcmdcommandarray=() - read -r -a steamcmdcommandarray <<< "${steamcmdcommand}" + # Wrap steamcmdcommand as a single-element array to avoid word-splitting + # on paths/commands that should not be tokenised. + steamcmdcommandarray=("${steamcmdcommand}") unbuffercommand=() if [ -n "${unbuffer}" ]; then unbuffercommand=("${unbuffer}") diff --git a/lgsm/modules/fix_st.sh b/lgsm/modules/fix_st.sh index 598d971b0..887ea987f 100755 --- a/lgsm/modules/fix_st.sh +++ b/lgsm/modules/fix_st.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM fix_ts.sh module +# LinuxGSM fix_st.sh module # Author: Daniel Gibbs # Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com From c864cb596b5e678879ca5f5ae4100d92d9f72e91 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Apr 2026 20:51:10 +0000 Subject: [PATCH 118/132] fix(vints): assign remotebuild instead of unused remotebuildversion The API version lookup was setting remotebuildversion but all subsequent jq queries used ${remotebuild}, which was never populated. This caused 'Unable to get remote build' on every install/update. --- lgsm/modules/update_vints.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/modules/update_vints.sh b/lgsm/modules/update_vints.sh index 86a7156ee..5bf3df25d 100755 --- a/lgsm/modules/update_vints.sh +++ b/lgsm/modules/update_vints.sh @@ -39,11 +39,11 @@ fn_update_remotebuild() { apiurl="http://api.vintagestory.at/stable-unstable.json" remotebuildresponse=$(curl -s "${apiurl}") if [ "${branch}" == "stable" ]; then - remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -Ev "\-rc|\-pre" | sort -r -V | head -1) + remotebuild=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -Ev "\-rc|\-pre" | sort -r -V | head -1) elif [ "${branch}" == "unstable" ]; then - remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -E "\-rc|\-pre" | sort -r -V | head -1) + remotebuild=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -E "\-rc|\-pre" | sort -r -V | head -1) else - remotebuildversion="${branch}" + remotebuild="${branch}" fi remotebuildfilename=$(echo "${remotebuildresponse}" | jq --arg remotebuild "${remotebuild}" -r '.[$remotebuild].linuxserver.filename') remotebuildurl=$(echo "${remotebuildresponse}" | jq --arg remotebuild "${remotebuild}" -r '.[$remotebuild].linuxserver.urls.cdn') From 1fdd43a6adeb1839da62660d8c54cdf4fd37f008 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Apr 2026 21:01:35 +0000 Subject: [PATCH 119/132] fix(xnt): unset exitbypass after command_stop.sh in fn_update_localbuild --- lgsm/modules/update_xnt.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lgsm/modules/update_xnt.sh b/lgsm/modules/update_xnt.sh index 501f91c8d..904b7b1a4 100755 --- a/lgsm/modules/update_xnt.sh +++ b/lgsm/modules/update_xnt.sh @@ -29,7 +29,9 @@ fn_update_localbuild() { exitbypass=1 fn_sleep_time_5 tmux -L "${socketname}" send-keys -t "${sessionname}" "version" C-m > /dev/null 2>&1 + exitbypass=1 command_stop.sh + unset exitbypass fn_firstcommand_reset fi From fdb86257e0ee7bc476ebf2f4c29cef058199165e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Apr 2026 21:06:52 +0000 Subject: [PATCH 120/132] fix(ci): resolve super-linter failures - Set DEFAULT_BRANCH to current branch to fix 'master not found' error - Use fetch-depth: 0 so GITHUB_BEFORE_SHA can be resolved - Set update_etl.sh executable bit (BASH_EXEC) - Fix .codespellrc tab indentation (EDITORCONFIG) - Add .gitleaks.toml allowlist for GA4 Measurement Protocol API secret (GITLEAKS) - Fix .markdown-lint.yml: disable MD030/MD013/MD033/MD041/MD051 to match existing repo style (MARKDOWN) --- .github/linters/.codespellrc | 10 +++++----- .github/linters/.gitleaks.toml | 9 +++++++++ .github/linters/.markdown-lint.yml | 11 ++++------- .github/workflows/action-super-linter.yml | 6 +++--- lgsm/modules/update_etl.sh | 0 5 files changed, 21 insertions(+), 15 deletions(-) create mode 100644 .github/linters/.gitleaks.toml mode change 100644 => 100755 lgsm/modules/update_etl.sh diff --git a/.github/linters/.codespellrc b/.github/linters/.codespellrc index 229066881..47dd5ccea 100644 --- a/.github/linters/.codespellrc +++ b/.github/linters/.codespellrc @@ -1,11 +1,11 @@ [codespell] # Skip data tables that contain many short server identifiers (e.g. "fof", "nd") skip = - lgsm/data/*.csv, - package-lock.json, - */package-lock.json, - node_modules, - */node_modules/* + lgsm/data/*.csv, + package-lock.json, + */package-lock.json, + node_modules, + */node_modules/* # Ignore common identifiers/acronyms and extensions used throughout LinuxGSM ignore-words-list = distroname,fof,nd,sav,parms,ThirdParty diff --git a/.github/linters/.gitleaks.toml b/.github/linters/.gitleaks.toml new file mode 100644 index 000000000..b61845ba6 --- /dev/null +++ b/.github/linters/.gitleaks.toml @@ -0,0 +1,9 @@ +title = "LinuxGSM Gitleaks Config" + +[allowlist] + description = "Known false positives" + regexes = [ + # Google Analytics 4 Measurement Protocol API secret - not a sensitive credential, + # it is intentionally embedded in client-side code and is safe to be public. + '''apisecret="[A-Za-z0-9_\-]+"''', + ] diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml index 094bbbcd6..62d421814 100644 --- a/.github/linters/.markdown-lint.yml +++ b/.github/linters/.markdown-lint.yml @@ -12,12 +12,9 @@ MD013: false # MD033: The main README uses inline HTML for badges. MD033: false -# Match existing list formatting in this repo. +# MD007: Repo uses 2-space indentation for nested lists. MD007: - indent: 4 + indent: 2 -MD030: - ul_single: 3 - ol_single: 2 - ul_multi: 3 - ol_multi: 2 +# MD030: Repo mixes 1-space unordered and 2-space ordered list markers. +MD030: false diff --git a/.github/workflows/action-super-linter.yml b/.github/workflows/action-super-linter.yml index de396dcd4..e2755e20a 100644 --- a/.github/workflows/action-super-linter.yml +++ b/.github/workflows/action-super-linter.yml @@ -27,9 +27,8 @@ jobs: - name: Checkout code uses: actions/checkout@v6 with: - # Shallow clone reduces transient fetch failures (HTTP 500) from GitHub. - # We lint the whole codebase instead of relying on git history. - fetch-depth: 1 + # Full clone required so super-linter can resolve GITHUB_BEFORE_SHA. + fetch-depth: 0 fetch-tags: false persist-credentials: false @@ -42,6 +41,7 @@ jobs: env: # To report GitHub Actions status checks GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DEFAULT_BRANCH: ${{ github.ref_name }} VALIDATE_BIOME_FORMAT: false VALIDATE_BIOME_LINT: false VALIDATE_GITHUB_ACTIONS_ZIZMOR: false diff --git a/lgsm/modules/update_etl.sh b/lgsm/modules/update_etl.sh old mode 100644 new mode 100755 From 9a61c0f4c6db6a9d0d8943bd8f8ab32988377cd5 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Apr 2026 21:44:26 +0000 Subject: [PATCH 121/132] chore(ci): upgrade webfactory/ssh-agent from v0.9.0 to v0.10.0 v0.10.0 upgrades from Node.js 20 to Node.js 24, resolving the deprecation warning ahead of the June 2026 forced migration. --- .github/workflows/git-sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/git-sync.yml b/.github/workflows/git-sync.yml index 42c660d9b..986346c49 100644 --- a/.github/workflows/git-sync.yml +++ b/.github/workflows/git-sync.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: SSH Agent - uses: webfactory/ssh-agent@v0.9.0 + uses: webfactory/ssh-agent@v0.10.0 with: ssh-private-key: ${{ secrets.BITBUCKET_SECRET }} From 445dddbd212833ad80808f9f0c0a8b78b010645e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 24 Apr 2026 18:49:19 +0100 Subject: [PATCH 122/132] fix(steamcmd): add libtinfo.so.5 symlink fix for readline warning (#4899) * fix(steamcmd): add libtinfo.so.5 symlink fix for readline warning On distros shipping libtinfo.so.6 but not libtinfo.so.5 (Ubuntu 22.04+, Debian 12+), SteamCMD prints: WARNING: Failed to load 32-bit libtinfo.so.5 or libncurses.so.5. Please install (lib32tinfo5 / ncurses-libs.i686 / equivalent) to enable readline. lib32tinfo5 does not exist on Ubuntu 24.04. Creating a user-space symlink inside the steamcmd directory resolves the warning without requiring root or a missing package. * fix(steamcmd): address Copilot review feedback on libtinfo symlink fix - Iterate over all candidate steamcmd dirs (HOME/.steam/steamcmd, steamcmddir, HOME/.local/share/Steam/steamcmd) matching the pattern used for steamclient.so fixes elsewhere in the module - Replace '! -f && ! -L' guard with '! -e' so broken/dangling symlinks are also repaired rather than silently skipped - Add mkdir -p before ln in case the directory does not exist yet - Capture exitcode=$? after ln so fn_fix_msg_end reports failures --------- Co-authored-by: LinuxGSM --- lgsm/modules/fix_steamcmd.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lgsm/modules/fix_steamcmd.sh b/lgsm/modules/fix_steamcmd.sh index 0ba5c85b2..36bc378ac 100755 --- a/lgsm/modules/fix_steamcmd.sh +++ b/lgsm/modules/fix_steamcmd.sh @@ -113,6 +113,31 @@ if [ ! -f "${steamclientsdk32}" ]; then fn_fix_msg_end fi +# Helps fix: WARNING: Failed to load 32-bit libtinfo.so.5 or libncurses.so.5. +# On distros that ship libtinfo.so.6 (e.g. Ubuntu 22.04+, Debian 12+) but not +# libtinfo.so.5, SteamCMD prints this warning and loses readline support. +# Creating a symlink from .so.5 -> .so.6 resolves the warning without root. +for libtinfo32dir in "${HOME}/.steam/steamcmd" "${steamcmddir}" "${HOME}/.local/share/Steam/steamcmd"; do + if [ -d "${libtinfo32dir}" ]; then + libtinfo32so="${libtinfo32dir}/libtinfo.so.5" + # Also repair broken symlinks (! -e catches missing target, -L catches dangling link) + if [ ! -e "${libtinfo32so}" ]; then + # Find the .so.6 in the system 32-bit lib paths + for libtinfo32so6 in /lib/i386-linux-gnu/libtinfo.so.6 /usr/lib/i386-linux-gnu/libtinfo.so.6 /lib32/libtinfo.so.6; do + if [ -f "${libtinfo32so6}" ]; then + fixname="libtinfo.so.5 32-bit symlink" + fn_fix_msg_start + mkdir -p "${libtinfo32dir}" + ln -sf "${libtinfo32so6}" "${libtinfo32so}" + exitcode=$? + fn_fix_msg_end + break + fi + done + fi + fi +done + # steamclient.so fixes if [ "${shortname}" == "bo" ]; then fn_fix_steamclient_so "32" "${serverfiles}/BODS_Data/Plugins/x86" From 5a3c210ab78b9fc2a704511b0639c8db0518f038 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 24 Apr 2026 20:56:48 +0100 Subject: [PATCH 123/132] feat(newserver): Military Conflict: Vietnam MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for the Military Conflict: Vietnam dedicated game server. Supersedes #4594 (original WIP PR from @knoxed — completing the implementation). Changes: - Added mcvserver default configuration - Added mcv to serverlist and all distro CSV files - Added install_config handler for mcvserver - Added dependency info for all distros - Added game icons - Fixed CI workflow issues Co-authored-by: Knoxed <1338733+knoxed@users.noreply.github.com> --- .github/workflows/details-check.yml | 2 +- .github/workflows/serverlist-validate.yml | 5 +- ...update-copyright-years-in-license-file.yml | 2 +- .github/workflows/version-check.yml | 2 +- .../config-lgsm/mcvserver/_default.cfg | 189 ++++++++++++++++++ lgsm/data/almalinux-8.csv | 4 +- lgsm/data/almalinux-9.csv | 4 +- lgsm/data/centos-7.csv | 4 +- lgsm/data/centos-8.csv | 4 +- lgsm/data/centos-9.csv | 4 +- lgsm/data/debian-10.csv | 2 + lgsm/data/debian-11.csv | 2 + lgsm/data/debian-12.csv | 2 + lgsm/data/debian-13.csv | 2 + lgsm/data/debian-9.csv | 2 + lgsm/data/gameicons/mcv-icon.png | Bin 0 -> 2334 bytes lgsm/data/gameicons/ps-icon.png | Bin 1216 -> 0 bytes lgsm/data/gameicons/squad44-icon.png | Bin 0 -> 1849 bytes lgsm/data/gameicons/tf2c-icon.png | Bin 0 -> 2412 bytes lgsm/data/rhel-7.csv | 4 +- lgsm/data/rhel-8.csv | 4 +- lgsm/data/rhel-9.csv | 4 +- lgsm/data/rocky-8.csv | 4 +- lgsm/data/rocky-9.csv | 4 +- lgsm/data/serverlist.csv | 1 + lgsm/data/ubuntu-16.04.csv | 2 + lgsm/data/ubuntu-18.04.csv | 2 + lgsm/data/ubuntu-20.04.csv | 2 + lgsm/data/ubuntu-22.04.csv | 2 + lgsm/data/ubuntu-23.04.csv | 2 + lgsm/data/ubuntu-23.10.csv | 2 + lgsm/data/ubuntu-24.04.csv | 4 +- lgsm/modules/install_config.sh | 5 + 33 files changed, 257 insertions(+), 15 deletions(-) create mode 100644 lgsm/config-default/config-lgsm/mcvserver/_default.cfg create mode 100644 lgsm/data/gameicons/mcv-icon.png delete mode 100644 lgsm/data/gameicons/ps-icon.png create mode 100644 lgsm/data/gameicons/squad44-icon.png create mode 100644 lgsm/data/gameicons/tf2c-icon.png diff --git a/.github/workflows/details-check.yml b/.github/workflows/details-check.yml index c58aa0ae4..aced7522d 100644 --- a/.github/workflows/details-check.yml +++ b/.github/workflows/details-check.yml @@ -21,7 +21,7 @@ jobs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Generate matrix with generate-matrix.sh run: chmod +x .github/workflows/details-check-generate-matrix.sh; .github/workflows/details-check-generate-matrix.sh diff --git a/.github/workflows/serverlist-validate.yml b/.github/workflows/serverlist-validate.yml index c2605b062..e2016eddf 100644 --- a/.github/workflows/serverlist-validate.yml +++ b/.github/workflows/serverlist-validate.yml @@ -6,13 +6,16 @@ on: permissions: contents: read +env: + datadir: lgsm/data + jobs: serverlist-validate: if: github.repository_owner == 'GameServerManagers' runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Compare Versions run: chmod +x .github/workflows/serverlist-validate.sh; .github/workflows/serverlist-validate.sh diff --git a/.github/workflows/update-copyright-years-in-license-file.yml b/.github/workflows/update-copyright-years-in-license-file.yml index 1123b8cce..d9870a166 100644 --- a/.github/workflows/update-copyright-years-in-license-file.yml +++ b/.github/workflows/update-copyright-years-in-license-file.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 - name: Action Update License Year diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml index cfa7615bd..2b4448643 100644 --- a/.github/workflows/version-check.yml +++ b/.github/workflows/version-check.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Version Check run: chmod +x .github/workflows/version-check.sh; .github/workflows/version-check.sh diff --git a/lgsm/config-default/config-lgsm/mcvserver/_default.cfg b/lgsm/config-default/config-lgsm/mcvserver/_default.cfg new file mode 100644 index 000000000..3d822892a --- /dev/null +++ b/lgsm/config-default/config-lgsm/mcvserver/_default.cfg @@ -0,0 +1,189 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +game_type="0" +game_mode="0" +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +steamport="26901" +defaultmap="mcv_siege" +maxplayers="32" +tickrate="64" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game vietnam -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +game_type ${game_type} +game_mode ${game_mode} -nobreakpad" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# Alert on Start/Stop/Restart +statusalert="off" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify +gotifyalert="off" +gotifytoken="token" +gotifywebhook="webhook" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" +pushoveruserkey="userkey" + +# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat +rocketchatalert="off" +rocketchatwebhook="webhook" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help". +telegramapi="api.telegram.org" +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="1136190" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Military Conflict: Vietnam" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/vietnam" +executabledir="${serverfiles}" +executable="./srcds_run_x64" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 2405a4b3e..42b0bcfbd 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -67,6 +67,7 @@ l4d l4d2 mc,java-21-openjdk mcb,libnsl +mcv mh mohaa,compat-libstdc++-33.i686 mta,ncurses-compat-libs,libxml2 @@ -82,7 +83,6 @@ opfor pc pc2 pmc,java-21-openjdk -ps,GConf2 pvkii pvr,libcxx pw @@ -109,12 +109,14 @@ sm,telnet,expect sof2 sol squad +squad44 st,libxml2 stn sven terraria tf tf2,libcurl.i686 +tf2c,libcurl.i686 tfc ti ts diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index 069e8e437..7780ebf79 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -67,6 +67,7 @@ l4d l4d2 mc,java-21-openjdk mcb,libnsl +mcv mh mohaa,compat-libstdc++-33.i686 mta,ncurses-compat-libs,libxml2 @@ -82,7 +83,6 @@ opfor pc pc2 pmc,java-21-openjdk -ps,GConf2 pvkii pvr,libcxx pw @@ -109,12 +109,14 @@ sm,telnet,expect sof2 sol squad +squad44 st,libxml2 stn sven terraria tf tf2,libcurl.i686 +tf2c,libcurl.i686 tfc ti ts diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index 39af5868d..c61fbf7d9 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -67,6 +67,7 @@ l4d l4d2 mc,java-21-openjdk mcb,libnsl +mcv mh mohaa,compat-libstdc++-33.i686 mta,ncurses-libs,libxml2 @@ -82,7 +83,6 @@ opfor pc pc2 pmc,java-11-openjdk -ps,GConf2 pvkii pvr,libcxx pw @@ -109,12 +109,14 @@ sm,telnet,expect sof2 sol squad +squad44 st,libxml2 stn sven terraria tf tf2,libcurl.i686 +tf2c,libcurl.i686 tfc ti ts diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index bcaf1e31d..a9b0692b4 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -67,6 +67,7 @@ l4d l4d2 mc,java-21-openjdk mcb,libnsl +mcv mh mohaa,compat-libstdc++-33.i686 mta,ncurses-compat-libs,libxml2 @@ -82,7 +83,6 @@ opfor pc pc2 pmc,java-17-openjdk -ps,GConf2 pvkii pvr,libcxx pw @@ -109,12 +109,14 @@ sm,telnet,expect sof2 sol squad +squad44 st,libxml2 stn sven terraria tf tf2,libcurl.i686 +tf2c,libcurl.i686 tfc ti ts diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index 446a55ebb..2dcfe82b5 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -67,6 +67,7 @@ l4d l4d2 mc,java-17-openjdk mcb,libnsl +mcv mh mohaa,compat-libstdc++-33.i686 mta,ncurses-compat-libs,libxml2 @@ -82,7 +83,6 @@ opfor pc pc2 pmc,java-17-openjdk -ps,GConf2 pvkii pvr,libcxx pw @@ -109,12 +109,14 @@ sm,telnet,expect sof2 sol squad +squad44 st,libxml2 stn sven terraria tf tf2,libcurl.i686 +tf2c,libcurl.i686 tfc ti ts diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index e0c6ea7e4..b4d0123ff 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -66,6 +66,7 @@ l4d l4d2 mc,openjdk-11-jre mcb +mcv mh mohaa,libstdc++5:i386 mta,libncursesw5,libxml2-utils @@ -115,6 +116,7 @@ sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 +tf2c,libcurl4-gnutls-dev:i386 tfc ti ts diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 0d2652293..3e835e1d4 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -67,6 +67,7 @@ l4d l4d2 mc,openjdk-17-jre mcb +mcv mh mohaa,libstdc++5:i386 mta,libncursesw5,libxml2-utils @@ -115,6 +116,7 @@ sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 +tf2c,libcurl4-gnutls-dev:i386 tfc ti ts diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index e67a822b7..6c3dc59c7 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -67,6 +67,7 @@ l4d l4d2 mc,openjdk-17-jre mcb +mcv mh mohaa,libstdc++5:i386 mta,libncursesw5,libxml2-utils @@ -115,6 +116,7 @@ sven,libssl3:i386,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 +tf2c,libcurl4-gnutls-dev:i386 tfc ti ts diff --git a/lgsm/data/debian-13.csv b/lgsm/data/debian-13.csv index e7a622a7e..841be5a34 100644 --- a/lgsm/data/debian-13.csv +++ b/lgsm/data/debian-13.csv @@ -67,6 +67,7 @@ l4d l4d2 mc,openjdk-25-jre mcb +mcv mh mohaa,libstdc++5:i386 mta,libncursesw5,libxml2-utils @@ -115,6 +116,7 @@ sven,libssl3:i386,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 +tf2c,libcurl4-gnutls-dev:i386 tfc ti ts diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index a111c6800..a79b9ebaa 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -67,6 +67,7 @@ l4d l4d2 mc,openjdk-8-jre mcb +mcv mh mohaa,libstdc++5:i386 mta,libncursesw5,libxml2-utils @@ -115,6 +116,7 @@ sven,zlib1g:i386 terraria tf tf2,libcurl4-gnutls-dev:i386 +tf2c,libcurl4-gnutls-dev:i386 tfc ti ts diff --git a/lgsm/data/gameicons/mcv-icon.png b/lgsm/data/gameicons/mcv-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..fefcc23460df41173b4c4265a9f3e47018a67498 GIT binary patch literal 2334 zcmV+(3E}pMP){|8q>3VC9^G+t{kF@~ zMK#xj^$u)4oz7Cm<~U}XA(K*)fmi@DD~wVwDT>;VBuF_*kqadWI6)xBx>BVvByvon zO>Ln()v)|{?NXjdGgFtLwfFD$gXMKO-ME33NkkbTvroxNNCcUrWKNzj8wExQEl~@U zQiHcfWi2v7%G_5vR<%}(iY}Lv`AK2r?s|8yVNRvuyt_S~tyZ3-BXAsC77;OIU|>=t zLvRvuRTPs_X^|_UNnvb1WN%|Pkjm>twOXG{XND^ordm+2cI@{1`B%sEb0zY}=z0Fq_r$MO9V0 zD5VmLJ#obL$8G7c>cz3?jFM*`uNhU-Za@};#1Uo7Vw1%dWh<4JimW?MCd*2wG=viA zv|eHi_x%7VW*?FdG^^(Gxi+$GckQ+r?)`SN8m)+fze;AR>ZEi&GKZ98b;q8y6kuM?)JtGq22hpC@(MO_0nL0 z&a*6y=jxajyHssraWq2Iu}+qU!#MP$43u>gVpuK>wzgDJlRrJ3oKp4l`D2^yi&rmR zzWpgi???6?&YsP!_3Fet`P)zTwts)KZ5-t3!~0#@aQrpTz4yEO`-3S}G@*}rb}@feoWnq0uCzqgR&8N@*=Hb)NyqJCcn{PIG)~Z<- zCSpC+9*W+vv&o8-FoDs41jIfKQWuk=Ov{;YF=d}PgzWFT_af)&Os>*o(A{!2eg4^# zi^sFZdPm8u&hvvuV?%9kELH93#~4z!oLx@Nd*??NU8J(A2J3^$gZEWAZQ5I{pc}^| z{9I4PgvA6;iuL+ut5TPO#x}j%xbe_?$o2QT&D}6-$DAb`4hMupkQ8KTAcOWmQAVoj z)&96`4~;V0O+`%b81f_2FiHaZ)XoWfZ{vi$}93=Vw=&^zuXc!^`%VO^CvJj+_#( zkV!+L{nk?^Bl2Nr7iBfLjx|hcGhbhP`A?tLi`d0&T`pRe-ZrCJpNu#d&2dPztmg`8 zJbv`^kI&c5=f8aXYQulN9)ADLD~S?05FmgiV1tk&kG&mA&C_YQIA5GTI=T4xyygD- z=C*Nz-1%xf15>n3dvRH|hrLX5CDs8iJKubGbJ%70_WI@RNW;-QIy+-e`wyGL{SH&0 zoCGO_5WTl~?5e3;S8_R<{_%(F|Gjy?CjqrEs{i??(_cO-b+R;;#FM*2@#{ZtK$o#x z?L%-v?ko*H_YG$UI+BUgg}NXE#Ee9w!H8&cs=a8^np1GaXz`oYWS(8H+woceSE)b zUcI~DVa>S>vX~O4?lzCRFF%^ErMP+h1DE+1pFeb>{Oy1L4{>&xbHEqPy z-d$Z=y?F5SIk{{V14|W14ODKq+{$^_SN&v)z|;<`O|*CKOW#uKi={5+1Iab zcA!TVbcCFlBkB>09?Fp^q?Ce13IY=V015_TK*5jz$7onDG}YnQ6)67Yt1p*x?-#Rg zU%XsQ*Q!1}=5Dv^jseh6-?h{Vk%S&)=|yExWdIS55`nqg z6wA@EJ$thL@b>?BHu=M!zN>3r)$~IdlL1A3gfy%YS|O>ivg(IAY~Q9Q>&4kswm1 zW(j3L#V81wIH=^A8B$`F5rHv7W&ttzkU4-Bje+b^aj#t7*8gN;@wQ-EMdJef@YAG7(?2DxLyxc~qF07*qoM6N<$ Ef~gOJ-v9sr literal 0 HcmV?d00001 diff --git a/lgsm/data/gameicons/ps-icon.png b/lgsm/data/gameicons/ps-icon.png deleted file mode 100644 index afe81e82340b2e04a66a4487da79be395d144dc4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1216 zcmV;x1V8(UP);lyv|H@b~B2Jk~o$#Q~>DXj^_S7i)EPB=jBK)UDdc|P~) z2mgfE4=;dFa0&s!U?*Sz2so$?5(^FxfC&QtlMpG{EAgK;a(CD!C2SGUC=pCVVF~C; z#(r2?arfipR>>a6ar=;|q|+jrCAq0t1kn)rbbpF1I1+c$es5`W1z9y%Z!OwG2Ib5d zQi{oflGLHUdvA`1$483;&t?9+>O{^pD@=7$5|H?ya^{8_-F-c3#-9Dr=!QMpr*eV* z?e~Rg4-+tHQ{FXk@84ntA$>k3^OZiu-pR>W>*+2EN>Cz9>TG?9{bbH=Rc|Mqxc=X#C}`ceeyf-teI&QFUegY>)zXP`>A}ejXn_7Xm7`G>u=vT|nUqIHyqy3$g zZdM)x9o=%iub6S$7e%gwno2t?4P>w__q`6&>bf~r!rB)0H7dE9_ck^L=;DEv z_WB)+Cd0ipDlBWVt>np$`_YXNbe(E?LO77LJ~cTJubC=hZGa{qY`9X_e+0!5Q^{Py zZBvK5$=P*3>?VQPiSj$W!UX)&OBTh|qIo*y)3}L@!hdS6jE%V}2742$t8PQvB!Z7x zQY#`aQG4dq;ZKeSkL`-uedja=XsC-$nCc7;6q3F3 z*Z%st;dbzXGiSLceklh5VUl}$bYJbazwI>;>rTy0b1htJZ}4h%Yr1HW00O|)!1*&b z{v4=U!8kY^-jh?^wWZ3)XWR|~qBNA9G%u|cY5c*zbJCNMo_f8lV_Vs=UnQ7ifQ^Rl z_}`rJ*xy*^$~Fok4@aI%6|KwP_Xh-`oPtFR#+nOMx_?<-%gE6Iee&=PnmUtr8`Na5 zz;y`50BrlQJ$!lev{FsRaLqQ|kDGLB00t5vA18}>p&PR)|6951JC3HntbYx+4WjbSWWnpw>05UK#Gc7SNEipD! zF*iCeIXW{nD=;uRFfc@Fw(|f003~!qSaf7zbY(hiZ)9m^c>ppnGBYhPFfB1QR53R? eFgZFiH7hVMIxsLbHx5q#0000vG925{=gAW`89C~`Ddy4uON1M6+H~)XVX8|=`Rp-?C&Ud~lgb)%% z5g~*Sk|YTRf*`;^mSyzISeDHmz^*_bfc|Pc&pWdiW8`wV5JHNgz_g}mnx?^+<2V>F z3A!!RhNgbZ1WpCcR zSzcZ~b?OwuFdWALI8GUU*3zjkRBy+Q9lEZMj*hObuHL$JtEQ%=y1Lr7ZAxi>e}7(H zUMLijWtr#sqN1Y4#>UmvRZ3|j63KQg2m%lRV~pTmc9~J(=>)*g27-c z7BfwAcz9SJ3knKcE|;chv$M05(v_8!UAuPu#%YJyNEAhu zWi?H+EUTubCND3qwzjskw6wgu+~e__IB{Zqecd!oSX@_Ecj?k4pU=nhye!Mr)z!&l za(#WhzrP;UJQ<6{78Vxb@pvp2+t}DxT3X_H{^`@Fo12@Po15Wq z7-Kv)H)mPal`B`=Za37nwY9aXsw$OAg~MS%5FF~uvdpH_X@+4~mNg9H;>C+ko;)Fh z*tVTaCJPG-0pHJ`KQAmS1Ofp<2qA=JS-;=k-QDf?`%|gZ($dnyhYt)prKP2Aw;O=wIF3>p3WZcv)ph;u-Mgk~_Vo1Vx=tyTBqBuQcz#^HmaC@z;P7z`?kQdwDv5c2tay}i8;9y};2D$38# zFD@?b?(U|PLeF2md>L58A%s>|Rxrkki;KCrxzT8p=Xu+<{eC}Gp67W=X)>AQdH&3q zGqG6g@#Du=uU_rw=ulPFvaFVtmcxe+H#Ie>syaM8{OHl6w{PE0O-=cHKEp7!drc68 z7cX9DnpRR$Qdn5%@pyLb+$jh`I2?w4@p`?-jvZTETwGgQgOh?rrBW$E$iTorQ&ZD# zTEuZ2CkR3&lR*esmi6u1w}S@{y4~)wva)zQUQtm|RaK>F+W!6fp{=H-rUHS0$Kyc= zZES3KJRZX^Mn*<@dV1#P=Yjql$ALqT-k)s^MQ?9!A0Ho|pP#3cZf$LCY-|8Hkx1m+ zxpQ~!+%ZiPL?5P1)2y$rXBfu0f*fsjEMQaBz@P+R@R0vLqeKixBGU?7VQ{g3ILsK(a4zIFKlc+x5U0L(9QmSl!&*oKB|) z2M675cQ*M{RYeHhyLZodh`@KpUG`h#=Z*HaCd=~Z=qRPMqN2h{3#QJWKR+-qfU+Jt z|I&^eITDY@Z{EBa3jZb5%#(I1$D?4d)4UcGwt?AbHuHRvpdvj08_aFGqMD2m$;o?rIg nU;fNszoRe^4_@H^q`dzD5Wgm!a9kiv00000NkvXXu0mjf**A<+ literal 0 HcmV?d00001 diff --git a/lgsm/data/gameicons/tf2c-icon.png b/lgsm/data/gameicons/tf2c-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f466347a186fad95ce446187b3c36c1c226c8970 GIT binary patch literal 2412 zcmV-y36u7TP)CY z3vP(S)HrL_|cE%jN3Ix;CarP8`vK?ex}>O){vp z6R8LNsEi@4kf@Y`h|@IH3iCV*gV7E_0YJ`K*9tio5pJ4>nNvzv!VvZ<$;Q^|$v400 zjyvx-{+i=4=12eFk*_@aAC-_Q9Jy-yrkieh?yFzjxqJY%8l#D594BjC)3l}JS}PH0 zhN`s&hLDnoAYm4cDU#v4?tbT6fAsc^tqoF`aM#u3+uQH?_4{A@`qyr3t_`6F zQlJ$8p8MaIg*k-cTDy68J(OW>Yw@mMz2}x&zxVM+{`k8up6j|55kXK|X<;a(5F*a= zY^`<9iAV_H*s)^|Km70wH=pQM+GXhH5|uGhaZY7<(0lKRFf(s%Z)$Ir;lQ`{4Y%C< z;DaALdewF*MHrlG5LHUWxrRa-o30HLOVS8NId$Lre)-sqTUM2llSL01K@vfhl=m(T zTxyKz$dMzpaxT$(8&e=vkKM5S-Ur{EN^G3t9HazeA;f`uEu(r0AOROkTv({7z4{aV^-&kCI_0jd!jnDkm-&*oS z#JL#dVh-A2Rprq?{QXzGdOOPu$bbuLA;;P4m7jj+sbN29tqB>w@2bu@7eesfi-@!K z%4_GuO{-I$KoF|+uG?Sk`Nn9ZVHnmoHo`n!cl_E@zw(RQM>aMOA5waubP=9_&HLZ| zn=k#(r7(>~1HSp{&KLtynb~T`sVHSCgOFyK0JGLMB|tPtnY2hw-nV@}TH{^g=M+jU zTI-dy^{vC*v16OU>dRmJcZG|RgE19vy=EmR0_}30-tt2yN%6}sUEI0Y_rsLa?6h&l z4+lXRqZBYC6pg5)QYoqJnlKJldqs{RR0c!@z?`#ho0OTEb;*%gTWhYp_L_%&<3Xf| zXrP#o!v4OWE&q1u0TI)Q;Gyi$^`Wvq;B?6&wI>q2S zzj<{1-ur*)V;}vawXPk9;Jhvnr*Zh;hu?F@owqyZw5DkoW8tw6I~Vpo{^;Z1dj8uA zP1|%aMsmIrCL*g<`^*=8*hFc8mhHUQ)=5)$^}?}nL|H6`^>+-e16~it`t#K zmsy&o$vHEpm_w;Wq;M_w-goN6_q;mH`^F<8G_7OK{qoYHbz$yLpFYh+n5%bf-}f}< zS*Q>JGheuH`RS)VABLnrmzWyoW0;Yu_3p(Nzgvn3V-;LGv^Gq=Z=6ESx#pP(%)%ey zqW|Qvzqt7F9#pNBo#LddBIBu)#K3LaBG8|H>d&8l{sm@sMhQm%A)=JZ?#{kejj$HP z!&^t1rbD1{n4NBo?tn2)>g!+o=4bx$>DF&Zt|5fB^C<_CQWZHx&ECP-_!VILI}d&2 z{I>_jhOC{_0aD6wzI161NsFqBwUuVEQbBPQ<%;M&)_rjGrT^ah-G@JdVwgEg0YxPX zf+hecr7*KGrWCQ(U$}7j0}p)Y%g;VnvuWJAp>BVtS7i2f_6gL+hBJn93JR$f1hypY z*S_+N4?OUpix>BeaU!6UsZ}iHHbTYegi+SZnoep>$1o)LO?dTiYn5 z=6SYWzyA8`&c5(p%*&Zj2VVODW#Nh&W+>foDq@28Bc7iv^64pzE3#V=2Y^wq&eONHH^)T%BujjsViOiz~Y`Ga|NaJC40`PLr`Q%nY+J zMp?zcxnxNIAXTdIjfnJ9K&;lgIVS|GjgB!kO#@WtoHjQP?e1P4=b#i;sALF$`f1FC zeP{5R#y5>)=31GEuK0;aX^3+H(AL@*M eNE1;A@&5oeRnKIuq;I Date: Fri, 24 Apr 2026 22:43:42 +0100 Subject: [PATCH 124/132] fix: support legacy game servers on older Ubuntu/Debian runners (#4903) * fix(workflows): support legacy game servers on older Ubuntu/Debian runners Multiple game servers have glibc compatibility requirements that prevent them from running on Ubuntu 24.04: - bfv, bf1942: Require Ubuntu <= 22.04 or Debian <= 12 (glibc 2.31) - btl, onset: Require Ubuntu <= 20.04 or Debian <= 11 (glibc 2.31) Changes: - Add runner field to details-check matrix generation - Map legacy servers to appropriate ubuntu-XX.04 LTS runners - Modern servers continue on ubuntu-latest (24.04) - Update details-check.yml to use dynamic runner from matrix This ensures all server tests pass in CI without breaking modern server testing on current GitHub Actions runners. * fix(workflows): run details-check on PRs and normalize ref resolution Details Check was not running for PR #4903 because the workflow only triggered on push to develop/workflow_dispatch. Also, pull_request refs (refs/pull/*) are not valid raw-content refs for GitHub downloads. Changes: - Trigger Details Check on pull_request to develop - Add LGSM_REF env resolved to PR head SHA or branch ref name - Use LGSM_REF for linuxgsm.sh download and LGSM_GITHUBBRANCH usage - Use LGSM_REF in matrix generation when fetching serverlist.csv This ensures legacy server jobs (bfv, bf1942, btl, onset) are included and executed during PR validation. * fix(workflows): run update-check on PRs and normalize ref resolution Apply the same PR-safe workflow behavior used in details-check: - Trigger update-check on pull_request to develop - Resolve LGSM_REF to PR head SHA or branch ref name - Use LGSM_REF for linuxgsm.sh download and LGSM_GITHUBBRANCH calls This ensures update-check validates PR changes instead of only running on develop pushes. * fix(check_deps): avoid false Debian version check on Ubuntu Ubuntu reports ID_LIKE=debian, which caused Debian upper-version checks to run on Ubuntu and incorrectly fail legacy titles on Ubuntu 22.04.x. Use distroid==debian for Debian limits in legacy compatibility guards so: - bf1942/bfv pass on Ubuntu 22.04.x as intended - btl/onset limits still apply correctly - Debian limits still apply on Debian only * fix(workflows): add PR trigger to version-check; replace archived action in docker trigger version-check.yml: - Add pull_request trigger targeting develop so version format is validated on PRs before merge trigger-docker-build.yml: - Replace archived convictional/trigger-workflow-and-wait@v1.6.5 with native gh CLI approach (trigger + watch run ID) - Uses GH_TOKEN env var with PERSONAL_ACCESS_TOKEN secret - gh workflow run dispatches the workflow; gh run watch polls for completion and exits non-zero on failure, preserving job dependencies * fix(workflows): use timestamp filter to reliably identify triggered run ID Using --limit 1 to find the run ID is a race condition if another run of the same workflow starts concurrently. Capture a timestamp before dispatching and pass --created >=${before} to gh run list so we always select the run we just triggered. * remove pr check --- .../details-check-generate-matrix.sh | 19 +++++++- .github/workflows/details-check.yml | 20 +++++---- .github/workflows/trigger-docker-build.yml | 44 ++++++++++++++----- .github/workflows/update-check.yml | 16 ++++--- lgsm/modules/check_deps.sh | 6 +-- 5 files changed, 74 insertions(+), 31 deletions(-) diff --git a/.github/workflows/details-check-generate-matrix.sh b/.github/workflows/details-check-generate-matrix.sh index 2c0803519..1093a46cf 100755 --- a/.github/workflows/details-check-generate-matrix.sh +++ b/.github/workflows/details-check-generate-matrix.sh @@ -1,6 +1,7 @@ #!/bin/bash -curl "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/lgsm/data/serverlist.csv" | grep -v '^[[:blank:]]*$' > serverlist.csv +ref="${LGSM_REF:-${GITHUB_REF#refs/heads/}}" +curl "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${ref}/lgsm/data/serverlist.csv" | grep -v '^[[:blank:]]*$' > serverlist.csv echo -n "{" > "shortnamearray.json" echo -n "\"include\":[" >> "shortnamearray.json" @@ -14,10 +15,26 @@ while read -r line; do export gamename distro=$(echo "$line" | awk -F, '{ print $4 }') export distro + # Legacy servers that require older Ubuntu/Debian versions due to glibc compatibility + case "${shortname}" in + bfv|bf1942) + # Requires Ubuntu <= 22.04 or Debian <= 12 (glibc 2.31 compatible) + runner="ubuntu-22.04" + ;; + btl|onset) + # Requires Ubuntu <= 20.04 or Debian <= 11 (glibc 2.31 compatible) + runner="ubuntu-20.04" + ;; + *) + runner="ubuntu-latest" + ;; + esac { echo -n "{"; echo -n "\"shortname\":"; echo -n "\"${shortname}\""; + echo -n ",\"runner\":"; + echo -n "\"${runner}\""; echo -n "},"; } >> "shortnamearray.json" done < <(tail -n +2 serverlist.csv) diff --git a/.github/workflows/details-check.yml b/.github/workflows/details-check.yml index aced7522d..856ab2d2a 100644 --- a/.github/workflows/details-check.yml +++ b/.github/workflows/details-check.yml @@ -17,6 +17,8 @@ jobs: create-matrix: if: github.repository_owner == 'GameServerManagers' runs-on: ubuntu-latest + env: + LGSM_REF: ${{ github.event.pull_request.head.sha || github.ref_name }} outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: @@ -37,14 +39,16 @@ jobs: if: github.repository_owner == 'GameServerManagers' needs: create-matrix continue-on-error: true - runs-on: ubuntu-latest + runs-on: ${{ matrix.runner }} + env: + LGSM_REF: ${{ github.event.pull_request.head.sha || github.ref_name }} strategy: matrix: ${{ fromJSON(needs.create-matrix.outputs.matrix) }} steps: - name: Download linuxgsm.sh - run: wget "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh"; chmod +x linuxgsm.sh + run: wget "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${LGSM_REF}/linuxgsm.sh"; chmod +x linuxgsm.sh - name: Install dependencies run: sudo apt-get install libxml2-utils jq @@ -53,10 +57,10 @@ jobs: run: mkdir -p serverfiles - name: Grab server - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./linuxgsm.sh ${{ matrix.shortname }}server - name: Enable developer mode - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server developer + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server developer - name: Generate servercfgname id: sets-servercfgname @@ -73,7 +77,7 @@ jobs: fi - name: Pre-load LinuxGSM - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server details + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server details - name: Display config run: | @@ -87,10 +91,10 @@ jobs: run: grep "startparameters" lgsm/config-default/config-lgsm/${{ matrix.shortname }}server/_default.cfg - name: Details - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server details + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server details - name: Detect details - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server parse-game-details + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server parse-game-details - name: Query Raw - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server query-raw + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server query-raw diff --git a/.github/workflows/trigger-docker-build.yml b/.github/workflows/trigger-docker-build.yml index 390123322..823592457 100644 --- a/.github/workflows/trigger-docker-build.yml +++ b/.github/workflows/trigger-docker-build.yml @@ -15,12 +15,22 @@ jobs: runs-on: ubuntu-latest steps: - name: Trigger Workflow and Wait (linuxgsm) - uses: convictional/trigger-workflow-and-wait@v1.6.5 - with: - owner: GameServerManagers - repo: docker-linuxgsm - github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - workflow_file_name: action-docker-publish.yml + env: + GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + run: | + before=$(date -u +%Y-%m-%dT%H:%M:%SZ) + gh workflow run action-docker-publish.yml --repo GameServerManagers/docker-linuxgsm + sleep 10 + run_id=$(gh run list \ + --workflow action-docker-publish.yml \ + --repo GameServerManagers/docker-linuxgsm \ + --created ">=${before}" \ + --limit 1 \ + --json databaseId \ + --jq '.[0].databaseId') + gh run watch "${run_id}" \ + --repo GameServerManagers/docker-linuxgsm \ + --exit-status trigger_build_docker-gameserver: if: github.repository_owner == 'GameServerManagers' @@ -29,9 +39,19 @@ jobs: runs-on: ubuntu-latest steps: - name: Trigger Workflow and Wait (gameserver) - uses: convictional/trigger-workflow-and-wait@v1.6.5 - with: - owner: GameServerManagers - repo: docker-gameserver - github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - workflow_file_name: action-docker-publish.yml + env: + GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + run: | + before=$(date -u +%Y-%m-%dT%H:%M:%SZ) + gh workflow run action-docker-publish.yml --repo GameServerManagers/docker-gameserver + sleep 10 + run_id=$(gh run list \ + --workflow action-docker-publish.yml \ + --repo GameServerManagers/docker-gameserver \ + --created ">=${before}" \ + --limit 1 \ + --json databaseId \ + --jq '.[0].databaseId') + gh run watch "${run_id}" \ + --repo GameServerManagers/docker-gameserver \ + --exit-status diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index 8863cedc7..ad1150f7b 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -16,6 +16,8 @@ jobs: update-check: if: github.repository_owner == 'GameServerManagers' runs-on: ubuntu-latest + env: + LGSM_REF: ${{ github.event.pull_request.head.sha || github.ref_name }} strategy: fail-fast: false @@ -24,30 +26,30 @@ jobs: steps: - name: Download linuxgsm.sh - run: wget "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh"; chmod +x linuxgsm.sh + run: wget "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${LGSM_REF}/linuxgsm.sh"; chmod +x linuxgsm.sh - name: Install dependencies run: sudo dpkg --add-architecture i386; sudo apt-get update; - name: Grab server - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./linuxgsm.sh ${{ matrix.shortname }}server - name: Enable developer mode - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server developer + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server developer - name: Insert steamuser if: matrix.shortname == 'jk2' run: echo -e "steamuser=\"${{ secrets.STEAMCMD_USER }}\"\nsteampass='${{ secrets.STEAMCMD_PASS }}'" > lgsm/config-lgsm/${{ matrix.shortname }}server/common.cfg - name: Install server - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server auto-install + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server auto-install - name: Check Update server - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server check-update + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server check-update - name: Update server - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server update + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server update - name: Force Update server if: matrix.shortname == 'css' - run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server force-update + run: LGSM_GITHUBBRANCH="${LGSM_REF}" ./${{ matrix.shortname }}server force-update diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh index 6d572fd40..3d4109e2c 100755 --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -362,7 +362,7 @@ if [ -n "${distrosupport}" ]; then fi # These titles are only supported up to Ubuntu 22.04 (Jammy) and Debian 12 (Bookworm). -if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" "gt" "22.04"; } || { [ "${distroidlike}" == "debian" ] && dpkg --compare-versions "${distroversion}" "gt" "12"; }; then +if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" "gt" "22.04"; } || { [ "${distroid}" == "debian" ] && dpkg --compare-versions "${distroversion}" "gt" "12"; }; then if [ "${shortname}" == "bf1942" ] || [ "${shortname}" == "bfv" ]; then fn_print_failure_nl "${gamename} is not supported on ${distroname} (requires Ubuntu <= 22.04 or Debian <= 12)." fn_script_log_fail "${gamename} is not supported on ${distroname}." @@ -370,8 +370,8 @@ if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" fi fi -# These titles are only supported up to Ubuntu 20.04 and Debian 11 (and Debian-like derivatives). -if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" "gt" "20.04"; } || { [ "${distroidlike}" == "debian" ] && dpkg --compare-versions "${distroversion}" "gt" "11"; }; then +# These titles are only supported up to Ubuntu 20.04 and Debian 11. +if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" "gt" "20.04"; } || { [ "${distroid}" == "debian" ] && dpkg --compare-versions "${distroversion}" "gt" "11"; }; then if [ "${shortname}" == "onset" ] || [ "${shortname}" == "btl" ]; then fn_print_failure_nl "${gamename} is not supported on ${distroname} (requires Ubuntu <= 20.04 or Debian <= 11)." fn_script_log_fail "${gamename} is not supported on ${distroname}." From 4fda9ab461406928326975688b47e08d43a21873 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Apr 2026 22:47:31 +0100 Subject: [PATCH 125/132] chore(deps): bump dessant/lock-threads from 5 to 6 (#4864) Bumps [dessant/lock-threads](https://github.com/dessant/lock-threads) from 5 to 6. - [Release notes](https://github.com/dessant/lock-threads/releases) - [Changelog](https://github.com/dessant/lock-threads/blob/main/CHANGELOG.md) - [Commits](https://github.com/dessant/lock-threads/compare/v5...v6) --- updated-dependencies: - dependency-name: dessant/lock-threads dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniel Gibbs --- .github/workflows/lock.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 8a08284a4..a0a810172 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Lock Threads - uses: dessant/lock-threads@v5 + uses: dessant/lock-threads@v6 with: github-token: ${{ secrets.GITHUB_TOKEN }} issue-comment: > From f48da4f3066cf401548cbdd2562420a959ef82c6 Mon Sep 17 00:00:00 2001 From: WildPenguin Date: Sun, 26 Apr 2026 14:19:52 +0300 Subject: [PATCH 126/132] papermc: add OpenJDK-25 (headless) dependency Dev builds of papermc will not work on older jre, albeit it's still in alpha/beta, some time in the future it will be the stable build. I have not noticed any issues running the stable build with jre-25. --- lgsm/data/ubuntu-24.04.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index 6f96fac7f..e9cdc2002 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -82,7 +82,7 @@ onset,libmariadb-dev opfor pc pc2 -pmc,openjdk-21-jre +pmc,openjdk-25-jre-headless pvkii pvr,libc++1 pw From 0862942d5481e94a89c2b407dc8e437f055c7e6b Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 26 Apr 2026 18:22:41 +0000 Subject: [PATCH 127/132] fix(pmc): use openjdk-25-jre instead of headless variant, update vpmc to java 25 --- lgsm/data/ubuntu-24.04.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index e9cdc2002..478d2b240 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -82,7 +82,7 @@ onset,libmariadb-dev opfor pc pc2 -pmc,openjdk-25-jre-headless +pmc,openjdk-25-jre pvkii pvr,libc++1 pw @@ -130,7 +130,7 @@ ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev vints,dotnet-runtime-8.0 -vpmc,openjdk-21-jre +vpmc,openjdk-25-jre vs wet wf From 0396f245910cf6fd5c4cb28617bfc5e490868726 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 26 Apr 2026 19:42:20 +0100 Subject: [PATCH 128/132] feat(deps): update Java deps to openjdk-25-jre and add Ubuntu 26.04 support (#4908) - ubuntu-24.04: update pz, rw, wmc to openjdk-25-jre - debian-13: update vpmc to openjdk-25-jre, fix wmc typo (openjdk21-jre -> openjdk-25-jre) - add ubuntu-26.04.csv with all Java deps on openjdk-25-jre --- lgsm/data/debian-13.csv | 4 +- lgsm/data/ubuntu-24.04.csv | 6 +- lgsm/data/ubuntu-26.04.csv | 141 +++++++++++++++++++++++++++++++++++++ 3 files changed, 146 insertions(+), 5 deletions(-) create mode 100644 lgsm/data/ubuntu-26.04.csv diff --git a/lgsm/data/debian-13.csv b/lgsm/data/debian-13.csv index 841be5a34..a287d7835 100644 --- a/lgsm/data/debian-13.csv +++ b/lgsm/data/debian-13.csv @@ -130,11 +130,11 @@ ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev vints,dotnet-runtime-8.0 -vpmc,openjdk-21-jre +vpmc,openjdk-25-jre vs wet wf -wmc,openjdk21-jre +wmc,openjdk-25-jre wurm,xvfb xnt zmr diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index 478d2b240..f2578b9a8 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -86,7 +86,7 @@ pmc,openjdk-25-jre pvkii pvr,libc++1 pw -pz,openjdk-21-jre,rng-tools5 +pz,openjdk-25-jre,rng-tools5 q2 q3 q4 @@ -96,7 +96,7 @@ ricochet ro rtcw rust,lib32z1 -rw,openjdk-21-jre +rw,openjdk-25-jre samp sb sbots @@ -134,7 +134,7 @@ vpmc,openjdk-25-jre vs wet wf -wmc,openjdk-21-jre +wmc,openjdk-25-jre wurm,xvfb xnt zmr diff --git a/lgsm/data/ubuntu-26.04.csv b/lgsm/data/ubuntu-26.04.csv new file mode 100644 index 000000000..f2578b9a8 --- /dev/null +++ b/lgsm/data/ubuntu-26.04.csv @@ -0,0 +1,141 @@ +all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat-openbsd,pigz,python3,tar,tmux,unzip,util-linux,uuid-runtime,wget,xz-utils +steamcmd,lib32gcc-s1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd +ac +ahl +ahl2 +ark +arma3 +armar,libcurl4t64 +ats +av +bb +bb2,libcurl4-gnutls-dev:i386 +bd +bf1942 +bfv,libstdc++5:i386 +bmdm +bo +bs +bt,libicu-dev,dos2unix,libxml2-utils +btl +cc +ck,xvfb,libxi6 +cmw +cod,libstdc++5:i386 +cod2,libstdc++5:i386 +cod4 +coduo,libstdc++5:i386 +codwaw +col +cs +cs2 +cscz +csgo +css +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl4-gnutls-dev:i386 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod +hcu +hl2dm +hldm +hldms +hw,lib32z1 +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,openjdk-25-jre +mcb +mcv +mh +mohaa,libstdc++5:i386 +mta,libxml2-utils +nd +nec +nmrih +ns +ns2,speex +ns2c,speex:i386 +ohd +onset,libmariadb-dev +opfor +pc +pc2 +pmc,openjdk-25-jre +pvkii +pvr,libc++1 +pw +pz,openjdk-25-jre,rng-tools5 +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,lib32z1 +rw,openjdk-25-jre +samp +sb +sbots +scpsl,mono-complete +scpslsm,mono-complete +sdtd,telnet,expect,libxml2-utils +sf +sfc +sm,telnet,expect +sof2 +sol +squad +squad44 +st,libxml2-utils +stn +sven,zlib1g:i386 +terraria +tf +tf2,libcurl4-gnutls-dev:i386 +tf2c,libcurl4-gnutls-dev:i386 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,libc6-dev,libatomic1,libpulse-dev +vints,dotnet-runtime-8.0 +vpmc,openjdk-25-jre +vs +wet +wf +wmc,openjdk-25-jre +wurm,xvfb +xnt +zmr +zps From 094de9eb5cf4f28e23873900e45dc4c62b3a03be Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 26 Apr 2026 19:45:52 +0100 Subject: [PATCH 129/132] chore: synced file(s) with dgibbs64/repo-sync (#4904) * chore: synced local '.github/' with remote 'general/.github/' * chore: synced local './' with remote 'bash/' --------- Co-authored-by: unknown --- .devcontainer/devcontainer.json | 56 +++++++++++------------ .github/workflows/action-super-linter.yml | 6 +-- .prettierrc.json | 2 +- .vscode/extensions.json | 20 ++++---- 4 files changed, 41 insertions(+), 43 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 32c844ac7..506b50754 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,30 +1,30 @@ { - "name": "BASH Dev Container", - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", - "features": { - "ghcr.io/devcontainers-community/npm-features/prettier:1": { - "plugins": "prettier-plugin-sh" - }, - "ghcr.io/devcontainers-extra/features/actionlint:1": {}, - "ghcr.io/devcontainers-extra/features/checkov:1": {}, - "ghcr.io/devcontainers-extra/features/markdownlint-cli:1": {}, - "ghcr.io/devcontainers-extra/features/shellcheck:1": {}, - "ghcr.io/devcontainers-extra/features/yamllint:2": {}, - "ghcr.io/devcontainers/features/github-cli:1": {} - }, - "customizations": { - "vscode": { - "extensions": [ - "DavidAnson.vscode-markdownlint", - "editorconfig.editorconfig", - "esbenp.prettier-vscode", - "github.vscode-github-actions", - "GitHub.vscode-pull-request-github", - "redhat.vscode-yaml", - "timonwong.shellcheck", - "yzhang.markdown-all-in-one" - ] - } - }, - "postCreateCommand": "npm init -y >/dev/null 2>&1 || true && npm install --no-save prettier prettier-plugin-sh prettier-plugin-jinja-template" + "name": "BASH Dev Container", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "ghcr.io/devcontainers-community/npm-features/prettier:1": { + "plugins": "prettier-plugin-sh" + }, + "ghcr.io/devcontainers-extra/features/actionlint:1": {}, + "ghcr.io/devcontainers-extra/features/checkov:1": {}, + "ghcr.io/devcontainers-extra/features/markdownlint-cli:1": {}, + "ghcr.io/devcontainers-extra/features/shellcheck:1": {}, + "ghcr.io/devcontainers-extra/features/yamllint:2": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} + }, + "customizations": { + "vscode": { + "extensions": [ + "DavidAnson.vscode-markdownlint", + "editorconfig.editorconfig", + "esbenp.prettier-vscode", + "github.vscode-github-actions", + "GitHub.vscode-pull-request-github", + "redhat.vscode-yaml", + "timonwong.shellcheck", + "yzhang.markdown-all-in-one" + ] + } + }, + "postCreateCommand": "npm init -y >/dev/null 2>&1 || true && npm install --no-save prettier prettier-plugin-sh prettier-plugin-jinja-template" } diff --git a/.github/workflows/action-super-linter.yml b/.github/workflows/action-super-linter.yml index e2755e20a..31b2fa949 100644 --- a/.github/workflows/action-super-linter.yml +++ b/.github/workflows/action-super-linter.yml @@ -27,9 +27,9 @@ jobs: - name: Checkout code uses: actions/checkout@v6 with: - # Full clone required so super-linter can resolve GITHUB_BEFORE_SHA. + # super-linter needs the full git history to get the + # list of files that changed across commits fetch-depth: 0 - fetch-tags: false persist-credentials: false - name: Install Prettier plugins (for summary formatting) @@ -41,7 +41,6 @@ jobs: env: # To report GitHub Actions status checks GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DEFAULT_BRANCH: ${{ github.ref_name }} VALIDATE_BIOME_FORMAT: false VALIDATE_BIOME_LINT: false VALIDATE_GITHUB_ACTIONS_ZIZMOR: false @@ -49,7 +48,6 @@ jobs: VALIDATE_JSON_PRETTIER: false VALIDATE_MARKDOWN_PRETTIER: false VALIDATE_NATURAL_LANGUAGE: false - VALIDATE_PYTHON_RUFF_FORMAT: false VALIDATE_SHELL_SHFMT: false VALIDATE_TRIVY: false VALIDATE_YAML_PRETTIER: false diff --git a/.prettierrc.json b/.prettierrc.json index 1902f8021..02d542d50 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,3 +1,3 @@ { - "plugins": ["prettier-plugin-sh"] + "plugins": ["prettier-plugin-sh"] } diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 5c06a83bf..d31b65dd2 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,12 +1,12 @@ { - "recommendations": [ - "DavidAnson.vscode-markdownlint", - "editorconfig.editorconfig", - "esbenp.prettier-vscode", - "github.vscode-github-actions", - "GitHub.vscode-pull-request-github", - "redhat.vscode-yaml", - "timonwong.shellcheck", - "yzhang.markdown-all-in-one" - ] + "recommendations": [ + "DavidAnson.vscode-markdownlint", + "editorconfig.editorconfig", + "esbenp.prettier-vscode", + "github.vscode-github-actions", + "GitHub.vscode-pull-request-github", + "redhat.vscode-yaml", + "timonwong.shellcheck", + "yzhang.markdown-all-in-one" + ] } From f7a1258b58a30cde8f55c50e5ee8e43f3297aaf3 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 26 Apr 2026 18:57:39 +0000 Subject: [PATCH 130/132] fix(jbep3): add distro deps entries and game icon --- .../config-lgsm/jbep3server/_default.cfg | 198 ++++++++++++++++++ lgsm/data/almalinux-8.csv | 1 + lgsm/data/almalinux-9.csv | 1 + lgsm/data/centos-7.csv | 1 + lgsm/data/centos-8.csv | 1 + lgsm/data/centos-9.csv | 1 + lgsm/data/debian-10.csv | 1 + lgsm/data/debian-11.csv | 1 + lgsm/data/debian-12.csv | 1 + lgsm/data/debian-13.csv | 1 + lgsm/data/debian-9.csv | 1 + lgsm/data/gameicons/jbep3-icon.png | Bin 0 -> 400 bytes lgsm/data/rhel-7.csv | 1 + lgsm/data/rhel-8.csv | 1 + lgsm/data/rhel-9.csv | 1 + lgsm/data/rocky-8.csv | 1 + lgsm/data/rocky-9.csv | 1 + lgsm/data/serverlist.csv | 2 +- lgsm/data/ubuntu-16.04.csv | 1 + lgsm/data/ubuntu-18.04.csv | 1 + lgsm/data/ubuntu-20.04.csv | 1 + lgsm/data/ubuntu-22.04.csv | 1 + lgsm/data/ubuntu-23.04.csv | 1 + lgsm/data/ubuntu-23.10.csv | 1 + lgsm/data/ubuntu-24.04.csv | 1 + lgsm/data/ubuntu-26.04.csv | 1 + 26 files changed, 222 insertions(+), 1 deletion(-) create mode 100644 lgsm/config-default/config-lgsm/jbep3server/_default.cfg create mode 100644 lgsm/data/gameicons/jbep3-icon.png diff --git a/lgsm/config-default/config-lgsm/jbep3server/_default.cfg b/lgsm/config-default/config-lgsm/jbep3server/_default.cfg new file mode 100644 index 000000000..2036d3522 --- /dev/null +++ b/lgsm/config-default/config-lgsm/jbep3server/_default.cfg @@ -0,0 +1,198 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="crossfire" +maxplayers="24" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game jbep3 -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# Alert on Start/Stop/Restart +statusalert="off" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify +gotifyalert="off" +gotifytoken="token" +gotifywebhook="webhook" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" +pushoveruserkey="userkey" + +# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat +rocketchatalert="off" +rocketchatwebhook="webhook" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help all". +telegramapi="api.telegram.org" +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +telegramthreadid="" +telegramsilentnotification="false" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="869800" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Jabroni Brawl: Episode 3" +engine="source" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/jbep3" +executabledir="${serverfiles}" +executable="./srcds_run.sh" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 42b0bcfbd..e02ca7858 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -58,6 +58,7 @@ hz ins inss ios +jbep3 jc2 jc3 jk2 diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index 7780ebf79..5a6d996e7 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -58,6 +58,7 @@ hz ins inss ios +jbep3 jc2 jc3 jk2 diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index c61fbf7d9..c5632722e 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -58,6 +58,7 @@ hz ins inss ios +jbep3 jc2 jc3 jk2 diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index a9b0692b4..0b0b766d0 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -58,6 +58,7 @@ hz ins inss ios +jbep3 jc2 jc3 jk2 diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index 2dcfe82b5..fd9c0fa39 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -58,6 +58,7 @@ hz ins inss ios +jbep3 jc2 jc3 jk2 diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index b4d0123ff..5b8d73a06 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -57,6 +57,7 @@ hz ins inss ios +jbep3 jc2 jc3 jk2 diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 3e835e1d4..adba97d27 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -58,6 +58,7 @@ hz ins inss ios +jbep3 jc2 jc3 jk2 diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 6c3dc59c7..2da22f88c 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -58,6 +58,7 @@ hz ins inss ios +jbep3 jc2 jc3 jk2 diff --git a/lgsm/data/debian-13.csv b/lgsm/data/debian-13.csv index a287d7835..401cf281c 100644 --- a/lgsm/data/debian-13.csv +++ b/lgsm/data/debian-13.csv @@ -58,6 +58,7 @@ hz ins inss ios +jbep3 jc2 jc3 jk2 diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index a79b9ebaa..c0e990961 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -58,6 +58,7 @@ hz ins inss ios +jbep3 jc2 jc3 jk2 diff --git a/lgsm/data/gameicons/jbep3-icon.png b/lgsm/data/gameicons/jbep3-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..609a0345f36fd0fe211d0d2f656f048c821b2a3d GIT binary patch literal 400 zcmV;B0dM|^P)U>LPv)Phk9hOGtN)lFvlMxQ=^_Dzn2b0Jdy{{8#>^~=qBcjm2Ja{bON z{1z}VGBDsm5P;16^!c+xn2%>%$i-_{%=C?VYnpjDx$v04h{pm3R11)~zkdBXb>S=n z0|Pe~w}OluehUc40V4*Njg`&JzzE`@$Il)!QW(j|3ix<=_pRCjVgLXCf6lT6U%!53 zq;4Fzg!yBq#x^#A|=qoMA|Eb3|QQj%AC u`1sL*Bm38FUQeL~j5ed~qEQP*EdT&Sc5W~td^U0b0000 Date: Sat, 2 May 2026 16:57:56 +0100 Subject: [PATCH 131/132] feat(bb): add BrainBread server update functionality (#4912) * feat(bb): add BrainBread server update functionality * Implemented `update_bb.sh` to handle updates for BrainBread servers. * Integrated new update checks in `command_check_update.sh` and `command_update.sh`. * Updated `install_server_files.sh` to include BrainBread server installation logic. Co-authored-by: Copilot * feat(bb): enhance BrainBread update process * Updated `fn_update_dl` to use `remotebuildhash` for file integrity. * Added handling for missing `remotebuildhash` to default to "nohash". * Included `update_steamcmd.sh` call to ensure both Steam app and GitHub package updates are performed. Co-authored-by: Copilot * fix(steamcmd): ensure core HL1 files are present after appid 90 update * Added checks to verify the presence of core HL1 files after updating appid 90. * If files are missing, an update is forced and errors are logged. * Exits the script if files are still missing after the retry. * fix(steamcmd): update error messages for GoldSrc engine * Changed appid 90 references to GoldSrc for clarity. * Updated error messages to reflect the correct engine context. * Ensures users are informed about missing core HL1 files after GoldSrc updates. Co-authored-by: Copilot * feat(serverlist): add Military Conflict: Vietnam server entry * Introduced new server entry for `Military Conflict: Vietnam` in `serverlist.csv`. * Enhances the variety of game servers available for users. --------- Co-authored-by: Copilot --- lgsm/data/serverlist.csv | 1 + lgsm/modules/command_check_update.sh | 2 + lgsm/modules/command_update.sh | 2 + lgsm/modules/core_dl.sh | 6 + lgsm/modules/core_modules.sh | 5 + lgsm/modules/core_steamcmd.sh | 17 +++ lgsm/modules/install_server_files.sh | 13 +- lgsm/modules/update_bb.sh | 175 +++++++++++++++++++++++++++ 8 files changed, 212 insertions(+), 9 deletions(-) create mode 100644 lgsm/modules/update_bb.sh diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 382eabbaf..3ddc013c3 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -67,6 +67,7 @@ l4d,l4dserver,Left 4 Dead,ubuntu-24.04 l4d2,l4d2server,Left 4 Dead 2,ubuntu-24.04 mc,mcserver,Minecraft,ubuntu-24.04 mcb,mcbserver,Minecraft Bedrock,ubuntu-24.04 +mcv,mcvserver,Military Conflict: Vietnam,ubuntu-24.04 mh,mhserver,MORDHAU,ubuntu-24.04 mohaa,mohaaserver,Medal of Honor: Allied Assault,ubuntu-24.04 mta,mtaserver,Multi Theft Auto,ubuntu-24.04 diff --git a/lgsm/modules/command_check_update.sh b/lgsm/modules/command_check_update.sh index 6e429512a..93a770e79 100755 --- a/lgsm/modules/command_check_update.sh +++ b/lgsm/modules/command_check_update.sh @@ -30,6 +30,8 @@ elif [ "${shortname}" == "jk2" ]; then update_jk2.sh elif [ "${shortname}" == "vints" ]; then update_vints.sh +elif [ "${shortname}" == "bb" ]; then + update_bb.sh elif [ "${shortname}" == "ut99" ]; then update_ut99.sh elif [ "${shortname}" == "xnt" ]; then diff --git a/lgsm/modules/command_update.sh b/lgsm/modules/command_update.sh index 996d402a4..a7cfc1b12 100755 --- a/lgsm/modules/command_update.sh +++ b/lgsm/modules/command_update.sh @@ -31,6 +31,8 @@ elif [ "${shortname}" == "jk2" ]; then update_jk2.sh elif [ "${shortname}" == "vints" ]; then update_vints.sh +elif [ "${shortname}" == "bb" ]; then + update_bb.sh elif [ "${shortname}" == "ut99" ]; then update_ut99.sh elif [ "${shortname}" == "xnt" ]; then diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh index 4730c0cff..c3194a915 100755 --- a/lgsm/modules/core_dl.sh +++ b/lgsm/modules/core_dl.sh @@ -139,6 +139,12 @@ fn_dl_steamcmd() { fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" fn_script_log_fail "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" core_exit.sh + # Invalid platform for app/update request. + elif [ -n "$(grep -i "Invalid platform" "${steamcmdlog}" | tail -1)" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Invalid platform for AppID ${appid}" + fn_print_nl "Check steamcmdforcewindows setting and system architecture (x86_64 required for most servers)" + fn_script_log_fail "${commandaction} ${selfname}: ${remotelocation}: Invalid platform for AppID ${appid}" + core_exit.sh # Need tp purchase game. elif [ -n "$(grep "No subscription" "${steamcmdlog}" | tail -1)" ]; then fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Steam account does not have a license for the required game" diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 10d408449..ce1a6f6d4 100755 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -710,6 +710,11 @@ update_ut99.sh() { fn_fetch_module } +update_bb.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + update_vints.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh index d265f577d..463a1f7da 100755 --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -427,4 +427,21 @@ fn_check_steamcmd_appmanifest() { fn_dl_steamcmd fi fi + + # GoldSrc can occasionally report success while core HL1 files are incomplete. + if [ "${engine}" == "goldsrc" ]; then + if [ ! -f "${serverfiles}/hlds_run" ] || [ ! -f "${serverfiles}/engine_i486.so" ] || [ ! -d "${serverfiles}/valve" ]; then + fn_print_error_nl "Core HL1 files missing after GoldSrc update" + fn_script_log_error "Core HL1 files missing after GoldSrc update" + fn_print_info_nl "Forcing update to correct issue" + fn_script_log_info "Forcing update to correct issue" + fn_dl_steamcmd + + if [ ! -f "${serverfiles}/hlds_run" ] || [ ! -f "${serverfiles}/engine_i486.so" ] || [ ! -d "${serverfiles}/valve" ]; then + fn_print_fail_nl "Core HL1 files are still missing after retry" + fn_script_log_fail "Core HL1 files are still missing after retry" + core_exit.sh + fi + fi + fi } diff --git a/lgsm/modules/install_server_files.sh b/lgsm/modules/install_server_files.sh index 8a993b45c..e5f10739d 100755 --- a/lgsm/modules/install_server_files.sh +++ b/lgsm/modules/install_server_files.sh @@ -32,14 +32,7 @@ fn_install_server_files() { run="norun" force="noforce" md5="e3b4962cdd9d41e23c6fed65101bccde" - elif [ "${shortname}" == "bb" ]; then - remote_fileurl="http://linuxgsm.download/BrainBread/brainbread-v1.2-linuxserver.tar.xz" - local_filedir="${tmpdir}" - local_filename="brainbread-v1.2-linuxserver.tar.xz" - chmodx="nochmodx" - run="norun" - force="noforce" - md5="55f227183b736397806d5b6db6143f15" + elif [ "${shortname}" == "cod" ]; then remote_fileurl="http://linuxgsm.download/CallOfDuty/cod-lnxded-1.5b-full.tar.xz" local_filedir="${tmpdir}" @@ -267,6 +260,8 @@ elif [ "${shortname}" == "jk2" ]; then update_jk2.sh elif [ "${shortname}" == "vints" ]; then update_vints.sh +elif [ "${shortname}" == "bb" ]; then + update_bb.sh elif [ "${shortname}" == "ut99" ]; then fn_install_server_files update_ut99.sh @@ -274,7 +269,7 @@ elif [ "${shortname}" == "xnt" ]; then update_xnt.sh elif [ "${shortname}" == "etl" ]; then update_etl.sh -elif [ -z "${appid}" ] || [ "${shortname}" == "ahl" ] || [ "${shortname}" == "bb" ] || [ "${shortname}" == "q4" ] || [ "${shortname}" == "ns" ] || [ "${shortname}" == "sfc" ] || [ "${shortname}" == "ts" ] || [ "${shortname}" == "vs" ] || [ "${shortname}" == "zmr" ]; then +elif [ -z "${appid}" ] || [ "${shortname}" == "ahl" ] || [ "${shortname}" == "q4" ] || [ "${shortname}" == "ns" ] || [ "${shortname}" == "sfc" ] || [ "${shortname}" == "ts" ] || [ "${shortname}" == "vs" ] || [ "${shortname}" == "zmr" ]; then if [ "${shortname}" == "ut" ]; then install_eula.sh fi diff --git a/lgsm/modules/update_bb.sh b/lgsm/modules/update_bb.sh new file mode 100644 index 000000000..1f2f12ce8 --- /dev/null +++ b/lgsm/modules/update_bb.sh @@ -0,0 +1,175 @@ +#!/bin/bash +# LinuxGSM update_bb.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of BrainBread servers. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_dl() { + # Download and extract files to serverfiles. + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "${remotebuildhash}" + fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" + echo "${remotebuild}" > "${serverfiles}/build.txt" + fn_clear_tmp +} + +fn_update_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Uses build file to get local build. + localbuild=$(head -n 1 "${serverfiles}/build.txt" 2> /dev/null) + if [ -z "${localbuild}" ]; then + fn_print_error "Checking local build: ${remotelocation}: missing local build info" + fn_script_log_error "Missing local build info" + fn_script_log_error "Set localbuild to 0" + localbuild="0" + else + fn_print_ok "Checking local build: ${remotelocation}" + fn_script_log_pass "Checking local build" + fi +} + +fn_update_remotebuild() { + # Gets remote build info. + apiurl="https://api.github.com/repos/IronOak-Studios/BrainBread/releases/latest" + remotebuildresponse=$(curl -s "${apiurl}") + remotebuildfilename=$(echo "${remotebuildresponse}" | jq -r '.assets[] | select(.name | test("linuxserver\\.tar\\.gz$")) | .name' | head -n 1) + remotebuildurl=$(echo "${remotebuildresponse}" | jq -r '.assets[] | select(.name | test("linuxserver\\.tar\\.gz$")) | .browser_download_url' | head -n 1) + remotebuildhash=$(echo "${remotebuildresponse}" | jq -r '.assets[] | select(.name | test("linuxserver\\.tar\\.gz$")) | .digest' | sed 's/^sha256://g' | head -n 1) + remotebuild=$(echo "${remotebuildresponse}" | jq -r '.tag_name') + if [ -z "${remotebuildhash}" ] || [ "${remotebuildhash}" == "null" ]; then + remotebuildhash="nohash" + fi + + if [ "${firstcommandname}" != "INSTALL" ]; then + fn_print_dots "Checking remote build: ${remotelocation}" + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ] || [ -z "${remotebuildurl}" ] || [ "${remotebuildurl}" == "null" ] || [ -z "${remotebuildfilename}" ] || [ "${remotebuildfilename}" == "null" ]; then + fn_print_fail "Checking remote build: ${remotelocation}" + fn_script_log_fail "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking remote build: ${remotelocation}" + fn_script_log_pass "Checking remote build" + fi + else + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ] || [ -z "${remotebuildurl}" ] || [ "${remotebuildurl}" == "null" ] || [ -z "${remotebuildfilename}" ] || [ "${remotebuildfilename}" == "null" ]; then + fn_print_failure "Unable to get remote build" + fn_script_log_fail "Unable to get remote build" + core_exit.sh + fi + fi +} + +fn_update_compare() { + fn_print_dots "Checking for update: ${remotelocation}" + # Update has been found or force update. + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then + # Create update lockfile. + date '+%s' > "${lockdir:?}/update.lock" + fn_print_ok_nl "Checking for update: ${remotelocation}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" + if [ -n "${branch}" ]; then + fn_print_nl "* Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuildhash: ${remotebuildhash}" + fn_print_nl "* remotebuild: ${remotebuild}" + fi + fn_print "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuild}" + + if [ "${commandname}" == "UPDATE" ]; then + date +%s > "${lockdir:?}/last-updated.lock" + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + fn_update_dl + if [ "${localbuild}" == "0" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + fn_sleep_time_5 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + fn_update_dl + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi + unset exitbypass + alert="update" + elif [ "${commandname}" == "CHECK-UPDATE" ]; then + alert="check-update" + fi + alert.sh + else + fn_print_ok_nl "Checking for update: ${remotelocation}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" + if [ -n "${branch}" ]; then + fn_print_nl "* Branch: ${branch}" + fi + fn_print "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + fn_print_nl "Remote build info" + fn_print_nl "* apiurl: ${apiurl}" + fn_print_nl "* remotebuildfilename: ${remotebuildfilename}" + fn_print_nl "* remotebuildurl: ${remotebuildurl}" + fn_print_nl "* remotebuildhash: ${remotebuildhash}" + fn_print_nl "* remotebuild: ${remotebuild}" + fi + fi +} + +# The location where the builds are checked and downloaded. +remotelocation="github.com" + +if [ "${firstcommandname}" == "INSTALL" ]; then + fn_update_remotebuild + fn_update_dl +else + # BrainBread requires both Steam app updates and GitHub package updates. + update_steamcmd.sh + + fn_print_dots "Checking for update" + fn_print_dots "Checking for update: ${remotelocation}" + fn_script_log_info "Checking for update: ${remotelocation}" + fn_update_localbuild + fn_update_remotebuild + fn_update_compare +fi From 946cd6fa44c6ac00dd621ee1a846a681189c779b Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 2 May 2026 17:30:15 +0100 Subject: [PATCH 132/132] fix(deps): update .NET runtime version for Vintage Story (#4913) * Changed `dotnet-runtime-8.0` to `dotnet-runtime-10.0` in dependency lists for Ubuntu and Debian. * Enhanced the `check_deps.sh` script to dynamically check for the required .NET runtime version. * Added a warning for users on older distributions regarding potential missing .NET runtimes. --- lgsm/data/debian-12.csv | 2 +- lgsm/data/debian-13.csv | 2 +- lgsm/data/ubuntu-24.04.csv | 2 +- lgsm/data/ubuntu-26.04.csv | 2 +- lgsm/modules/check_deps.sh | 38 ++++++++++++++++++++++++++++++-------- 5 files changed, 34 insertions(+), 12 deletions(-) diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 2da22f88c..40e325b6c 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -130,7 +130,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-8.0 +vints,dotnet-runtime-10.0 vpmc,openjdk-17-jre vs wet diff --git a/lgsm/data/debian-13.csv b/lgsm/data/debian-13.csv index 401cf281c..d53dfb44f 100644 --- a/lgsm/data/debian-13.csv +++ b/lgsm/data/debian-13.csv @@ -130,7 +130,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-8.0 +vints,dotnet-runtime-10.0 vpmc,openjdk-25-jre vs wet diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index ac683d5d3..0e010abd6 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -130,7 +130,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-8.0 +vints,dotnet-runtime-10.0 vpmc,openjdk-25-jre vs wet diff --git a/lgsm/data/ubuntu-26.04.csv b/lgsm/data/ubuntu-26.04.csv index ac683d5d3..0e010abd6 100644 --- a/lgsm/data/ubuntu-26.04.csv +++ b/lgsm/data/ubuntu-26.04.csv @@ -130,7 +130,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-8.0 +vints,dotnet-runtime-10.0 vpmc,openjdk-25-jre vs wet diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh index 3d4109e2c..e4bcad4be 100755 --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -8,15 +8,28 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_dotnet_repo() { + local dotnetpackage + dotnetpackage="dotnet-runtime-7.0" + + for dep in "${array_deps_missing[@]}"; do + if [[ "${dep}" == dotnet-runtime-* ]]; then + dotnetpackage="${dep}" + break + fi + done + if [ "${distroid}" == "ubuntu" ]; then - # if package dotnet-runtime-7.0 is unavailable in ubuntu repos, add the microsoft repo. - if ! apt-cache show dotnet-runtime-7.0 > /dev/null 2>&1; then + # If the required .NET package is unavailable in Ubuntu repos, add the Microsoft repo. + if ! apt-cache show "${dotnetpackage}" > /dev/null 2>&1; then fn_fetch_file "https://packages.microsoft.com/config/ubuntu/${distroversion}/packages-microsoft-prod.deb" "" "" "" "/tmp" "packages-microsoft-prod.deb" "" "" "" "" sudo dpkg -i /tmp/packages-microsoft-prod.deb fi elif [ "${distroid}" == "debian" ]; then - fn_fetch_file "https://packages.microsoft.com/config/debian/${distroversion}/packages-microsoft-prod.deb" "" "" "" "/tmp" "packages-microsoft-prod.deb" "" "" "" "" - sudo dpkg -i /tmp/packages-microsoft-prod.deb + # If the required .NET package is unavailable in Debian repos, add the Microsoft repo. + if ! apt-cache show "${dotnetpackage}" > /dev/null 2>&1; then + fn_fetch_file "https://packages.microsoft.com/config/debian/${distroversion}/packages-microsoft-prod.deb" "" "" "" "/tmp" "packages-microsoft-prod.deb" "" "" "" "" + sudo dpkg -i /tmp/packages-microsoft-prod.deb + fi fi } @@ -281,10 +294,10 @@ fn_deps_detector() { depstatus=1 monoinstalled=false fi - # .NET Core: A .NET Core repo needs to be installed. - elif [ "${deptocheck}" == "dotnet-runtime-7.0" ]; then - # .NET is not installed. - if dotnet --list-runtimes | grep -q "Microsoft.NETCore.App 7.0"; then + # .NET runtime: check installed runtime version for any dotnet-runtime-X.Y package. + elif [[ "${deptocheck}" =~ ^dotnet-runtime-([0-9]+\.[0-9]+)$ ]]; then + dotnetrequired="${BASH_REMATCH[1]}" + if [ "$(command -v dotnet 2> /dev/null)" ] && dotnet --list-runtimes | grep -q "Microsoft.NETCore.App ${dotnetrequired}"; then depstatus=0 dotnetinstalled=true else @@ -379,6 +392,15 @@ if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" fi fi +# Vintage Story tracks newer .NET runtimes; older distro releases may not ship required packages. +if [ "${shortname}" == "vints" ]; then + if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" "lt" "24.04"; } || { [ "${distroid}" == "debian" ] && dpkg --compare-versions "${distroversion}" "lt" "12"; } || [ "${distroid}" == "centos" ] || [ "${distroid}" == "rhel" ] || [ "${distroid}" == "rocky" ] || [ "${distroid}" == "almalinux" ]; then + fn_print_warning_nl "${gamename} may require newer .NET runtimes than ${distroname} provides." + echo -e "If startup fails due to missing .NET runtime, upgrading to Ubuntu 24.04+ or Debian 12+ is recommended." + fn_script_log_warn "${gamename} may require newer .NET runtimes than ${distroname} provides." + fi +fi + if [ ! -f "${tmpdir}/dependency-no-check.tmp" ] && [ ! -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then # Check that the distro dependency csv file exists. fn_check_file_github "lgsm/data" "${distroid}-${distroversioncsv}.csv"