Browse Source

chore: use prettier for code tidy (#3901)

* feat: start using prettier linter

https://prettier.io/

* feat: prettier code formatting

* feat: add super linter
pull/3911/head
Daniel Gibbs 3 years ago
committed by GitHub
parent
commit
635f4bce52
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 32
      .github/ISSUE_TEMPLATE/bug-report.md
  2. 31
      .github/ISSUE_TEMPLATE/feature-request.md
  3. 13
      .github/ISSUE_TEMPLATE/new-server-request.md
  4. 1
      .github/dependabot.yml
  5. 92
      .github/labeler.yml
  6. 31
      .github/pull_request_template.md
  7. 55
      .github/workflows/linter.yml
  8. 4
      .github/workflows/lock.yml
  9. 4
      .github/workflows/potential-duplicates.yml
  10. 29
      CODE_OF_CONDUCT.md
  11. 116
      CONTRIBUTING.md
  12. 22
      README.md
  13. 19
      lgsm/functions/README.md
  14. 3
      lgsm/functions/alert_discord.sh
  15. 3
      lgsm/functions/alert_gotify.sh
  16. 3
      lgsm/functions/alert_ifttt.sh
  17. 3
      lgsm/functions/alert_pushbullet.sh
  18. 3
      lgsm/functions/alert_rocketchat.sh
  19. 3
      lgsm/functions/alert_slack.sh
  20. 3
      lgsm/functions/alert_telegram.sh
  21. 7
      lgsm/functions/check_deps.sh
  22. 4
      lgsm/functions/command_dev_detect_deps.sh
  23. 5
      lgsm/functions/command_dev_detect_glibc.sh
  24. 10
      lgsm/functions/command_dev_detect_ldd.sh
  25. 1
      lgsm/functions/command_dev_query_raw.sh
  26. 15
      lgsm/functions/command_fastdl.sh
  27. 10
      lgsm/functions/command_mods_install.sh
  28. 3
      lgsm/functions/command_mods_remove.sh
  29. 3
      lgsm/functions/command_postdetails.sh
  30. 3
      lgsm/functions/command_start.sh
  31. 1
      lgsm/functions/core_getopt.sh
  32. 9
      lgsm/functions/core_logs.sh
  33. 2
      lgsm/functions/core_messages.sh
  34. 6
      lgsm/functions/fix_ark.sh
  35. 6
      lgsm/functions/fix_vh.sh
  36. 5
      lgsm/functions/info_distro.sh
  37. 4
      lgsm/functions/info_game.sh
  38. 3
      lgsm/functions/install_retry.sh
  39. 189
      lgsm/functions/install_server_files.sh
  40. 8
      linuxgsm.sh
  41. 12
      tests/tests_defaultcfg/tests_defaultcfg.sh
  42. 11
      tests/tests_fctrserver.sh
  43. 17
      tests/tests_jc2server.sh
  44. 11
      tests/tests_mcserver.sh
  45. 11
      tests/tests_ts3server.sh

32
.github/ISSUE_TEMPLATE/bug-report.md

@ -2,25 +2,26 @@
name: Bug Report name: Bug Report
about: Found a bug? Raise a report. about: Found a bug? Raise a report.
title: "[BUG]" title: "[BUG]"
labels: 'type: bug' labels: "type: bug"
assignees: '' assignees: ""
--- ---
Issues raised here are **ONLY** for: Issues raised here are **ONLY** for:
* LinuxGSM bugs.
* Feature suggestions. - LinuxGSM bugs.
* Code contributions. - Feature suggestions.
- Code contributions.
Issues raised here are **NOT** for: Issues raised here are **NOT** for:
* General support.
* Specific game server issues (e.g CS:GO, TF2). - General support.
* Dedicated server issues (e.g Ubuntu, CentOS). - Specific game server issues (e.g CS:GO, TF2).
* Anything not directly related to LinuxGSM development. - Dedicated server issues (e.g Ubuntu, CentOS).
- Anything not directly related to LinuxGSM development.
For general support visit the **[LinuxGSM-Support](https://linuxgsm.com/support)**. For general support visit the **[LinuxGSM-Support](https://linuxgsm.com/support)**.
***Please use the template below, deleting the above text*** **_Please use the template below, deleting the above text_**
## User Story ## User Story
@ -28,10 +29,10 @@ As a [user description], I want [desired action] so that [desired outcome].
## Basic info ## Basic info
* **Distro:** [Ubuntu 18.04] - **Distro:** [Ubuntu 18.04]
* **Game:** [Garry's Mod] - **Game:** [Garry's Mod]
* **Command:** [Monitor] - **Command:** [Monitor]
* **LinuxGSM version:** [v20.1.3] - **LinuxGSM version:** [v20.1.3]
## Further Information ## Further Information
@ -40,6 +41,7 @@ A clear description of what the bug is and any ideas on how to resolve it. Plus
## To Reproduce ## To Reproduce
Steps to reproduce the behaviour: Steps to reproduce the behaviour:
1. Go to '...' 1. Go to '...'
2. Click on '....' 2. Click on '....'
3. Scroll down to '....' 3. Scroll down to '....'

31
.github/ISSUE_TEMPLATE/feature-request.md

@ -2,25 +2,26 @@
name: Feature Request name: Feature Request
about: Suggest an idea for LinuxGSM. about: Suggest an idea for LinuxGSM.
title: "[FEATURE]" title: "[FEATURE]"
labels: 'type: feature request' labels: "type: feature request"
assignees: '' assignees: ""
--- ---
Issues raised here are **ONLY** for: Issues raised here are **ONLY** for:
* LinuxGSM bugs.
* Feature suggestions. - LinuxGSM bugs.
* Code contributions. - Feature suggestions.
- Code contributions.
Issues raised here are **NOT** for: Issues raised here are **NOT** for:
* General support.
* Specific game server issues (e.g CS:GO, TF2). - General support.
* Dedicated server issues (e.g Ubuntu, CentOS). - Specific game server issues (e.g CS:GO, TF2).
* Anything not directly related to LinuxGSM development. - Dedicated server issues (e.g Ubuntu, CentOS).
- Anything not directly related to LinuxGSM development.
For general support visit the **[LinuxGSM Support](https://linuxgsm.com/support)** page. For general support visit the **[LinuxGSM Support](https://linuxgsm.com/support)** page.
***Please use the template below, deleting the above text*** **_Please use the template below, deleting the above text_**
## User Story ## User Story
@ -28,10 +29,10 @@ As a [user description], I want [desired action] so that [desired outcome].
## Basic info ## Basic info
* **Distro:** [Ubuntu 20.04] - **Distro:** [Ubuntu 20.04]
* **Game:** [Garry's Mod] - **Game:** [Garry's Mod]
* **Command:** [Monitor] - **Command:** [Monitor]
* **LinuxGSM version:** [v20.1.3] - **LinuxGSM version:** [v20.1.3]
## Further Information ## Further Information

13
.github/ISSUE_TEMPLATE/new-server-request.md

@ -2,9 +2,8 @@
name: New Server Request name: New Server Request
about: Suggest a new game server to be added. about: Suggest a new game server to be added.
title: "[Server Request]" title: "[Server Request]"
labels: 'type: game server request' labels: "type: game server request"
assignees: '' assignees: ""
--- ---
## What game server would you like to add? ## What game server would you like to add?
@ -17,8 +16,8 @@ Provide any useful documentation or resources that might help.
## Is the server on Steam? ## Is the server on Steam?
* [ ] Yes - [ ] Yes
* [ ] No - [ ] No
If yes Use SteamDB to get the appid. (https://steamdb.info). If yes Use SteamDB to get the appid. (https://steamdb.info).
@ -28,5 +27,5 @@ If yes Use SteamDB to get the appid. (https://steamdb.info).
We only support Linux servers and do **not** support Wine. We only support Linux servers and do **not** support Wine.
* [ ] Yes - [ ] Yes
* [ ] No - [ ] No

1
.github/dependabot.yml

@ -1,7 +1,6 @@
# Set update schedule for GitHub Actions # Set update schedule for GitHub Actions
version: 2 version: 2
updates: updates:
- package-ecosystem: "github-actions" - package-ecosystem: "github-actions"
directory: "/" directory: "/"
schedule: schedule:

92
.github/labeler.yml

@ -1,98 +1,98 @@
# Add/remove 'critical' label if issue contains the words 'urgent' or 'critical' # Add/remove 'critical' label if issue contains the words 'urgent' or 'critical'
# Type # Type
"type: game server request": "type: game server request":
- '/(Server Request)/i' - "/(Server Request)/i"
"type: bug": "type: bug":
- '/(bug)/i' - "/(bug)/i"
"type: feature request": "type: feature request":
- '/(feature)/i' - "/(feature)/i"
# Commands # Commands
"command: backup": "command: backup":
- '/(backup)/i' - "/(backup)/i"
"command: console": "command: console":
- '/(console|tmux)/i' - "/(console|tmux)/i"
"command: debug": "command: debug":
- '/(debug)/i' - "/(debug)/i"
"command: details": "command: details":
- '/(details)/i' - "/(details)/i"
"command: fast-dl": "command: fast-dl":
- '/(fast-dl|fastdl)/i' - "/(fast-dl|fastdl)/i"
"command: install": "command: install":
- '/(install)/i' - "/(install)/i"
"command: mods": "command: mods":
- '/(mods)/i' - "/(mods)/i"
"command: monitor": "command: monitor":
- '/(monitor)/i' - "/(monitor)/i"
"command: post-details": "command: post-details":
- '/(post-details)/i' - "/(post-details)/i"
"command: restart": "command: restart":
- '/(restart)/i' - "/(restart)/i"
"command: send": "command: send":
- '/(send)/i' - "/(send)/i"
"command: skeleton": "command: skeleton":
- '/(skeleton)/i' - "/(skeleton)/i"
"command: start": "command: start":
- '/(start)/i' - "/(start)/i"
"command: stop": "command: stop":
- '/(stop)/i' - "/(stop)/i"
"command: update-lgsm": "command: update-lgsm":
- '/(update-lgsm)/i' - "/(update-lgsm)/i"
"command: update": "command: update":
- '/(update)/i' - "/(update)/i"
"command: validate": "command: validate":
- '/(validate)/i' - "/(validate)/i"
"command: wipe": "command: wipe":
- '/(wipe)/i' - "/(wipe)/i"
# Distros # Distros
"distro: AlmaLinux": "distro: AlmaLinux":
- '/(Alma)/i' - "/(Alma)/i"
"distro: Arch Linux": "distro: Arch Linux":
- '/(Arch)/i' - "/(Arch)/i"
"distro: CentOS": "distro: CentOS":
- '/(CentOS)/i' - "/(CentOS)/i"
"distro: Debian": "distro: Debian":
- '/(Debian)/i' - "/(Debian)/i"
"distro: Fedora": "distro: Fedora":
- '/(Fedora)/i' - "/(Fedora)/i"
"distro: openSUSE": "distro: openSUSE":
- '/(openSUSE|suse)/i' - "/(openSUSE|suse)/i"
"distro: Rocky Linux": "distro: Rocky Linux":
- '/(Rocky)/i' - "/(Rocky)/i"
"distro: Slackware": "distro: Slackware":
- '/(Slackware)/i' - "/(Slackware)/i"
"distro: Ubuntu": "distro: Ubuntu":
- '/(Ubuntu)/i' - "/(Ubuntu)/i"
# Info # Info
"info: alerts": "info: alerts":
- '/(alert)/i' - "/(alert)/i"
"info: dependency": "info: dependency":
- '/(dependency|deps)/i' - "/(dependency|deps)/i"
"info: docker": "info: docker":
- '/(docker)/i' - "/(docker)/i"
"info: docs": "info: docs":
- '/(documentation|docs)/i' - "/(documentation|docs)/i"
"info: email": "info: email":
- '/(postfix|sendmail|exim|smtp)/i' - "/(postfix|sendmail|exim|smtp)/i"
"info: query": "info: query":
- '/(gamedig|gsquery)/i' - "/(gamedig|gsquery)/i"
"info: steamcmd": "info: steamcmd":
- '/(steamcmd)/i' - "/(steamcmd)/i"
"info: systemd": "info: systemd":
- '/(systemd)/i' - "/(systemd)/i"
"info: tmux": "info: tmux":
- '/(tmux)/i' - "/(tmux)/i"
"info: website": "info: website":
- '/(website)/i' - "/(website)/i"
# Games # Games
"game: Ark: Survival Evolved": "game: Ark: Survival Evolved":
- '/(Ark: Survival Evolved|Ark)/i' - "/(Ark: Survival Evolved|Ark)/i"
"game: ARMA 3": "game: ARMA 3":
- '/(ARMA 3)/i' - "/(ARMA 3)/i"
"game: Assetto Corsa": "game: Assetto Corsa":
- '/(Assetto Corsa)/i' - "/(Assetto Corsa)/i"
"game: Avorion": "game: Avorion":
- '/(Avorion)/i' - "/(Avorion)/i"
"game: Ballistic Overkill": "game: Ballistic Overkill":
- '/(Ballistic Overkill)/i' - "/(Ballistic Overkill)/i"
"game: Barotrauma": "game: Barotrauma":
- '/(Barotrauma)/i' - "/(Barotrauma)/i"

31
.github/pull_request_template.md

@ -6,29 +6,30 @@ Fixes #[issue]
## Type of change ## Type of change
* [ ] Bug fix (a change which fixes an issue). - [ ] Bug fix (a change which fixes an issue).
* [ ] New feature (change which adds functionality). - [ ] New feature (change which adds functionality).
* [ ] New Server (new server added). - [ ] New Server (new server added).
* [ ] Refactor (restructures existing code). - [ ] Refactor (restructures existing code).
* [ ] Comment update (typo, spelling, explanation, examples, etc). - [ ] Comment update (typo, spelling, explanation, examples, etc).
## Checklist ## Checklist
PR will not be merged until all steps are complete. PR will not be merged until all steps are complete.
* [ ] This pull request links to an issue. - [ ] This pull request links to an issue.
* [ ] This pull request uses the `develop` branch as its base. - [ ] This pull request uses the `develop` branch as its base.
* [ ] This pull request Subject follows the Conventional Commits standard. - [ ] This pull request Subject follows the Conventional Commits standard.
* [ ] This code follows the style guidelines of this project. - [ ] This code follows the style guidelines of this project.
* [ ] I have performed a self-review of my code. - [ ] I have performed a self-review of my code.
* [ ] I have checked that this code is commented where required. - [ ] I have checked that this code is commented where required.
* [ ] I have provided a detailed with enough description of this PR. - [ ] I have provided a detailed with enough description of this PR.
* [ ] I have checked If documentation needs updating. - [ ] I have checked If documentation needs updating.
## Documentation ## Documentation
If documentation does need updating either update it by creating a PR (preferred) or request a documentation update. 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: https://github.com/GameServerManagers/LinuxGSM-Docs
- Dev docs: https://github.com/GameServerManagers/LinuxGSM-Dev-Docs
**Thank you for your Pull Request!** **Thank you for your Pull Request!**

55
.github/workflows/linter.yml

@ -0,0 +1,55 @@
---
#################################
#################################
## Super Linter GitHub Actions ##
#################################
#################################
name: Lint Code Base
#
# Documentation:
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
#
#############################
# Start the job on all push #
#############################
on:
push:
branches-ignore: [master, main]
# Remove the line above to run when pushing to master
pull_request:
###############
# Set the Job #
###############
jobs:
build:
# Name the Job
name: Lint Code Base
# Set the agent to run on
runs-on: ubuntu-latest
##################
# Load all steps #
##################
steps:
##########################
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v2
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
################################
# Run Linter against code base #
################################
- name: Lint Code Base
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: false
# Change to 'master' if your main branch differs
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

4
.github/workflows/lock.yml

@ -1,8 +1,8 @@
name: 'Lock Threads' name: "Lock Threads"
on: on:
schedule: schedule:
- cron: '0 0 * * *' - cron: "0 0 * * *"
permissions: permissions:
contents: read contents: read

4
.github/workflows/potential-duplicates.yml

@ -12,9 +12,9 @@ jobs:
# Issue title filter work with anymatch https://www.npmjs.com/package/anymatch. # Issue title filter work with anymatch https://www.npmjs.com/package/anymatch.
# Any matched issue will stop detection immediately. # Any matched issue will stop detection immediately.
# You can specify multi filters in each line. # You can specify multi filters in each line.
filter: '' filter: ""
# Exclude keywords in title before detecting. # Exclude keywords in title before detecting.
exclude: '' exclude: ""
# Label to set, when potential duplicates are detected. # Label to set, when potential duplicates are detected.
label: potential-duplicate label: potential-duplicate
# Get issues with state to compare. Supported state: 'all', 'closed', 'open'. # Get issues with state to compare. Supported state: 'all', 'closed', 'open'.

29
CODE_OF_CONDUCT.md

@ -1,4 +1,3 @@
# Contributor Covenant Code of Conduct # Contributor Covenant Code of Conduct
## Our Pledge ## Our Pledge
@ -18,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our Examples of behavior that contributes to a positive environment for our
community include: community include:
* Demonstrating empathy and kindness toward other people - Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences - Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback - Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, - Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience and learning from the experience
* Focusing on what is best not just for us as individuals, but for the - Focusing on what is best not just for us as individuals, but for the
overall community overall community
Examples of unacceptable behavior include: Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or - The use of sexualized language or imagery, and sexual attention or
advances of any kind advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks - Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment - Public or private harassment
* Publishing others' private information, such as a physical or email - Publishing others' private information, such as a physical or email
address, without their explicit permission address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a - Other conduct which could reasonably be considered inappropriate in a
professional setting professional setting
## Enforcement Responsibilities ## Enforcement Responsibilities
@ -120,14 +119,14 @@ version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
Community Impact Guidelines were inspired by Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. [Mozilla's code of conduct enforcement ladder][mozilla coc].
For answers to common questions about this code of conduct, see the FAQ at For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available [https://www.contributor-covenant.org/faq][faq]. Translations are available
at [https://www.contributor-covenant.org/translations][translations]. at [https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org [homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity [mozilla coc]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq [faq]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations [translations]: https://www.contributor-covenant.org/translations

116
CONTRIBUTING.md

@ -7,31 +7,32 @@ The following is a set of guidelines for contributing to LinuxGSM, which are hos
## Table of Contents ## Table of Contents
[Contributing to LinuxGSM](#contributing-to-linuxgsm) [Contributing to LinuxGSM](#contributing-to-linuxgsm)
* [Table of Contents](#table-of-contents)
* [Code of Conduct](#code-of-conduct) - [Table of Contents](#table-of-contents)
* [🎉 Bug/Enhancement Contributions 🐛](#bug-enhancement-contributions) - [Code of Conduct](#code-of-conduct)
+ [🐛Reporting Bugs](#reporting-bugs) - [🎉 Bug/Enhancement Contributions 🐛](#bug-enhancement-contributions)
- [🐛Reporting Bugs](#reporting-bugs)
- [Before Submitting A Bug Report](#before-submitting-a-bug-report) - [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-) - [How Do I Submit A (Good) Bug Report?](#how-do-i-submit-a--good--bug-report-)
+ [🎉Suggesting Features](#suggesting-features) - [🎉Suggesting Features](#suggesting-features)
- [Before Submitting An Feature Suggestion](#before-submitting-an-feature-suggestion) - [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-) - [How Do I Submit A (Good) Feature Suggestion?](#how-do-i-submit-a--good--feature-suggestion-)
+ [🎮 Game Server Requests](#game-server-requests) - [🎮 Game Server Requests](#game-server-requests)
- [Before Submitting a Game Server Request](#before-submitting-a-game-server-request) - [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-) - [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) - [🎮 Game Server Specific Issues](#game-server-specific-issues)
* [💻 Code Contributions](#code-contributions) - [💻 Code Contributions](#code-contributions)
+ [Pull Requests](#pull-requests) - [Pull Requests](#pull-requests)
- [Pull Request naming convention](#pull-request-naming-convention) - [Pull Request naming convention](#pull-request-naming-convention)
+ [Testing](#testing) - [Testing](#testing)
- [Pull Request Status Checks](#pull-request-status-checks) - [Pull Request Status Checks](#pull-request-status-checks)
- [Test Environment](#test-environment) - [Test Environment](#test-environment)
+ [:wine_glass: Styleguides](#-wine-glass--styleguides) - [:wine_glass: Styleguides](#-wine-glass--styleguides)
- [Git Commit Messages](#git-commit-messages) - [Git Commit Messages](#git-commit-messages)
- [BASH Styleguide](#bash-styleguide) - [BASH Styleguide](#bash-styleguide)
* [:blue_book: Document Contributions](#-blue-book--document-contributions) - [:blue_book: Document Contributions](#-blue-book--document-contributions)
+ [Documentation Styleguide](#documentation-styleguide) - [Documentation Styleguide](#documentation-styleguide)
* [Issue and Pull Request Labels](#issue-and-pull-request-labels) - [Issue and Pull Request Labels](#issue-and-pull-request-labels)
## Code of Conduct ## Code of Conduct
@ -43,24 +44,24 @@ This project and everyone participating in it is governed by the [LinuxGSM Code
This section guides you through submitting a bug report for LinuxGSM. Following these guidelines help maintainers and the community understand your report 📝, reproduce the behaviour💻, and find any related reports 🔎. This section guides you through submitting a bug report for LinuxGSM. Following these guidelines help maintainers and the community understand your report 📝, reproduce the behaviour💻, and find any related reports 🔎.
Before creating bug reports, please check [this list](https://github.com/GameServerManagers/linuxgsm/blob/master/CONTRIBUTING.md#before-submitting-a-bug-report) as you might find out that you don’t need to create one. When you are creating a bug report, please [include as many details as possible](https://github.com/GameServerManagers/linuxgsm/blob/master/CONTRIBUTING.md#how-do-i-submit-a-good-bug-report). Fill out [the required template]([https://github.com/GameServerManagers/LinuxGSM/issues/new/choose](https://github.com/GameServerManagers/LinuxGSM/issues/new/choose)), the information it asks for helps us resolve issues faster. Before creating bug reports, please check [this list](https://github.com/GameServerManagers/linuxgsm/blob/master/CONTRIBUTING.md#before-submitting-a-bug-report) as you might find out that you don’t need to create one. When you are creating a bug report, please [include as many details as possible](https://github.com/GameServerManagers/linuxgsm/blob/master/CONTRIBUTING.md#how-do-i-submit-a-good-bug-report). Fill out [the required template](<[https://github.com/GameServerManagers/LinuxGSM/issues/new/choose](https://github.com/GameServerManagers/LinuxGSM/issues/new/choose)>), the information it asks for helps us resolve issues faster.
#### Before Submitting A Bug Report #### 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 [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. - **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. - **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? #### 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). 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. - **Use a clear and descriptive title** for the issue to identify the problem.
* **Complete the user story** to give a summary of the issue. - **Complete the user story** to give a summary of the issue.
* **Provide basic info** to help us understand the context of the issue. - **Provide basic info** to help us understand the context of the issue.
* **Provide further info** to give specifics and more detail. - **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. - **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. - **Explain what you expect** to happen, so we know what you think should occur.
### 🎉Suggesting Features ### 🎉Suggesting Features
@ -68,31 +69,34 @@ This section guides you through submitting a feature suggestion for LinuxGSM, in
#### Before Submitting An Feature Suggestion #### Before Submitting An Feature Suggestion
* **Check the** [**documentation**](https://docs.linuxgsm.com/%5D(https://docs.linuxgsm.com/)) to confirm that the enhancement doesn’t already exist. - **Check the** [**documentation**](<https://docs.linuxgsm.com/%5D(https://docs.linuxgsm.com/)>) 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. - **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. - **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? #### 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). 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. - **Use a clear and descriptive title** for the issue to identify the problem.
* **Complete the user story** to give a summary of the issue. - **Complete the user story** to give a summary of the issue.
* **Provide basic info** to help us understand the context of the enhancement. - **Provide basic info** to help us understand the context of the enhancement.
* **Provide further info** to give specifics and more detail. - **Provide further info** to give specifics and more detail.
* **Provide any further reading** materials that might assist in developing the enhancement. - **Provide any further reading** materials that might assist in developing the enhancement.
### 🎮 Game Server Requests ### 🎮 Game Server Requests
This section guides you through submitting a game server request for LinuxGSM, Following these guidelines help maintainers and the community understand your game server request 📝. This section guides you through submitting a game server request for LinuxGSM, Following these guidelines help maintainers and the community understand your game server request 📝.
#### Before Submitting a Game Server Request #### 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 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 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? #### 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 - The title should be as follows: **[Server Request] Game Name**
* **Supply any documentation/how-to guides** for the game server. - **Provide Steam App ID** if applicable
- **Supply any documentation/how-to guides** for the game server.
### 🎮 Game Server Specific Issues ### 🎮 Game Server Specific Issues
@ -110,10 +114,10 @@ A [list](https://docs.linuxgsm.com/support/game-server) of known game developer
The process described here has several goals: The process described here has several goals:
* Maintain LinuxGSM quality. - Maintain LinuxGSM quality.
* Fix problems that are important to users. - Fix problems that are important to users.
* Engage the community in working toward the best possible LinuxGSM. - Engage the community in working toward the best possible LinuxGSM.
* Enable a sustainable system for LinuxGSM maintainers to review contributions. - Enable a sustainable system for LinuxGSM maintainers to review contributions.
Please follow these steps to have your contribution considered by the maintainers: Please follow these steps to have your contribution considered by the maintainers:
@ -135,18 +139,18 @@ If applied, this commit will _your subject line here_
For example: For example:
* If applied, this commit will **refactor subsystem X for readability** - If applied, this commit will **refactor subsystem X for readability**
* If applied, this commit will **update getting started documentation** - If applied, this commit will **update getting started documentation**
* If applied, this commit will **remove deprecated methods** - If applied, this commit will **remove deprecated methods**
* If applied, this commit will **release version 1.0.0** - 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 **merge pull request #123 from user/branch**
Notice how this doesn’t work for the other non-imperative forms: 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 **fixed bug with Y**
* If applied, this commit will **change the behaviour of X** - 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 **more fixes for broken stuff**
* If applied, this commit will **sweet new API methods** - If applied, this commit will **sweet new API methods**
Below is an example of the subject line for a pull request: Below is an example of the subject line for a pull request:
@ -157,10 +161,13 @@ Below is an example of the subject line for a pull request:
### Testing ### Testing
#### Pull Request Status Checks #### Pull Request Status Checks
When a Pull Request is submitted, a series of status check tests are conducted. These tests will assess the code quality, complete CI tests etc. To get your PR merged these status checks must pass. When a Pull Request is submitted, a series of status check tests are conducted. These tests will assess the code quality, complete CI tests etc. To get your PR merged these status checks must pass.
#### Test Environment #### Test Environment
It is recommended that you have a testing environment available to test your code during development. To test your own code you must change some variables within the `linuxgsm.sh` file. This will force the use of your own code branch. It is recommended that you have a testing environment available to test your code during development. To test your own code you must change some variables within the `linuxgsm.sh` file. This will force the use of your own code branch.
```bash ```bash
## GitHub Branch Select ## GitHub Branch Select
# Allows for the use of different function files # Allows for the use of different function files
@ -203,10 +210,11 @@ Highlights the LinuxGSM command the Issue/PR relates to.
Labels to help pinpoint what the issue or PR relates to. Labels to help pinpoint what the issue or PR relates to.
variants: variants:
* _distro_
* _engine_ - _distro_
* _game_ - _engine_
* _info_ - _game_
- _info_
**outcome** Labels **outcome** Labels
Labels that identify why an issue was closed. Labels that identify why an issue was closed.

22
README.md

File diff suppressed because one or more lines are too long

19
lgsm/functions/README.md

@ -3,14 +3,15 @@
These modules are scripts that are called upon by the primary script linuxgsm.sh These modules are scripts that are called upon by the primary script linuxgsm.sh
## Module Names ## Module Names
Modules have been named to give an idea of what the function does. Modules have been named to give an idea of what the function does.
* core: Essential modules that will always run first. - core: Essential modules that will always run first.
* command: Primary command function. - command: Primary command function.
* check: Runs checks that will either halt on or fix an issue. - check: Runs checks that will either halt on or fix an issue.
* dev: development modules. - dev: development modules.
* fix: Applies a game server specific fix. - fix: Applies a game server specific fix.
* info: retrieves information from a source such as config file or the OS. - info: retrieves information from a source such as config file or the OS.
* install: modules related to the installer. - install: modules related to the installer.
* monitor: modules related to monitor. - monitor: modules related to monitor.
* update: modules that update the game server. - update: modules that update the game server.

3
lgsm/functions/alert_discord.sh

@ -7,7 +7,8 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
json=$(cat <<EOF json=$(
cat << EOF
{ {
"username":"LinuxGSM", "username":"LinuxGSM",
"avatar_url":"https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", "avatar_url":"https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg",

3
lgsm/functions/alert_gotify.sh

@ -7,7 +7,8 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
json=$(cat <<EOF json=$(
cat << EOF
{ {
"title": "${alertemoji} ${alertsubject} ${alertemoji}", "title": "${alertemoji} ${alertsubject} ${alertemoji}",
"message": "Server name\n${servername}\n\nMessage\n${alertbody}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}", "message": "Server name\n${servername}\n\nMessage\n${alertbody}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}",

3
lgsm/functions/alert_ifttt.sh

@ -7,7 +7,8 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
json=$(cat <<EOF json=$(
cat << EOF
{ {
"value1": "${selfname}", "value1": "${selfname}",
"value2": "${alertemoji} ${alertsubject} ${alertemoji}", "value2": "${alertemoji} ${alertsubject} ${alertemoji}",

3
lgsm/functions/alert_pushbullet.sh

@ -7,7 +7,8 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
json=$(cat <<EOF json=$(
cat << EOF
{ {
"channel_tag": "${channeltag}", "channel_tag": "${channeltag}",
"type": "note", "type": "note",

3
lgsm/functions/alert_rocketchat.sh

@ -7,7 +7,8 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
json=$(cat <<EOF json=$(
cat << EOF
{ {
"alias": "LinuxGSM", "alias": "LinuxGSM",
"text": "*${alertemoji} ${alertsubject} ${alertemoji}* \n *${servername}* \n ${alertbody} \n More info: ${alerturl}", "text": "*${alertemoji} ${alertsubject} ${alertemoji}* \n *${servername}* \n ${alertbody} \n More info: ${alerturl}",

3
lgsm/functions/alert_slack.sh

@ -7,7 +7,8 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
json=$(cat <<EOF json=$(
cat << EOF
{ {
"attachments": [ "attachments": [
{ {

3
lgsm/functions/alert_telegram.sh

@ -7,7 +7,8 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
json=$(cat <<EOF json=$(
cat << EOF
{ {
"chat_id": "${telegramchatid}", "chat_id": "${telegramchatid}",
"parse_mode": "HTML", "parse_mode": "HTML",

7
lgsm/functions/check_deps.sh

@ -143,7 +143,6 @@ fn_install_missing_deps(){
fi fi
fi fi
# Add sudo dpkg --add-architecture i386 if using i386 packages. # Add sudo dpkg --add-architecture i386 if using i386 packages.
if [ "$(command -v dpkg-query 2> /dev/null)" ]; then if [ "$(command -v dpkg-query 2> /dev/null)" ]; then
if printf '%s\n' "${array_deps_required[@]}" | grep -q -P 'i386'; then if printf '%s\n' "${array_deps_required[@]}" | grep -q -P 'i386'; then
@ -226,13 +225,13 @@ fn_deps_detector(){
# SteamCMD: Will be removed from required array if no appid is present or non-free repo is not available. # SteamCMD: Will be removed from required array if no appid is present or non-free repo is not available.
# This will cause SteamCMD to be installed using tar. # This will cause SteamCMD to be installed using tar.
if [ "${deptocheck}" == "libsdl2-2.0-0:i386" ] && [ -z "${appid}" ]; then if [ "${deptocheck}" == "libsdl2-2.0-0:i386" ] && [ -z "${appid}" ]; then
array_deps_required=( "${array_deps_required[@]/libsdl2-2.0-0:i386}" ) array_deps_required=("${array_deps_required[@]/libsdl2-2.0-0:i386/}")
steamcmdstatus=1 steamcmdstatus=1
elif [ "${deptocheck}" == "steamcmd" ] && [ -z "${appid}" ]; then elif [ "${deptocheck}" == "steamcmd" ] && [ -z "${appid}" ]; then
array_deps_required=( "${array_deps_required[@]/steamcmd}" ) array_deps_required=("${array_deps_required[@]/steamcmd/}")
steamcmdstatus=1 steamcmdstatus=1
elif [ "${deptocheck}" == "steamcmd" ] && [ "${distroid}" == "debian" ] && ! grep -qE "^deb .*non-free" /etc/apt/sources.list; then elif [ "${deptocheck}" == "steamcmd" ] && [ "${distroid}" == "debian" ] && ! grep -qE "^deb .*non-free" /etc/apt/sources.list; then
array_deps_required=( "${array_deps_required[@]/steamcmd}" ) array_deps_required=("${array_deps_required[@]/steamcmd/}")
steamcmdstatus=1 steamcmdstatus=1
# Java: Added for users using Oracle JRE to bypass check. # Java: Added for users using Oracle JRE to bypass check.
elif [[ ${deptocheck} == "openjdk"* ]] || [[ ${deptocheck} == "java"* ]]; then elif [[ ${deptocheck} == "openjdk"* ]] || [[ ${deptocheck} == "java"* ]]; then

4
lgsm/functions/command_dev_detect_deps.sh

@ -23,8 +23,8 @@ else
echo -e "readelf/eu-readelf not installed" echo -e "readelf/eu-readelf not installed"
fi fi
files=$(find "${serverfiles}" | wc -l) files=$(find "${serverfiles}" | wc -l)
find "${serverfiles}" -type f -print0 | find "${serverfiles}" -type f -print0 \
while IFS= read -r -d $'\0' line; do | while IFS= read -r -d $'\0' line; do
if [ "${readelf}" == "eu-readelf" ]; then if [ "${readelf}" == "eu-readelf" ]; then
${readelf} -d "${line}" 2> /dev/null | grep NEEDED | awk '{ print $4 }' | sed 's/\[//g;s/\]//g' >> "${tmpdir}/.depdetect_readelf" ${readelf} -d "${line}" 2> /dev/null | grep NEEDED | awk '{ print $4 }' | sed 's/\[//g;s/\]//g' >> "${tmpdir}/.depdetect_readelf"
else else

5
lgsm/functions/command_dev_detect_glibc.sh

@ -34,7 +34,6 @@ elif [ -f "${serverfiles}" ]; then
fi fi
echo -e "" echo -e ""
glibc_check_dir_array=(steamcmddir serverfiles) glibc_check_dir_array=(steamcmddir serverfiles)
for glibc_check_var in "${glibc_check_dir_array[@]}"; do for glibc_check_var in "${glibc_check_dir_array[@]}"; do
if [ "${glibc_check_var}" == "serverfiles" ]; then if [ "${glibc_check_var}" == "serverfiles" ]; then
@ -47,8 +46,8 @@ for glibc_check_var in "${glibc_check_dir_array[@]}"; do
if [ -d "${glibc_check_dir}" ]; then if [ -d "${glibc_check_dir}" ]; then
glibc_check_files=$(find "${glibc_check_dir}" | wc -l) glibc_check_files=$(find "${glibc_check_dir}" | wc -l)
find "${glibc_check_dir}" -type f -print0 | find "${glibc_check_dir}" -type f -print0 \
while IFS= read -r -d $'\0' line; do | 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)
if [ "${glibcversion}" ]; then if [ "${glibcversion}" ]; then
echo -e "${glibcversion}: ${line}" >> "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" echo -e "${glibcversion}: ${line}" >> "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp"

10
lgsm/functions/command_dev_detect_ldd.sh

@ -31,14 +31,12 @@ touch "${tmpdir}/detect_ldd.tmp"
touch "${tmpdir}/detect_ldd_not_found.tmp" touch "${tmpdir}/detect_ldd_not_found.tmp"
files=$(find "${serverfiles}" | wc -l) files=$(find "${serverfiles}" | wc -l)
find "${serverfiles}" -type f -print0 | find "${serverfiles}" -type f -print0 \
while IFS= read -r -d $'\0' line; do | while IFS= read -r -d $'\0' line; do
if ldd "${line}" 2>/dev/null | grep -v "not a dynamic executable" if ldd "${line}" 2> /dev/null | grep -v "not a dynamic executable"; then
then
echo -e "${line}" >> "${tmpdir}/detect_ldd.tmp" echo -e "${line}" >> "${tmpdir}/detect_ldd.tmp"
ldd "${line}" 2> /dev/null | grep -v "not a dynamic executable" >> "${tmpdir}/detect_ldd.tmp" ldd "${line}" 2> /dev/null | grep -v "not a dynamic executable" >> "${tmpdir}/detect_ldd.tmp"
if ldd "${line}" 2>/dev/null | grep -v "not a dynamic executable" | grep "not found" if ldd "${line}" 2> /dev/null | grep -v "not a dynamic executable" | grep "not found"; then
then
echo -e "${line}" >> "${tmpdir}/detect_ldd_not_found.tmp" echo -e "${line}" >> "${tmpdir}/detect_ldd_not_found.tmp"
ldd "${line}" 2> /dev/null | grep -v "not a dynamic executable" | grep "not found" >> "${tmpdir}/detect_ldd_not_found.tmp" ldd "${line}" 2> /dev/null | grep -v "not a dynamic executable" | grep "not found" >> "${tmpdir}/detect_ldd_not_found.tmp"
fi fi

1
lgsm/functions/command_dev_query_raw.sh

@ -82,7 +82,6 @@ else
echo -e "HTTP Query:" echo -e "HTTP Query:"
fi fi
if [ -v webadminport ]; then if [ -v webadminport ]; then
echo -e "Web Admin: \t${webadminport} \t$(ss -tupl | grep ${webadminport} | wc -l) \t$(ss -tupl | grep ${webadminport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${webadminport} | grep udp | awk '{ print $2 }')" echo -e "Web Admin: \t${webadminport} \t$(ss -tupl | grep ${webadminport} | wc -l) \t$(ss -tupl | grep ${webadminport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${webadminport} | grep udp | awk '{ print $2 }')"
else else

15
lgsm/functions/command_fastdl.sh

@ -158,7 +158,8 @@ fn_fastdl_preview(){
tput sc tput sc
while read -r ext; do while read -r ext; do
((fileswc++)) ((fileswc++))
tput rc; tput el tput rc
tput el
echo -e "gathering ${allowed_extention} : ${fileswc}..." echo -e "gathering ${allowed_extention} : ${fileswc}..."
echo -e "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" echo -e "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt"
done < <(find . -type f -iname "${allowed_extention}") done < <(find . -type f -iname "${allowed_extention}")
@ -189,11 +190,13 @@ fn_fastdl_preview(){
tput sc tput sc
while read -r ext; do while read -r ext; do
((fileswc++)) ((fileswc++))
tput rc; tput el tput rc
tput el
echo -e "gathering ${directory} ${allowed_extention} : ${fileswc}..." echo -e "gathering ${directory} ${allowed_extention} : ${fileswc}..."
echo -e "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" echo -e "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt"
done < <(find "${systemdir}/${directory}" -type f -iname "${allowed_extention}") done < <(find "${systemdir}/${directory}" -type f -iname "${allowed_extention}")
tput rc; tput el tput rc
tput el
echo -e "gathering ${directory} ${allowed_extention} : ${fileswc}..." echo -e "gathering ${directory} ${allowed_extention} : ${fileswc}..."
if [ ${fileswc} != 0 ]; then if [ ${fileswc} != 0 ]; then
fn_print_ok_eol_nl fn_print_ok_eol_nl
@ -241,7 +244,8 @@ fn_fastdl_gmod(){
tput sc tput sc
while read -r fastdlfile; do while read -r fastdlfile; do
((fileswc++)) ((fileswc++))
tput rc; tput el tput rc
tput el
echo -e "copying ${allowed_extention} : ${fileswc}..." echo -e "copying ${allowed_extention} : ${fileswc}..."
cp --parents "${fastdlfile}" "${fastdldir}" cp --parents "${fastdlfile}" "${fastdldir}"
exitcode=$? exitcode=$?
@ -328,7 +332,8 @@ fn_fastdl_source(){
tput sc tput sc
while read -r fastdlfile; do while read -r fastdlfile; do
((fileswc++)) ((fileswc++))
tput rc; tput el tput rc
tput el
echo -e "copying ${directory} ${allowed_extention} : ${fileswc}..." echo -e "copying ${directory} ${allowed_extention} : ${fileswc}..."
fn_sleep_time fn_sleep_time
# get relative path of file in the dir # get relative path of file in the dir

10
lgsm/functions/command_mods_install.sh

@ -100,11 +100,11 @@ if [ "${modcommand}" == "amxmodx" ]; then
fn_mod_exist "metamod" fn_mod_exist "metamod"
fi fi
if [ "${modcommand}" == "amxmodxcs" ] || if [ "${modcommand}" == "amxmodxcs" ] \
[ "${modcommand}" == "amxmodxdod" ] || || [ "${modcommand}" == "amxmodxdod" ] \
[ "${modcommand}" == "amxmodxtfc" ] || || [ "${modcommand}" == "amxmodxtfc" ] \
[ "${modcommand}" == "amxmodxns" ] || || [ "${modcommand}" == "amxmodxns" ] \
[ "${modcommand}" == "amxmodxts" ]; then || [ "${modcommand}" == "amxmodxts" ]; then
fn_mod_exist "amxmodx" fn_mod_exist "amxmodx"
fi fi

3
lgsm/functions/command_mods_remove.sh

@ -78,7 +78,8 @@ while [ "${modfileline}" -le "${modsfilelistsize}" ]; do
fn_script_log_pass "Removing ${modinstalldir}/${currentfileremove}" fn_script_log_pass "Removing ${modinstalldir}/${currentfileremove}"
fi fi
fi fi
tput rc; tput el tput rc
tput el
echo -e "removing ${modprettyname} ${modfileline} / ${modsfilelistsize} : ${currentfileremove}..." echo -e "removing ${modprettyname} ${modfileline} / ${modsfilelistsize} : ${currentfileremove}..."
((modfileline++)) ((modfileline++))
done done

3
lgsm/functions/command_postdetails.sh

@ -34,8 +34,7 @@ else
info_game.sh info_game.sh
info_distro.sh info_distro.sh
info_messages.sh info_messages.sh
for queryip in "${queryips[@]}" for queryip in "${queryips[@]}"; do
do
query_gamedig.sh query_gamedig.sh
if [ "${querystatus}" == "0" ]; then if [ "${querystatus}" == "0" ]; then
break break

3
lgsm/functions/command_start.sh

@ -140,8 +140,7 @@ fn_start_tmux(){
cat "${lgsmlogdir}/.${selfname}-tmux-error.tmp" | tee -a "${lgsmlog}" cat "${lgsmlogdir}/.${selfname}-tmux-error.tmp" | tee -a "${lgsmlog}"
# Detected error https://linuxgsm.com/support # Detected error https://linuxgsm.com/support
if grep -c "Operation not permitted" "${lgsmlogdir}/.${selfname}-tmux-error.tmp" if grep -c "Operation not permitted" "${lgsmlogdir}/.${selfname}-tmux-error.tmp"; then
then
echo -e "" echo -e ""
echo -e "Fix" echo -e "Fix"
echo -e "=================================" echo -e "================================="

1
lgsm/functions/core_getopt.sh

@ -56,7 +56,6 @@ cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect require
cmd_dev_query_raw=("qr;query-raw" "command_dev_query_raw.sh" "The raw output of gamedig and gsquery.") cmd_dev_query_raw=("qr;query-raw" "command_dev_query_raw.sh" "The raw output of gamedig and gsquery.")
cmd_dev_clear_functions=("cf;clear-functions" "command_dev_clear_functions.sh" "Delete the contents of the functions dir.") cmd_dev_clear_functions=("cf;clear-functions" "command_dev_clear_functions.sh" "Delete the contents of the functions dir.")
### Set specific opt here. ### Set specific opt here.
currentopt=("${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monitor[@]}" "${cmd_test_alert[@]}" "${cmd_details[@]}" "${cmd_postdetails[@]}" "${cmd_skeleton[@]}") currentopt=("${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monitor[@]}" "${cmd_test_alert[@]}" "${cmd_details[@]}" "${cmd_postdetails[@]}" "${cmd_skeleton[@]}")

9
lgsm/functions/core_logs.sh

@ -38,7 +38,14 @@ if [ "$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l)" -ne "0" ];
darkrplogdir="${systemdir}/data/darkrp_logs" darkrplogdir="${systemdir}/data/darkrp_logs"
legacyserverlogdir="${logdir}/server" legacyserverlogdir="${logdir}/server"
# Setting up counting variables # Setting up counting variables
scriptcount="0" ; consolecount="0" ; gamecount="0" ; srcdscount="0" ; smcount="0" ; ulxcount="0" ; darkrpcount="0" ; legacycount="0" scriptcount="0"
consolecount="0"
gamecount="0"
srcdscount="0"
smcount="0"
ulxcount="0"
darkrpcount="0"
legacycount="0"
fn_sleep_time fn_sleep_time
fn_print_info "Removing logs older than ${logdays} days" fn_print_info "Removing logs older than ${logdays} days"
fn_script_log_info "Removing logs older than ${logdays} days" fn_script_log_info "Removing logs older than ${logdays} days"

2
lgsm/functions/core_messages.sh

@ -366,7 +366,7 @@ fn_prompt_message(){
local prompt="$1" local prompt="$1"
read -e -p "${prompt}" -r answer read -e -p "${prompt}" -r answer
if fn_prompt_yn "Continue" Y; then if fn_prompt_yn "Continue" Y; then
break; break
fi fi
done done
echo "${answer}" echo "${answer}"

6
lgsm/functions/fix_ark.sh

@ -19,7 +19,11 @@ elif [ "${steamappsfilewc}" -eq "1" ]; then
# This allows LinxuGSM to select either ~/.steam or ~/Steam. depending on what is being used # This allows LinxuGSM to select either ~/.steam or ~/Steam. depending on what is being used
steamappsfile=$(find "${HOME}" -name appworkshop_346110.acf) steamappsfile=$(find "${HOME}" -name appworkshop_346110.acf)
steamappsdir=$(dirname "${steamappsfile}") steamappsdir=$(dirname "${steamappsfile}")
steamappspath=$(cd "${steamappsdir}" || return; cd ../;pwd) steamappspath=$(
cd "${steamappsdir}" || return
cd ../
pwd
)
# removes the symlink if exists. # removes the symlink if exists.
# fixes issue with older versions of LinuxGSM linking to /home/arkserver/steamcmd # fixes issue with older versions of LinuxGSM linking to /home/arkserver/steamcmd

6
lgsm/functions/fix_vh.sh

@ -12,10 +12,8 @@ export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH
modsdir="${lgsmdir}/mods" modsdir="${lgsmdir}/mods"
modsinstalledlistfullpath="${modsdir}/installed-mods.txt" modsinstalledlistfullpath="${modsdir}/installed-mods.txt"
if [ -f "${modsinstalledlistfullpath}" ]; then if [ -f "${modsinstalledlistfullpath}" ]; then
if grep -qE "^valheimplus" "${modsinstalledlistfullpath}" if grep -qE "^valheimplus" "${modsinstalledlistfullpath}"; then
then if ! grep -qE "^executable=\"./start_server_bepinex.sh\"" "${configdirserver}/${selfname}.cfg"; then
if ! grep -qE "^executable=\"./start_server_bepinex.sh\"" "${configdirserver}/${selfname}.cfg"
then
echo 'executable="./start_server_bepinex.sh"' >> "${configdirserver}/${selfname}.cfg" echo 'executable="./start_server_bepinex.sh"' >> "${configdirserver}/${selfname}.cfg"
executable="./start_server_bepinex.sh" executable="./start_server_bepinex.sh"
fi fi

5
lgsm/functions/info_distro.sh

@ -186,7 +186,10 @@ if [ "$(command -v numfmt 2>/dev/null)" ]; then
else else
# Older distros will need to use free. # Older distros will need to use free.
# Older versions of free do not support -h option. # Older versions of free do not support -h option.
if [ "$(free -h > /dev/null 2>&1; echo $?)" -ne "0" ]; then if [ "$(
free -h > /dev/null 2>&1
echo $?
)" -ne "0" ]; then
humanreadable="-m" humanreadable="-m"
else else
humanreadable="-h" humanreadable="-h"

4
lgsm/functions/info_game.sh

@ -104,7 +104,6 @@ fn_info_game_armar(){
serverpassword=$(jq -r '.game.password' "${servercfgfullpath}") serverpassword=$(jq -r '.game.password' "${servercfgfullpath}")
battleeyeport=1376 battleeyeport=1376
# Not set # Not set
adminpassword=${adminpassword:-"NOT SET"} adminpassword=${adminpassword:-"NOT SET"}
configip=${configip:-"0.0.0.0"} configip=${configip:-"0.0.0.0"}
@ -373,8 +372,6 @@ fn_info_game_coduo(){
queryport=${port:-"28960"} queryport=${port:-"28960"}
} }
fn_info_game_cod2() { fn_info_game_cod2() {
# Config # Config
if [ ! -f "${servercfgfullpath}" ]; then if [ ! -f "${servercfgfullpath}" ]; then
@ -2242,7 +2239,6 @@ fn_info_game_wf(){
webadminport=${webadminport:-"0"} webadminport=${webadminport:-"0"}
} }
fn_info_game_wmc() { fn_info_game_wmc() {
if [ ! -f "${servercfgfullpath}" ]; then if [ ! -f "${servercfgfullpath}" ]; then
servername="${unavailable}" servername="${unavailable}"

3
lgsm/functions/install_retry.sh

@ -8,7 +8,8 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if fn_prompt_yn "Retry install?" Y; then if fn_prompt_yn "Retry install?" Y; then
command_install.sh; core_exit.sh command_install.sh
core_exit.sh
else else
exitcode=0 exitcode=0
core_exit.sh core_exit.sh

189
lgsm/functions/install_server_files.sh

@ -9,59 +9,194 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_install_server_files() { fn_install_server_files() {
if [ "${shortname}" == "ahl" ]; then if [ "${shortname}" == "ahl" ]; then
remote_fileurl="http://linuxgsm.download/ActionHalfLife/action_halflife-1.0.tar.xz"; local_filedir="${tmpdir}"; local_filename="action_halflife-1.0.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="61d7b79fd714888b6d65944fdaafa94a" remote_fileurl="http://linuxgsm.download/ActionHalfLife/action_halflife-1.0.tar.xz"
local_filedir="${tmpdir}"
local_filename="action_halflife-1.0.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="61d7b79fd714888b6d65944fdaafa94a"
elif [ "${shortname}" == "bf1942" ]; then elif [ "${shortname}" == "bf1942" ]; then
remote_fileurl="http://linuxgsm.download/BattleField1942/bf1942_lnxded-1.61-hacked-to-1.612.full.tar.xz"; local_filedir="${tmpdir}"; local_filename="bf1942_lnxded-1.61-hacked-to-1.612.full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="4223bf4ed85f5162c24b2cba51249b9e" remote_fileurl="http://linuxgsm.download/BattleField1942/bf1942_lnxded-1.61-hacked-to-1.612.full.tar.xz"
local_filedir="${tmpdir}"
local_filename="bf1942_lnxded-1.61-hacked-to-1.612.full.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="4223bf4ed85f5162c24b2cba51249b9e"
elif [ "${shortname}" == "bfv" ]; then elif [ "${shortname}" == "bfv" ]; then
remote_fileurl="http://linuxgsm.download/BattlefieldVietnam/bfv_linded-v1.21-20041207_patch.tar.xz"; local_filedir="${tmpdir}"; local_filename="bfv_linded-v1.21-20041207_patch.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="e3b4962cdd9d41e23c6fed65101bccde" remote_fileurl="http://linuxgsm.download/BattlefieldVietnam/bfv_linded-v1.21-20041207_patch.tar.xz"
local_filedir="${tmpdir}"
local_filename="bfv_linded-v1.21-20041207_patch.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="e3b4962cdd9d41e23c6fed65101bccde"
elif [ "${shortname}" == "bb" ]; then 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" 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 elif [ "${shortname}" == "cod" ]; then
remote_fileurl="http://linuxgsm.download/CallOfDuty/cod-lnxded-1.5b-full.tar.xz"; local_filedir="${tmpdir}"; local_filename="cod-lnxded-1.5-large.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="ee0ad1ccbfa1fd27fde01a4a431a5c2f" remote_fileurl="http://linuxgsm.download/CallOfDuty/cod-lnxded-1.5b-full.tar.xz"
local_filedir="${tmpdir}"
local_filename="cod-lnxded-1.5-large.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="ee0ad1ccbfa1fd27fde01a4a431a5c2f"
elif [ "${shortname}" == "coduo" ]; then elif [ "${shortname}" == "coduo" ]; then
remote_fileurl="http://linuxgsm.download/CallOfDutyUnitedOffensive/coduo-lnxded-1.51b-full.tar.xz"; local_filedir="${tmpdir}"; local_filename="coduo-lnxded-1.51b-full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="35cabccd67adcda44aaebc59405915b9" remote_fileurl="http://linuxgsm.download/CallOfDutyUnitedOffensive/coduo-lnxded-1.51b-full.tar.xz"
local_filedir="${tmpdir}"
local_filename="coduo-lnxded-1.51b-full.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="35cabccd67adcda44aaebc59405915b9"
elif [ "${shortname}" == "cod2" ]; then elif [ "${shortname}" == "cod2" ]; then
remote_fileurl="http://linuxgsm.download/CallOfDuty2/cod2-lnxded-1.3-full.tar.xz"; local_filedir="${tmpdir}"; local_filename="cod2-lnxded-1.3-full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="b8c4c611f01627dd43348e78478a3d41" remote_fileurl="http://linuxgsm.download/CallOfDuty2/cod2-lnxded-1.3-full.tar.xz"
local_filedir="${tmpdir}"
local_filename="cod2-lnxded-1.3-full.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="b8c4c611f01627dd43348e78478a3d41"
elif [ "${shortname}" == "cod4" ]; then elif [ "${shortname}" == "cod4" ]; then
remote_fileurl="http://linuxgsm.download/CallOfDuty4/cod4x18_1790_lnxded.tar.xz"; local_filedir="${tmpdir}"; local_filename="cod4x18_1790_lnxded.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="30609db2afde09d22498fbab3a427d11" remote_fileurl="http://linuxgsm.download/CallOfDuty4/cod4x18_1790_lnxded.tar.xz"
local_filedir="${tmpdir}"
local_filename="cod4x18_1790_lnxded.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="30609db2afde09d22498fbab3a427d11"
elif [ "${shortname}" == "codwaw" ]; then elif [ "${shortname}" == "codwaw" ]; then
remote_fileurl="http://linuxgsm.download/CallOfDutyWorldAtWar/codwaw-lnxded-1.7-full.tar.xz"; local_filedir="${tmpdir}"; local_filename="codwaw-lnxded-1.7-full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="2c6be1bb66ea631b9b2e7ae6216c6680" remote_fileurl="http://linuxgsm.download/CallOfDutyWorldAtWar/codwaw-lnxded-1.7-full.tar.xz"
local_filedir="${tmpdir}"
local_filename="codwaw-lnxded-1.7-full.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="2c6be1bb66ea631b9b2e7ae6216c6680"
elif [ "${shortname}" == "etl" ]; then 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" 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 elif [ "${shortname}" == "mohaa" ]; then
remote_fileurl="http://linuxgsm.download/MedalofHonorAlliedAssault/moh_revival_v1.12_RC3.5.1.tar.xz"; local_filedir="${tmpdir}"; local_filename="moh_revival_v1.12_RC3.5.1.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="7c664538999252eeaf2b6d9949416480" remote_fileurl="http://linuxgsm.download/MedalofHonorAlliedAssault/moh_revival_v1.12_RC3.5.1.tar.xz"
local_filedir="${tmpdir}"
local_filename="moh_revival_v1.12_RC3.5.1.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="7c664538999252eeaf2b6d9949416480"
elif [ "${shortname}" == "ns" ]; then elif [ "${shortname}" == "ns" ]; then
remote_fileurl="http://linuxgsm.download/NaturalSelection/ns_dedicated_server_v32.tar.xz"; local_filedir="${tmpdir}"; local_filename="ns_dedicated_server_v32.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="23ec3cadd93d8bb1c475bad5b9cce370" remote_fileurl="http://linuxgsm.download/NaturalSelection/ns_dedicated_server_v32.tar.xz"
local_filedir="${tmpdir}"
local_filename="ns_dedicated_server_v32.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="23ec3cadd93d8bb1c475bad5b9cce370"
elif [ "${shortname}" == "q2" ]; then elif [ "${shortname}" == "q2" ]; then
remote_fileurl="http://linuxgsm.download/Quake2/quake2-3.20-glibc-i386-full-linux2.0.tar.xz"; local_filedir="${tmpdir}"; local_filename="quake2-3.20-glibc-i386-full-linux2.0.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="2908164a32d4808bb720f2161f6b0c82" remote_fileurl="http://linuxgsm.download/Quake2/quake2-3.20-glibc-i386-full-linux2.0.tar.xz"
local_filedir="${tmpdir}"
local_filename="quake2-3.20-glibc-i386-full-linux2.0.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="2908164a32d4808bb720f2161f6b0c82"
elif [ "${shortname}" == "q3" ]; then elif [ "${shortname}" == "q3" ]; then
remote_fileurl="http://linuxgsm.download/Quake3/quake3-1.32c-x86-full-linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="quake3-1.32c-x86-full-linux.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="b0e26d8919fe9313fb9d8ded2360f3db" remote_fileurl="http://linuxgsm.download/Quake3/quake3-1.32c-x86-full-linux.tar.xz"
local_filedir="${tmpdir}"
local_filename="quake3-1.32c-x86-full-linux.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="b0e26d8919fe9313fb9d8ded2360f3db"
elif [ "${shortname}" == "qw" ]; then elif [ "${shortname}" == "qw" ]; then
remote_fileurl="http://linuxgsm.download/QuakeWorld/nquake.server.linux.190506.full.tar.xz"; local_filedir="${tmpdir}"; local_filename="nquake.server.linux.190506.full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="82055b7d973206c13a606db8ba288d03" remote_fileurl="http://linuxgsm.download/QuakeWorld/nquake.server.linux.190506.full.tar.xz"
local_filedir="${tmpdir}"
local_filename="nquake.server.linux.190506.full.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="82055b7d973206c13a606db8ba288d03"
elif [ "${shortname}" == "rtcw" ]; then elif [ "${shortname}" == "rtcw" ]; then
remote_fileurl="http://linuxgsm.download/ReturnToCastleWolfenstein/iortcw-1.51c-x86_64-server-linux-20190507.tar.xz"; local_filedir="${tmpdir}"; local_filename="iortcw-1.51c-x86_64-server-linux-20190507.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="df6ff664d37dd0d22787848bdb3cac5f" remote_fileurl="http://linuxgsm.download/ReturnToCastleWolfenstein/iortcw-1.51c-x86_64-server-linux-20190507.tar.xz"
local_filedir="${tmpdir}"
local_filename="iortcw-1.51c-x86_64-server-linux-20190507.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="df6ff664d37dd0d22787848bdb3cac5f"
elif [ "${shortname}" == "sfc" ]; then elif [ "${shortname}" == "sfc" ]; then
remote_fileurl="http://linuxgsm.download/SourceFortsClassic/SFClassic-1.0-RC7-fix.tar.xz"; local_filedir="${tmpdir}"; local_filename="SFClassic-1.0-RC7-fix.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="70077137185700e28fe6bbb6021d12bc" remote_fileurl="http://linuxgsm.download/SourceFortsClassic/SFClassic-1.0-RC7-fix.tar.xz"
local_filedir="${tmpdir}"
local_filename="SFClassic-1.0-RC7-fix.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="70077137185700e28fe6bbb6021d12bc"
elif [ "${shortname}" == "sof2" ]; then elif [ "${shortname}" == "sof2" ]; then
remote_fileurl="http://linuxgsm.download/SoldierOfFortune2/sof2gold-1.03.tar.xz"; local_filedir="${tmpdir}"; local_filename="sof2gold-1.03.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="201e23bab04207d00ce813d001c483d9" remote_fileurl="http://linuxgsm.download/SoldierOfFortune2/sof2gold-1.03.tar.xz"
local_filedir="${tmpdir}"
local_filename="sof2gold-1.03.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="201e23bab04207d00ce813d001c483d9"
elif [ "${shortname}" == "ts" ]; then elif [ "${shortname}" == "ts" ]; then
remote_fileurl="http://linuxgsm.download/TheSpecialists/ts-3-linux-final.tar.xz"; local_filedir="${tmpdir}"; local_filename="ts-3-linux-final.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="3c66ecff6e3644f7ac88015732a0fb93" remote_fileurl="http://linuxgsm.download/TheSpecialists/ts-3-linux-final.tar.xz"
local_filedir="${tmpdir}"
local_filename="ts-3-linux-final.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="3c66ecff6e3644f7ac88015732a0fb93"
elif [ "${shortname}" == "ut2k4" ]; then elif [ "${shortname}" == "ut2k4" ]; then
remote_fileurl="http://linuxgsm.download/UnrealTournament2004/ut2004-server-3369-3-ultimate-linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="ut2004-server-3369-3-ultimate-linux.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="9fceaab68554749f4b45be66613b9a15" remote_fileurl="http://linuxgsm.download/UnrealTournament2004/ut2004-server-3369-3-ultimate-linux.tar.xz"
local_filedir="${tmpdir}"
local_filename="ut2004-server-3369-3-ultimate-linux.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="9fceaab68554749f4b45be66613b9a15"
elif [ "${shortname}" == "ut99" ]; then elif [ "${shortname}" == "ut99" ]; then
remote_fileurl="http://linuxgsm.download/UnrealTournament99/ut99-server-469b-ultimate-linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="ut99-server-469b-ultimate-linux.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="dba3f1122a5e60ee45ece7422fcf78f5" remote_fileurl="http://linuxgsm.download/UnrealTournament99/ut99-server-469b-ultimate-linux.tar.xz"
local_filedir="${tmpdir}"
local_filename="ut99-server-469b-ultimate-linux.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="dba3f1122a5e60ee45ece7422fcf78f5"
elif [ "${shortname}" == "ut" ]; then elif [ "${shortname}" == "ut" ]; then
remote_fileurl="http://linuxgsm.download/UnrealTournament/UnrealTournament-Server-XAN-3525360-Linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="UnrealTournament-Server-XAN-3525360-Linux.tar.xz"; chmodx="noexecute" run="norun"; force="noforce"; md5="41dd92015713a78211eaccf503b72393" remote_fileurl="http://linuxgsm.download/UnrealTournament/UnrealTournament-Server-XAN-3525360-Linux.tar.xz"
local_filedir="${tmpdir}"
local_filename="UnrealTournament-Server-XAN-3525360-Linux.tar.xz"
chmodx="noexecute" run="norun"
force="noforce"
md5="41dd92015713a78211eaccf503b72393"
elif [ "${shortname}" == "ut3" ]; then elif [ "${shortname}" == "ut3" ]; then
remote_fileurl="http://linuxgsm.download/UnrealTournament3/UT3-linux-server-2.1.tar.xz"; local_filedir="${tmpdir}"; local_filename="UT3-linux-server-2.1.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="8876cca61e3f83ea08db25208bde6ac6" remote_fileurl="http://linuxgsm.download/UnrealTournament3/UT3-linux-server-2.1.tar.xz"
local_filedir="${tmpdir}"
local_filename="UT3-linux-server-2.1.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="8876cca61e3f83ea08db25208bde6ac6"
elif [ "${shortname}" == "vs" ]; then elif [ "${shortname}" == "vs" ]; then
remote_fileurl="http://linuxgsm.download/VampireSlayer/vs_l-6.0_full.tar.xz"; local_filedir="${tmpdir}"; local_filename="vs_l-6.0_full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="b322f79e0abd31847493c52acf802667" remote_fileurl="http://linuxgsm.download/VampireSlayer/vs_l-6.0_full.tar.xz"
local_filedir="${tmpdir}"
local_filename="vs_l-6.0_full.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="b322f79e0abd31847493c52acf802667"
elif [ "${shortname}" == "wet" ]; then elif [ "${shortname}" == "wet" ]; then
remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/enemy-territory.260b.tar.xz"; local_filedir="${tmpdir}"; local_filename="enemy-territory.260b.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="581a333cc7eacda2f56d5a00fe11eafa" remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/enemy-territory.260b.tar.xz"
local_filedir="${tmpdir}"
local_filename="enemy-territory.260b.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="581a333cc7eacda2f56d5a00fe11eafa"
elif [ "${shortname}" == "samp" ]; then elif [ "${shortname}" == "samp" ]; then
remote_fileurl="https://files.sa-mp.com/samp037svr_R2-1.tar.gz"; local_filedir="${tmpdir}"; local_filename="samp037svr_R2-1.tar.gz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="93705e165550c97484678236749198a4" remote_fileurl="https://files.sa-mp.com/samp037svr_R2-1.tar.gz"
local_filedir="${tmpdir}"
local_filename="samp037svr_R2-1.tar.gz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="93705e165550c97484678236749198a4"
elif [ "${shortname}" == "zmr" ]; then elif [ "${shortname}" == "zmr" ]; then
remote_fileurl="http://linuxgsm.download/ZombieMasterReborn/zombie_master_reborn_b5_2.tar.xz"; local_filedir="${tmpdir}"; local_filename="zombie_master_reborn_b5_2.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="4b9b9832e863d03981a40c26065792a6" remote_fileurl="http://linuxgsm.download/ZombieMasterReborn/zombie_master_reborn_b5_2.tar.xz"
local_filedir="${tmpdir}"
local_filename="zombie_master_reborn_b5_2.tar.xz"
chmodx="nochmodx" run="norun"
force="noforce"
md5="4b9b9832e863d03981a40c26065792a6"
fi fi
fn_fetch_file "${remote_fileurl}" "" "" "" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" fn_fetch_file "${remote_fileurl}" "" "" "" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}"
fn_dl_extract "${local_filedir}" "${local_filename}" "${serverfiles}" fn_dl_extract "${local_filedir}" "${local_filename}" "${serverfiles}"

8
linuxgsm.sh

@ -238,7 +238,7 @@ fn_install_menu_whiptail() {
while read -r line; do while read -r line; do
key=$(echo -e "${line}" | awk -F "," '{print $3}') key=$(echo -e "${line}" | awk -F "," '{print $3}')
val=$(echo -e "${line}" | awk -F "," '{print $2}') val=$(echo -e "${line}" | awk -F "," '{print $2}')
menu_options+=( "${val//\"}" "${key//\"}" ) menu_options+=("${val//\"/}" "${key//\"/}")
done < "${options}" done < "${options}"
OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3) OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3)
if [ $? == 0 ]; then if [ $? == 0 ]; then
@ -264,9 +264,11 @@ fn_install_menu() {
done done
case "$(basename "${menucmd}")" in case "$(basename "${menucmd}")" in
whiptail | dialog) whiptail | dialog)
fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30
;;
*) *)
fn_install_menu_bash selection "${title}" "${caption}" "${options}";; fn_install_menu_bash selection "${title}" "${caption}" "${options}"
;;
esac esac
eval "$resultvar=\"${selection}\"" eval "$resultvar=\"${selection}\""
} }

12
tests/tests_defaultcfg/tests_defaultcfg.sh

@ -6,8 +6,8 @@ echo -e "Description:"
echo -e "test checks that vars present in ALL _default.cfg files are correct." echo -e "test checks that vars present in ALL _default.cfg files are correct."
echo -e "" echo -e ""
echo -e "In master config < | > In game config" echo -e "In master config < | > In game config"
find "lgsm/config-default/config-lgsm/" ! -name '*template.cfg' -name "*.cfg" -type f -print0 | find "lgsm/config-default/config-lgsm/" ! -name '*template.cfg' -name "*.cfg" -type f -print0 \
while IFS= read -r -d $'\0' line; do | while IFS= read -r -d $'\0' line; do
grep "=" "${line}" | cut -f1 -d"=" > defaultcfgtemp.txt grep "=" "${line}" | cut -f1 -d"=" > defaultcfgtemp.txt
diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_0.txt defaultcfgtemp.txt) diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_0.txt defaultcfgtemp.txt)
if [ "${diffoutput}" ]; then if [ "${diffoutput}" ]; then
@ -28,8 +28,8 @@ echo -e "Description:"
echo -e "test checks that vars present in ALL _default.cfg files are correct." echo -e "test checks that vars present in ALL _default.cfg files are correct."
echo -e "" echo -e ""
echo -e "In master config < | > In game config" echo -e "In master config < | > In game config"
find lgsm/config-default/config-lgsm/ ! -name '*template.cfg' -name "*.cfg" -type f -print0 | find lgsm/config-default/config-lgsm/ ! -name '*template.cfg' -name "*.cfg" -type f -print0 \
while IFS= read -r -d $'\0' line; do | while IFS= read -r -d $'\0' line; do
grep "=" "${line}" | cut -f1 -d"=" > defaultcfgtemp.txt grep "=" "${line}" | cut -f1 -d"=" > defaultcfgtemp.txt
diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_0.txt defaultcfgtemp.txt | grep '^<') diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_0.txt defaultcfgtemp.txt | grep '^<')
if [ "${diffoutput}" ]; then if [ "${diffoutput}" ]; then
@ -50,8 +50,8 @@ echo -e "Description:"
echo -e "test checks that comments in ALL _default.cfg files are correct." echo -e "test checks that comments in ALL _default.cfg files are correct."
echo -e "" echo -e ""
echo -e "In master config < | > In game config" echo -e "In master config < | > In game config"
find lgsm/config-default/config-lgsm/ ! -name '*template.cfg' -name "*.cfg" -type f -print0 | find lgsm/config-default/config-lgsm/ ! -name '*template.cfg' -name "*.cfg" -type f -print0 \
while IFS= read -r -d $'\0' line; do | while IFS= read -r -d $'\0' line; do
grep "#" "${line}" > defaultcfgtemp.txt grep "#" "${line}" > defaultcfgtemp.txt
diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_1.txt defaultcfgtemp.txt | grep '^<') diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_1.txt defaultcfgtemp.txt | grep '^<')
if [ "${diffoutput}" ]; then if [ "${diffoutput}" ]; then

11
tests/tests_fctrserver.sh

@ -238,7 +238,7 @@ fn_install_menu_whiptail() {
while read -r line; do while read -r line; do
key=$(echo -e "${line}" | awk -F "," '{print $3}') key=$(echo -e "${line}" | awk -F "," '{print $3}')
val=$(echo -e "${line}" | awk -F "," '{print $2}') val=$(echo -e "${line}" | awk -F "," '{print $2}')
menu_options+=( "${val//\"}" "${key//\"}" ) menu_options+=("${val//\"/}" "${key//\"/}")
done < "${options}" done < "${options}"
OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3) OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3)
if [ $? == 0 ]; then if [ $? == 0 ]; then
@ -264,9 +264,11 @@ fn_install_menu() {
done done
case "$(basename "${menucmd}")" in case "$(basename "${menucmd}")" in
whiptail | dialog) whiptail | dialog)
fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30
;;
*) *)
fn_install_menu_bash selection "${title}" "${caption}" "${options}";; fn_install_menu_bash selection "${title}" "${caption}" "${options}"
;;
esac esac
eval "$resultvar=\"${selection}\"" eval "$resultvar=\"${selection}\""
} }
@ -793,7 +795,8 @@ fn_setstatus
exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5" BASH_XTRACEFD="5"
set -x set -x
updateonstart="on";command_start.sh updateonstart="on"
command_start.sh
) )
fn_test_result_pass fn_test_result_pass
echo -e "run order" echo -e "run order"

17
tests/tests_jc2server.sh

@ -239,7 +239,7 @@ fn_install_menu_whiptail() {
while read -r line; do while read -r line; do
key=$(echo -e "${line}" | awk -F "," '{print $3}') key=$(echo -e "${line}" | awk -F "," '{print $3}')
val=$(echo -e "${line}" | awk -F "," '{print $2}') val=$(echo -e "${line}" | awk -F "," '{print $2}')
menu_options+=( "${val//\"}" "${key//\"}" ) menu_options+=("${val//\"/}" "${key//\"/}")
done < "${options}" done < "${options}"
OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3) OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3)
if [ $? == 0 ]; then if [ $? == 0 ]; then
@ -265,9 +265,11 @@ fn_install_menu() {
done done
case "$(basename "${menucmd}")" in case "$(basename "${menucmd}")" in
whiptail | dialog) whiptail | dialog)
fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30
;;
*) *)
fn_install_menu_bash selection "${title}" "${caption}" "${options}";; fn_install_menu_bash selection "${title}" "${caption}" "${options}"
;;
esac esac
eval "$resultvar=\"${selection}\"" eval "$resultvar=\"${selection}\""
} }
@ -798,7 +800,8 @@ fn_setstatus
exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5" BASH_XTRACEFD="5"
set -x set -x
updateonstart="on";command_start.sh updateonstart="on"
command_start.sh
) )
fn_test_result_pass fn_test_result_pass
echo -e "run order" echo -e "run order"
@ -979,7 +982,8 @@ fn_setstatus
exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5" BASH_XTRACEFD="5"
set -x set -x
forceupdate=1;command_update.sh forceupdate=1
command_update.sh
) )
fn_test_result_pass fn_test_result_pass
echo -e "run order" echo -e "run order"
@ -998,7 +1002,8 @@ fn_setstatus
exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5" BASH_XTRACEFD="5"
set -x set -x
forceupdate=1;command_update.sh forceupdate=1
command_update.sh
) )
fn_test_result_pass fn_test_result_pass
echo -e "run order" echo -e "run order"

11
tests/tests_mcserver.sh

@ -239,7 +239,7 @@ fn_install_menu_whiptail() {
while read -r line; do while read -r line; do
key=$(echo -e "${line}" | awk -F "," '{print $3}') key=$(echo -e "${line}" | awk -F "," '{print $3}')
val=$(echo -e "${line}" | awk -F "," '{print $2}') val=$(echo -e "${line}" | awk -F "," '{print $2}')
menu_options+=( "${val//\"}" "${key//\"}" ) menu_options+=("${val//\"/}" "${key//\"/}")
done < "${options}" done < "${options}"
OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3) OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3)
if [ $? == 0 ]; then if [ $? == 0 ]; then
@ -265,9 +265,11 @@ fn_install_menu() {
done done
case "$(basename "${menucmd}")" in case "$(basename "${menucmd}")" in
whiptail | dialog) whiptail | dialog)
fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30
;;
*) *)
fn_install_menu_bash selection "${title}" "${caption}" "${options}";; fn_install_menu_bash selection "${title}" "${caption}" "${options}"
;;
esac esac
eval "$resultvar=\"${selection}\"" eval "$resultvar=\"${selection}\""
} }
@ -792,7 +794,8 @@ fn_setstatus
exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5" BASH_XTRACEFD="5"
set -x set -x
updateonstart="on";command_start.sh updateonstart="on"
command_start.sh
) )
fn_test_result_pass fn_test_result_pass
echo -e "run order" echo -e "run order"

11
tests/tests_ts3server.sh

@ -239,7 +239,7 @@ fn_install_menu_whiptail() {
while read -r line; do while read -r line; do
key=$(echo -e "${line}" | awk -F "," '{print $3}') key=$(echo -e "${line}" | awk -F "," '{print $3}')
val=$(echo -e "${line}" | awk -F "," '{print $2}') val=$(echo -e "${line}" | awk -F "," '{print $2}')
menu_options+=( "${val//\"}" "${key//\"}" ) menu_options+=("${val//\"/}" "${key//\"/}")
done < "${options}" done < "${options}"
OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3) OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3)
if [ $? == 0 ]; then if [ $? == 0 ]; then
@ -265,9 +265,11 @@ fn_install_menu() {
done done
case "$(basename "${menucmd}")" in case "$(basename "${menucmd}")" in
whiptail | dialog) whiptail | dialog)
fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30
;;
*) *)
fn_install_menu_bash selection "${title}" "${caption}" "${options}";; fn_install_menu_bash selection "${title}" "${caption}" "${options}"
;;
esac esac
eval "$resultvar=\"${selection}\"" eval "$resultvar=\"${selection}\""
} }
@ -792,7 +794,8 @@ fn_setstatus
exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log"
BASH_XTRACEFD="5" BASH_XTRACEFD="5"
set -x set -x
updateonstart="on";command_start.sh updateonstart="on"
command_start.sh
) )
fn_test_result_pass fn_test_result_pass
echo -e "run order" echo -e "run order"

Loading…
Cancel
Save