diff --git a/.editorconfig b/.editorconfig index ef3ef8bd9..f20e02e1c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,3 +11,18 @@ 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 + +# BASH Files +[*.{.sh}] +indent_style = tab +indent_size = 4 diff --git a/.gitattributes b/.gitattributes index bbe6490d1..cfa570e67 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,16 +7,16 @@ *.so.6 binary # Custom for Visual Studio -*.cs diff=csharp +*.cs diff=csharp # Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain +*.doc diff=astextplain +*.DOC diff=astextplain *.docx diff=astextplain *.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 357dfdf6e..441867e9c 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -9,4 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username -custom: [paypal.me/dgibbs64] # Replace with a single custom sponsorship URL +custom: # Replace with a single custom sponsorship URL diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index d3c1adfbb..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -name: Bug report -about: Found a bug? Raise a report. - ---- -Issues raised here are **ONLY** for: -* LinuxGSM bugs. -* Feature suggestions. -* Code contributions. - -Issues raised here are **NOT** for: -* General support. -* Specific game server issues (e.g CS:GO, TF2). -* 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)**. - -***Please use the template below, deleting the above text*** - -## User Story - -As a [user description], I want [desired action] so that [desired outcome]. - -## Basic info - -* **Distro:** [Ubuntu 18.04] -* **Game:** [Garry's Mod] -* **Command:** [Monitor] -* **LinuxGSM version:** [v20.1.3] - -## Further Information - -A clear description of what the bug is and any ideas on how to resolve it. Plus any further context that might be relevant to the issue. - -## To Reproduce - -Steps to reproduce the behaviour: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -## Expected behaviour diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..e9f2d000b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,92 @@ +--- +name: Bug Report +description: File a bug report +title: "[Bug]: " +labels: ["type: bug"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: input + id: user-story + attributes: + label: User story + description: As a [user description], I want [desired action] so that [desired outcome]. + placeholder: As a [user description], I want [desired action] so that [desired outcome]. + validations: + required: true + - type: input + id: game + attributes: + label: Game + description: What game server are you hosting? + placeholder: Valheim + validations: + required: true + - type: dropdown + id: distro + attributes: + label: Linux distro + multiple: true + options: + - Ubuntu 24.04 + - Ubuntu 22.04 + - Ubuntu 20.04 + - Debian 12 + - Debian 11 + - RedHat 9 + - RedHat 8 + - Other + validations: + required: true + - type: dropdown + id: command + attributes: + label: Command + multiple: true + options: + - "command: start" + - "command: stop" + - "command: restart" + - "command: monitor" + - "command: details" + - "command: update" + - "command: validate" + - "command: backup" + - "command: mods-install" + - "command: mods-update" + - "command: mods-remove" + - "command: debug" + - "command: console" + - "command: install" + - "command: auto-update" + - "command: update-lgsm" + - "command: wipe" + - "command: send" + validations: + required: true + - type: textarea + id: further-info + attributes: + label: Further information + description: A clear description of what the bug is, any ideas on how to resolve it and any further context that might be relevant to the issue. + placeholder: Tell us what you see! + validations: + required: true + - type: textarea + id: logs + attributes: + label: Relevant log output + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + render: shell + - type: textarea + id: steps + attributes: + label: Steps to reproduce + description: Steps to reproduce the behaviour. + placeholder: | + 1. Go to '...' + 2. Click on '....' + 3. Scroll down to '....' + 4. See error diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..d2113c6ca --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Ask a question + about: Ask questions and discuss with other users of LinuxGSM. + url: https://github.com/GameServerManagers/LinuxGSM/discussions + - name: Discord Server + about: Join the LinuxGSM Discord community server. Discuss your LinuxGSM setup, get help and advice + url: https://linuxgsm.com/discord diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index dc51fe40e..000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for LinuxGSM. - ---- - -Issues raised here are **ONLY** for: -* LinuxGSM bugs. -* Feature suggestions. -* Code contributions. - -Issues raised here are **NOT** for: -* General support. -* Specific game server issues (e.g CS:GO, TF2). -* 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. - -***Please use the template below, deleting the above text*** - -## User Story - -As a [user description], I want [desired action] so that [desired outcome]. - -## Basic info - -* **Distro:** [Ubuntu 20.04] -* **Game:** [Garry's Mod] -* **Command:** [Monitor] -* **LinuxGSM version:** [v20.1.3] - -## Further Information - -A clear description of what the feature is and any ideas on how to achieve this. - -## Further Reading - -Provide any useful documentation or resources that might help. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 000000000..f1a8ccaf6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,75 @@ +--- +name: Feature Request +description: Suggest a feature +title: "[Feature]: " +labels: ["type: feature"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this feature request! + - type: input + id: user-story + attributes: + label: User story + description: As a [user description], I want [desired action] so that [desired outcome]. + placeholder: As a [user description], I want [desired action] so that [desired outcome]. + validations: + required: true + - type: input + id: game + attributes: + label: Game + description: What game server are you hosting? + placeholder: Valheim + validations: + required: false + - type: dropdown + id: distro + attributes: + label: Linux distro + multiple: true + options: + - Ubuntu 24.04 + - Ubuntu 22.04 + - Ubuntu 20.04 + - Debian 12 + - Debian 11 + - RedHat 9 + - RedHat 8 + - Other + validations: + required: false + - type: dropdown + id: command + attributes: + label: Command + multiple: true + options: + - "command: start" + - "command: stop" + - "command: restart" + - "command: monitor" + - "command: details" + - "command: update" + - "command: validate" + - "command: backup" + - "command: mods-install" + - "command: mods-update" + - "command: mods-remove" + - "command: debug" + - "command: console" + - "command: install" + - "command: auto-update" + - "command: update-lgsm" + - "command: wipe" + - "command: send" + validations: + required: true + - type: textarea + id: further-info + attributes: + label: Further information + description: A clear description of what the feature is and any ideas on how to achieve this. + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/new-server-request.md b/.github/ISSUE_TEMPLATE/new-server-request.md deleted file mode 100644 index ada8638cc..000000000 --- a/.github/ISSUE_TEMPLATE/new-server-request.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -name: New server request -about: Suggest a new game server to be added. - ---- - -## What game server would you like adding? - -[game server] - -## Can you link to any tutorials or guides? - -Provide any useful documentation or resources that might help. - -## Is the server on Steam? - -* [ ] Yes -* [ ] No - -If yes Use SteamDB to get the appid. (https://steamdb.info). - -[appid] - -## Is the server supported on Linux? - -We only support Linux servers and do **not** support Wine. - -* [ ] Yes -* [ ] No diff --git a/.github/ISSUE_TEMPLATE/server_request.yml b/.github/ISSUE_TEMPLATE/server_request.yml new file mode 100644 index 000000000..31dbc6b81 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/server_request.yml @@ -0,0 +1,57 @@ +--- +name: Server Request +description: Suggest a new game server to be added +title: "[Server Request]: " +labels: ["type: game server request"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this game server! + - type: input + id: game-server + attributes: + label: Game server + description: What game server would you like to add? + validations: + required: true + - type: checkboxes + id: on-linux + attributes: + label: Linux support + description: Does this game server have Linux support? (not wine) + options: + - label: "Yes" + validations: + required: true + - type: dropdown + id: on-steam + attributes: + label: Steam + description: Is this game server available on Steam? + options: + - "Yes" + - "No" + validations: + required: true + - type: input + id: steam-id + attributes: + label: Steam appid + description: What is the Steam appid of the game server? Use SteamDB to get the appid. (https://steamdb.info). + placeholder: "892970" + validations: + required: false + - type: textarea + id: guides + attributes: + label: Guides + description: Links to guides on how to install the game server + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com) + options: + - label: I agree to follow this project's Code of Conduct + required: true diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..443cf3bec --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +# 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" diff --git a/.github/issue_label_bot.yaml b/.github/issue_label_bot.yaml deleted file mode 100644 index ee6d724f1..000000000 --- a/.github/issue_label_bot.yaml +++ /dev/null @@ -1,4 +0,0 @@ -label-alias: - bug: 'type: bug' - feature_request: 'type: feature request' - question: 'question' diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 000000000..34ffd66f1 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,162 @@ +"command: backup": + - "/(backup)/i" +"command: console": + - "/(console|tmux)/i" +"command: debug": + - "/(command: debug)/i" +"command: details": + - "/(command: details)/i" +"command: fast-dl": + - "/(fast-dl|fastdl)/i" +"command: install": + - "/(install)/i" +"command: mods": + - "/(command: mods)/i" +"command: monitor": + - "/(command: monitor)/i" +"command: post-details": + - "/(command: post-details)/i" +"command: restart": + - "/(command: restart)/i" +"command: send": + - "/(command: send)/i" +"command: skeleton": + - "/(command: skeleton)/i" +"command: start": + - "/(command: start)/i" +"command: stop": + - "/(command: stop)/i" +"command: update-lgsm": + - "/(update-lgsm)/i" +"command: update": + - "/(command: update)/i" +"command: validate": + - "/(validate)/i" +"command: wipe": + - "/(wipe)/i" + +# Distros +"distro: AlmaLinux": + - "/(Alma)/i" +"distro: Arch Linux": + - "/(Arch Linux)/i" +"distro: CentOS": + - "/(CentOS)/i" +"distro: Debian": + - "/(Debian)/i" +"distro: Fedora": + - "/(Fedora)/i" +"distro: openSUSE": + - "/(openSUSE|suse)/i" +"distro: Rocky Linux": + - "/(Rocky)/i" +"distro: Slackware": + - "/(Slackware)/i" +"distro: Ubuntu": + - "/(Ubuntu)/i" + +# Games +"game: 7 Days to Die": + - "/(7 Days to Die|sdtd)/i" +"game: Ark: Survival Evolved": + - "/(Ark: Survival Evolved|Ark)/i" +"game: ARMA 3": + - "/(ARMA 3|ARMA3)/i" +"game: Assetto Corsa": + - "/(Assetto Corsa)/i" +"game: Avorion": + - "/(Avorion)/i" +"game: Ballistic Overkill": + - "/(Ballistic Overkill)/i" +"game: BATTALION: Legacy": + - "/(BATTALION: Legacy)/i" +"game: Barotrauma": + - "/(Barotrauma)/i" +"game: Counter-Strike: Global Offensive": + - "/(Counter-Strike: Global Offensive|CS:GO|csgo)/i" +"game: Counter-Strike 2": + - "/(Counter-Strike 2|CS2)/i" +"game: Counter-Strike: Source": + - "/(Counter-Strike: Source|CS:S)/i" +"game: Counter-Strike 1.6": + - "/(Counter-Strike 1.6|Counter Strike 1.6|CS 1.6|cs1.6)/i" +"game: Dayz": + - "/(Dayz)/i" +"game: Don't Starve Together": + - "/(Don't Starve Together|Dont Starve Together|DST)/i" +"game: Eco": + - "/(^Eco$)/i" +"game: Factorio": + - "/(Factorio)/i" +"game: Garry's Mod": + - "/(Garry's Mod|Garrys Mod|GMod)/i" +"game: Insurgency: Sandstorm": + - "/(Insurgency: Sandstorm|Insurgency)/i" +"game: Killing Floor 2": + - "/(Killing Floor 2|KF2)/i" +"game: Left 4 Dead 2": + - "/(Left 4 Dead 2|L4D2)/i" +"game: Minecraft": + - "/(Minecraft)((?!bedrock).)*$/i" +"game: Minecraft Bedrock": + - "/(Bedrock)/i" +"game: Mumble": + - "/(Mumble)/i" +"game: Project Zomboid": + - "/(Project Zomboid|PZ)/i" +"game: Quake 3": + - "/(Quake 3|Q3A|q3)/i" +"game: Rising World": + - "/(Rising World)/i" +"game: Satisfactory": + - "/(Satisfactory)/i" +"game: Squad": + - "/(Squad)/i" +"game: Starbound": + - "/(Starbound)/i" +"game: Stationeers": + - "/(Stationeers)/i" +"game: Teamspeak 3": + - "/(Teamspeak 3|ts3)/i" +"game: Rust": + - "/(Rust)/i" +"game: Unturned": + - "/(Unturned)/i" +"game: Unreal Tournament 99": + - "/(Unreal Tournament 99|ut99)/i" +"game: Unreal Tournament 2004": + - "/(Unreal Tournament 2004|ut2k4)/i" +"game: Unreal Tournament 3": + - "/(Unreal Tournament 3|ut3)/i" +"game: Valheim": + - "/(Valheim)/i" + +# Info +"info: alerts": + - "/(alert)/i" +"info: dependency": + - "/(dependency|deps)/i" +"info: docker": + - "/(docker)/i" +"info: docs": + - "/(documentation|^docs$)/i" +"info: email": + - "/(postfix|sendmail|exim|smtp)/i" +"info: query": + - "/(gamedig|gsquery)/i" +"info: steamcmd": + - "/(steamcmd)/i" +"info: systemd": + - "/(systemd)/i" +"info: tmux": + - "/(tmux)/i" +"info: website": + - "/(website)/i" + +# Type +"type: game server request": + - "/(Server Request)/i" +"type: bug": + - "/(bug)/i" +"type: feature request": + - "/(feature)/i" diff --git a/.github/lock.yml b/.github/lock.yml deleted file mode 100644 index dd136ecdc..000000000 --- a/.github/lock.yml +++ /dev/null @@ -1,38 +0,0 @@ -# Configuration for Lock Threads - https://github.com/dessant/lock-threads - -# Number of days of inactivity before a closed issue or pull request is locked -daysUntilLock: 365 - -# Skip issues and pull requests created before a given timestamp. Timestamp must -# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable -skipCreatedBefore: false - -# Issues and pull requests with these labels will be ignored. Set to `[]` to disable -exemptLabels: [] - -# Label to add before locking, such as `outdated`. Set to `false` to disable -lockLabel: false - -# Comment to post before locking. Set to `false` to disable -lockComment: > - This thread has been automatically locked since there has not been - any recent activity after it was closed. Please open a new issue for - related bugs. - -# Assign `resolved` as the reason for locking. Set to `false` to disable -setLockReason: false - -# Limit to only `issues` or `pulls` -# only: issues - -# Optionally, specify configuration settings just for `issues` or `pulls` -# issues: -# exemptLabels: -# - help-wanted -# lockLabel: outdated - -# pulls: -# daysUntilLock: 30 - -# Repository to extend settings from -# _extends: repo \ No newline at end of file diff --git a/.github/no-response.yml b/.github/no-response.yml deleted file mode 100644 index 34cf8d447..000000000 --- a/.github/no-response.yml +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for probot-no-response - https://github.com/probot/no-response - -# Number of days of inactivity before an Issue is closed for lack of response -daysUntilClose: 60 -# Label requiring a response -responseRequiredLabel: "needs more info" -# Comment to post when closing an Issue for lack of response. Set to `false` to disable -closeComment: > - This issue has been automatically closed because there has been no response - to this issue and is now stale. \ No newline at end of file diff --git a/.github/potential-duplicates.yml b/.github/potential-duplicates.yml deleted file mode 100644 index 3ca5a7cb8..000000000 --- a/.github/potential-duplicates.yml +++ /dev/null @@ -1,13 +0,0 @@ -# Label name and color to set, when potential duplicates are detected -issueLabel: "duplicate" -labelColor: 579e01 - -# If similarity is higher than this threshold, issue will be marked as duplicate -threshold: 0.60 - -# Comment to post when potential duplicates are detected -referenceComment: > - Potential duplicates: - {{#issues}} - - [#{{ number }}] {{ title }} ({{ accuracy }}%) - {{/issues}} diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index af1c7faba..4e6d08327 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,29 +6,30 @@ Fixes #[issue] ## Type of change -* [ ] Bug fix (a change which fixes an issue). -* [ ] New feature (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 with 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: https://github.com/GameServerManagers/LinuxGSM-Docs +- Dev docs: https://github.com/GameServerManagers/LinuxGSM-Dev-Docs **Thank you for your Pull Request!** diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index 1387c5e19..000000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,4 +0,0 @@ -template: | - ## Changelog - - $CHANGES \ No newline at end of file diff --git a/.github/topissuebot.yml b/.github/topissuebot.yml deleted file mode 100644 index 06c64ae01..000000000 --- a/.github/topissuebot.yml +++ /dev/null @@ -1,4 +0,0 @@ -# Configuration for top-issue-bot -labelName: ":thumbsup: Top Issue!" -labelColor: "f442c2" -numberOfIssuesToLabel: 5 diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml new file mode 100644 index 000000000..e0b06990f --- /dev/null +++ b/.github/workflows/add-to-project.yml @@ -0,0 +1,18 @@ +name: Add to Project +on: + issues: + types: + - opened + - labeled + +jobs: + add-to-project: + if: github.repository_owner == 'GameServerManagers' + runs-on: ubuntu-latest + steps: + - name: Add to Project + uses: actions/add-to-project@v1.0.2 + with: + project-url: https://github.com/orgs/GameServerManagers/projects/11 + github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} + labeled: "type: game server request" diff --git a/.github/workflows/details-check-generate-matrix.sh b/.github/workflows/details-check-generate-matrix.sh new file mode 100755 index 000000000..bba9e8d5d --- /dev/null +++ b/.github/workflows/details-check-generate-matrix.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +curl "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/lgsm/data/serverlist.csv" | grep -v '^[[:blank:]]*$' > serverlist.csv + +echo -n "{" > "shortnamearray.json" +echo -n "\"include\":[" >> "shortnamearray.json" + +while read -r line; do + shortname=$(echo "$line" | awk -F, '{ print $1 }') + export shortname + servername=$(echo "$line" | awk -F, '{ print $2 }') + export servername + gamename=$(echo "$line" | awk -F, '{ print $3 }') + 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" +done < <(tail -n +2 serverlist.csv) +sed -i '$ s/.$//' "shortnamearray.json" +echo -n "]" >> "shortnamearray.json" +echo -n "}" >> "shortnamearray.json" +rm serverlist.csv diff --git a/.github/workflows/details-check.yml b/.github/workflows/details-check.yml new file mode 100644 index 000000000..748a77991 --- /dev/null +++ b/.github/workflows/details-check.yml @@ -0,0 +1,89 @@ +# This action will check that LinuxGSM is picking up game server config and parameter variables. +name: Details Check +on: + workflow_dispatch: + push: + branches: + - develop + +concurrency: + group: details-check-${{ github.ref_name }} + cancel-in-progress: true + +jobs: + create-matrix: + if: github.repository_owner == 'GameServerManagers' + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Generate matrix with generate-matrix.sh + run: chmod +x .github/workflows/details-check-generate-matrix.sh; .github/workflows/details-check-generate-matrix.sh + + - name: Set Matrix + id: set-matrix + run: | + shortnamearray=$(cat shortnamearray.json) + echo "${shortnamearray}" + echo -n "matrix=${shortnamearray}" >> $GITHUB_OUTPUT + + details-check: + if: github.repository_owner == 'GameServerManagers' + needs: create-matrix + continue-on-error: true + runs-on: ubuntu-latest + + 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 + + - name: Install dependencies + run: sudo apt-get install libxml2-utils jq + + - name: Create serverfiles directory + run: mkdir -p serverfiles + + - name: Grab server + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server + + - name: Enable developer mode + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server developer + + - name: Generate servercfgname + id: sets-servercfgname + run: | + servercfg=$(sed -n "/^\/ { s/.*= *\"\?\([^\"']*\)\"\?/\1/p;q }" lgsm/config-lgsm/${{ matrix.shortname }}server/_default.cfg) + echo "servercfgname=$servercfg" >> "$GITHUB_OUTPUT" + + - name: Download config + run: | + if [ "${{ steps.sets-servercfgname.outputs.servercfgname }}" == "" ]; then + echo "This game server has no config file." + else + curl -f -o config "https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main/${{ matrix.shortname }}/${{ steps.sets-servercfgname.outputs.servercfgname }}" + fi + - name: Display config + run: | + if [ "${{ steps.sets-servercfgname.outputs.servercfgname }}" == "" ]; then + echo "This game server has no config file." + else + cat config + fi + + - name: Display parameters + 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 + + - name: Detect details + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server parse-game-details + + - name: Query Raw + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server query-raw diff --git a/.github/workflows/git-sync.yml b/.github/workflows/git-sync.yml index 9fc886b4e..544ba6892 100644 --- a/.github/workflows/git-sync.yml +++ b/.github/workflows/git-sync.yml @@ -1,27 +1,27 @@ -name: Backup Repo +name: Github to Bitbucket Sync # This action will sync the github repo with a backup bitbucket repo. # This will allow LinuxGSM to use Bitbucket as and alternative download if github fails. on: push: branches: - master - - 'develop' + - develop jobs: - repo-sync: + gitHub-to-bitbucket: + if: github.repository_owner == 'GameServerManagers' runs-on: ubuntu-latest steps: - - name: ssh - uses: webfactory/ssh-agent@v0.2.0 - with: - ssh-private-key: ${{ secrets.BITBUCKET_SECRET }} - ssh_private_key: ${{ secrets.BITBUCKET_SECRET }} + - name: SSH Agent + uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: ${{ secrets.BITBUCKET_SECRET }} - - name: repo-sync - uses: wei/git-sync@v2 - with: - source_repo: "https://github.com/GameServerManagers/LinuxGSM" - source_branch: "refs/heads/*" - destination_repo: "git@bitbucket.org:GameServerManagers/linuxgsm.git" - destination_branch: "refs/heads/*" - ssh_private_key: ${{ secrets.BITBUCKET_SECRET }} + - name: Git Sync + uses: wei/git-sync@v3.0.0 + with: + ssh_private_key: ${{ secrets.BITBUCKET_SECRET }} + source_repo: "https://github.com/GameServerManagers/LinuxGSM" + source_branch: "refs/heads/*" + destination_repo: "git@bitbucket.org:GameServerManagers/linuxgsm.git" + destination_branch: "refs/heads/*" diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 000000000..4a946a861 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,32 @@ +name: Issue Labeler +on: + issues: + types: + - opened + - edited + +permissions: + issues: write + contents: read + +jobs: + issue-labeler: + if: github.repository_owner == 'GameServerManagers' + runs-on: ubuntu-latest + steps: + - name: Issue Labeler + uses: github/issue-labeler@v3.4 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/labeler.yml + enable-versioned-regex: 0 + include-title: 1 + + is-sponsor-label: + if: github.repository_owner == 'GameServerManagers' + runs-on: ubuntu-latest + steps: + - name: Is Sponsor Label + uses: JasonEtco/is-sponsor-label-action@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml new file mode 100644 index 000000000..ce00b840b --- /dev/null +++ b/.github/workflows/lock.yml @@ -0,0 +1,26 @@ +name: Lock Threads +on: + schedule: + - cron: "0 0 * * 1" + +permissions: + issues: write + pull-requests: write + +jobs: + lock: + if: github.repository_owner == 'GameServerManagers' + runs-on: ubuntu-latest + steps: + - name: Lock Threads + uses: dessant/lock-threads@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + issue-comment: > + This issue has been automatically locked since there + has not been any recent activity after it was closed. + Please open a new issue for related bugs. + pr-comment: > + This pull request has been automatically locked since there + has not been any recent activity after it was closed. + Please open a new issue for related bugs. diff --git a/.github/workflows/potential-duplicates.yml b/.github/workflows/potential-duplicates.yml new file mode 100644 index 000000000..ea0ba23fd --- /dev/null +++ b/.github/workflows/potential-duplicates.yml @@ -0,0 +1,23 @@ +name: Potential Duplicates +on: + issues: + types: + - opened +jobs: + potential-duplicates: + if: github.repository_owner == 'GameServerManagers' + runs-on: ubuntu-latest + steps: + - name: Potential Duplicates + uses: wow-actions/potential-duplicates@v1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + filter: "" + exclude: "" + label: potential-duplicate + state: all + threshold: 0.8 + comment: > + Potential duplicates: {{#issues}} + - [#{{ number }}] {{ title }} ({{ accuracy }}%) + {{/issues}} diff --git a/.github/workflows/serverlist-validate-game-icons.sh b/.github/workflows/serverlist-validate-game-icons.sh new file mode 100755 index 000000000..2fdb0ff8f --- /dev/null +++ b/.github/workflows/serverlist-validate-game-icons.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +cd "${datadir}" || exit + +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 + # check if $shortname-icon.png exists + if [ ! -f "gameicons/${shortname}-icon.png" ]; then + echo "ERROR: gameicons/${shortname}-icon.png does not exist" + exitcode=1 + else + echo "OK: gameicons/${shortname}-icon.png exists" + fi +done + +echo "" +echo "Checking if an unexpected gameicon exists" +for gameicon in $(ls -1 gameicons); do + # check if $gameicon is in serverlist.csv + if ! grep -q "${gameicon%-icon.png}" serverlist.csv; then + echo "ERROR: gameicon ${gameicon} is not in serverlist.csv" + exitcode=1 + else + echo "OK: gameicon ${gameicon} is in serverlist.csv" + fi +done + +echo "" +echo "Checking that the number of gameicons matches the number of servers in serverlist.csv" +gameiconcount="$(ls -1 gameicons | 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)" + exitcode=1 +else + echo "OK: gameiconcount ($gameiconcount) matches serverlistcount ($serverlistcount)" +fi + +exit ${exitcode} diff --git a/.github/workflows/serverlist-validate.sh b/.github/workflows/serverlist-validate.sh new file mode 100755 index 000000000..7d931372d --- /dev/null +++ b/.github/workflows/serverlist-validate.sh @@ -0,0 +1,38 @@ +#!/bin/bash +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 +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$')" +# loop though each csv file and make sure the number of lines is the same as the serverlistcount +for csv in $csvlist; do + csvcount="$(wc -l < "${csv}")" + csvcount=$((csvcount - 2)) + if [ "$csvcount" -ne "$serverlistcount" ]; then + echo "ERROR: $csv ($csvcount) does not match serverlist.csv ($serverlistcount)" + exitcode=1 + else + echo "OK: $csv ($csvcount) and serverlist.csv ($serverlistcount) match" + fi +done + +# Compare all game servers listed in serverlist.csv to $shortname-icon.png files in ${datadir}/gameicons +# if the game server is listed in serverlist.csv then it will have a $shortname-icon.png file + +# loop though shortname in serverlist.csv +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 + # check if $shortname-icon.png exists + if [ ! -f "gameicons/${shortname}-icon.png" ]; then + echo "ERROR: gameicons/${shortname}-icon.png does not exist" + exitcode=1 + else + echo "OK: gameicons/${shortname}-icon.png exists" + fi +done + +exit ${exitcode} diff --git a/.github/workflows/serverlist-validate.yml b/.github/workflows/serverlist-validate.yml new file mode 100644 index 000000000..f4a95a039 --- /dev/null +++ b/.github/workflows/serverlist-validate.yml @@ -0,0 +1,18 @@ +name: Server List Validation +on: + workflow_dispatch: + push: + +jobs: + serverlist-validate: + if: github.repository_owner == 'GameServerManagers' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Compare Versions + run: chmod +x .github/workflows/serverlist-validate.sh; .github/workflows/serverlist-validate.sh + + - name: Validate Game Icons + run: chmod +x .github/workflows/serverlist-validate-game-icons.sh; .github/workflows/serverlist-validate-game-icons.sh diff --git a/.github/workflows/trigger-docker-build.yml b/.github/workflows/trigger-docker-build.yml new file mode 100644 index 000000000..ae66542de --- /dev/null +++ b/.github/workflows/trigger-docker-build.yml @@ -0,0 +1,33 @@ +name: Trigger Docker Build +on: + release: + types: + - published + +jobs: + trigger_build_docker-linuxgsm: + if: github.repository_owner == 'GameServerManagers' + name: Trigger Build Docker LinuxGSM + 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: docker-publish.yml + + trigger_build_docker-gameserver: + if: github.repository_owner == 'GameServerManagers' + name: Trigger Build Docker GameServer + needs: trigger_build_docker-linuxgsm + 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: docker-publish.yml diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml new file mode 100644 index 000000000..932e3ea2a --- /dev/null +++ b/.github/workflows/update-check.yml @@ -0,0 +1,51 @@ +name: Update Check +# This action will check that LinuxGSM is picking up game server config and parameter variables. +on: + workflow_dispatch: + push: + branches: + - develop + +concurrency: + group: update-check-${{ github.ref_name }} + cancel-in-progress: true + +jobs: + update-check: + if: github.repository_owner == 'GameServerManagers' + continue-on-error: true + runs-on: ubuntu-latest + + strategy: + matrix: + shortname: [css, fctr, jk2, mc, mcb, mta, pmc, ts3, ut99, vints] + + steps: + - name: Download 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; + + - name: Grab server + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server + + - name: Enable developer mode + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ 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 + + - name: Check Update server + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server check-update + + - name: Update server + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server update + + - name: Force Update server + if: matrix.shortname == 'css' + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server force-update diff --git a/.github/workflows/update-copyright-years-in-license-file.yml b/.github/workflows/update-copyright-years-in-license-file.yml new file mode 100644 index 000000000..3301c9cb7 --- /dev/null +++ b/.github/workflows/update-copyright-years-in-license-file.yml @@ -0,0 +1,25 @@ +name: Update copyright year(s) in license file +on: + workflow_dispatch: + schedule: + - cron: "0 3 1 1 *" # 03:00 AM on January 1 + +jobs: + update-license-year: + if: github.repository_owner == 'GameServerManagers' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + 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/.github/workflows/version-check.sh b/.github/workflows/version-check.sh new file mode 100644 index 000000000..a5f21c5cb --- /dev/null +++ b/.github/workflows/version-check.sh @@ -0,0 +1,15 @@ +#!/bin/bash +version=$(grep "version=" linuxgsm.sh | sed -e 's/version//g' | tr -d '="') +modulesversion=$(grep "modulesversion=" lgsm/modules/core_modules.sh | sed -e 's/modulesversion//g' | tr -d '="') + +if [ "${version}" != "${modulesversion}" ]; then + echo "Error! LinuxGSM version mismatch" + echo "Version: ${version}" + echo "Modules Version: ${modulesversion}" + exit 1 +else + echo "Success! LinuxGSM version match" + echo "Version: ${version}" + echo "Modules Version: ${modulesversion}" + exit +fi diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml new file mode 100644 index 000000000..cfa7615bd --- /dev/null +++ b/.github/workflows/version-check.yml @@ -0,0 +1,17 @@ +name: Version Check +on: + push: + +permissions: + contents: read + +jobs: + version-Check: + if: github.repository_owner == 'GameServerManagers' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Version Check + run: chmod +x .github/workflows/version-check.sh; .github/workflows/version-check.sh diff --git a/.github/write-good.yml b/.github/write-good.yml deleted file mode 100644 index 00eefa99c..000000000 --- a/.github/write-good.yml +++ /dev/null @@ -1,4 +0,0 @@ -# .github/write-good.yml -writeGood: true -alex: true -spellchecker: true diff --git a/.gitignore b/.gitignore index 12218bea3..e5c465ce2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -*.db -.idea +.vscode/settings.json +/node_modules diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..1902f8021 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,3 @@ +{ + "plugins": ["prettier-plugin-sh"] +} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0ea421b0e..000000000 --- a/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -language: node_js -dist: bionic -node_js: - - "stable" -env: - global: - secure: VsS98cwJ5X/Ev3HEm7KEOPftYay+7jNTHepTS7d+gQNHcDR1UYKTmqlQNSIoUC52Ejs1cHq43jOfle4330zDPOYI0v5BMri6/iZKpmMxAw6KWNiUgSkziTP2kHC4NRLwEoU2WQTI3JZQjrBEfsPmD81+yR/eWXV3rph+YcSOxao= - -before_script: - - curl -L "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/shunit2/shunit2-2.1.6.tgz" | tar zx - -install: - - npm install gamedig - -addons: - apt: - packages: - - mailutils - - postfix - - jq - - lib32gcc1 - - lib32stdc++6 - - shellcheck - - libcurl4-openssl-dev - - libdw-dev - - cmake - -jobs: - include: - - stage: "Jobs" - name: "code coverage" - script: bash tests/tests_kcov.sh; kcov --bash-method=DEBUG coverage tests/tests_mcserver.sh - - script: bash tests/tests_mcserver.sh - name: "Minecraft" - - script: bash tests/tests_jc2server.sh - name: "Just Cause 2" - - script: bash tests/tests_fctrserver.sh - name: "Factorio" - - script: bash tests/tests_ts3server.sh - name: "Teamspeak 3" - - script: bash tests/tests_defaultcfg/tests_defaultcfg.sh - name: "_default.cfg checks" -after_success: -- bash <(curl -Ls https://coverage.codacy.com/get.sh) diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000..c7a7dab10 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + "recommendations": [ + "ms-python.python", + "editorconfig.editorconfig", + "yzhang.markdown-all-in-one", + "esbenp.prettier-vscode", + "timonwong.shellcheck", + "redhat.vscode-yaml" + ] +} diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 7fe220357..a69325281 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -2,72 +2,131 @@ ## Our Pledge -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, sex characteristics, gender identity and expression, -level of experience, education, socio-economic status, nationality, personal -appearance, race, religion, or sexual identity and orientation. +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. ## Our Standards -Examples of behavior that contributes to creating a positive environment -include: +Examples of behavior that contributes to a positive environment for our +community include: -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +- 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 by participants include: +Examples of unacceptable behavior include: -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without 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 -## Our Responsibilities +## Enforcement Responsibilities -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. ## Scope -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at me@danielgibbs.co.uk. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. +reported to the community leaders responsible for enforcement at +[INSERT CONTACT METHOD]. +All complaints will be reviewed and investigated promptly and fairly. -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. ## Attribution -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][mozilla coc]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][faq]. Translations are available +at [https://www.contributor-covenant.org/translations][translations]. [homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[mozilla coc]: https://github.com/mozilla/diversity +[faq]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2cadd7e54..7b549c795 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,35 +5,38 @@ The following is a set of guidelines for contributing to LinuxGSM, which are hosted in the [GameServerManagers Organization](https://github.com/gameservermanagers) on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. ## Table of Contents -* [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 Suggestion?](#how-do-i-submit-a--good--feature-suggestion--1) - * [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) - * [Styleguides](#-wine-glass--styleguides) - * [Git Commit Messages](#git-commit-messages) - * [BASH Styleguide](#bash-styleguide) - * [Document Contributions](#-blue-book--document-contributions) - * [Documentation Styleguide](#documentation-styleguide) - * [Issue and Pull Request Labels](#issue-and-pull-request-labels) + +[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) + ## Code of Conduct -This project and everyone participating in it are governed by the [LinuxGSM Code of Conduct](https://github.com/GameServerManagers/linuxgsm/blob/master/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behaviour to [daniel.gibbs@linuxgsm.com](mailto:daniel.gibbs@linuxgsm.com). +This project and everyone participating in it is governed by the [LinuxGSM Code of Conduct](https://github.com/GameServerManagers/linuxgsm/blob/master/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behaviour to [daniel.gibbs@linuxgsm.com](mailto:daniel.gibbs@linuxgsm.com). ## 🎉 Bug/Enhancement Contributions 🐛 @@ -41,25 +44,24 @@ This project and everyone participating in it are 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 🔎. -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/atom/atom/blob/master/CONTRIBUTING.md#how-do-i-submit-a-good-bug-report). Fill out [the required template](https://github.com/atom/.github/blob/master/.github/ISSUE_TEMPLATE/bug_report.md), 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 -* **Check the** [**documentation**](https://docs.linuxgsm.com/%5D(https://docs.linuxgsm.com/))**.** You might be able to find the cause of the problem and fix things yourself. -* **Check that the problem is not related to** [**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. +- **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 @@ -67,35 +69,42 @@ This section guides you through submitting a feature suggestion for LinuxGSM, in #### 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 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 -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 -* **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 instead of opening a new one. +- **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. ### 🎮 Game Server Specific Issues LinuxGSM is a management script that acts as a wrapper around game servers. These game servers are developed by different game developers such as Valve, Epic and Facepunch to name a few. -LinuxGSM has no control over the development and limited knowledge issues directly relating to the game servers themselves. The same also applies for any mods, add-ons, maps etc. +LinuxGSM has no control over the development and limited knowledge of issues directly relating to the game servers themselves. The same also applies to any mods, add-ons, maps etc. -If there is an issue with a specific game server or mod the best action may be to contact the game/mod developers on there support forums. If it is unclear some community members might be able to help. +If there is an issue with a specific game server or mod the best action may be to contact the game/mod developers on their support forums. If it is unclear some community members should be able to help. A [list](https://docs.linuxgsm.com/support/game-server) of known game developer forums is available on the [LinuxGSM docs](https://docs.linuxgsm.com/support/game-server). @@ -105,14 +114,14 @@ 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: -1. Follow all instructions in [the template](https://github.com/GameServerManagers/LinuxGSM/blob/master/.github/pull_request_template.md) +1. Follow all check-list in [the template](https://github.com/GameServerManagers/LinuxGSM/blob/master/.github/pull_request_template.md) 2. Follow the [style guides](#styleguides) 3. After you submit your pull request, verify that all [status checks](https://help.github.com/articles/about-status-checks/) are passing @@ -130,32 +139,35 @@ 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. +Below is an example of the subject line for a pull request: -feat(alerts): add slack support to alerts +**feat(alerts): add slack support to alerts** -fix(csgoserver): remove SteamCMD auth requirement 32-bit workaround +**fix(csgoserver): remove SteamCMD auth requirement 32-bit workaround** ### Testing #### Pull Request Status Checks -When a Pull Request is submitted, a series of status check tests are conducted. These tests will asses 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 -It is recommended that you have a testing environment available to test your code during development. To test your own cod 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 ## GitHub Branch Select # Allows for the use of different function files @@ -183,7 +195,7 @@ As well as code contributions it is possible to contribute by writing and improv ### Documentation Styleguide -LinuxGSM has various documentation available to assist users and developers. LinuxGSM primarily uses [GitBook](http://gitbook.com/) which uses the [Markdown](https://www.markdownguide.org/) document standard. LinuxGSM uses [Codacy](https://app.codacy.com/manual/GameServerManagers/LinuxGSM/dashboard) to analyse any Pull Requests to give you feedback on markup standards. +LinuxGSM has various documentation available to assist [users](https://docs.linuxgsm.com) and [developers](dev-docs.linuxgsm.com). LinuxGSM primarily uses [GitBook](http://gitbook.com/) which uses the [Markdown](https://www.markdownguide.org/) document standard. LinuxGSM uses [Codacy](https://app.codacy.com/manual/GameServerManagers/LinuxGSM/dashboard) to analyse any Pull Requests to give you feedback on markup standards. ## Issue and Pull Request Labels @@ -192,16 +204,17 @@ This section lists the labels we use to help us track and manage issues and pull [GitHub search](https://help.github.com/articles/searching-issues/) makes it easy to use labels for finding groups of issues or pull requests you're interested in. There are several categories of labels available: **command** Labels -Highlights the LinuxGSM command the Issue/PR relates too. +Highlights the LinuxGSM command the Issue/PR relates to. **info** Labels -Labels to help pinpoint what the issue or PR relates too. +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/LICENSE b/LICENSE.md similarity index 94% rename from LICENSE rename to LICENSE.md index 6fa6c795f..c8ab9fa34 100644 --- a/LICENSE +++ b/LICENSE.md @@ -1,6 +1,6 @@ -MIT License +# The MIT License (MIT) -Copyright (c) 2012-2020 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 diff --git a/README.md b/README.md index 2b0f05ec1..4075a4e3d 100644 --- a/README.md +++ b/README.md @@ -1,41 +1,43 @@ -

-
- LinuxGSM -

- -[![LinuxGSM](https://img.shields.io/badge/-LinuxGSM-2b2b2b.svg?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAACsAAABACAYAAACDbo5ZAAAGD0lEQVR4AcWYa2wUVRvHz75c2vJ2disXoUBEVIioRAx%2BMIFA1IRwUS6KCCiIKBrvhEYiiGm5iBgk8QOGEgUUDYTttmVZWFr2UmwURS6iYAoCtmisElSsdHdbkT7%2BTzoNy%2BGc2dm54C%2F5Rdkz85x%2FZ86ZOXOYXYhIg3Phx%2FA4PAcv6f%2Btg5vhHJjP3EcZsgsshufJHH%2FAJbDztQ7aG35J1vgCXn%2BtgvrgEbLHYei9FmE3kDOUuh10OGwjZ7gEh7kZ9gNyllK3gnrg7%2BQs56DHjbCDyB0GuRF2ArnDeDfCziF3mO1G2FfJHRa4EXYpuUOxG2GXkzuUuBH2TXKH5W6ELSV3eM%2BNsOUk5yQcAY8p2uvgSPitor3MjbB1UOQXOFBvHwpbhPYWOExvL4SNUOQ7p4P2JTlzhOPmCu0vCu1PQpE2WOhk2MdJjk9y7HNwP1wEPUJbAcmZ6WTYrYolnifbxZBiibnFySHQCkUaLdY7C0V4%2FT5OhF1JcuIW6%2B0lOcvsBi2Ezao3j8Ov7Quwj52w60jNKIs1R5GatVaDDoEXSU4D7GSxbidYT3IuwjusFK0mNUVMwaZNNbl%2B%2F87hoVCom0HthaQmnG3QB0lNPcxlCvz%2B0GtlZTuorCxYYlA%2FDzbY%2FnrAgV3hCVLzCDMgEAi9wMMi9IIM%2FUwnNXWwi5mwRaSmmmXA798xq%2F3Khp420VeE1LyS6eQeBhttSXgzywCCToIUCOyYZvKLOWWwkdfd6ORVpGYJM0F5efDe9mEQHGty2BWTmhVGO4PNBmOoKzMBxmo%2FhD25dWvljSbD5hjMkb9gT9lJq63Mzi1bKkbjloc7xBWtwiRrDASCVRi%2FRxA8if%2BvrawMTzYI%2FACpeUv2KFFtDcUyTKilCHcis8G1Ga7wHpLzG8wVFs1K7jaeUKHZfIxmkj9%2FM4S9x9RGiMEudo0QbCVu9Xqn5PWEwLUk5%2FP0iaXac53I0kAH9Sau4m54lo%2FdTMfyekLYKQZ7ub34AbMMlmw5irC2VYTN0fuVMYMf8JHxJ7L7YYXAlSRnI2%2F8RtH4siTsDMz%2BZ5yS15OEXUxyDjGD1%2BvEq8MG16CDzY6JepKwT6geYbzxb0XjGMl7vwGSgzZIwo4nOa1M8Yr9Afb%2Fj8L21%2FsXaeaNZ2A6KTiEASph%2F0vF80cn4tokqu79fzfCUk2vfF4%2FFdFGEjGPHvg2yWrsDG%2F4%2BqpZB8jPOiXjWk0y5iXdM3XhKUvxBTA9UvHuvNPh%2Bzb%2BWj10z6nwuHWBbQFMvNCjKnn7qd1jS%2Fnx9VX3b6jC%2BbwOr5eMe3%2B83IcW4%2F3qgT%2BUTbA9srGaiHsn8AKiF6Ld%2FxF%2FOx6eeAJXabvK78MTTornNMd6XJTVR7%2Fj9bBjhFxV%2FMc1kJOAy2AeA%2FgrV4mFVDZFCqm8rEJ6qysCAWqK9iaztRJRbWXa4moFTELOav7jY%2FqAvoXp0Gc9NX7bIZl17%2FZl0rC1wRLeno0NvP%2B0CTcYNnS8wW6CtzNANaxzKqo9hRNOQ8rGo7tmSsMe2zWdt2frqVRcm5s2fofCgawDNHRNxnyfqgsYez4y4ADCjRM9H73hsNWafILTQdaFiSTj%2BQ%2FxA6yH7d%2BCmR8XbYr0a7VTF2N4siSsb5qdos3R6%2FjGxpULFfw7EfORnbrI9TAToX0sD40%2F2ylcGdh2Rdhg%2BSf2gka9jRTqK9%2BGwgHz7RTfVbHxirDhivdthYUvMRX8aYAD9lstvi%2B0aDL2DUZ0eCBUNNVG0IP65FLTWqPdiqdC0koHTVXe7iyNRG23QotBEy1RbTAzQyrmnYUT2rLsoA13JpcB4eVC2daBM1g2JGLekmwf5On7EJfngfZTNnVSce8bFjaTmQdvs%2FXmO%2FJVpoXdx3RSUe9O00Fj3nUdy0RLgRHiHXOPGW1h2uKZ07c9rG%2Bxyefp23pQeyBIEQoavYlakrG8fnrY5yHn2fbxXzAgw7m8bT5zkkSk4C7cpmOK21esB%2FXAQ5DzFfTo43%2BF%2FDzf0eZ4wZ3MDSjMcvD6nIeOahGgia%2FyU3HforTPkWkwnakdn0cI9jqfbPjD%2FuQLJr6644snlgX%2FApOMoyd1R5%2FxAAAAAElFTkSuQmCC)](https://linuxgsm.com) [![Build Status](https://travis-ci.com/GameServerManagers/LinuxGSM.svg?branch=master)](https://travis-ci.com/GameServerManagers/LinuxGSM) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/3e98be27840043a090c3ab6e35db44b0)](https://app.codacy.com/app/GameServerManagers/LinuxGSM?utm_source=github.com&utm_medium=referral&utm_content=GameServerManagers/LinuxGSM&utm_campaign=Badge_Grade_Dashboard) [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/9ef77095e98a43618ddd57381f86b4be)](https://www.codacy.com/manual/GameServerManagers/LinuxGSM?utm_source=github.com&utm_medium=referral&utm_content=GameServerManagers/LinuxGSM&utm_campaign=Badge_Coverage) [![Backup Repo](https://github.com/GameServerManagers/LinuxGSM/workflows/Backup%20Repo/badge.svg)](https://bitbucket.org/GameServerManagers/linuxgsm) [![Discord](https://discordapp.com/api/guilds/127498813903601664/widget.png?style=shield)](https://linuxgsm.com/discord) [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/GameServerManagers/LinuxGSM/blob/master/LICENSE) [![made-with-bash](https://img.shields.io/badge/-Made%20with%20Bash-1f425f.svg?logo=image%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw%2FeHBhY2tldCBiZWdpbj0i77u%2FIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8%2BIDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkE3MDg2QTAyQUZCMzExRTVBMkQxRDMzMkJDMUQ4RDk3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkE3MDg2QTAzQUZCMzExRTVBMkQxRDMzMkJDMUQ4RDk3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTcwODZBMDBBRkIzMTFFNUEyRDFEMzMyQkMxRDhEOTciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTcwODZBMDFBRkIzMTFFNUEyRDFEMzMyQkMxRDhEOTciLz4gPC9yZGY6RGVzY3JpcHRpb24%2BIDwvcmRmOlJERj4gPC94OnhtcG1ldGE%2BIDw%2FeHBhY2tldCBlbmQ9InIiPz6lm45hAAADkklEQVR42qyVa0yTVxzGn7d9Wy03MS2ii8s%2BeokYNQSVhCzOjXZOFNF4jx%2BMRmPUMEUEqVG36jo2thizLSQSMd4N8ZoQ8RKjJtooaCpK6ZoCtRXKpRempbTv5ey83bhkAUphz8fznvP8znn%2B%2F3NeEEJgNBoRRSmz0ub%2FfuxEacBg%2FDmYtiCjgo5NG2mBXq%2BH5I1ogMRk9Zbd%2BQU2e1ML6VPLOyf5tvBQ8yT1lG10imxsABm7SLs898GTpyYynEzP60hO3trHDKvMigUwdeaceacqzp7nOI4n0SSIIjl36ao4Z356OV07fSQAk6xJ3XGg%2BLCr1d1OYlVHp4eUHPnerU79ZA%2F1kuv1JQMAg%2BE4O2P23EumF3VkvHprsZKMzKwbRUXFEyTvSIEmTVbrysp%2BWr8wfQHGK6WChVa3bKUmdWou%2BjpArdGkzZ41c1zG%2Fu5uGH4swzd561F%2BuhIT4%2BLnSuPsv9%2BJKIpjNr9dXYOyk7%2FBZrcjIT4eCnoKgedJP4BEqhG77E3NKP31FO7cfQA5K0dSYuLgz2TwCWJSOBzG6crzKK%2BohNfni%2Bx6OMUMMNe%2Fgf7ocbw0v0acKg6J8Ql0q%2BT%2FAXR5PNi5dz9c71upuQqCKFAD%2BYhrZLEAmpodaHO3Qy6TI3NhBpbrshGtOWKOSMYwYGQM8nJzoFJNxP2HjyIQho4PewK6hBktoDcUwtIln4PjOWzflQ%2Be5yl0yCCYgYikTclGlxadio%2BBQCSiW1UXoVGrKYwH4RgMrjU1HAB4vR6LzWYfFUCKxfS8Ftk5qxHoCUQAUkRJaSEokkV6Y%2F%2BJUOC4hn6A39NVXVBYeNP8piH6HeA4fPbpdBQV5KOx0QaL1YppX3Jgk0TwH2Vg6S3u%2BdB91%2B%2FpuNYPYFl5uP5V7ZqvsrX7jxqMXR6ff3gCQSTzFI0a1TX3wIs8ul%2Bq4HuWAAiM39vhOuR1O1fQ2gT%2F26Z8Z5vrl2OHi9OXZn995nLV9aFfS6UC9JeJPfuK0NBohWpCHMSAAsFe74WWP%2BvT25wtP9Bpob6uGqqyDnOtaeumjRu%2ByFu36VntK%2FPA5umTJeUtPWZSU9BCgud661odVp3DZtkc7AnYR33RRC708PrVi1larW7XwZIjLnd7R6SgSqWSNjU1B3F72pz5TZbXmX5vV81Yb7Lg7XT%2FUXriu8XLVqw6c6XqWnBKiiYU%2BMt3wWF7u7i91XlSEITwSAZ%2FCzAAHsJVbwXYFFEAAAAASUVORK5CYII%3D)](https://www.gnu.org/software/bash/) +

+ 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. ## Hassle-Free Dedicated Game Servers -Traditionally game servers are not easy to manage yourself. Admins often have to spend hours messing around trying to get their server working. LinuxGSM is a command-line tool designed to be as simple as possible, allowing admins to spend less time on management and more time gaming. +Traditionally game servers are not easy to manage yourself. Admins often have to spend hours messing around trying to get their servers working. LinuxGSM is a command-line tool designed to be as simple as possible, allowing admins to spend less time on management and more time gaming. ## Main features 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. ## :wrench: Requirements -Each game server has its own specific dependency requirements. Visit a specific game server installation page on the [LinuxGSM](https://linuxgsm.com) website to check dependency requirements for the game server you want to install. +Each game server has specific dependency requirements. Visit a specific game server installation page on the [LinuxGSM](https://linuxgsm.com) website to check dependency requirements for the game server you want to install. ## :blue_book: Documentation @@ -43,12 +45,12 @@ Documentation is found at [linuxgsm.com](https://linuxgsm.com) and [docs.linuxgs ## :question: Support -There are a various ways to get support, check out the [support](https://linuxgsm.com/support/) page to the right support. +There are various ways to get support, check out the [support](https://linuxgsm.com/support/) page for the right support. -## :heart: Donate +## :heart: Sponsor -If you would like to [donate](https://linuxgsm.com/donate) to the project there are several ways you can, via [GitHub Sponsors](https://github.com/sponsors/dgibbs64), [Patreon](https://www.patreon.com/dgibbs) and [PayPal](https://www.paypal.me/dgibbs64). I would like to thank everyone who has previously sent a donation. Since 2012 LinuxGSM has been steadily growing with new servers, features and improvements added regularly. +If you would like to [sponsor](https://linuxgsm.com/sponsor) to the project there are several ways you can, via [GitHub Sponsors](https://github.com/sponsors/dgibbs64) and [PayPal](https://www.paypal.me/dgibbs64). I would like to thank everyone who sponsors me. Since 2012 LinuxGSM has been steadily growing with new servers, features, and improvements added regularly. -## Contributors +## 🧙‍♂️ Contributors -A big thank you goes to all the wonderful people who contribute ideas, code, docs and support to this project. +A big thank you goes to all the wonderful people who contribute ideas, code, docs, and support to this project. diff --git a/lgsm/config-default/config-lgsm/acserver/_default.cfg b/lgsm/config-default/config-lgsm/acserver/_default.cfg index 7bc9de9d1..154f38c7b 100644 --- a/lgsm/config-default/config-lgsm/acserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/acserver/_default.cfg @@ -12,12 +12,8 @@ steamuser="username" steampass='password' -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters - -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-c ${servercfgfullpath}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-c ${servercfgfullpath}" #### LinuxGSM Settings #### @@ -35,8 +31,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -47,18 +44,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -67,18 +62,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -108,8 +110,12 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="302550" +steamcmdforcewindows="yes" # 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 @@ -122,16 +128,21 @@ branch="" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="5" -querytype="" +querytype="assettocorsa" + +## Console type +consoleverbose="yes" +consoleinteract="no" ## Game Server Details # Do not edit @@ -155,7 +166,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -167,3 +178,7 @@ 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/config-default/config-lgsm/ahl2server/_default.cfg b/lgsm/config-default/config-lgsm/ahl2server/_default.cfg index c41d0c8f9..a98c90701 100644 --- a/lgsm/config-default/config-lgsm/ahl2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ahl2server/_default.cfg @@ -12,7 +12,7 @@ steamuser="username" steampass='password' -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -20,10 +20,8 @@ sourcetvport="27020" defaultmap="act_airport" maxplayers="20" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game ahl2 -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game ahl2 -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -41,8 +39,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -53,18 +52,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -73,18 +70,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -111,6 +115,16 @@ ansi="on" ## Message Display Time | https://docs.linuxgsm.com/features/message-display-time sleeptime="0.5" +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="985050" +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 @@ -122,24 +136,21 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" -## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd -# Server appid -appid="985050" -# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch -branch="" -# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server -steammaster="true" +## Console type +consoleverbose="yes" +consoleinteract="yes" ## Game Server Details # Do not edit @@ -163,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -175,3 +186,7 @@ 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/config-default/config-lgsm/ahlserver/_default.cfg b/lgsm/config-default/config-lgsm/ahlserver/_default.cfg index 69fc33e0c..04cc2e6f9 100644 --- a/lgsm/config-default/config-lgsm/ahlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ahlserver/_default.cfg @@ -8,17 +8,15 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" defaultmap="ahl_hydro" maxplayers="16" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game action -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers} " -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game action -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers} " #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,9 +113,11 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="90" +steamcmdforcewindows="no" appidmod="cstrike" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,20 +132,25 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="9" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Action half-life" +gamename="Action Half-Life" engine="goldsrc" glibc="2.3.4" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/arkserver/_default.cfg b/lgsm/config-default/config-lgsm/arkserver/_default.cfg index a657d6273..8680c1bad 100644 --- a/lgsm/config-default/config-lgsm/arkserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/arkserver/_default.cfg @@ -8,19 +8,17 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="7777" queryport="27015" -rconport="27020" -# Default Map: TheIsland, Ragnarok, CrystalIsles, Aberration_P, ScorchedEarth_P +# Default Map: TheIsland, Ragnarok, CrystalIsles, Aberration_P, ScorchedEarth_P, TheCenter, Extinction, Valguero_P, Genesis, Gen2 defaultmap="TheIsland" -maxplayers="70" +altsavedirectoryname="${defaultmap}" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="\"${defaultmap}?AltSaveDirectoryName=${defaultmap}?listen?MultiHome=${ip}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port} -automanagedmods\"" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +## Game Server Docs | https://ark.wiki.gg/wiki/Server_configuration +startparameters="${defaultmap}?AltSaveDirectoryName=${altsavedirectoryname} -MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -AutoManagedMods -Crossplay -PublicIPForEpic=${publicip}" #### LinuxGSM Settings #### @@ -38,8 +36,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -50,18 +49,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -70,18 +67,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -111,8 +115,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="376030" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -127,22 +133,27 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" +## Console type +consoleverbose="no" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="ARK: Survival Evolved" engine="unreal4" -glibc="2.15" +glibc="2.17" #### Directories #### # Edit with care @@ -160,7 +171,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -172,3 +183,7 @@ 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/config-default/config-lgsm/arma3server/_default.cfg b/lgsm/config-default/config-lgsm/arma3server/_default.cfg index 628634140..b0918ef3c 100644 --- a/lgsm/config-default/config-lgsm/arma3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/arma3server/_default.cfg @@ -12,7 +12,7 @@ steamuser="username" steampass='password' -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="2302" @@ -31,10 +31,8 @@ servermods="" # Leave empty for default bepath="" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-ip=${ip} -port=${port} -cfg=${networkcfgfullpath} -config=${servercfgfullpath} -mod=${mods} -servermod=${servermods} -bepath=${bepath} -autoinit -loadmissiontomemory" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-ip=${ip} -port=${port} -cfg=${networkcfgfullpath} -config=${servercfgfullpath} -mod=${mods} -servermod=${servermods} -bepath=${bepath} -autoinit -loadmissiontomemory" #### LinuxGSM Settings #### @@ -52,8 +50,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -64,18 +63,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -84,18 +81,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -125,8 +129,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="233780" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -141,22 +147,27 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="ARMA 3" engine="realvirtuality" -glibc="2.13" +glibc="2.27" #### Directories #### # Edit with care @@ -164,7 +175,7 @@ glibc="2.13" ## Game Server Directories systemdir="${serverfiles}" executabledir="${serverfiles}" -executable="./arma3server" +executable="./arma3server_x64" servercfgdir="${systemdir}/cfg" servercfg="${selfname}.server.cfg" servercfgdefault="server.cfg" @@ -178,7 +189,7 @@ networkcfgfullpath="${networkcfgdir}/${networkcfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" lgsmlog="${lgsmlogdir}/${selfname}-script.log" @@ -189,3 +200,7 @@ 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/config-default/config-lgsm/armarserver/_default.cfg b/lgsm/config-default/config-lgsm/armarserver/_default.cfg new file mode 100644 index 000000000..61103d332 --- /dev/null +++ b/lgsm/config-default/config-lgsm/armarserver/_default.cfg @@ -0,0 +1,187 @@ +################################## +######## 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 #### + +# https://community.bistudio.com/wiki/Arma_Reforger:Server_Hosting +# MaxFPS to limit the used Server resouces +maxfps="60" + +# Profile Name +serverprofile="server" +serverprofilefullpath="${serverfiles}/profiles/${serverprofile}" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-config ${servercfgfullpath} -profile ${serverprofilefullpath} -maxFPS ${maxfps}" + +#### 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="5" + +## 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="1874900" +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="2" + +## 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="no" + +## Game Server Details +# Do not edit +gamename="Arma Reforger" +engine="enfusion" +glibc="2.27" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./ArmaReforgerServer" +servercfgdir="${systemdir}" +servercfg="${selfname}_config.json" +servercfgdefault="server.json" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +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/config-default/config-lgsm/atsserver/_default.cfg b/lgsm/config-default/config-lgsm/atsserver/_default.cfg new file mode 100644 index 000000000..f6d165098 --- /dev/null +++ b/lgsm/config-default/config-lgsm/atsserver/_default.cfg @@ -0,0 +1,179 @@ +################################## +######## 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 #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-nosingle" + +#### 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 +appid="2239530" +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="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="4" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="American Truck Simulator" +engine="prism3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}/bin/linux_x64" +executable="./amtrucks_server" +servercfgdir="${HOME}/.local/share/American Truck Simulator" +servercfg="server_config.sii" +servercfgdefault="server_config.sii" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +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/config-default/config-lgsm/avserver/_default.cfg b/lgsm/config-default/config-lgsm/avserver/_default.cfg index f4f430e16..7b225de1f 100644 --- a/lgsm/config-default/config-lgsm/avserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/avserver/_default.cfg @@ -7,18 +7,9 @@ # [instance].cfg - applies settings to a specific instance. #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters -port="27000" -# https://steamidfinder.com -adminsteamid="" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -if [ ! -z "${adminsteamid}" ]; then - admincmd="--admin ${adminsteamid}" -fi -parms="--galaxy-name ${selfname} --ip ${ip} --datapath ${avdatapath} ${admincmd}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="--galaxy-name ${selfname} --ip ${ip} --datapath ${avdatapath}" #### LinuxGSM Settings #### @@ -27,6 +18,7 @@ parms="--galaxy-name ${selfname} --ip ${ip} --datapath ${avdatapath} ${admincmd} # https://docs.linuxgsm.com/configuration/linuxgsm-stats # (on|off) stats="off" + ## Notification Alerts # (on|off) @@ -35,8 +27,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -47,18 +40,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -67,18 +58,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -104,11 +102,14 @@ ansi="on" ## Message Display Time | https://docs.linuxgsm.com/features/message-display-time sleeptime="0.5" + ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="565060" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -123,17 +124,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="10" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp -querymode="5" +querymode="1" querytype="" +## Console type +consoleverbose="yes" +consoleinteract="yes" + ## Game Server Details # Do not edit gamename="Avorion" @@ -147,8 +153,8 @@ glibc="2.15" avdatapath="${serverfiles}/galaxy" avgalaxypath="${avdatapath}/${selfname}" systemdir="${serverfiles}" -executabledir="${systemdir}" -executable="./server.sh" +executabledir="${systemdir}/bin" +executable="./bin/AvorionServer" servercfgdir="${avgalaxypath}" servercfg="server.ini" servercfgdefault="server.ini" @@ -158,7 +164,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/ServerLogs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -170,3 +176,7 @@ 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/config-default/config-lgsm/bb2server/_default.cfg b/lgsm/config-default/config-lgsm/bb2server/_default.cfg index e361cb9dc..b9250cc5f 100644 --- a/lgsm/config-default/config-lgsm/bb2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/bb2server/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -21,10 +21,8 @@ maxplayers="20" # More info: https://docs.linuxgsm.com/steamcmd/gslt gslt="" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game brainbread2 -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game brainbread2 -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -42,8 +40,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -54,18 +53,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -74,18 +71,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -115,8 +119,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="475370" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -131,17 +137,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="BrainBread 2" @@ -164,7 +175,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -176,3 +187,7 @@ 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/config-default/config-lgsm/bbserver/_default.cfg b/lgsm/config-default/config-lgsm/bbserver/_default.cfg index 3fdb866c3..99262d8e3 100644 --- a/lgsm/config-default/config-lgsm/bbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bbserver/_default.cfg @@ -8,17 +8,15 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" defaultmap="bb_chp4_slaywatch" maxplayers="16" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game brainbread -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game brainbread -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,9 +113,11 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="90" +steamcmdforcewindows="no" appidmod="cstrike" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="9" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="BrainBread" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/bdserver/_default.cfg b/lgsm/config-default/config-lgsm/bdserver/_default.cfg index ec408753e..3c1769fb3 100644 --- a/lgsm/config-default/config-lgsm/bdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bdserver/_default.cfg @@ -8,17 +8,15 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" defaultmap="pve_tomb" maxplayers="3" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game bdef -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game bdef -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,8 +113,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="817300" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -125,17 +131,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="9" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Base Defense" @@ -158,7 +169,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -170,3 +181,7 @@ 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/config-default/config-lgsm/bf1942server/_default.cfg b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg index ebb977a92..30e2f957a 100644 --- a/lgsm/config-default/config-lgsm/bf1942server/_default.cfg +++ b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg @@ -8,10 +8,8 @@ #### Game Server Settings #### -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="+hostServer 1 +dedicated 1" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+hostServer 1 +dedicated 1" #### LinuxGSM Settings #### @@ -29,8 +27,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -41,18 +40,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -61,18 +58,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -110,16 +114,21 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" -querytype="protocol-valve" +querytype="protocol-gamespy1" + +## Console type +consoleverbose="no" +consoleinteract="no" ## Game Server Details # Do not edit @@ -143,7 +152,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -155,3 +164,7 @@ 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/config-default/config-lgsm/mumbleserver/_default.cfg b/lgsm/config-default/config-lgsm/bfvserver/_default.cfg similarity index 70% rename from lgsm/config-default/config-lgsm/mumbleserver/_default.cfg rename to lgsm/config-default/config-lgsm/bfvserver/_default.cfg index 6afe760ae..53aa36054 100644 --- a/lgsm/config-default/config-lgsm/mumbleserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bfvserver/_default.cfg @@ -7,12 +7,9 @@ # [instance].cfg - applies settings to a specific instance. #### Game Server Settings #### -# Use .ini config file for Mumble (Murmur) server. -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-fg -ini ${servercfgfullpath}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+statusMonitor 1" #### LinuxGSM Settings #### @@ -30,8 +27,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -42,18 +40,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -62,18 +58,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -111,41 +114,46 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion -stopmode="2" +# 11: end +stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="mumbleping" +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="yes" ## Game Server Details # Do not edit -gamename="Mumble" -engine="null" -glibc="null" +gamename="Battlefield: Vietnam" +engine="refractor" +glibc="2.2.4" #### Directories #### # Edit with care ## Game Server Directories systemdir="${serverfiles}" -executabledir="${serverfiles}" -executable="./murmur.x86" -servercfgdir="${systemdir}" -servercfg="${selfname}.ini" -servercfgdefault="murmur.ini" +executabledir="${systemdir}" +executable="./start.sh" +servercfgdir="${systemdir}/mods/bfvietnam/settings" +servercfg="serversettings.con" +servercfgdefault="serversettings.con" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" -#gamelogdir="" # No server logs available +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${serverfiles}/mods/bfvietnam/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" lgsmlog="${lgsmlogdir}/${selfname}-script.log" @@ -156,3 +164,7 @@ 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/config-default/config-lgsm/bmdmserver/_default.cfg b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg index 61d4c3e4c..e353d57b0 100644 --- a/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -21,10 +21,8 @@ maxplayers="16" # More info: https://docs.linuxgsm.com/steamcmd/gslt gslt="" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game bms -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game bms -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -42,8 +40,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -54,18 +53,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -74,18 +71,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -115,8 +119,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="346680" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -131,17 +137,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Black Mesa: Deathmatch" @@ -164,7 +175,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -176,3 +187,7 @@ 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/config-default/config-lgsm/boserver/_default.cfg b/lgsm/config-default/config-lgsm/boserver/_default.cfg index 698667c10..ae7912ab6 100644 --- a/lgsm/config-default/config-lgsm/boserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/boserver/_default.cfg @@ -12,12 +12,9 @@ # GSLT can be used for running a public server. # More info: https://docs.linuxgsm.com/steamcmd/gslt gslt="" -ip="" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-batchmode -nographics -dedicated -configfile=${servercfgfullpath}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-batchmode -nographics -dedicated -configfile=${servercfgfullpath}" #### LinuxGSM Settings #### @@ -35,8 +32,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -47,18 +45,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -67,18 +63,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -108,8 +111,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="416880" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -124,17 +129,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Ballistic Overkill" @@ -147,7 +157,7 @@ glibc="2.15" ## Game Server Directories systemdir="${serverfiles}" executabledir="${serverfiles}" -executable="./BODS.x86" +executable="./BODS.x86_64" servercfgdir="${systemdir}" servercfg="${selfname}.txt" servercfgdefault="config.txt" @@ -157,7 +167,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -169,3 +179,7 @@ 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/config-default/config-lgsm/bsserver/_default.cfg b/lgsm/config-default/config-lgsm/bsserver/_default.cfg index 69094f8ef..d81cde16d 100644 --- a/lgsm/config-default/config-lgsm/bsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bsserver/_default.cfg @@ -12,7 +12,7 @@ steamuser="username" steampass='password' -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -25,10 +25,8 @@ maxplayers="16" # More info: https://docs.linuxgsm.com/steamcmd/gslt gslt="" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game "${serverfiles}/berimbau" -autoupdate -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game "${serverfiles}/berimbau" -autoupdate -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -46,8 +44,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -58,18 +57,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -78,18 +75,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -119,8 +123,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="228780" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -135,17 +141,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Blade Symphony" @@ -168,7 +179,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -180,3 +191,7 @@ 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/config-default/config-lgsm/bt1944server/_default.cfg b/lgsm/config-default/config-lgsm/btlserver/_default.cfg similarity index 73% rename from lgsm/config-default/config-lgsm/bt1944server/_default.cfg rename to lgsm/config-default/config-lgsm/btlserver/_default.cfg index d90b94523..28e8b95e3 100644 --- a/lgsm/config-default/config-lgsm/bt1944server/_default.cfg +++ b/lgsm/config-default/config-lgsm/btlserver/_default.cfg @@ -8,15 +8,13 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="7777" queryport="7780" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="/Game/Maps/Final_Maps/Derailed?Game=/Script/ShooterGame.WartideGameMode?listen -log -broadcastip=\"${extip}\" -PORT=${port} -QueryPort=${queryport} -defgameini=\"${servercfgfullpath}\"" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-Port=${port} -QueryPort=${queryport} -BroadcastIp=${publicip} -log" #### LinuxGSM Settings #### @@ -34,8 +32,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -46,18 +45,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -66,18 +63,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -107,8 +111,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="805140" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -123,20 +129,25 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit -gamename="Battalion 1944" +gamename="BATTALION: Legacy" engine="unreal4" glibc="2.17" @@ -144,18 +155,19 @@ glibc="2.17" # Edit with care ## Game Server Directories -systemdir="${serverfiles}/Linux/Battalion" +systemdir="${serverfiles}/Battalion" executabledir="${systemdir}/Binaries/Linux" -executable="./BattalionServer" +executable="./BattalionServer-Linux-Shipping" servercfgdir="${systemdir}/Saved/Config/LinuxServer" -servercfg="${selfname}.ini" -servercfgdefault="DefaultGame.ini" +servercfg="Game.ini" +servercfgdefault="Game.ini" servercfgfullpath="${servercfgdir}/${servercfg}" + ## Backup Directory backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -167,3 +179,7 @@ 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/config-default/config-lgsm/btserver/_default.cfg b/lgsm/config-default/config-lgsm/btserver/_default.cfg index 416e77c09..71c02c3fc 100644 --- a/lgsm/config-default/config-lgsm/btserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/btserver/_default.cfg @@ -8,10 +8,8 @@ #### Game Server Settings #### -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="" #### LinuxGSM Settings #### @@ -29,8 +27,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -41,18 +40,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -61,18 +58,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -102,8 +106,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="1026340" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -118,16 +124,21 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="7" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="protocol-valve" +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="yes" ## Game Server Details # Do not edit @@ -151,7 +162,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/ServerLogs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -163,3 +174,7 @@ 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/config-default/config-lgsm/ccserver/_default.cfg b/lgsm/config-default/config-lgsm/ccserver/_default.cfg index e9f0a70dd..66847b410 100644 --- a/lgsm/config-default/config-lgsm/ccserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ccserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -16,10 +16,8 @@ sourcetvport="27020" defaultmap="cbe_bunker" maxplayers="6" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game cure -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game cure -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -37,8 +35,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -49,18 +48,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -69,18 +66,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -110,8 +114,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="383410" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -126,17 +132,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Codename CURE" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/ckserver/_default.cfg b/lgsm/config-default/config-lgsm/ckserver/_default.cfg new file mode 100644 index 000000000..f54d7cc7f --- /dev/null +++ b/lgsm/config-default/config-lgsm/ckserver/_default.cfg @@ -0,0 +1,187 @@ +################################## +######## 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="1234" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-batchmode -ip ${ip} -port ${port} -datapath ${servercfgdir} -logfile ${gamelog}" + +#### 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 +appid="1963720" +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="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="no" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Core Keeper" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +preexecutable="xvfb-run" +executable="./CoreKeeperServer" +servercfgdir="${systemdir}/gamedata/${selfname}" +servercfg="ServerConfig.json" +servercfgdefault="ServerConfig.json" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${serverfiles}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" +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/config-default/config-lgsm/cmwserver/_default.cfg b/lgsm/config-default/config-lgsm/cmwserver/_default.cfg index 155ef0c17..776b06a1d 100644 --- a/lgsm/config-default/config-lgsm/cmwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/cmwserver/_default.cfg @@ -8,19 +8,14 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="7777" queryport="7779" defaultmap="AOCTD-Frigid_p" - -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ - -parms="${defaultmap}?steamsockets -multihome=${ip} -Port=${port} -QueryPort=${queryport} -seekfreeloadingserver -configsubdir=${gamelogdir} -log=${gamelog}" - -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="${defaultmap}?steamsockets -multihome=${ip} -Port=${port} -QueryPort=${queryport} -seekfreeloadingserver -configsubdir=${selfname} -log=${gamelog}" #### LinuxGSM Settings #### @@ -38,8 +33,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -50,18 +46,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -70,18 +64,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -111,8 +112,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="220070" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -127,17 +130,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Chivalry: Medieval Warfare" @@ -146,6 +154,7 @@ glibc="2.15" #### Directories #### # Edit with care + ## Game Server Directories systemdir="${serverfiles}" executabledir="${systemdir}/Binaries/Linux" @@ -159,7 +168,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -173,3 +182,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/cod2server/_default.cfg b/lgsm/config-default/config-lgsm/cod2server/_default.cfg index a686ea45f..9665a9ba8 100644 --- a/lgsm/config-default/config-lgsm/cod2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cod2server/_default.cfg @@ -8,16 +8,14 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="28960" defaultmap="mp_leningrad" maxplayers="20" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +exec ${servercfg} +map ${defaultmap}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +map ${defaultmap} +exec ${servercfg}" #### LinuxGSM Settings #### @@ -35,8 +33,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -47,18 +46,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -67,18 +64,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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="" ## Backup | https://docs.linuxgsm.com/commands/backup @@ -113,17 +117,22 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-quake3" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Call of Duty 2" @@ -146,7 +155,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -158,3 +167,7 @@ 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/config-default/config-lgsm/cod4server/_default.cfg b/lgsm/config-default/config-lgsm/cod4server/_default.cfg index 027c52509..f9787c352 100644 --- a/lgsm/config-default/config-lgsm/cod4server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cod4server/_default.cfg @@ -8,16 +8,14 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="28960" defaultmap="mp_crossfire" maxplayers="32" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set fs_homepath ${serverfiles} +set sv_authorizemode "-1" +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +exec ${servercfg} +map ${defaultmap}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set fs_homepath ${serverfiles} +set sv_authorizemode "-1" +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +map ${defaultmap} +exec ${servercfg}" #### LinuxGSM Settings #### @@ -35,8 +33,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -47,18 +46,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -67,18 +64,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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="" ## Backup | https://docs.linuxgsm.com/commands/backup @@ -113,17 +117,22 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-quake3" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Call of Duty 4" @@ -146,7 +155,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -158,3 +167,7 @@ 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/config-default/config-lgsm/codserver/_default.cfg b/lgsm/config-default/config-lgsm/codserver/_default.cfg index 74e186466..8f1476ad3 100644 --- a/lgsm/config-default/config-lgsm/codserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/codserver/_default.cfg @@ -8,16 +8,14 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="28960" defaultmap="mp_neuville" maxplayers="20" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +exec ${servercfg} +map ${defaultmap}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +map ${defaultmap} +exec ${servercfg}" #### LinuxGSM Settings #### @@ -35,8 +33,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -47,18 +46,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -67,18 +64,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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="" ## Backup | https://docs.linuxgsm.com/commands/backup @@ -113,17 +117,22 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-quake3" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Call of Duty" @@ -146,7 +155,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -158,3 +167,7 @@ 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/config-default/config-lgsm/coduoserver/_default.cfg b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg index b4e16cfff..c405966d4 100644 --- a/lgsm/config-default/config-lgsm/coduoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg @@ -8,16 +8,14 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="28960" defaultmap="mp_cassino" maxplayers="20" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +exec ${servercfg} +map ${defaultmap}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +map ${defaultmap} +exec ${servercfg}" #### LinuxGSM Settings #### @@ -35,8 +33,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -47,18 +46,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -67,18 +64,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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="" ## Backup | https://docs.linuxgsm.com/commands/backup @@ -113,17 +117,22 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-quake3" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Call of Duty: United Offensive" @@ -146,7 +155,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -158,3 +167,7 @@ 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/config-default/config-lgsm/codwawserver/_default.cfg b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg index aeecf8f7b..ca0f002d3 100644 --- a/lgsm/config-default/config-lgsm/codwawserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg @@ -8,16 +8,14 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="28960" defaultmap="mp_castle" maxplayers="20" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +exec ${servercfg} +map ${defaultmap}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +map ${defaultmap} +exec ${servercfg}" #### LinuxGSM Settings #### @@ -35,8 +33,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -47,18 +46,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -67,18 +64,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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="" ## Backup | https://docs.linuxgsm.com/commands/backup @@ -113,17 +117,22 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-quake3" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Call of Duty: World at War" @@ -146,7 +155,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -158,3 +167,7 @@ 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/config-default/config-lgsm/colserver/_default.cfg b/lgsm/config-default/config-lgsm/colserver/_default.cfg new file mode 100644 index 000000000..cd94e9b37 --- /dev/null +++ b/lgsm/config-default/config-lgsm/colserver/_default.cfg @@ -0,0 +1,183 @@ +################################## +######## 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 #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +## https://colonysurvival.gamepedia.com/Dedicated_Server#Installation_.28Linux.29 +startparameters="-batchmode -nographics +server.config ${servercfgfullpath}" + +#### 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 +appid="748090" +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="2" + +## 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="no" + +## Game Server Details +# Do not edit +gamename="Colony Survival" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./colonyserver.x86_64" +servercfgdir="${systemdir}/gamedata/settings" +servercfg="${selfname}.json" +servercfgdefault="colserver.json" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${serverfiles}/gamedata/logs/server/" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" +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/config-default/config-lgsm/cs2server/_default.cfg b/lgsm/config-default/config-lgsm/cs2server/_default.cfg new file mode 100644 index 000000000..dca9194f4 --- /dev/null +++ b/lgsm/config-default/config-lgsm/cs2server/_default.cfg @@ -0,0 +1,192 @@ +################################## +######## 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 +# https://docs.linuxgsm.com/game-servers/counter-strike-2 +ip="0.0.0.0" +port="27015" +maxplayers="16" +wsapikey="" + +## Game Server Login Token (GSLT): Required +# GSLT is required 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="-dedicated -ip ${ip} -port ${port} -maxplayers ${maxplayers} -authkey ${wsapikey} +exec ${selfname}.cfg" + +#### 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 +appid="730" +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="9" + +## 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="Counter-Strike 2" +engine="source2" +glibc="2.31" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/game/csgo" +executabledir="${serverfiles}/game/bin/linuxsteamrt64" +executable="./cs2" +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/config-default/config-lgsm/csczserver/_default.cfg b/lgsm/config-default/config-lgsm/csczserver/_default.cfg index 8065dbba2..29001a098 100644 --- a/lgsm/config-default/config-lgsm/csczserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csczserver/_default.cfg @@ -8,17 +8,15 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" defaultmap="de_dust2" maxplayers="16" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game czero -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game czero -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,9 +113,11 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="90" +steamcmdforcewindows="no" appidmod="czero" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="9" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Counter-Strike: Condition Zero" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/csgoserver/_default.cfg b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg index 963f873c5..29b3aea10 100644 --- a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg @@ -8,24 +8,35 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters # https://docs.linuxgsm.com/game-servers/counter-strike-global-offensive -# [Game Modes] gametype gamemode mapgroup (you can mix these across all Game Modes except Danger Zone, but use only one) -# Arms Race 1 0 mg_armsrace -# Classic Casual 0 0 mg_casualsigma, mg_casualdelta -# Classic Competitive 0 1 mg_active, mg_reserves, mg_hostage, mg_de_dust2 -# Custom 3 0 -# Deathmatch 1 2 mg_deathmatch -# Demolition 1 1 mg_demolition -# Wingman 0 2 -# Danger Zone 6 0 mg_dz_blacksite (map: dz_blacksite), mg_dz_sirocco (map: dz_sirocco) +# [Game Modes] gametype gamemode gamemodeflags skirmishid mapgroup (you can mix these across all Game Modes except Danger Zone, but use only one) +# Arms Race 1 0 0 0 mg_armsrace +# Boom! Headshot! 1 2 0 6 mg_skirmish_headshots +# Classic Casual 0 0 0 0 mg_casualsigma, mg_casualdelta +# Classic Competitive (Default) 0 1 0 0 mg_active, mg_reserves, mg_hostage, mg_de_dust2, ... +# Classic Competitive (Short Match) 0 1 32 0 mg_active, mg_reserves, mg_hostage, mg_de_dust2, ... +# Danger Zone 6 0 0 0 mg_dz_blacksite (map: dz_blacksite), mg_dz_sirocco (map: dz_sirocco) +# Deathmatch (Default) 1 2 0 0 mg_deathmatch +# Deathmatch (Free For All) 1 2 32 0 mg_deathmatch +# Deathmatch (Team vs Team) 1 2 4 0 mg_deathmatch +# Demolition 1 1 0 0 mg_demolition +# Flying Scoutsman 0 0 0 3 mg_skirmish_flyingscoutsman +# Hunter-Gatherers 1 2 0 7 mg_skirmish_huntergatherers +# Retakes 0 0 0 12 mg_skirmish_retakes +# Stab Stab Zap 0 0 0 1 mg_skirmish_stabstabzap +# Trigger Discipline 0 0 0 4 mg_skirmish_triggerdiscipline +# Wingman 0 2 0 0 mg_de_prime, mg_de_blagai, mg_de_vertigo, mg_de_inferno, mg_de_overpass, mg_de_cbble, mg_de_train, mg_de_shortnuke, mg_de_shortdust, mg_de_lake gametype="0" gamemode="0" +gamemodeflags="0" +skirmishid="0" mapgroup="mg_active" ip="0.0.0.0" port="27015" clientport="27005" sourcetvport="27020" +steamport="26901" defaultmap="de_mirage" maxplayers="16" tickrate="64" @@ -41,10 +52,8 @@ wsapikey="" wscollectionid="" wsstartmap="" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +mapgroup ${mapgroup} +game_type ${gametype} +game_mode ${gamemode} +host_workshop_collection ${wscollectionid} +workshop_start_map ${wsstartmap} -authkey ${wsapikey} -nobreakpad" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +mapgroup ${mapgroup} +game_type ${gametype} +game_mode ${gamemode} +sv_game_mode_flags ${gamemodeflags} +sv_skirmish_id ${skirmishid} +host_workshop_collection ${wscollectionid} +workshop_start_map ${wsstartmap} -authkey ${wsapikey} -nobreakpad" #### LinuxGSM Settings #### @@ -62,8 +71,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -74,18 +84,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -94,18 +102,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -135,8 +150,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="740" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -151,17 +168,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion -stopmode="3" +# 11: end +stopmode="9" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Counter-Strike: Global Offensive" @@ -184,7 +206,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -196,3 +218,7 @@ 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/config-default/config-lgsm/csserver/_default.cfg b/lgsm/config-default/config-lgsm/csserver/_default.cfg index 584e0ad77..266448e74 100644 --- a/lgsm/config-default/config-lgsm/csserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csserver/_default.cfg @@ -8,17 +8,15 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" defaultmap="de_dust2" maxplayers="16" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game cstrike -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game cstrike -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,9 +113,11 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="90" +steamcmdforcewindows="no" appidmod="cstrike" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="9" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Counter-Strike 1.6" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/cssserver/_default.cfg b/lgsm/config-default/config-lgsm/cssserver/_default.cfg index 316eb26f8..103c30897 100644 --- a/lgsm/config-default/config-lgsm/cssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/cssserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -21,10 +21,8 @@ maxplayers="16" # More info: https://docs.linuxgsm.com/steamcmd/gslt gslt="" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game cstrike -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game cstrike -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -42,8 +40,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -54,18 +53,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -74,18 +71,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -115,8 +119,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="232330" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -131,17 +137,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Counter-Strike: Source" @@ -164,7 +175,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -176,3 +187,7 @@ 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/config-default/config-lgsm/ss3server/_default.cfg b/lgsm/config-default/config-lgsm/ctserver/_default.cfg similarity index 71% rename from lgsm/config-default/config-lgsm/ss3server/_default.cfg rename to lgsm/config-default/config-lgsm/ctserver/_default.cfg index 9032678a4..ac87d7516 100644 --- a/lgsm/config-default/config-lgsm/ss3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ctserver/_default.cfg @@ -8,14 +8,8 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters -ip="0.0.0.0" - -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -# Edit with care | https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/master/SeriousSam3BFE/help/DedicatedServer_Readme.txt -fn_parms(){ -parms="+ip ${ip} +logfile ${gamelog} +exec ${servercfgfullpath}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-batchmode -showlogs" #### LinuxGSM Settings #### @@ -33,8 +27,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -45,18 +40,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -65,18 +58,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -105,9 +105,11 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid -appid="41080" +appid="1670340" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -122,41 +124,46 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion -stopmode="2" +# 11: end +stopmode="5" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="protocol-valve" +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="yes" ## Game Server Details # Do not edit -gamename="Serious Sam 3: BFE" -engine="seriousengine35" -glibc="2.13" +gamename="Craftopia" +engine="unity3d" +glibc="2.17" #### Directories #### # Edit with care ## Game Server Directories -systemdir="${serverfiles}/Bin" -executabledir="${systemdir}" -executable="./runSam3_DedicatedServer.sh" -servercfgdir="${serverfiles}/Content/SeriousSam3/Config" -servercfg="${selfname}.ini" -servercfgdefault="server.ini" +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./Craftopia.x86_64" +servercfgdir="${systemdir}" +servercfg="ServerSetting.ini" +servercfgdefault="ServerSetting.ini" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" -gamelogdir="${logdir}/server" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +#gamelogdir="${serverfiles}" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" gamelog="${gamelogdir}/${selfname}-game.log" @@ -166,6 +173,6 @@ alertlog="${lgsmlogdir}/${selfname}-alert.log" postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming +gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" -gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/dabserver/_default.cfg b/lgsm/config-default/config-lgsm/dabserver/_default.cfg index 612ea671f..3d5015808 100644 --- a/lgsm/config-default/config-lgsm/dabserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dabserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -16,10 +16,8 @@ sourcetvport="27020" defaultmap="da_rooftops" maxplayers="10" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -37,8 +35,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -49,18 +48,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -69,18 +66,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -110,8 +114,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="317800" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Double Action: Boogaloo" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/dayzserver/_default.cfg b/lgsm/config-default/config-lgsm/dayzserver/_default.cfg new file mode 100644 index 000000000..f09d23c23 --- /dev/null +++ b/lgsm/config-default/config-lgsm/dayzserver/_default.cfg @@ -0,0 +1,202 @@ +################################## +######## 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 #### + +## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login +steamuser="username" +steampass='password' + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="2302" + +## DayZ Modules +# Add mods with relative paths: +# mods/@cf +# To load the "Community framework for DayZ SA" module found in the +# directory serverfiles/mods/@cf. Load several mods as: +# mods="mods/@cf\;mods/@dayz-expansion\;mods/@deerisle" +mods="" + +## Server-side Mods +servermods="" + +## Path to BattlEye +# Leave empty for default +bepath="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-ip=${ip} -port=${port} -config=${servercfgfullpath} -mod=${mods} -servermod=${servermods} -bepath=${bepath} -limitFPS=60 -dologs -adminlog -freezeCheck" + +#### 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="5" + +## 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="223350" +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="2" + +## 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="no" + +## Game Server Details +# Do not edit +gamename="DayZ" +engine="enfusion" +glibc="2.27" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./DayZServer" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.server.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +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/config-default/config-lgsm/dmcserver/_default.cfg b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg index 43fe8e8f1..3d74fca4d 100644 --- a/lgsm/config-default/config-lgsm/dmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg @@ -8,17 +8,15 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" defaultmap="dcdm5" maxplayers="16" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game dmc -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game dmc -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,9 +113,11 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="90" +steamcmdforcewindows="no" appidmod="dmc" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="9" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Deathmatch Classic" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/dodrserver/_default.cfg b/lgsm/config-default/config-lgsm/dodrserver/_default.cfg new file mode 100644 index 000000000..0565b94e9 --- /dev/null +++ b/lgsm/config-default/config-lgsm/dodrserver/_default.cfg @@ -0,0 +1,186 @@ +################################## +######## 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 +servername="LinuxGSM" +ip="0.0.0.0" +port="7777" +queryport="27015" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -SteamServerName='${servername}' -log" + +#### 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 +appid="1088320" +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="2" + +## 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="no" + +## Game Server Details +# Do not edit +gamename="Day of Dragons" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/Dragons" +executabledir="${systemdir}/Binaries/Linux" +executable="./DragonsServer-Linux-Shipping" +servercfgdir="${systemdir}/Saved/Config/LinuxServer" +servercfg="Game.ini" +servercfgdefault="Game.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/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/config-default/config-lgsm/dodserver/_default.cfg b/lgsm/config-default/config-lgsm/dodserver/_default.cfg index 0d1b447c3..e2419289a 100644 --- a/lgsm/config-default/config-lgsm/dodserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodserver/_default.cfg @@ -8,17 +8,15 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" defaultmap="dod_Anzio" maxplayers="16" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game dod -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game dod -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,9 +113,11 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="90" +steamcmdforcewindows="no" appidmod="dod" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="9" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Day of Defeat" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/dodsserver/_default.cfg b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg index 572046108..b6973f0a7 100644 --- a/lgsm/config-default/config-lgsm/dodsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -16,10 +16,8 @@ sourcetvport="27020" defaultmap="dod_Anzio" maxplayers="16" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game dod -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game dod -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -37,8 +35,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -49,18 +48,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -69,18 +66,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -110,8 +114,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="232290" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Day of Defeat: Source" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/doiserver/_default.cfg b/lgsm/config-default/config-lgsm/doiserver/_default.cfg index d7916e2b5..9a06b7b02 100644 --- a/lgsm/config-default/config-lgsm/doiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/doiserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -17,10 +17,8 @@ defaultmap="bastogne stronghold" maxplayers="32" tickrate="64" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game doi -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers} -workshop -norestart" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game doi -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers} -workshop -norestart" #### LinuxGSM Settings #### @@ -38,8 +36,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -50,18 +49,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -70,18 +67,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -111,8 +115,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="462310" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -127,17 +133,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Day of Infamy" @@ -160,7 +171,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -172,3 +183,7 @@ 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/config-default/config-lgsm/dstserver/_default.cfg b/lgsm/config-default/config-lgsm/dstserver/_default.cfg index 7491e7e55..2c8de8bd4 100644 --- a/lgsm/config-default/config-lgsm/dstserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dstserver/_default.cfg @@ -8,21 +8,18 @@ #### Game Server Settings #### -## Installation Variables | https://docs.linuxgsm.com/game-servers/dont-starve-together +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters sharding="false" master="true" shard="Master" cluster="Cluster_1" cave="false" -# Edit with care persistentstorageroot="${HOME}/.klei" confdir="DoNotStarveTogether" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-persistent_storage_root ${persistentstorageroot} -conf_dir ${confdir} -cluster ${cluster} -shard ${shard}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-persistent_storage_root ${persistentstorageroot} -conf_dir ${confdir} -cluster ${cluster} -shard ${shard}" #### LinuxGSM Settings #### @@ -40,8 +37,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -52,18 +50,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -72,18 +68,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -113,8 +116,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="343050" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -129,17 +134,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="1" querytype="" +## Console type +consoleverbose="yes" +consoleinteract="yes" + ## Game Server Details # Do not edit gamename="Don't Starve Together" @@ -166,7 +176,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -178,3 +188,7 @@ 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/config-default/config-lgsm/dysserver/_default.cfg b/lgsm/config-default/config-lgsm/dysserver/_default.cfg index 28cc7fb98..fcb37c41a 100644 --- a/lgsm/config-default/config-lgsm/dysserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dysserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -21,10 +21,8 @@ maxplayers="16" # More info: https://docs.linuxgsm.com/steamcmd/gslt gslt="" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game "${serverfiles}/dystopia" -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game "${serverfiles}/dystopia" -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -42,8 +40,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -54,18 +53,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -74,18 +71,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -115,8 +119,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="17585" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -131,17 +137,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Dystopia" @@ -164,7 +175,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -176,3 +187,7 @@ 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/config-default/config-lgsm/ecoserver/_default.cfg b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg index b4a4b92eb..c08f37072 100644 --- a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg @@ -8,10 +8,8 @@ #### Game Server Settings #### -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ - parms="-nogui" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-nogui" #### LinuxGSM Settings #### @@ -29,8 +27,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -41,18 +40,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -61,18 +58,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -102,8 +106,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="739590" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -118,22 +124,27 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp -querymode="1" -querytype="" +querymode="3" +querytype="eco" + +## Console type +consoleverbose="yes" +consoleinteract="no" ## Game Server Details # Do not edit gamename="Eco" engine="unity3d" -glibc="null" +glibc="2.15" #### Directories #### # Edit with care @@ -141,7 +152,7 @@ glibc="null" ## Game Server Directories systemdir="${serverfiles}" executabledir="${serverfiles}" -executable="mono ./EcoServer.exe" +executable="./EcoServer" servercfgdir="${systemdir}/Configs" servercfg="Network.eco" servercfgdefault="Network.eco" @@ -151,7 +162,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -164,3 +175,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/emserver/_default.cfg b/lgsm/config-default/config-lgsm/emserver/_default.cfg index 8ab7aefe1..1762e5175 100644 --- a/lgsm/config-default/config-lgsm/emserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/emserver/_default.cfg @@ -8,12 +8,12 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" sourcetvport="27020" -defaultmap="emp_district" +defaultmap="con_district402" maxplayers="62" ## Game Server Login Token (GSLT): Optional @@ -21,10 +21,8 @@ maxplayers="62" # More info: https://docs.linuxgsm.com/steamcmd/gslt gslt="" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game empires -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game empires -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -42,8 +40,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -54,18 +53,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -74,18 +71,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -115,8 +119,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="460040" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -131,17 +137,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Empires Mod" @@ -164,7 +175,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -176,3 +187,7 @@ 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/config-default/config-lgsm/etlserver/_default.cfg b/lgsm/config-default/config-lgsm/etlserver/_default.cfg index add0f74b6..11a408fb8 100644 --- a/lgsm/config-default/config-lgsm/etlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/etlserver/_default.cfg @@ -8,10 +8,8 @@ #### Game Server Settings #### -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="+set net_strict 1 +set fs_homepath ${serverfiles} +exec ${servercfg}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set net_strict 1 +set fs_homepath ${serverfiles} +exec ${servercfg}" #### LinuxGSM Settings #### @@ -29,8 +27,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -41,18 +40,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -61,18 +58,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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="" ## Backup | https://docs.linuxgsm.com/commands/backup @@ -107,17 +111,22 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-quake3" +## Console type +consoleverbose="yes" +consoleinteract="yes" + ## Game Server Details # Do not edit gamename="ET: Legacy" @@ -140,7 +149,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -152,3 +161,7 @@ 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/config-default/config-lgsm/ets2server/_default.cfg b/lgsm/config-default/config-lgsm/ets2server/_default.cfg new file mode 100644 index 000000000..6abe98fb3 --- /dev/null +++ b/lgsm/config-default/config-lgsm/ets2server/_default.cfg @@ -0,0 +1,179 @@ +################################## +######## 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 #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-nosingle" + +#### 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 +appid="1948160" +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="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="4" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Euro Truck Simulator 2" +engine="prism3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}/bin/linux_x64" +executable="./eurotrucks2_server" +servercfgdir="${HOME}/.local/share/Euro Truck Simulator 2" +servercfg="server_config.sii" +servercfgdefault="server_config.sii" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +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/config-default/config-lgsm/fctrserver/_default.cfg b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg index fddab05ee..284fafaec 100644 --- a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg @@ -8,18 +8,15 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="34197" rconport="34198" rconpassword="CHANGE_ME" -# (stable|experimental) -branch="stable" +branch="stable" # values: stable, experimental -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="--start-server ${serverfiles}/save1.zip --server-settings ${servercfgfullpath} --port ${port} --rcon-port ${rconport} --rcon-password ${rconpassword}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="--bind ${ip} --start-server ${serverfiles}/save1.zip --server-settings ${servercfgfullpath} --port ${port} --rcon-port ${rconport} --rcon-password ${rconpassword}" #### LinuxGSM Settings #### @@ -37,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -49,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -69,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -118,17 +121,22 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="1" querytype="" +## Console type +consoleverbose="yes" +consoleinteract="yes" + ## Game Server Details # Do not edit gamename="Factorio" @@ -151,7 +159,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -163,3 +171,7 @@ 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/config-default/config-lgsm/fofserver/_default.cfg b/lgsm/config-default/config-lgsm/fofserver/_default.cfg index 49105660c..7ce630310 100644 --- a/lgsm/config-default/config-lgsm/fofserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/fofserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -16,10 +16,8 @@ sourcetvport="27020" defaultmap="fof_depot" maxplayers="20" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game fof -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game fof -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -37,8 +35,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -49,18 +48,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -69,18 +66,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -110,8 +114,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="295230" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Fistful of Frags" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/gmodserver/_default.cfg b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg index bd254e8b1..2cc683d20 100644 --- a/lgsm/config-default/config-lgsm/gmodserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -18,24 +18,16 @@ maxplayers="16" tickrate="66" gamemode="sandbox" -## Workshop Parameters | https://wiki.garrysmod.com/page/Workshop_for_Dedicated_Servers -# To get an API key visit - https://steamcommunity.com/dev/apikey -wsapikey="" +## Workshop Parameters | https://wiki.facepunch.com/gmod/Workshop_for_Dedicated_Servers wscollectionid="" -## Custom Start Parameters -# Default -disableluarefresh, disables lua autorefresh reducing server lag. Auto refresh only useful for developers. -customparms="-disableluarefresh" - ## 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 Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game garrysmod -strictportbind -ip ${ip} -port ${port} -tickrate ${tickrate} +host_workshop_collection ${wscollectionid} -authkey ${wsapikey} +clientport ${clientport} +tv_port ${sourcetvport} +gamemode ${gamemode} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers} ${customparms}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game garrysmod -strictportbind -ip ${ip} -port ${port} -tickrate ${tickrate} +host_workshop_collection ${wscollectionid} +clientport ${clientport} +tv_port ${sourcetvport} +gamemode ${gamemode} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers} -disableluarefresh" #### LinuxGSM Settings #### @@ -53,8 +45,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -65,18 +58,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -85,18 +76,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -126,8 +124,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="4020" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -142,17 +142,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Garry's Mod" @@ -176,7 +181,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -188,3 +193,7 @@ 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/config-default/config-lgsm/hcuserver/_default.cfg b/lgsm/config-default/config-lgsm/hcuserver/_default.cfg new file mode 100644 index 000000000..0925fe384 --- /dev/null +++ b/lgsm/config-default/config-lgsm/hcuserver/_default.cfg @@ -0,0 +1,195 @@ +################################## +######## 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 +defaultmap="KidsBedroom" +ip="0.0.0.0" +maxplayers="8" +port="7777" +queryport="27015" +servername="LinuxGSM" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="${defaultmap}?MaxPlayers=${maxplayers} -ServerName='${servername}' -Port=${port} -QueryPort=${queryport}" + +## Server Parameters for Plague mode +#startparameters="${defaultmap}?Game=PL?MapList=KidsBedroom,Garden,Hallway_Simple,Attic_Daytime,Garage,Shed,Kitchen,Hallway_Hard,ToyPalace,Bathroom?MaxPlayers=${maxplayers}?WeaponTypes=7?TimeLimit=600 -ServerName='${servername}' -Port=${port} -QueryPort=${queryport} -NOCONSOLE -unattended" + +## Server Parameters for Co-op mode +#startparameters="${defaultmap}?Difficulty=1?Game=WV?MapList=KidsBedroom?MaxPlayers=4 -ServerName='${servername}' -Port=${port} -QueryPort=${queryport} -NOCONSOLE -unattended" + + +#### 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="5" + +## 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="1045940" +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="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="HYPERCHARGE: Unboxed" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/Unboxed" +executabledir="${systemdir}/Binaries/Linux" +executable="./UnboxedServer-Linux-Shipping" +servercfgdir="${systemdir}/Saved/Config/LinuxServer" +servercfg="GameUserSettings.ini" +servercfgdefault="GameUserSettings.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/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/config-default/config-lgsm/hl2dmserver/_default.cfg b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg index 22c3da329..c429a6c8e 100644 --- a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -16,10 +16,8 @@ sourcetvport="27020" defaultmap="dm_lockdown" maxplayers="16" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game hl2mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game hl2mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -37,8 +35,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -49,18 +48,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -69,18 +66,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -110,8 +114,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="232370" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Half Life 2: Deathmatch" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/hldmserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg index 1a17fdd91..3bddb128e 100644 --- a/lgsm/config-default/config-lgsm/hldmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg @@ -8,17 +8,15 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" defaultmap="crossfire" maxplayers="16" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game valve -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game valve -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,8 +113,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="90" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -125,17 +131,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="9" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Half Life: Deathmatch" @@ -158,7 +169,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -170,3 +181,7 @@ 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/config-default/config-lgsm/hldmsserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg index 0036ec7e1..74321c1f4 100644 --- a/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -16,10 +16,8 @@ sourcetvport="27020" defaultmap="crossfire" maxplayers="16" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game hl1mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game hl1mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -37,8 +35,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -49,18 +48,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -69,18 +66,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -110,8 +114,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="255470" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Half-Life Deathmatch: Source" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/hwserver/_default.cfg b/lgsm/config-default/config-lgsm/hwserver/_default.cfg index 426d2d250..7fe1a4969 100644 --- a/lgsm/config-default/config-lgsm/hwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hwserver/_default.cfg @@ -8,17 +8,16 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters -servername="LinuxGSM Server" +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +servername="LinuxGSM" ip="0.0.0.0" port="12871" queryport="12881" maxplayers="20" -defaultmap="" #Optional -creativemode="0" #Free Build: creativemode="1" -gamelog="gamelog.txt" +defaultmap="nullius" +creativemode="0" # values: Free Build = 1, Survival = 0 -## Adding admins using STEAMID64 +## Add admins using STEAMID64 # Example : addadmin 012345678901234567; addadmin 987654321098765432 admins="" @@ -26,11 +25,9 @@ admins="" # Rollback server state (remove after start command) loadsave="" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -# Edit with care | http://hurtworld.wikia.com/wiki/Hosting_A_Server -fn_parms(){ -parms="-batchmode -nographics -exec \"host ${port} ${defaultmap} ${loadsave};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${admins}\" -logfile \"${gamelog}\" " -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +# http://hurtworld.wikia.com/wiki/Hosting_A_Server +startparameters="-batchmode -nographics -logfile ${gamelog} -exec \"host ${port} ${defaultmap} ${loadsave};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};addadmin ${admins}\"" #### LinuxGSM Settings #### @@ -48,8 +45,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -60,18 +58,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -80,18 +76,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -121,8 +124,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="405100" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -137,17 +142,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" +## Console type +consoleverbose="no" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Hurtworld" @@ -160,13 +170,13 @@ glibc="2.15" ## Game Server Directories systemdir="${serverfiles}" executabledir="${serverfiles}" -executable=$([ "$(uname -m)" == "x86_64" ] && echo -e "./Hurtworld.x86_64" || echo -e "./Hurtworld.x86") +executable="./Hurtworld.x86_64" ## Backup Directory backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -180,3 +190,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" 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/config-default/config-lgsm/hzserver/_default.cfg b/lgsm/config-default/config-lgsm/hzserver/_default.cfg new file mode 100644 index 000000000..b610594e7 --- /dev/null +++ b/lgsm/config-default/config-lgsm/hzserver/_default.cfg @@ -0,0 +1,184 @@ +################################## +######## 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="7777" +queryport="27015" +servername="LinuxGSM" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-log -port=${port} -queryport=${queryport} -steamservername=${servername}" + +#### 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="5" + +## 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="2728330" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="linuxbranch" +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="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="no" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="HumanitZ" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/TSSGame" +executabledir="${systemdir}/Binaries/Linux" +executable="./TSSGameServer-Linux-Shipping" +servercfgdir="${systemdir}/Saved/Config/LinuxServer" +servercfg="GameUserSettings.ini" +servercfgdefault="GameUserSettings.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/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/config-default/config-lgsm/insserver/_default.cfg b/lgsm/config-default/config-lgsm/insserver/_default.cfg index 98817e908..cd1d13029 100644 --- a/lgsm/config-default/config-lgsm/insserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/insserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -22,10 +22,8 @@ tickrate="64" # More info: https://docs.linuxgsm.com/steamcmd/gslt gslt="" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game insurgency -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers} -workshop -norestart" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game insurgency -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers} -workshop -norestart" #### LinuxGSM Settings #### @@ -43,8 +41,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -55,18 +54,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -75,18 +72,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -116,8 +120,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="237410" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -132,17 +138,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Insurgency" @@ -165,7 +176,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -177,3 +188,7 @@ 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/config-default/config-lgsm/inssserver/_default.cfg b/lgsm/config-default/config-lgsm/inssserver/_default.cfg index 605a95fbb..4049e5e11 100644 --- a/lgsm/config-default/config-lgsm/inssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/inssserver/_default.cfg @@ -8,25 +8,25 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27102" queryport="27131" -servername="LinuxGSM Server" -serverpassword="" -defaultmap="Canyon" -defaultscenario="Scenario_Crossing_Push_Security" +rconport="27015" +rconpassword="CHANGE_ME" +servername="LinuxGSM" +defaultmap="Oilfield" +defaultscenario="Scenario_Refinery_Push_Security" maxplayers="28" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ - # Allows serverpassword to work with parameters - if [ "${serverpassword}" != "NOT SET" ]; then - parms="${defaultmap}?Scenario=${defaultscenario}?MaxPlayers=${maxplayers}?Port=${port}?QueryPort=${queryport}?password="${serverpassword}" -hostname='${servername}' -log" - else - parms="${defaultmap}?Scenario=${defaultscenario}?MaxPlayers=${maxplayers}?Port=${port}?QueryPort=${queryport} -hostname='${servername}' -log" - fi -} +## 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 +## Game Server Docs | https://mod.io/g/insurgencysandstorm/r/server-admin-guide +startparameters="${defaultmap}?Scenario=${defaultscenario}?MaxPlayers=${maxplayers} -Port=${port} -QueryPort=${queryport} -hostname='${servername}' -Rcon -RconPassword=${rconpassword} -RconListenPort=${rconport} -GSLTToken=${gslt} -log" #### LinuxGSM Settings #### @@ -44,8 +44,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -56,18 +57,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -76,18 +75,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -117,10 +123,12 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="581330" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server -steammaster="false" +steammaster="true" ## Stop Mode | https://docs.linuxgsm.com/features/stop-mode # 1: tmux kill @@ -133,17 +141,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Insurgency: Sandstorm" @@ -157,16 +170,12 @@ glibc="2.17" systemdir="${serverfiles}/Insurgency" executabledir="${systemdir}/Binaries/Linux" executable="./InsurgencyServer-Linux-Shipping" -servercfgdir="${systemdir}/Saved/Config/LinuxServer" -servercfg="Game.ini" -servercfgdefault="Game.ini" -servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -179,3 +188,7 @@ 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/config-default/config-lgsm/iosserver/_default.cfg b/lgsm/config-default/config-lgsm/iosserver/_default.cfg index acf13f368..ff6764d0b 100644 --- a/lgsm/config-default/config-lgsm/iosserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/iosserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -16,10 +16,8 @@ sourcetvport="27020" defaultmap="8v8_vienna" maxplayers="32" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game iosoccer -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game iosoccer -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -37,8 +35,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -49,18 +48,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -69,18 +66,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -110,8 +114,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="673990" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -126,17 +132,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="IOSoccer" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/jc2server/_default.cfg b/lgsm/config-default/config-lgsm/jc2server/_default.cfg index 81cd0ff5b..5a82bbad9 100644 --- a/lgsm/config-default/config-lgsm/jc2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc2server/_default.cfg @@ -8,10 +8,8 @@ #### Game Server Settings #### -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="" #### LinuxGSM Settings #### @@ -29,8 +27,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -41,18 +40,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -61,18 +58,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -102,8 +106,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="261140" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -118,16 +124,21 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" -querytype="jc2mp" +querytype="jc2m" + +## Console type +consoleverbose="yes" +consoleinteract="no" ## Game Server Details # Do not edit @@ -151,7 +162,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" #gamelogdir="" # No server logs available lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -163,3 +174,7 @@ 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/config-default/config-lgsm/jc3server/_default.cfg b/lgsm/config-default/config-lgsm/jc3server/_default.cfg index e3793f805..62d9cd4ab 100644 --- a/lgsm/config-default/config-lgsm/jc3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc3server/_default.cfg @@ -8,10 +8,8 @@ #### Game Server Settings #### -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="" #### LinuxGSM Settings #### @@ -29,8 +27,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -41,18 +40,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -61,18 +58,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -102,8 +106,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="619960" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -118,16 +124,21 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="protocol-valve" +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="yes" ## Game Server Details # Do not edit @@ -151,8 +162,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" -#gamelogdir="" # No server logs available +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" lgsmlog="${lgsmlogdir}/${selfname}-script.log" @@ -163,3 +173,7 @@ 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/config-default/config-lgsm/jk2server/_default.cfg b/lgsm/config-default/config-lgsm/jk2server/_default.cfg new file mode 100644 index 000000000..f238c45fe --- /dev/null +++ b/lgsm/config-default/config-lgsm/jk2server/_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 #### + +## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login +steamuser="username" +steampass='password' + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27960" +defaultmap="ffa_bespin" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set net_ip ${ip} +set net_port ${port} +map ${defaultmap} +exec ${servercfg}" + +#### 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 +appid="6030" +steamcmdforcewindows="yes" +# 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-quake3" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Jedi Knight II: Jedi Outcast" +engine="idtech3" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/GameData" +executabledir="${systemdir}" +executable="./jk2mvded" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backups" + +## 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/config-default/config-lgsm/kf2server/_default.cfg b/lgsm/config-default/config-lgsm/kf2server/_default.cfg index 7ad9fc930..8f44458cd 100644 --- a/lgsm/config-default/config-lgsm/kf2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/kf2server/_default.cfg @@ -8,16 +8,14 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" queryport="27015" defaultmap="KF-BioticsLab" gamemode="KFGameContent.KFGameInfo_VersusSurvival" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="\"${defaultmap}?Game=${gamemode}?ConfigSubDir=${selfname} -QueryPort=${queryport}\"" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="\"${defaultmap}?Game=${gamemode}?ConfigSubDir=${selfname} -QueryPort=${queryport}\"" #### LinuxGSM Settings #### @@ -35,8 +33,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -47,18 +46,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -67,18 +64,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -108,10 +112,12 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="232130" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server -steammaster="false" +steammaster="true" ## Stop Mode | https://docs.linuxgsm.com/features/stop-mode # 1: tmux kill @@ -124,17 +130,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Killing Floor 2" @@ -143,6 +154,7 @@ glibc="2.3.2" #### Directories #### # Edit with care + ## Game Server Directories systemdir="${serverfiles}" executabledir="${systemdir}/Binaries/Win64" @@ -156,7 +168,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -168,3 +180,7 @@ 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/config-default/config-lgsm/kfserver/_default.cfg b/lgsm/config-default/config-lgsm/kfserver/_default.cfg index f4ef0a7f7..222ba9979 100644 --- a/lgsm/config-default/config-lgsm/kfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/kfserver/_default.cfg @@ -12,18 +12,16 @@ steamuser="username" steampass='password' -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" defaultmap="KF-BioticsLab.rom" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="server ${defaultmap}?game=KFmod.KFGameType?VACSecured=true -nohomedir ini=${servercfg} log=${gamelog}" +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="server ${defaultmap}?game=KFmod.KFGameType?VACSecured=true -nohomedir ini=${servercfg} log=${gamelog}" -# Server Start Command for Objective mode +## Server Parameters for Objective mode #defaultmap="KFO-Steamland" -#parms="server ${defaultmap}?Game=KFStoryGame.KFStoryGame?VACSecured=true -nohomedir ini=${servercfg} log=${gamelog}" -} +#startparameters="server ${defaultmap}?Game=KFStoryGame.KFStoryGame?VACSecured=true -nohomedir ini=${servercfg} log=${gamelog}" #### LinuxGSM Settings #### @@ -41,8 +39,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -53,18 +52,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -73,18 +70,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -114,10 +118,12 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="215360" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server -steammaster="false" +steammaster="true" ## Stop Mode | https://docs.linuxgsm.com/features/stop-mode # 1: tmux kill @@ -130,16 +136,21 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" -querytype="protocol-unreal2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" ## Game Server Details # Do not edit @@ -151,7 +162,6 @@ glibc="2.4" # Edit with care ## Game Server Directories -serverfiles="${rootdir}/serverfiles" systemdir="${serverfiles}/System" executabledir="${systemdir}" executable="./ucc-bin" @@ -165,7 +175,7 @@ compressedmapsdir="${rootdir}/Maps-Compressed" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -179,3 +189,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/l4d2server/_default.cfg b/lgsm/config-default/config-lgsm/l4d2server/_default.cfg index 4852b2231..a37ef4eb4 100644 --- a/lgsm/config-default/config-lgsm/l4d2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/l4d2server/_default.cfg @@ -8,17 +8,15 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" defaultmap="c5m1_waterfront" maxplayers="8" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game left4dead2 -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game left4dead2 -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,8 +113,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="222860" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -125,17 +131,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Left 4 Dead 2" @@ -158,7 +169,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -170,3 +181,7 @@ 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/config-default/config-lgsm/l4dserver/_default.cfg b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg index 158605d2f..dc22bc871 100644 --- a/lgsm/config-default/config-lgsm/l4dserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg @@ -8,17 +8,15 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" defaultmap="l4d_hospital01_apartment" maxplayers="8" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game left4dead -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game left4dead -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,8 +113,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="222840" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -125,17 +131,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Left 4 Dead" @@ -158,7 +169,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -170,3 +181,7 @@ 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/config-default/config-lgsm/mcbserver/_default.cfg b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg index 839f5a9af..d7171a3f6 100644 --- a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg @@ -8,10 +8,11 @@ #### Game Server Settings #### -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="" + +# Version (latest|1.18.33.02) +mcversion="latest" #### LinuxGSM Settings #### @@ -29,8 +30,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -41,18 +43,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -61,18 +61,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -110,16 +117,21 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="5" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp -querymode="4" -querytype="minecraftbe" +querymode="2" +querytype="mbe" + +## Console type +consoleverbose="yes" +consoleinteract="yes" ## Game Server Details # Do not edit @@ -143,7 +155,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -155,3 +167,7 @@ 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/config-default/config-lgsm/mcserver/_default.cfg b/lgsm/config-default/config-lgsm/mcserver/_default.cfg index a49465f45..1288fab95 100644 --- a/lgsm/config-default/config-lgsm/mcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcserver/_default.cfg @@ -8,16 +8,17 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters javaram="1024" # -Xmx$1024M -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="nogui" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="nogui" -## Branch, "snapshot" include snapshot and pre-release versions. | (release|snapshot) +## Release Settings | https://docs.linuxgsm.com/game-servers/minecraft#release-settings +# Branch (release|snapshot) branch="release" +# Version (latest|1.16) +mcversion="latest" #### LinuxGSM Settings #### @@ -35,8 +36,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -47,18 +49,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -67,18 +67,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -116,17 +123,22 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="5" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="minecraft" +## Console type +consoleverbose="yes" +consoleinteract="yes" + ## Game Server Details # Do not edit gamename="Minecraft" @@ -139,7 +151,8 @@ glibc="null" ## Game Server Directories systemdir="${serverfiles}" executabledir="${serverfiles}" -executable="java -Xmx${javaram}M -jar ${serverfiles}/minecraft_server.jar" +preexecutable="java -Xmx${javaram}M -jar" +executable="./minecraft_server.jar" servercfgdir="${systemdir}" servercfg="server.properties" servercfgdefault="server.properties" @@ -149,7 +162,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -161,3 +174,7 @@ 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/config-default/config-lgsm/mhserver/_default.cfg b/lgsm/config-default/config-lgsm/mhserver/_default.cfg index 255ecdd04..197440ab2 100644 --- a/lgsm/config-default/config-lgsm/mhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mhserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="7777" beaconport="15000" @@ -16,10 +16,9 @@ queryport="27015" # Maps: FFA_Camp, FFA_Contraband, FFA_Grad, FFA_MountainPeak, FFA_Taiga, FFA_ThePit, FFA_Tourney, SKM_Camp, SKM_Contraband, SKM_Grad, SKM_MountainPeak, SKM_Taiga, SKM_ThePit, SKM_Tourney, TDM_Camp, TDM_Contraband, TDM_Grad, TDM_MountainPeak, TDM_Taiga, TDM_ThePit, TDM_Tourney defaultmap="FFA_ThePit" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="Mordhau ${defaultmap} -log -MultiHome=${ip} -Port=${port} -BeaconPort=${beaconport} -QueryPort=${queryport}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +## Game Server Docs | https://mordhau.fandom.com/wiki/Dedicated_Server_Hosting_Guide +startparameters="Mordhau ${defaultmap} -MultiHome=${ip} -Port=${port} -BeaconPort=${beaconport} -QueryPort=${queryport} -GameIni=${servercfgfullpath} -log" #### LinuxGSM Settings #### @@ -37,8 +36,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -49,18 +49,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -69,18 +67,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -110,8 +115,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="629800" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -126,16 +133,21 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="protocol-valve" +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="no" ## Game Server Details # Do not edit @@ -159,7 +171,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +183,7 @@ 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/config-default/config-lgsm/mohaaserver/_default.cfg b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg index 1f82fe0c4..dfd87335c 100644 --- a/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg @@ -8,15 +8,13 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="12203" defaultmap="dm/mohdm1" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set fs_outputpath ${gamelogdir} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +exec ${servercfg} +map ${defaultmap}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set fs_outputpath ${gamelogdir} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +map ${defaultmap} +exec ${servercfg} " #### LinuxGSM Settings #### @@ -34,8 +32,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -46,18 +45,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -66,18 +63,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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="" ## Backup | https://docs.linuxgsm.com/commands/backup @@ -112,16 +116,21 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="protocol-quake3" +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="no" ## Game Server Details # Do not edit @@ -145,7 +154,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -157,3 +166,7 @@ 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/config-default/config-lgsm/momserver/_default.cfg b/lgsm/config-default/config-lgsm/momserver/_default.cfg new file mode 100644 index 000000000..5834670c9 --- /dev/null +++ b/lgsm/config-default/config-lgsm/momserver/_default.cfg @@ -0,0 +1,186 @@ +################################## +######## 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="7777" +beaconport="15000" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +## Game Server Docs | https://memoriesofmars.fandom.com/wiki/Dedicated_Servers +startparameters="-MultiHome=${ip} -Port=${port} -BeaconPort=${beaconport} -log" + +#### 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 +appid="897590" +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="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Memories of Mars" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/Game" +executabledir="${systemdir}/Binaries/Linux" +executable="./MemoriesOfMarsServer" +servercfgdir="${serverfiles}" +servercfg="DedicatedServerConfig.cfg" +servercfgdefault="DedicatedServerConfig.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Game/Saved/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/config-default/config-lgsm/mtaserver/_default.cfg b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg index dc6aac282..d1880ef89 100644 --- a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg @@ -8,14 +8,11 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -# Edit with care -fn_parms(){ -parms="" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="" #### LinuxGSM Settings #### @@ -33,8 +30,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -45,18 +43,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -65,18 +61,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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="" ## Backup | https://docs.linuxgsm.com/commands/backup @@ -111,17 +114,22 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="4" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="3" querytype="protocol-ase" +## Console type +consoleverbose="yes" +consoleinteract="yes" + ## Game Server Details # Do not edit gamename="Multi Theft Auto" @@ -138,13 +146,14 @@ executabledir="${systemdir}" executable="./mta-server64" servercfgdir="${systemdir}/mods/deathmatch" servercfg="mtaserver.conf" +servercfgdefault="mtaserver.conf" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/mods/deathmatch/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -156,3 +165,7 @@ 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/config-default/config-lgsm/ndserver/_default.cfg b/lgsm/config-default/config-lgsm/ndserver/_default.cfg index 084bcc20b..249556af4 100644 --- a/lgsm/config-default/config-lgsm/ndserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ndserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -16,10 +16,8 @@ sourcetvport="27020" defaultmap="hydro" maxplayers="32" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game nucleardawn -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game nucleardawn -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -37,8 +35,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -49,18 +48,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -69,18 +66,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -110,8 +114,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="111710" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Nuclear Dawn" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/necserver/_default.cfg b/lgsm/config-default/config-lgsm/necserver/_default.cfg new file mode 100644 index 000000000..8062f8d5f --- /dev/null +++ b/lgsm/config-default/config-lgsm/necserver/_default.cfg @@ -0,0 +1,183 @@ +################################## +######## 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 #### + +## Pre-defined Paramters | https://docs.linuxgsm.com/configuration/start-parameters#predefined-parameters +worldname="MyWorld" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-localdir -world ${worldname}" + +#### 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 +appid="1169370" +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="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Necesse" +engine="null" +glibc="2.9" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./StartServer-nogui.sh" +servercfgdir="${serverfiles}/cfg" +servercfg="server.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/config-default/config-lgsm/nmrihserver/_default.cfg b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg index 261d74fed..8757caa6c 100644 --- a/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -21,10 +21,8 @@ maxplayers="8" # More info: https://docs.linuxgsm.com/steamcmd/gslt gslt="" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game nmrih -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game nmrih -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -42,8 +40,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -54,18 +53,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -74,18 +71,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -115,8 +119,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="317670" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -131,17 +137,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="No More Room in Hell" @@ -164,7 +175,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -176,3 +187,7 @@ 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/config-default/config-lgsm/ns2cserver/_default.cfg b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg index 6e857c346..2f8f47af5 100644 --- a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg @@ -8,25 +8,23 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" defaultmap="co_core" maxplayers="24" -servername="LinuxGSM Server" -webadminuser="admin" -webadminpass="admin" -webadminport="8080" +servername="LinuxGSM" +httpuser="admin" +httppassword="CHANGE_ME" +httpport="8080" mods="" serverpassword="" # Add the following line to the parms if you want a private server. Ensuring # that the password variable above is not left empty. # -password \"${serverpassword}\" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${servercfgdir}\" -modstorage \"${modstoragedir}\" -mods \"${mods}\"" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-name '${servername}' -port ${port} -webadmin -webdomain ${ip} -webuser ${httpuser} -webpassword '${httppassword}' -webport ${httpport} -map ${defaultmap} -limit ${maxplayers} -config_path '${servercfgdir}' -modstorage '${modstoragedir}' -mods '${mods}'" #### LinuxGSM Settings #### @@ -44,8 +42,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -56,18 +55,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -76,18 +73,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -117,8 +121,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="313900" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -133,17 +139,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="6" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="NS2: Combat" @@ -164,7 +175,7 @@ modstoragedir="${servercfgdir}/Workshop" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -176,3 +187,7 @@ 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/config-default/config-lgsm/ns2server/_default.cfg b/lgsm/config-default/config-lgsm/ns2server/_default.cfg index 01cb086f9..9cec798da 100644 --- a/lgsm/config-default/config-lgsm/ns2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2server/_default.cfg @@ -8,29 +8,24 @@ #### Game Server Settings #### -## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login -steamuser="username" -steampass='password' - -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" defaultmap="ns2_summit" -maxplayers="24" -servername="LinuxGSM Server" -webadminuser="admin" -webadminpass="admin" -webadminport="8080" -mods="" +maxplayers="20" +maxspectators="5" +servername="LinuxGSM" +httpuser="admin" +httppassword="CHANGE_ME" +httpport="8080" +modserverport="27031" serverpassword="" # Add the following line to the parms if you want a private server. Ensuring # that the password variable above is not left empty. -# -password \"${serverpassword}\" +# -password '${serverpassword}' -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${servercfgdir}\" -logdir \"${gamelogdir}\" -modstorage \"${modstoragedir}\" -mods \"${mods}\"" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-name '${servername}' -port ${port} -webadmin -webdomain ${ip} -webuser ${httpuser} -webpassword '${httppassword}' -webport ${httpport} -startmodserver -modserverport ${modserverport} -map ${defaultmap} -limit ${maxplayers} -speclimit ${maxspectators} -config_path '${servercfgdir}' -logdir '${gamelogdir}' -modstorage '${modstoragedir}'" #### LinuxGSM Settings #### @@ -48,8 +43,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -60,18 +56,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -80,18 +74,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -121,8 +122,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="4940" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -137,17 +140,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="6" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Natural Selection 2" @@ -168,7 +176,7 @@ modstoragedir="${servercfgdir}/Workshop" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -180,3 +188,7 @@ 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/config-default/config-lgsm/nsserver/_default.cfg b/lgsm/config-default/config-lgsm/nsserver/_default.cfg index 446e8ab8a..367878519 100644 --- a/lgsm/config-default/config-lgsm/nsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/nsserver/_default.cfg @@ -8,17 +8,15 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" defaultmap="ns_hera" maxplayers="16" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game ns -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game ns -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,9 +113,11 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="90" +steamcmdforcewindows="no" appidmod="cstrike" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="9" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Natural Selection" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/ohdserver/_default.cfg b/lgsm/config-default/config-lgsm/ohdserver/_default.cfg new file mode 100644 index 000000000..26bc3a30c --- /dev/null +++ b/lgsm/config-default/config-lgsm/ohdserver/_default.cfg @@ -0,0 +1,187 @@ +################################## +######## 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="7777" +queryport="27005" +rconport="7778" +servername="LinuxGSM" +# Maps: risala, khafji_p, lamdong, montecassino, argonne +defaultmap="AAS-TestMap" +maxplayers="16" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="${defaultmap}?MaxPlayers=${maxplayers} -MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -RconPort=${rconport} -SteamServerName='${servername}' -log" + +#### 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 +appid="950900" +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="2" + +## 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="no" + +## Game Server Details +# Do not edit +gamename="Operation: Harsh Doorstop" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/HarshDoorstop" +executabledir="${systemdir}/Binaries/Linux" +executable="./HarshDoorstopServer-Linux-Shipping" +servercfgdir="${systemdir}/Saved/Config/LinuxServer" +servercfg="Game.ini" +servercfgdefault="Game.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +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" diff --git a/lgsm/config-default/config-lgsm/onsetserver/_default.cfg b/lgsm/config-default/config-lgsm/onsetserver/_default.cfg index 7401de91a..0103ef069 100644 --- a/lgsm/config-default/config-lgsm/onsetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/onsetserver/_default.cfg @@ -8,10 +8,9 @@ #### Game Server Settings #### -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="--config ${servercfgfullpath}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +## Game Server Docs | https://dev.playonset.com/wiki/DedicatedServer +startparameters="--config ${servercfgfullpath}" #### LinuxGSM Settings #### @@ -29,8 +28,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -41,18 +41,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -61,18 +59,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -102,8 +107,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="1204170" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -118,17 +125,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="1" querytype="" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Onset" @@ -151,7 +163,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -163,3 +175,7 @@ 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/config-default/config-lgsm/opforserver/_default.cfg b/lgsm/config-default/config-lgsm/opforserver/_default.cfg index a341627a9..93d00fc5c 100644 --- a/lgsm/config-default/config-lgsm/opforserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/opforserver/_default.cfg @@ -8,17 +8,15 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" defaultmap="op4_bootcamp" maxplayers="16" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game gearbox -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game gearbox -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,9 +113,11 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="90" +steamcmdforcewindows="no" appidmod="gearbox" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="9" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Half-Life: Opposing Force" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/gesserver/_default.cfg b/lgsm/config-default/config-lgsm/pc2server/_default.cfg similarity index 72% rename from lgsm/config-default/config-lgsm/gesserver/_default.cfg rename to lgsm/config-default/config-lgsm/pc2server/_default.cfg index a26a5df39..d4e6ce1d6 100644 --- a/lgsm/config-default/config-lgsm/gesserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pc2server/_default.cfg @@ -8,18 +8,12 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters -ip="0.0.0.0" -port="27015" -clientport="27005" -sourcetvport="27020" -defaultmap="ge_archives" -maxplayers="16" +## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login +steamuser="username" +steampass='password' -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game gesource -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="--config ${servercfg}" #### LinuxGSM Settings #### @@ -37,8 +31,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -49,18 +44,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -69,18 +62,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,9 +109,11 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid -appid="310" # Source 2007 SDK +appid="413770" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,40 +128,45 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion -stopmode="3" +# 11: end +stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit -gamename="GoldenEye: Source" -engine="source" +gamename="Project Cars 2" +engine="madness" glibc="2.15" #### Directories #### # Edit with care ## Game Server Directories -systemdir="${serverfiles}/gesource" +systemdir="${serverfiles}" executabledir="${serverfiles}" -executable="./srcds_run" -servercfgdir="${systemdir}/cfg" +executable="./DedicatedServerCmd.elf" +servercfgdir="${systemdir}" servercfg="${selfname}.cfg" -servercfgdefault="server.cfg" +servercfgdefault="config_sample/server.cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +178,7 @@ 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/config-default/config-lgsm/pcserver/_default.cfg b/lgsm/config-default/config-lgsm/pcserver/_default.cfg index fc74fbe5e..c36dfaac6 100644 --- a/lgsm/config-default/config-lgsm/pcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pcserver/_default.cfg @@ -8,10 +8,8 @@ #### Game Server Settings #### -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="--config ${servercfg}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="--config ${servercfg}" #### LinuxGSM Settings #### @@ -29,8 +27,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -41,18 +40,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -61,18 +58,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -102,10 +106,12 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="332670" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server -steammaster="false" +steammaster="true" ## Stop Mode | https://docs.linuxgsm.com/features/stop-mode # 1: tmux kill @@ -118,17 +124,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Project Cars" @@ -151,7 +162,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -163,3 +174,7 @@ 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/config-default/config-lgsm/pmcserver/_default.cfg b/lgsm/config-default/config-lgsm/pmcserver/_default.cfg new file mode 100644 index 000000000..74e0e7e18 --- /dev/null +++ b/lgsm/config-default/config-lgsm/pmcserver/_default.cfg @@ -0,0 +1,178 @@ +################################## +######## 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 +javaram="1024" # -Xmx$1024M + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="nogui" + +## Release Settings | https://docs.linuxgsm.com/game-servers/minecraft#release-settings +# Version (latest|1.16.5) +mcversion="latest" + +#### 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" + +## 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="5" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="minecraft" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="PaperMC" +engine="lwjgl2" +glibc="null" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +preexecutable="java -Xmx${javaram}M -jar" +executable="./paper.jar" +servercfgdir="${systemdir}" +servercfg="server.properties" +servercfgdefault="server.properties" +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/config-default/config-lgsm/pstbsserver/_default.cfg b/lgsm/config-default/config-lgsm/psserver/_default.cfg similarity index 76% rename from lgsm/config-default/config-lgsm/pstbsserver/_default.cfg rename to lgsm/config-default/config-lgsm/psserver/_default.cfg index 1a80e7a02..80d991f94 100644 --- a/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/psserver/_default.cfg @@ -8,20 +8,13 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="10027" queryport="10037" -rconport="21114" -randommap="NONE" -#servername="LinuxGSM Server" -maxplayers="40" -reservedslots="0" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="MULTIHOME=${ip} RANDOM=${randommap} Port=${port} QueryPort=${queryport} RCONPORT=${rconport} FIXEDMAXPLAYERS=${maxplayers} NumReservedSlots=${reservedslots}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -log" #### LinuxGSM Settings #### @@ -39,8 +32,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -51,18 +45,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -71,18 +63,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -112,10 +111,12 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="746200" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server -steammaster="false" +steammaster="true" ## Stop Mode | https://docs.linuxgsm.com/features/stop-mode # 1: tmux kill @@ -128,20 +129,25 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit -gamename="pstbsserver" +gamename="Post Scriptum" engine="unreal4" glibc="2.17" @@ -161,7 +167,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -174,3 +180,7 @@ 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/config-default/config-lgsm/pvkiiserver/_default.cfg b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg index 0118ecaa4..1e2ca3660 100644 --- a/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -16,10 +16,8 @@ sourcetvport="27020" defaultmap="bt_island" maxplayers="24" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game pvkii -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game pvkii -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -37,8 +35,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -49,18 +48,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -69,18 +66,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -110,8 +114,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="17575" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Pirates, Vikings, and Knights II" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/pvrserver/_default.cfg b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg new file mode 100644 index 000000000..374da3dd1 --- /dev/null +++ b/lgsm/config-default/config-lgsm/pvrserver/_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 #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="7777" +# Maps: bridge, datacenter, sand +defaultmap="datacenter" +# Get an API key from https://pavlov-ms.vankrupt.com/servers/v1/key +apikey="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +## Game Server Docs | http://pavlovwiki.com/index.php/Setting_up_a_dedicated_server +startparameters="Pavlov ${defaultmap} -MultiHome=${ip} -Port=${port} ApiKey=${apikey} -log" + +#### 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 +appid="622970" +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="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="5" +querytype="" + +## Console type +consoleverbose="no" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Pavlov VR" +engine="unreal5" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/Pavlov" +executabledir="${systemdir}/Binaries/Linux" +executable="./PavlovServer-Linux-Shipping" +servercfgdir="${systemdir}/Saved/Config/LinuxServer" +servercfg="Game.ini" +servercfgdefault="Game.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/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/config-default/config-lgsm/pwserver/_default.cfg b/lgsm/config-default/config-lgsm/pwserver/_default.cfg new file mode 100644 index 000000000..5e848264e --- /dev/null +++ b/lgsm/config-default/config-lgsm/pwserver/_default.cfg @@ -0,0 +1,188 @@ +################################## +######## 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 +servername="LinuxGSM" + +# For community servers (serverlist) you need to change these settings (publicip & publicport) in the gameserver config file aswell +port="8211" +steamport="27015" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +## Game Server Docs | https://tech.palworldgame.com/settings-and-operation/arguments +startparameters="-publiclobby -useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS -servername='${servername}' -port='${port}' -queryport='${steamport}'" + +#### 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 +appid="2394010" +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="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="palworld" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Palworld" +engine="unreal5" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/Pal" +executabledir="${systemdir}/Binaries/Linux/" +executable="./PalServer-Linux-Shipping" +servercfgdir="${serverfiles}/Pal/Saved/Config/LinuxServer" +servercfg="PalWorldSettings.ini" +servercfgdefault="PalWorldSettings.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/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/config-default/config-lgsm/pzserver/_default.cfg b/lgsm/config-default/config-lgsm/pzserver/_default.cfg index da9ae479d..f830d7cc4 100644 --- a/lgsm/config-default/config-lgsm/pzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pzserver/_default.cfg @@ -8,14 +8,12 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" adminpassword="CHANGE_ME" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-ip ${ip} -adminpassword \"${adminpassword}\" -servername ${selfname}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-servername ${selfname}" #### LinuxGSM Settings #### @@ -33,8 +31,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -45,18 +44,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -65,18 +62,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -106,8 +110,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="380870" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -122,17 +128,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Project Zomboid" @@ -155,7 +166,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${HOME}/Zomboid/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -167,3 +178,7 @@ 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/config-default/config-lgsm/q2server/_default.cfg b/lgsm/config-default/config-lgsm/q2server/_default.cfg index 832f641c7..79820d650 100644 --- a/lgsm/config-default/config-lgsm/q2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/q2server/_default.cfg @@ -8,15 +8,13 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27910" defaultmap="q2dm1" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="+set dedicated 1 +set ip ${ip} +set port ${port} +exec ${servercfg} +set deathmatch 1 +map ${defaultmap}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set dedicated 1 +set ip ${ip} +set port ${port} +exec ${servercfg} +set deathmatch 1 +map ${defaultmap}" #### LinuxGSM Settings #### @@ -34,8 +32,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -46,18 +45,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -66,18 +63,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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="" ## Backup | https://docs.linuxgsm.com/commands/backup @@ -112,17 +116,22 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-quake2" +## Console type +consoleverbose="yes" +consoleinteract="yes" + ## Game Server Details # Do not edit gamename="Quake 2" @@ -145,7 +154,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -157,3 +166,7 @@ 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/config-default/config-lgsm/q3server/_default.cfg b/lgsm/config-default/config-lgsm/q3server/_default.cfg index 6d28f4caf..74b0d11f3 100644 --- a/lgsm/config-default/config-lgsm/q3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/q3server/_default.cfg @@ -8,15 +8,13 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27960" defaultmap="q3dm17" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set com_hunkMegs 32 +set net_ip ${ip} +set net_port ${port} +exec ${servercfg} +map ${defaultmap}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set com_hunkMegs 32 +set net_ip ${ip} +set net_port ${port} +map ${defaultmap} +exec ${servercfg}" #### LinuxGSM Settings #### @@ -34,8 +32,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -46,18 +45,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -66,18 +63,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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="" ## Backup | https://docs.linuxgsm.com/commands/backup @@ -112,17 +116,22 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-quake3" +## Console type +consoleverbose="yes" +consoleinteract="yes" + ## Game Server Details # Do not edit gamename="Quake 3: Arena" @@ -145,7 +154,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -157,3 +166,7 @@ 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/config-default/config-lgsm/q4server/_default.cfg b/lgsm/config-default/config-lgsm/q4server/_default.cfg new file mode 100644 index 000000000..d07828e9f --- /dev/null +++ b/lgsm/config-default/config-lgsm/q4server/_default.cfg @@ -0,0 +1,188 @@ +################################## +######## 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 #### + +## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login +steamuser="username" +steampass='password' + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +port="28004" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set net_port ${port} +exec ${servercfg}" + +#### 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 +appid="2210" +steamcmdforcewindows="yes" +# 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="quake4" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Quake 4" +engine="idtech3_ql" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./quake4-dedicated" +servercfgdir="${systemdir}/q4base" +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="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +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/config-default/config-lgsm/qlserver/_default.cfg b/lgsm/config-default/config-lgsm/qlserver/_default.cfg index 3a5471ad6..84631b765 100644 --- a/lgsm/config-default/config-lgsm/qlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/qlserver/_default.cfg @@ -8,12 +8,8 @@ #### Game Server Settings #### -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -# Edit with care | Install/Config Guide : https://steamcommunity.com/sharedfiles/filedetails/?id=542966946 -# Console Commands : http://www.regurge.at/ql -fn_parms(){ -parms="+exec ${servercfg}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+exec ${servercfg}" #### LinuxGSM Settings #### @@ -31,8 +27,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -43,18 +40,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -63,18 +58,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -104,8 +106,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="349090" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -120,17 +124,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Quake Live" @@ -153,7 +162,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -166,3 +175,7 @@ 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/config-default/config-lgsm/qwserver/_default.cfg b/lgsm/config-default/config-lgsm/qwserver/_default.cfg index 59cdcc0f1..620943c3e 100644 --- a/lgsm/config-default/config-lgsm/qwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/qwserver/_default.cfg @@ -8,14 +8,12 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27500" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-port ${port} -game ktx +exec ${servercfg}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-port ${port} -game ktx +exec ${servercfg}" #### LinuxGSM Settings #### @@ -33,8 +31,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -45,18 +44,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -65,18 +62,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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="" ## Backup | https://docs.linuxgsm.com/commands/backup @@ -111,17 +115,22 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-quake1" +## Console type +consoleverbose="yes" +consoleinteract="yes" + ## Game Server Details # Do not edit gamename="QuakeWorld" @@ -144,7 +153,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -156,3 +165,7 @@ 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/config-default/config-lgsm/ricochetserver/_default.cfg b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg index b825fb75b..bb1957de0 100644 --- a/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg @@ -8,17 +8,15 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" defaultmap="rc_arena" maxplayers="16" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game ricochet -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game ricochet -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,9 +113,11 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="90" +steamcmdforcewindows="no" appidmod="ricochet" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="9" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Ricochet" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/roserver/_default.cfg b/lgsm/config-default/config-lgsm/roserver/_default.cfg index 3cbfd5888..0af49a0d4 100644 --- a/lgsm/config-default/config-lgsm/roserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/roserver/_default.cfg @@ -12,14 +12,12 @@ steamuser="username" steampass='password' -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" defaultmap="RO-Arad.rom" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="server ${defaultmap}?game=ROGame.ROTeamGame?VACSecured=true -nohomedir ini=${servercfg} log=${gamelog}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="server ${defaultmap}?game=ROGame.ROTeamGame?VACSecured=true -nohomedir ini=${servercfg} log=${gamelog}" #### LinuxGSM Settings #### @@ -37,8 +35,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -49,18 +48,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -69,18 +66,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -110,8 +114,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="223250" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -126,16 +132,21 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" -querytype="protocol-unreal2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" ## Game Server Details # Do not edit @@ -147,7 +158,6 @@ glibc="2.4" # Edit with care ## Game Server Directories -serverfiles="${rootdir}/serverfiles" systemdir="${serverfiles}/system" executabledir="${systemdir}" executable="./ucc-bin" @@ -161,7 +171,7 @@ compressedmapsdir="${rootdir}/Maps-Compressed" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -175,3 +185,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg b/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg index 93b9ce3fe..9011bbced 100644 --- a/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg @@ -8,15 +8,13 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27960" defaultmap="mp_beach" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 1 +set net_ip ${ip} +set net_port ${port} +exec ${servercfg} +map ${defaultmap}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 1 +set net_ip ${ip} +set net_port ${port} +exec ${servercfg} +map ${defaultmap}" #### LinuxGSM Settings #### @@ -34,8 +32,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -46,18 +45,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -66,18 +63,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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="" ## Backup | https://docs.linuxgsm.com/commands/backup @@ -112,17 +116,22 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-quake3" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Return to Castle Wolfenstein" @@ -145,7 +154,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -157,3 +166,7 @@ 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/config-default/config-lgsm/rustserver/_default.cfg b/lgsm/config-default/config-lgsm/rustserver/_default.cfg index cf70cdae7..cf609a84c 100644 --- a/lgsm/config-default/config-lgsm/rustserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rustserver/_default.cfg @@ -8,42 +8,28 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters -# More settings available after install in serverfiles/server/rust-server/server.cfg +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="28015" rconport="28016" +appport="28082" +queryport="28017" rconpassword="CHANGE_ME" -rconweb="1" # Value is: 1 for Facepunch's web panel; 0 for RCON tools like Rusty or Rustadmin -servername="Rust" +rconweb="1" # values: Facepunch web panel, Rustadmin desktop and Rustadmin Online = 1, Rusty = 0. +servername="LinuxGSM" +gamemode="vanilla" # values: vanilla, softcore ( Doc: https://wiki.facepunch.com/rust/server-gamemodes ) +serverlevel="Procedural Map" # values: Procedural Map, Barren, HapisIsland, SavasIsland +customlevelurl="" # Custom level url. +server.levelurl \"${customlevelurl}\" +seed="" # range: 1-2147483647, used to reproduce a procedural map. +salt="" # range: unknown, used to recover a known setting from an existing map. maxplayers="50" +worldsize="3000" # default: 3000, range: 1000-6000, map size in meters. +saveinterval="300" # Auto-save in seconds. +tickrate="30" # default: 30, range: 15-100. +tags="" # values: monthly, biweekly, weekly, vanilla, hardcore, softcore, pve, roleplay, creative, minigame, training, battlefield, broyale, builds, NA, SA, EU, WA, EA, OC, AF ( Doc: https://wiki.facepunch.com/rust/server-browser-tags ) -# Advanced Start Settings -seed="" # default random; range : 1 to 2147483647 ; used to change or reproduce a procedural map -salt="" # default random; range : unknown range ; used to recover a known setting from an existing map -worldsize="3000" # default 3000; range : 1000 to 6000 ; map size in meters -saveinterval="300" # Auto-save in seconds -tickrate="30" # default 30; range : 15 to 100 - -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -# Specific to Rust -if [ "${seed}" ]; then - # If set, then add to start parms - conditionalseed="+server.seed ${seed}" -else - # Keep randomness of the number if not set - conditionalseed="" -fi -if [ "${salt}" ]; then - # If set, then add to start parms - conditionalsalt="+server.salt ${salt}" -else - # Keep randomness of the number if not set - conditionalsalt="" -fi -parms="-batchmode +server.ip ${ip} +server.port ${port} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${selfname}\" ${conditionalseed} ${conditionalsalt} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.web ${rconweb} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile \"${gamelogdate}\"" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-batchmode +app.listenip ${ip} +app.port ${appport} +server.ip ${ip} +server.port ${port} +server.queryport ${queryport} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${selfname}\" +server.gamemode ${gamemode} +server.level \"${serverlevel}\" +server.seed ${seed} +server.salt ${salt} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.web ${rconweb} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" +server.tags ${tags} -logfile ${gamelog}" #### LinuxGSM Settings #### @@ -61,8 +47,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -73,18 +60,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -93,18 +78,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -121,7 +113,7 @@ logdays="7" ## Monitor | https://docs.linuxgsm.com/commands/monitor # Query delay time -querydelay="5" +querydelay="10" ## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors ansi="on" @@ -134,8 +126,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="258550" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -150,17 +144,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Rust" @@ -184,10 +183,11 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" lgsmlog="${lgsmlogdir}/${selfname}-script.log" consolelog="${consolelogdir}/${selfname}-console.log" alertlog="${lgsmlogdir}/${selfname}-alert.log" @@ -197,3 +197,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/rwserver/_default.cfg b/lgsm/config-default/config-lgsm/rwserver/_default.cfg index 95c37ef2d..9523dd63b 100644 --- a/lgsm/config-default/config-lgsm/rwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rwserver/_default.cfg @@ -8,13 +8,8 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters -javaram="2048" # -Xmx$2048M - -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="" #### LinuxGSM Settings #### @@ -32,8 +27,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -44,18 +40,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -64,18 +58,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -105,8 +106,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="339010" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch -branch="" +branch="unity" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -121,22 +124,27 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp -querymode="1" -querytype="" +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" ## Game Server Details # Do not edit gamename="Rising World" -engine="risingworld" -glibc="null" +engine="unity3d" +glibc="2.17" #### Directories #### # Edit with care @@ -144,7 +152,7 @@ glibc="null" ## Game Server Directories systemdir="${serverfiles}" executabledir="${serverfiles}" -executable="java -Xmx${javaram}m -jar ${serverfiles}/server.jar" +executable="./RisingWorldServer.x64" servercfgdir="${systemdir}" servercfg="server.properties" servercfgdefault="server.properties" @@ -154,7 +162,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -166,3 +174,7 @@ 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/config-default/config-lgsm/sampserver/_default.cfg b/lgsm/config-default/config-lgsm/sampserver/_default.cfg index 67331ee39..870603bb0 100644 --- a/lgsm/config-default/config-lgsm/sampserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sampserver/_default.cfg @@ -8,14 +8,12 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="7777" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="" #### LinuxGSM Settings #### @@ -33,8 +31,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -45,18 +44,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -65,18 +62,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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="" ## Backup | https://docs.linuxgsm.com/commands/backup @@ -111,16 +115,21 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="3" -querytype="samp" +querytype="gtasam" + +## Console type +consoleverbose="no" +consoleinteract="no" ## Game Server Details # Do not edit @@ -144,7 +153,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/samp03" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -156,3 +165,7 @@ 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/config-default/config-lgsm/sbotsserver/_default.cfg b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg index 6145c9905..82d651ec3 100644 --- a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg @@ -8,18 +8,14 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters port="7777" queryport="27015" defaultmap="StationKappa" -servername="LinuxGSM Server" -serverpassword="NOT SET" # Can't be adjusted currently -maxplayers="8" # Can't be adjusted currently +servername="LinuxGSM" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="Port=${port}?QueryPort=${queryport} -startup_map ${defaultmap} -server_name \"${servername}\"" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -startup_map ${defaultmap} -server_name '${servername}'" #### LinuxGSM Settings #### @@ -37,8 +33,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -49,18 +46,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -69,18 +64,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -110,8 +112,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="974130" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -126,17 +130,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="StickyBots" @@ -150,16 +159,11 @@ glibc="2.17" systemdir="${serverfiles}" executabledir="${systemdir}/blank1/Binaries/Linux" executable="./blank1Server-Linux-Shipping" -servercfgdir="${systemdir}/blank1/Saved/Config/LinuxServer" -servercfg="Game.ini" -servercfgdefault="Game.ini" -servercfgfullpath="${servercfgdir}/${servercfg}" - ## Backup Directory backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +175,7 @@ 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/config-default/config-lgsm/sbserver/_default.cfg b/lgsm/config-default/config-lgsm/sbserver/_default.cfg index f9ae836d1..3d06b4235 100644 --- a/lgsm/config-default/config-lgsm/sbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sbserver/_default.cfg @@ -12,13 +12,11 @@ steamuser="username" steampass='password' -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="" #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,9 +113,12 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="211820" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" -steammaster="flase" +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 @@ -124,17 +131,22 @@ steammaster="flase" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Starbound" @@ -157,7 +169,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/storage" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -169,3 +181,7 @@ 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/config-default/config-lgsm/scpslserver/_default.cfg b/lgsm/config-default/config-lgsm/scpslserver/_default.cfg new file mode 100644 index 000000000..237bbebe3 --- /dev/null +++ b/lgsm/config-default/config-lgsm/scpslserver/_default.cfg @@ -0,0 +1,185 @@ +################################## +######## 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 +## All server settings except the server port are done in the config file: +## Docs: https://en.scpslgame.com/index.php?title=Docs:Server_Config +port="7777" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="${port}" + +#### 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 +appid="996560" +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="7" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="SCP: Secret Laboratory" +engine="unity3d" +glibc="2.27" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./LocalAdmin" +servercfg="config_gameplay.txt" +servercfgdefault="config_gameplay.txt" +servercfgdir="${HOME}/.config/SCP Secret Laboratory/config/${port}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${HOME}/.config/SCP Secret Laboratory/LocalAdminLogs/${port}" +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/config-default/config-lgsm/scpslsmserver/_default.cfg b/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg new file mode 100644 index 000000000..e54814df2 --- /dev/null +++ b/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg @@ -0,0 +1,185 @@ +################################## +######## 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 +## All server settings except the server port are done in the config file: +## Docs: https://en.scpslgame.com/index.php?title=Docs:Server_Config +port="7777" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="${port}" + +#### 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 +appid="786920" +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="7" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="SCP: Secret Laboratory ServerMod" +engine="unity3d" +glibc="2.27" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./LocalAdmin" +servercfg="config_gameplay.txt" +servercfgdefault="config_gameplay.txt" +servercfgdir="${HOME}/.config/SCP Secret Laboratory/config/${port}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${HOME}/.config/SCP Secret Laboratory/LocalAdminLogs/${port}" +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/config-default/config-lgsm/sdtdserver/_default.cfg b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg index 6269e6150..0a091dae4 100644 --- a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg @@ -8,13 +8,11 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-logfile ${gamelogdir}/output_log__$(date +%Y-%m-%d__%H-%M-%S).txt -quit -batchmode -nographics -dedicated -configfile=${servercfgfullpath}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-quit -batchmode -nographics -dedicated -configfile=${servercfgfullpath}" #### LinuxGSM Settings #### @@ -32,8 +30,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -44,18 +43,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -64,18 +61,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -105,8 +109,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="294420" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -121,22 +127,27 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="8" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="7 Days To Die" engine="unity3d" -glibc="2.15" +glibc="2.27" #### Directories #### # Edit with care @@ -144,7 +155,7 @@ glibc="2.15" ## Game Server Directories systemdir="${serverfiles}" executabledir="${serverfiles}" -executable=$([ "$(uname -m)" == "x86_64" ] && echo -e "./7DaysToDieServer.x86_64" || echo -e "./7DaysToDieServer.x86") +executable="./7DaysToDieServer.x86_64" servercfgdir="${systemdir}" servercfg="${selfname}.xml" servercfgdirdefault="${serverfiles}" @@ -155,7 +166,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -168,3 +179,7 @@ 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/config-default/config-lgsm/secrets-common-template.cfg b/lgsm/config-default/config-lgsm/secrets-common-template.cfg new file mode 100644 index 000000000..d8ded6aa9 --- /dev/null +++ b/lgsm/config-default/config-lgsm/secrets-common-template.cfg @@ -0,0 +1,5 @@ +################################## +######## Common Secrets ########## +################################## +# PLACE GLOBAL SECRET SETTINGS HERE +## These settings will apply to all instances. diff --git a/lgsm/config-default/config-lgsm/secrets-instance-template.cfg b/lgsm/config-default/config-lgsm/secrets-instance-template.cfg new file mode 100644 index 000000000..5446d3718 --- /dev/null +++ b/lgsm/config-default/config-lgsm/secrets-instance-template.cfg @@ -0,0 +1,5 @@ +################################## +####### Instance Secrets ######### +################################## +# PLACE INSTANCE SECRET SETTINGS HERE +## These settings will apply to a specific instance. diff --git a/lgsm/config-default/config-lgsm/sfcserver/_default.cfg b/lgsm/config-default/config-lgsm/sfcserver/_default.cfg index 2203ba14b..831f92353 100644 --- a/lgsm/config-default/config-lgsm/sfcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sfcserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -16,10 +16,8 @@ sourcetvport="27020" defaultmap="sf_astrodome" maxplayers="32" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game sfclassic -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game sfclassic -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -37,8 +35,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -49,18 +48,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -69,18 +66,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -110,8 +114,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="244310" # Source 2013 SDK +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="SourceForts Classic" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/sfserver/_default.cfg b/lgsm/config-default/config-lgsm/sfserver/_default.cfg new file mode 100644 index 000000000..d6ce41d82 --- /dev/null +++ b/lgsm/config-default/config-lgsm/sfserver/_default.cfg @@ -0,0 +1,187 @@ +################################## +######## 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" +queryport="15777" +beaconport="15000" +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" + +#### 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 +appid="1690800" +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="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Satisfactory" +engine="unreal5" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/FactoryGame" +executabledir="${serverfiles}/Engine/Binaries/Linux" +executable="./FactoryServer-Linux-Shipping" +servercfgdir="${systemdir}/Saved/Config/LinuxServer" +servercfg="GameUserSettings.ini" +servercfgdefault="GameUserSettings.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/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/config-default/config-lgsm/smserver/_default.cfg b/lgsm/config-default/config-lgsm/smserver/_default.cfg new file mode 100644 index 000000000..306179b9c --- /dev/null +++ b/lgsm/config-default/config-lgsm/smserver/_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 #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +servername="LinuxGSM" +serverpassword="" +adminpassword="" +port="8777" +queryport="27015" +telnetport="18888" +maxplayers="50" +backupinterval="15" # Backup interval in minutes. +defaultmap="Level01_Main" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="WS ${defaultmap} -MultiHome=${ip} -Port=${port} -EchoPort=${telnetport} -QueryPort=${queryport} -SteamServerName='${servername}' -PSW='${serverpassword}' -adminpsw='${adminpassword}' -MaxPlayers=${maxplayers} -initbackup -backupinterval=${backupinterval} -UTF8Output -forcepassthrough -log" + +#### 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="5" + +## 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="3017300" +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 +# 12: shutdown +# 13: soulmask +stopmode="13" + +## 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="no" + +## Game Server Details +# Do not edit +gamename="Soulmask" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/WS" +executabledir="${systemdir}/Binaries/Linux" +executable="./WSServer-Linux-Shipping" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${systemdir}/WS/Saved/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/config-default/config-lgsm/sof2server/_default.cfg b/lgsm/config-default/config-lgsm/sof2server/_default.cfg index 090330f49..e00afefa1 100644 --- a/lgsm/config-default/config-lgsm/sof2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/sof2server/_default.cfg @@ -8,15 +8,13 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="20100" defaultmap="mp_shop" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="+set sv_punkbuster 0 +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +exec ${servercfg} +map ${defaultmap}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +exec ${servercfg} +map ${defaultmap}" #### LinuxGSM Settings #### @@ -34,8 +32,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -46,18 +45,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -66,18 +63,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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="" ## Backup | https://docs.linuxgsm.com/commands/backup @@ -112,17 +116,22 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-quake3" +## Console type +consoleverbose="yes" +consoleinteract="yes" + ## Game Server Details # Do not edit gamename="Soldier Of Fortune 2: Gold Edition" @@ -145,7 +154,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -157,3 +166,7 @@ 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/config-default/config-lgsm/solserver/_default.cfg b/lgsm/config-default/config-lgsm/solserver/_default.cfg index d1f853dca..8581104dd 100644 --- a/lgsm/config-default/config-lgsm/solserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/solserver/_default.cfg @@ -8,14 +8,12 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" maplist="mapslist.txt" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-b ${ip} -m ${maplist} -c ${servercfg}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-b ${ip} -m ${maplist} -c ${servercfg}" #### LinuxGSM Settings #### @@ -33,8 +31,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -45,18 +44,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -65,20 +62,30 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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" @@ -103,8 +110,12 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="638500" +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 @@ -117,16 +128,21 @@ branch="" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp -querymode="4" -querytype="soldat" +querymode="5" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="no" ## Game Server Details # Do not edit @@ -150,7 +166,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -162,3 +178,7 @@ 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/config-default/config-lgsm/squadserver/_default.cfg b/lgsm/config-default/config-lgsm/squadserver/_default.cfg index 81eb50c01..99b91b538 100644 --- a/lgsm/config-default/config-lgsm/squadserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/squadserver/_default.cfg @@ -8,15 +8,13 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters port="7787" queryport="27165" -randommap="ALWAYS" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="MULTIHOME=${ip} RANDOM=${randommap} Port=${port} QueryPort=${queryport}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +## Game Server Docs | https://squad.fandom.com/wiki/Dedicated_server +startparameters="-MultiHome=${ip} -Port=${port} -QueryPort=${queryport}" #### LinuxGSM Settings #### @@ -34,8 +32,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -46,18 +45,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -66,18 +63,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -107,10 +111,12 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="403240" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server -steammaster="false" +steammaster="true" ## Stop Mode | https://docs.linuxgsm.com/features/stop-mode # 1: tmux kill @@ -123,16 +129,21 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="protocol-valve" +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="no" ## Game Server Details # Do not edit @@ -144,11 +155,11 @@ glibc="2.17" # Edit with care ## Game Server Directories -systemdir="${serverfiles}/Squad" +systemdir="${serverfiles}/SquadGame" executabledir="${serverfiles}" executable="./SquadGameServer.sh" servercfgdir="${systemdir}/ServerConfig" -servercfg="${selfname}.cfg" +servercfg="Server.cfg" servercfgdefault="Server.cfg" servercfgfullpath="${servercfgdir}/${servercfg}" @@ -156,7 +167,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -169,3 +180,7 @@ 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/config-default/config-lgsm/stnserver/_default.cfg b/lgsm/config-default/config-lgsm/stnserver/_default.cfg new file mode 100644 index 000000000..70c7d290c --- /dev/null +++ b/lgsm/config-default/config-lgsm/stnserver/_default.cfg @@ -0,0 +1,186 @@ +################################## +######## 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 #### +maxplayers="20" +# Regions: USA: 0, EU: 1, AUS: 2 +region="0" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +# https://colonysurvival.gamepedia.com/Dedicated_Server#Installation_.28Linux.29 +startparameters="-mc ${maxplayers} -r ${region}" + +#### 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 +appid="1502300" +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="2" + +## 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="no" + +## Game Server Details +# Do not edit +gamename="Survive the Nights" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./Server_Linux_x64" +servercfgdir="${systemdir}/Config" +servercfg="ServerConfig.txt" +servercfgdefault="ServerConfig.txt" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${serverfiles}" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" +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/config-default/config-lgsm/stserver/_default.cfg b/lgsm/config-default/config-lgsm/stserver/_default.cfg index 581c1481a..2f2fe0ed4 100644 --- a/lgsm/config-default/config-lgsm/stserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stserver/_default.cfg @@ -8,20 +8,12 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters -ip="0.0.0.0" -port="27500" -queryport="27015" -worldtype="Moon" -autosaveinterval=300 -clearinterval=60 +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters worldname="moon_save" +worldtype="Moon" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -# Edit with care -fn_parms(){ -parms="-batchmode -nographics -autostart -gameport=${port} -updateport=${queryport} -worldtype=${worldtype} -loadworld=${worldname} -worldname=${worldname} -autosaveinterval=${autosaveinterval} -clearallinterval=${clearinterval}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-LOADLATEST ${worldname} ${worldtype}" #### LinuxGSM Settings #### @@ -39,8 +31,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -51,18 +44,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -71,18 +62,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -112,8 +110,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="600760" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -128,22 +128,27 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion -stopmode="2" +# 11: end +stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="protocol-valve" +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="yes" ## Game Server Details # Do not edit gamename="Stationeers" engine="unity3d" -glibc="2.15" +glibc="2.34" #### Directories #### # Edit with care @@ -153,15 +158,15 @@ systemdir="${serverfiles}" executabledir="${serverfiles}" executable="./rocketstation_DedicatedServer.x86_64" servercfgdir="${systemdir}" -servercfg="default.ini" -servercfgdefault="default.ini" +servercfg="setting.xml" +servercfgdefault="setting.xml" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${HOME}/.config/unity3d/Rocketwerkz/Stationeers" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -173,3 +178,7 @@ 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/config-default/config-lgsm/svenserver/_default.cfg b/lgsm/config-default/config-lgsm/svenserver/_default.cfg index 72b3acadd..4cd97c50e 100644 --- a/lgsm/config-default/config-lgsm/svenserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/svenserver/_default.cfg @@ -8,17 +8,15 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" defaultmap="svencoop1" maxplayers="16" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game svencoop -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} +maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game svencoop -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} +maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,8 +113,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="276060" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -125,17 +131,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="9" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Sven Co-op" @@ -158,7 +169,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -170,3 +181,7 @@ 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/config-default/config-lgsm/terrariaserver/_default.cfg b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg index 3f941122f..fc0d291c9 100644 --- a/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg @@ -12,13 +12,11 @@ steamuser="username" steampass='password' -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-config ${servercfgfullpath}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-config ${servercfgfullpath}" #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,8 +113,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="105600" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -125,17 +131,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="7" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="5" querytype="" +## Console type +consoleverbose="yes" +consoleinteract="yes" + ## Game Server Details # Do not edit gamename="Terraria" @@ -158,7 +169,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" #gamelogdir="" # No server logs available lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -170,3 +181,7 @@ 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/config-default/config-lgsm/tf2server/_default.cfg b/lgsm/config-default/config-lgsm/tf2server/_default.cfg index 31eefeb12..600249013 100644 --- a/lgsm/config-default/config-lgsm/tf2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/tf2server/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -21,10 +21,8 @@ maxplayers="16" # More info: https://docs.linuxgsm.com/steamcmd/gslt gslt="" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game tf -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game tf -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -42,8 +40,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -54,18 +53,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -74,18 +71,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -115,8 +119,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="232250" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -131,17 +137,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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" @@ -164,7 +175,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -176,3 +187,7 @@ 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/config-default/config-lgsm/tfcserver/_default.cfg b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg index ccd4988e0..17787eef5 100644 --- a/lgsm/config-default/config-lgsm/tfcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg @@ -8,17 +8,15 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" defaultmap="dustbowl" maxplayers="16" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game tfc -strictportbind _ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game tfc -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,9 +113,11 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="90" +steamcmdforcewindows="no" appidmod="tfc" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="9" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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 Classic" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/tfserver/_default.cfg b/lgsm/config-default/config-lgsm/tfserver/_default.cfg new file mode 100644 index 000000000..fbce96a44 --- /dev/null +++ b/lgsm/config-default/config-lgsm/tfserver/_default.cfg @@ -0,0 +1,200 @@ +################################## +######## 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="5001" +beaconport="5002" +shutdownport="5003" +queryport="27015" +adminlabel="true" # Enable admin icon. +allowsensitivewords="true" +altsavedirectoryname="${defaultmap}" +anticheat="true" +damageself="true" +damangeallies="true" +gamemode="0" # 0 = PvP; 1 = PvE +greenhand="true" +maxplayers="40" +maxqueuesize="50" +queuevalidtime="120" +saveinterval="300" # Auto-save in seconds. +serveradmins="" # Use 17-digit Steam IDs separated by commas to grant admin privileges to players. +servername="LinuxGSM" +serverpassword="" +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}'" + +#### 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="5" + +## 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="2334200" +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="2" + +## 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="no" + +## Game Server Details +# Do not edit +gamename="The Front" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/ProjectWar" +executabledir="${systemdir}/Binaries/Linux" +executable="./TheFrontServer" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/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/config-default/config-lgsm/tiserver/_default.cfg b/lgsm/config-default/config-lgsm/tiserver/_default.cfg new file mode 100644 index 000000000..4090d85c9 --- /dev/null +++ b/lgsm/config-default/config-lgsm/tiserver/_default.cfg @@ -0,0 +1,186 @@ +################################## +######## 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="7777" +defaultmap="/Game/TheIsle/Maps/Game/Gateway/Gateway" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +## Game Server Docs | https://isle.fandom.com/wiki/The_Isle_Server_Settings_and_Configuration +startparameters="${defaultmap} -Port=${port} -log" + +#### 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 +appid="412680" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="evrima" +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="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="The Isle" +engine="unreal5" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/TheIsle" +executabledir="${systemdir}/Binaries/Linux" +executable="./TheIsleServer-Linux-Shipping" +servercfgdir="${systemdir}/Saved/Config/LinuxServer" +servercfg="Game.ini" +servercfgdefault="Game.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/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/config-default/config-lgsm/ts3server/_default.cfg b/lgsm/config-default/config-lgsm/ts3server/_default.cfg index 3a511b394..bacda7aaa 100644 --- a/lgsm/config-default/config-lgsm/ts3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ts3server/_default.cfg @@ -8,13 +8,8 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters -# Edit serverfiles/ts3server.ini after installation - -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="inifile=${servercfgfullpath} pid_file=ts3server.pid" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="inifile=${servercfgfullpath} pid_file=ts3server.pid" #### LinuxGSM Settings #### @@ -32,8 +27,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -44,18 +40,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -64,18 +58,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -113,21 +114,26 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="5" -querytype="" +querytype="teamspeak3" + +## Console type +consoleverbose="yes" +consoleinteract="no" ## Game Server Details # Do not edit gamename="TeamSpeak 3" -servername="TeamSpeak 3 Server" +servername="LinuxGSM" engine="null" glibc="2.17" @@ -147,7 +153,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -159,3 +165,7 @@ 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/config-default/config-lgsm/tsserver/_default.cfg b/lgsm/config-default/config-lgsm/tsserver/_default.cfg index f73622b42..418727ae6 100644 --- a/lgsm/config-default/config-lgsm/tsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tsserver/_default.cfg @@ -8,17 +8,15 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" defaultmap="ts_neobaroque" maxplayers="32" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game ts -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers} " -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game ts -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers} " #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,9 +113,11 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="90" +steamcmdforcewindows="no" appidmod="cstrike" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="9" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="The Specialists" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/tuserver/_default.cfg b/lgsm/config-default/config-lgsm/tuserver/_default.cfg index ff4165e45..ba22c5aa6 100644 --- a/lgsm/config-default/config-lgsm/tuserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tuserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="7777" queryport="27015" @@ -18,10 +18,8 @@ queryport="27015" # More info: https://docs.linuxgsm.com/steamcmd/gslt gslt="" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-log -MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -TowerServerINI=${selfname}.ini" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -TowerServerINI=${selfname}.ini -log" #### LinuxGSM Settings #### @@ -39,8 +37,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -51,18 +50,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -71,18 +68,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -112,8 +116,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="439660" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -128,17 +134,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Tower Unite" @@ -161,7 +172,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -173,3 +184,7 @@ 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/config-default/config-lgsm/twserver/_default.cfg b/lgsm/config-default/config-lgsm/twserver/_default.cfg index 461c97059..4d47cb2d1 100644 --- a/lgsm/config-default/config-lgsm/twserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/twserver/_default.cfg @@ -12,13 +12,11 @@ steamuser="username" steampass='password' -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-f ${servercfg}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-f ${servercfg}" #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,8 +113,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="380840" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -125,17 +131,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="4" querytype="teeworlds" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Teeworlds" @@ -158,7 +169,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/untserver/_default.cfg b/lgsm/config-default/config-lgsm/untserver/_default.cfg index ef0fe4c24..a556c1758 100644 --- a/lgsm/config-default/config-lgsm/untserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/untserver/_default.cfg @@ -8,20 +8,22 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" maxplayers="20" -defaultmap="pei" +defaultmap="PEI" +servername="LinuxGSM" +perspective="first" # values: first, third, vehicle, Both. +gamemode="normal" # values: normal, easy, gold. -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +## Game Server Login Token (GSLT): Required +# GSLT is required for running a public server. +# More info: https://docs.linuxgsm.com/steamcmd/gslt +gslt="" -# Parameters are changed in game.ini and engine.ini (Location: ${systemdir}/Saved/Config/LinuxServer) -# Make sure you change the admin password before launching the server - -fn_parms(){ -parms="-port:${port} -players:${maxplayers} --nographics -${defaultmap} -batchmode +secureserver/${selfname}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-nographics -batchmode -bind ${ip} -port ${port} -maxplayers ${maxplayers} -perspective ${perspective} -mode ${gamemode} -name ${servername} -map ${defaultmap} -gslt ${gslt} +InternetServer/${selfname}" #### LinuxGSM Settings #### @@ -39,8 +41,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -51,18 +54,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -71,18 +72,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -112,8 +120,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="1110390" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -128,17 +138,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Unturned" @@ -161,7 +176,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -173,3 +188,7 @@ 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/config-default/config-lgsm/ut2k4server/_default.cfg b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg index 9c4164c72..ef8fab731 100644 --- a/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg @@ -8,14 +8,12 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters defaultmap="DM-Rankin" ip="0.0.0.0" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="server ${defaultmap}?game=XGame.xDeathMatch -nohomedir ini=${servercfg} log=${gamelog}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="server ${defaultmap}?game=XGame.xDeathMatch -nohomedir ini=${servercfg} log=${gamelog}" #### LinuxGSM Settings #### @@ -33,8 +31,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -45,18 +44,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -65,18 +62,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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="" ## Backup | https://docs.linuxgsm.com/commands/backup @@ -111,17 +115,22 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-unreal2" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Unreal Tournament 2004" @@ -145,7 +154,7 @@ compressedmapsdir="${rootdir}/Maps-Compressed" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -159,3 +168,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/ut3server/_default.cfg b/lgsm/config-default/config-lgsm/ut3server/_default.cfg index b42227859..22817e40c 100644 --- a/lgsm/config-default/config-lgsm/ut3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut3server/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="7777" queryport="6500" @@ -22,16 +22,14 @@ usesstats="false" shouldadvertise="true" pureserver="1" allowjoininprogress="true" -# Required: GameSpy Username and password -# https://docs.linuxgsm.com/game-servers/unreal-tournament-3#server-gamespy-login +# Required: OpenSpy Username and password +# https://docs.linuxgsm.com/game-servers/unreal-tournament-3#server-openspy-login gsusername="" gspassword="" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -# Edit with care | List of game types and mutators: https://docs.linuxgsm.com/game-servers/unreal-tournament-3 -fn_parms(){ -parms="server ${defaultmap}?Game=${game}?bIsDedicated=${isdedicated}?bIsLanMatch=${islanmatch}?bUsesStats=${usesstats}?bShouldAdvertise=${shouldadvertise}?PureServer=${pureserver}?bAllowJoinInProgress=${allowjoininprogress}?Mutator=${mutators}?ConfigSubDir=${selfname} -login=${gsusername} -password=${gspassword} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +# List of game types and mutators: https://docs.linuxgsm.com/game-servers/unreal-tournament-3 +startparameters="server ${defaultmap}?Game=${game}?bIsDedicated=${isdedicated}?bIsLanMatch=${islanmatch}?bUsesStats=${usesstats}?bShouldAdvertise=${shouldadvertise}?PureServer=${pureserver}?bAllowJoinInProgress=${allowjoininprogress}?Mutator=${mutators}?ConfigSubDir=${selfname} -login=${gsusername} -password=${gspassword} -multihome=${ip} -port=${port} -queryport=${queryport} -nohomedir -unattended -log=${gamelog}" #### LinuxGSM Settings #### @@ -49,8 +47,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -61,18 +60,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -81,18 +78,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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="" ## Backup | https://docs.linuxgsm.com/commands/backup @@ -127,16 +131,21 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="ut3" +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="no" ## Game Server Details # Do not edit @@ -160,7 +169,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -174,3 +183,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/ut99server/_default.cfg b/lgsm/config-default/config-lgsm/ut99server/_default.cfg index caab7ffea..3343afc81 100644 --- a/lgsm/config-default/config-lgsm/ut99server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut99server/_default.cfg @@ -8,14 +8,12 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters defaultmap="DM-Deck16][" ip="0.0.0.0" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="server ${defaultmap}.unr ini=${servercfgfullpath}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="server ${defaultmap}.unr ini=${servercfgfullpath}" #### LinuxGSM Settings #### @@ -33,8 +31,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -45,18 +44,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -65,18 +62,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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="" ## Backup | https://docs.linuxgsm.com/commands/backup @@ -111,17 +115,22 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-gamespy1" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Unreal Tournament 99" @@ -132,7 +141,7 @@ glibc="2.1" # Edit with care ## Game Server Directories -systemdir="${serverfiles}/System" +systemdir="${serverfiles}/System64" executabledir="${systemdir}" executable="./ucc-bin" servercfgdir="${systemdir}" @@ -145,7 +154,7 @@ compressedmapsdir="${rootdir}/Maps-Compressed" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -157,3 +166,7 @@ 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/config-default/config-lgsm/utserver/_default.cfg b/lgsm/config-default/config-lgsm/utserver/_default.cfg index 40d6cc526..299d2571a 100644 --- a/lgsm/config-default/config-lgsm/utserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/utserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters # For CTF: defaultmap="CTF-Face" gametype="CTF" ip="0.0.0.0" port="7777" @@ -16,10 +16,8 @@ defaultmap="DM-Underland" gametype="DM" timelimit="10" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="UnrealTournament ${defaultmap}?Game=${gametype}?TimeLimit=${timelimit} -port=${port}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="UnrealTournament ${defaultmap}?Game=${gametype}?TimeLimit=${timelimit} -port=${port}" #### LinuxGSM Settings #### @@ -37,8 +35,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -49,18 +48,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -69,18 +66,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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="" ## Backup | https://docs.linuxgsm.com/commands/backup @@ -115,17 +119,22 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="1" querytype="" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Unreal Tournament" @@ -141,13 +150,14 @@ executabledir="${systemdir}/Engine/Binaries/Linux" executable="./UE4Server-Linux-Shipping" servercfgdir="${systemdir}/UnrealTournament/Saved/Config/LinuxServer" servercfg="Game.ini" +servercfgdefault="Game.ini" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -159,3 +169,7 @@ 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/config-default/config-lgsm/vhserver/_default.cfg b/lgsm/config-default/config-lgsm/vhserver/_default.cfg new file mode 100644 index 000000000..b027d0fca --- /dev/null +++ b/lgsm/config-default/config-lgsm/vhserver/_default.cfg @@ -0,0 +1,217 @@ +################################## +######## 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 +servername="LinuxGSM" +serverpassword="" # Minimum password length is 5. +port="2456" +worldname="${selfname}" +public="1" +savedir="$HOME/.config/unity3d/IronGate/Valheim" +logFile="" +saveinterval="1800" # Auto-save in seconds. +backups="4" +backupshort="7200" +backuplong="43200" +instanceid="1" + +# INSTRUCTIONS FOR WORLD MODIFIERS (from Valheim Dedicated Server Manual.pdf located in serverfiles) +# World modifiers can only be set in the start parameters and can be a combination of the following +# PRESETS: +# Setting a preset will overwrite any other previous modifiers. +# Command line parameter: -preset +# Valid values: normal, casual, easy, hard, hardcore, immersive, hammer. +# MODIFIERS: +# This is set as a combination of key and value, if combined with a preset should be set after. +# Command line parameter: -modifier +# Valid keys and possible values: +# combat: veryeasy, easy, hard, veryhard +# deathPenalty: casual, veryeasy, easy, hard, hardcore +# resources: muchless, less, more, muchmore, most +# raids: none, muchless, less, more, muchmore +# portals: casual, hard, veryhard +# KEYS: +# Sets a world modifier checkbox key. +# Command line parameter: -setkey +# Valid values: nobuildcost, playerevents, passivemobs, nomap +# Example of a combination of modifiers where we set no raids, very hard portals and no map run: +# worldmodifiers="-modifier raids none -modifier portals veryhard -setkey nomap" +# NOTE: removing world modifiers will NOT reset them to default. the modifiers are stored in the world save file (.fwl) +# To go back to default you need to launch the server with the following parameter at least once: +#. worldmodifiers="-preset normal" + +worldmodifiers="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-name '${servername}' -password ${serverpassword} -port ${port} -world ${worldname} -public ${public} -savedir '${savedir}' -saveinterval ${saveinterval} -backups ${backups} -backupshort ${backupshort} -backuplong ${backuplong} -crossplay -instanceid ${instanceid} ${logFile:+ -logFile '${logFile}'} ${worldmodifiers:+ ${worldmodifiers}}" + +#### 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="5" + +## 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="896660" +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="2" + +## 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="no" + +## Game Server Details +# Do not edit +gamename="Valheim" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./valheim_server.x86_64" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/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/config-default/config-lgsm/vintsserver/_default.cfg b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg new file mode 100644 index 000000000..a3bc472c4 --- /dev/null +++ b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg @@ -0,0 +1,175 @@ +################################## +######## 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 #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="--dataPath ${servercfgdir}" + +## Release Settings | https://docs.linuxgsm.com/game-servers/vintagestory#release-settings +# Branch (stable|unstable) +branch="stable" + +#### 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" + +## 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="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="5" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Vintage Story" +engine="vintagestory" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +preexecutable="" +executable="./VintagestoryServer" +servercfgdir="${serverfiles}/data/${selfname}" +servercfg="serverconfig.json" +servercfgdefault="serverconfig.json" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${servercfgdir}/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/config-default/config-lgsm/vpmcserver/_default.cfg b/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg new file mode 100644 index 000000000..28bc1b2ea --- /dev/null +++ b/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg @@ -0,0 +1,179 @@ +################################## +######## 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 +javaram="1024" # -Xmx$1024M + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="" + +## Release Settings | https://docs.linuxgsm.com/game-servers/minecraft#release-settings +# Version (latest|3.1.1) +mcversion="latest" + +#### 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" + +## 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 +# 12: shutdown +stopmode="12" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="minecraft" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Velocity Proxy" +engine="lwjgl2" +glibc="null" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +preexecutable="java -Xmx${javaram}M -XX:+UseG1GC -XX:G1HeapRegionSize=4M -XX:+UnlockExperimentalVMOptions -XX:+ParallelRefProcEnabled -XX:+AlwaysPreTouch -XX:MaxInlineLevel=15 -jar" +executable="./velocity.jar" +servercfgdir="${systemdir}" +servercfg="velocity.toml" +servercfgdefault="velocity.toml" +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/config-default/config-lgsm/vsserver/_default.cfg b/lgsm/config-default/config-lgsm/vsserver/_default.cfg index 1eaa9ff86..c7976b384 100644 --- a/lgsm/config-default/config-lgsm/vsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vsserver/_default.cfg @@ -8,17 +8,15 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" defaultmap="vs_frost" maxplayers="16" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game vs -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game vs -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -36,8 +34,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -48,18 +47,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -68,18 +65,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -109,9 +113,11 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="90" +steamcmdforcewindows="no" appidmod="cstrike" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="9" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Vampire Slayer" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/wetserver/_default.cfg b/lgsm/config-default/config-lgsm/wetserver/_default.cfg index 54ee3d25b..b53a0674c 100644 --- a/lgsm/config-default/config-lgsm/wetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wetserver/_default.cfg @@ -8,10 +8,8 @@ #### Game Server Settings #### -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ - parms="+set net_strict 1 +set fs_homepath ${serverfiles} +exec ${servercfg}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set net_strict 1 +set fs_homepath ${serverfiles} +exec ${servercfg}" #### LinuxGSM Settings #### @@ -29,8 +27,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -41,18 +40,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -61,18 +58,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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="" ## Backup | https://docs.linuxgsm.com/commands/backup @@ -107,17 +111,22 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-quake3" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Wolfenstein: Enemy Territory" @@ -140,7 +149,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -152,3 +161,7 @@ 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/config-default/config-lgsm/wfserver/_default.cfg b/lgsm/config-default/config-lgsm/wfserver/_default.cfg index 1ddbd7746..d59790ca5 100644 --- a/lgsm/config-default/config-lgsm/wfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wfserver/_default.cfg @@ -8,15 +8,13 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="44400" httpport="44444" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="+exec ${servercfg} +sv_http_ip ${ip} +set sv_http_port ${httpport} +sv_ip ${ip} +sv_port ${port}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+exec ${servercfg} +sv_http_ip ${ip} +set sv_http_port ${httpport} +sv_ip ${ip} +sv_port ${port}" #### LinuxGSM Settings #### @@ -34,8 +32,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -46,18 +45,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -66,20 +63,30 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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" @@ -101,6 +108,17 @@ ansi="on" ## Message Display Time | https://docs.linuxgsm.com/features/message-display-time sleeptime="0.5" +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="1136510" +steamcmdforcewindows="no" +appidmod="warfork" +# 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 @@ -112,25 +130,21 @@ sleeptime="0.5" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-quake3" -## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd -# Server appid -appid="1136510" -appidmod="warfork" -# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch -branch="" -# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server -steammaster="true" +## Console type +consoleverbose="yes" +consoleinteract="yes" ## Game Server Details # Do not edit @@ -142,7 +156,7 @@ glibc="2.15" # Edit with care ## Game Server Directories -systemdir="${serverfiles}/Warfork.app/Contents/Resources" +systemdir="${serverfiles}" executabledir="${systemdir}" executable="./wf_server.x86_64" servercfgdir="${systemdir}/basewf" @@ -154,7 +168,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -166,3 +180,7 @@ 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/config-default/config-lgsm/wmcserver/_default.cfg b/lgsm/config-default/config-lgsm/wmcserver/_default.cfg new file mode 100644 index 000000000..c9a0a5d52 --- /dev/null +++ b/lgsm/config-default/config-lgsm/wmcserver/_default.cfg @@ -0,0 +1,178 @@ +################################## +######## 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 +javaram="1024" # -Xmx$1024M + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="nogui" + +## Release Settings | https://docs.linuxgsm.com/game-servers/minecraft#release-settings +# Version (latest|1.16.5) +mcversion="latest" + +#### 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" + +## 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="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="minecraft" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="WaterfallMC" +engine="lwjgl2" +glibc="null" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +preexecutable="java -Xmx${javaram}M -jar" +executable="./waterfall.jar" +servercfgdir="${systemdir}" +servercfg="config.yml" +servercfgdefault="config.yml" +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/config-default/config-lgsm/wurmserver/_default.cfg b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg index e131fc28b..0141e7d7e 100644 --- a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg @@ -8,12 +8,52 @@ #### Game Server Settings #### -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ - # Note Parameters are editing in the game server config file. - source "${servercfgfullpath}" - parms="ADMINPWD=\"$ADMINPWD\" EPICSETTINGS=\"$EPICSETTINGS\" EXTERNALPORT=\"$EXTERNALPORT\" HOMESERVER=\"$HOMESERVER\" HOMEKINGDOM=\"$HOMEKINGDOM\" LOGINSERVER=\"$LOGINSERVER\" MAXPLAYERS=\"$MAXPLAYERS\" QUERYPORT=\"$QUERYPORT\" SERVERNAME=\"$SERVERNAME\" SERVERPASSWORD=\"$SERVERPASSWORD\" START=\"$START\" IP=\"$IP\"" -} +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +# https://www.wurmpedia.com/index.php/Server_administration_(Wurm_Unlimited) + +# Game mode (Creative|Adventure) +gamemode="Creative" + +# The kingdom the server belongs to. +# If you're using the Adventure base, use 1, 2, or 3. +# If you're using Creative, use 4. +# Kingdom numbers: +# 0 - No kingdom +# 1 - Jen-Kellon +# 2 - Mol-Rehan +# 3 - Horde of the Summoned +# 4 - Freedom +homekingdom="4" + +# Unlocks the admin commands from within the game, that can be used to change +# the gameplay settings of the server, such as skill gain rate and field growth time. +adminpassword="CHANGE_ME" + +# If true the server will follow the rules from the Epic servers in Wurm Online. +# For instance it will use the skill curve. +epicsettings="false" + +# If the server is a home server (belongs to a single kingdom). +homeserver="true" + +# Defaults to true, should only be set to false if the server is intended to be +# connected with another server that is going to act as a loginserver. +loginserver="true" + +# Used for server to server communication. +rmiport="7221" +rmiregport="7220" + +maxplayers="200" +servername="LinuxGSM" +serverpassword="" +ip="0.0.0.0" +port="3724" +queryport="27016" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +# Parameters are edited in the game server config file. +startparameters="start=${gamemode} adminpwd='${adminpassword}' epicsettings='${epicsettings}' externalport='${port}' homeserver='${homeserver}' homekingdom='${homekingdom}' loginserver='${loginserver}' maxplayers='${maxplayers}' queryport='${queryport}' rmiport='${rmiport}' rmiregport='${rmiregport}' servername='${servername}' serverpassword='${serverpassword}' ip='${ip}'" #### LinuxGSM Settings #### @@ -31,8 +71,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -43,18 +84,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -63,20 +102,30 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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" @@ -101,8 +150,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="402370" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -117,17 +168,22 @@ steammaster="false" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="2" querytype="protocol-valve" +## Console type +consoleverbose="yes" +consoleinteract="no" + ## Game Server Details # Do not edit gamename="Wurm Unlimited" @@ -140,17 +196,13 @@ glibc="2.14" ## Game Server Directories systemdir="${serverfiles}" executabledir="${systemdir}" -executable="xvfb-run ./WurmServerLauncher" -servercfgdir="${systemdir}" -servercfg="${selfname}.cfg" -servercfgdefault="server.cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" +executable="./WurmServerLauncher" ## Backup Directory backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -162,3 +214,7 @@ 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/config-default/config-lgsm/xntserver/_default.cfg b/lgsm/config-default/config-lgsm/xntserver/_default.cfg new file mode 100644 index 000000000..402e6188f --- /dev/null +++ b/lgsm/config-default/config-lgsm/xntserver/_default.cfg @@ -0,0 +1,171 @@ +################################## +######## 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 + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-userdir ${systemdir}/${selfname}" + +#### 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="" + +## 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" + +## 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="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="3" +querytype="xonotic" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Xonotic" +engine="unreal3" +glibc="2.29" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./xonotic-linux64-dedicated" +servercfgdir="${systemdir}/${selfname}/data" +servercfg="server.cfg" +servercfgdefault="${systemdir}/server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +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" +gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/zmrserver/_default.cfg b/lgsm/config-default/config-lgsm/zmrserver/_default.cfg index b22f79fc2..391d83baf 100644 --- a/lgsm/config-default/config-lgsm/zmrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/zmrserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -16,10 +16,8 @@ sourcetvport="27020" defaultmap="zm_docksofthedead" maxplayers="16" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game zombie_master_reborn -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game zombie_master_reborn -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -37,8 +35,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -49,18 +48,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -69,18 +66,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -110,8 +114,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="244310" # Source 2013 SDK +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -126,17 +132,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Zombie Master: Reborn" @@ -159,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -171,3 +182,7 @@ 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/config-default/config-lgsm/zpsserver/_default.cfg b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg index 279f7258a..b5a7b3b93 100644 --- a/lgsm/config-default/config-lgsm/zpsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg @@ -8,7 +8,7 @@ #### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" clientport="27005" @@ -21,10 +21,8 @@ maxplayers="20" # More info: https://docs.linuxgsm.com/steamcmd/gslt gslt="" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game zps -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game zps -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### @@ -42,8 +40,9 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://termbin.com" + +# Alert on Start/Stop/Restart +statusalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -54,18 +53,16 @@ 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" -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet pushbulletalert="off" pushbullettoken="accesstoken" @@ -74,18 +71,25 @@ 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) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. +# 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 @@ -115,8 +119,10 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid appid="17505" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="true" @@ -131,17 +137,22 @@ steammaster="true" # 8: 7 Days to Die # 9: GoldSrc # 10: Avorion +# 11: end stopmode="3" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 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="Zombie Panic! Source" @@ -164,7 +175,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" @@ -176,3 +187,7 @@ 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/alert_discord_logo.jpg b/lgsm/data/alert_discord_logo.jpg new file mode 100644 index 000000000..db94b295e Binary files /dev/null and b/lgsm/data/alert_discord_logo.jpg differ diff --git a/lgsm/data/alert_discord_logo.png b/lgsm/data/alert_discord_logo.png deleted file mode 100644 index e56a92932..000000000 Binary files a/lgsm/data/alert_discord_logo.png and /dev/null differ diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv new file mode 100644 index 000000000..d4d2456bd --- /dev/null +++ b/lgsm/data/almalinux-8.csv @@ -0,0 +1,139 @@ +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python36,tar,tmux,unzip,util-linux,wget,xz +steamcmd,glibc.i686,libstdc++.i686 +ac +ahl +ahl2 +ark +arma3 +armar,libcurl,openssl-libs +ats +av +bb +bb2,libcurl.i686 +bd +bf1942,ncurses-libs.i686 +bfv,compat-libstdc++-33.i686,glibc.i686 +bmdm,ncurses-libs.i686 +bo +bs +bt,libicu,dos2unix,libxml2 +btl +cc +ck,xorg-x11-server-Xvfb +cmw +cod,compat-libstdc++-33.i686 +cod2,compat-libstdc++-33.i686 +cod4 +coduo,compat-libstdc++-33.i686 +codwaw +col +cs +cs2 +cscz +csgo +css,ncurses-libs.i686 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl.i686 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,ncurses-libs.i686 +hcu +hl2dm +hldm +hldms +hw,zlib-devel +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,java-21-openjdk +mcb,libnsl +mh +mohaa,compat-libstdc++-33.i686 +mta,ncurses-compat-libs,libxml2 +nd +nec +nmrih,ncurses-libs.i686 +ns +ns2,speex,tbb +ns2c,speex.i686,tbb.i686 +ohd +onset,mariadb-connector-c +opfor +pc +pc2 +pmc,java-21-openjdk +ps,GConf2 +pvkii +pvr,libcxx +pw +pz,java-11-openjdk rng-tools +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,zlib-devel +rw,java-11-openjdk +samp +sb +sbots +scpsl +scpslsm +sdtd,telnet,expect,libxml2 +sf +sfc,ncurses-libs.i686 +sm,telnet,expect +sof2 +sol +squad +st,libxml2 +stn +sven +terraria +tf +tf2,libcurl.i686 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,glibc-devel,libatomic,pulseaudio-libs-devel +vints,aspnetcore-runtime-7.0 +vpmc,java-21-openjdk +vs +wet +wf +wmc,java-21-openjdk +wurm,xorg-x11-server-Xvfb +xnt +zmr,ncurses-libs.i686 +zps,ncurses-libs.i686 diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv new file mode 100644 index 000000000..7dae6338e --- /dev/null +++ b/lgsm/data/almalinux-9.csv @@ -0,0 +1,139 @@ +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python3,tar,tmux,unzip,util-linux,wget,xz +steamcmd,glibc.i686,libstdc++.i686 +ac +ahl +ahl2 +ark +arma3 +armar,libcurl,openssl-libs +ats +av +bb +bb2,libcurl.i686 +bd +bf1942,ncurses-libs.i686 +bfv,compat-libstdc++-33.i686,glibc.i686 +bmdm,ncurses-libs.i686 +bo +bs +bt,libicu,dos2unix,libxml2 +btl +cc +ck,xorg-x11-server-Xvfb +cmw +cod,compat-libstdc++-33.i686 +cod2,compat-libstdc++-33.i686 +cod4 +coduo,compat-libstdc++-33.i686 +codwaw +col +cs +cs2 +cscz +csgo +css,ncurses-libs.i686 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl.i686 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,ncurses-libs.i686 +hcu +hl2dm +hldm +hldms +hw,zlib-devel +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,java-21-openjdk +mcb,libnsl +mh +mohaa,compat-libstdc++-33.i686 +mta,ncurses-compat-libs,libxml2 +nd +nec +nmrih,ncurses-libs.i686 +ns +ns2,speex,tbb +ns2c,speex.i686,tbb.i686 +ohd +onset,mariadb-connector-c +opfor +pc +pc2 +pmc,java-21-openjdk +ps,GConf2 +pvkii +pvr,libcxx +pw +pz,java-21-openjdk rng-tools +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,zlib-devel +rw,java-21-openjdk +samp +sb +sbots +scpsl +scpslsm +sdtd,telnet,expect,libxml2 +sf +sfc,ncurses-libs.i686 +sm,telnet,expect +sof2 +sol +squad +st,libxml2 +stn +sven +terraria +tf +tf2,libcurl.i686 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,glibc-devel,libatomic,pulseaudio-libs-devel +vints,aspnetcore-runtime-7.0 +vpmc,java-21-openjdk +vs +wet +wf +wmc,java-21-openjdk +wurm,xorg-x11-server-Xvfb +xnt +zmr,ncurses-libs.i686 +zps,ncurses-libs.i686 diff --git a/lgsm/data/appmanifest/ahl/appmanifest_10.acf b/lgsm/data/appmanifest/ahl/appmanifest_10.acf new file mode 100644 index 000000000..0c9023856 --- /dev/null +++ b/lgsm/data/appmanifest/ahl/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984402" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ahl/appmanifest_70.acf b/lgsm/data/appmanifest/ahl/appmanifest_70.acf new file mode 100644 index 000000000..9eb708ddd --- /dev/null +++ b/lgsm/data/appmanifest/ahl/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984404" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ahl/appmanifest_90.acf b/lgsm/data/appmanifest/ahl/appmanifest_90.acf new file mode 100644 index 000000000..421982e7d --- /dev/null +++ b/lgsm/data/appmanifest/ahl/appmanifest_90.acf @@ -0,0 +1,49 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688984267" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561200949853436" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + } + "UserConfig" + { + "mod" "cstrike" + } + "MountedConfig" + { + "mod" "cstrike" + } +} diff --git a/lgsm/data/appmanifest/bb/appmanifest_10.acf b/lgsm/data/appmanifest/bb/appmanifest_10.acf new file mode 100644 index 000000000..604394744 --- /dev/null +++ b/lgsm/data/appmanifest/bb/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984405" + "SizeOnDisk" "03" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/bb/appmanifest_70.acf b/lgsm/data/appmanifest/bb/appmanifest_70.acf new file mode 100644 index 000000000..36f34d2ce --- /dev/null +++ b/lgsm/data/appmanifest/bb/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984407" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/bb/appmanifest_90.acf b/lgsm/data/appmanifest/bb/appmanifest_90.acf new file mode 100644 index 000000000..c56dda551 --- /dev/null +++ b/lgsm/data/appmanifest/bb/appmanifest_90.acf @@ -0,0 +1,49 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688984269" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561200402315446" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + } + "UserConfig" + { + "mod" "cstrike" + } + "MountedConfig" + { + "mod" "cstrike" + } +} diff --git a/lgsm/data/appmanifest/cscz/appmanifest_10.acf b/lgsm/data/appmanifest/cscz/appmanifest_10.acf new file mode 100644 index 000000000..c5afe8bc0 --- /dev/null +++ b/lgsm/data/appmanifest/cscz/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1666731530" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/cscz/appmanifest_70.acf b/lgsm/data/appmanifest/cscz/appmanifest_70.acf new file mode 100644 index 000000000..a4157d7e0 --- /dev/null +++ b/lgsm/data/appmanifest/cscz/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1666731530" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/cscz/appmanifest_80.acf b/lgsm/data/appmanifest/cscz/appmanifest_80.acf new file mode 100644 index 000000000..ec35c446d --- /dev/null +++ b/lgsm/data/appmanifest/cscz/appmanifest_80.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "80" + "Universe" "1" + "name" "Counter-Strike: Condition Zero" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1666731530" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "81" + { + "manifest" "3601230779843470737" + "size" "415387682" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/cscz/appmanifest_90.acf b/lgsm/data/appmanifest/cscz/appmanifest_90.acf new file mode 100644 index 000000000..184a92b96 --- /dev/null +++ b/lgsm/data/appmanifest/cscz/appmanifest_90.acf @@ -0,0 +1,50 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1666731360" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561201630089482" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + "81" "80" + } + "UserConfig" + { + "mod" "czero" + } + "MountedConfig" + { + "mod" "czero" + } +} diff --git a/lgsm/data/appmanifest/css/appmanifest_10.acf b/lgsm/data/appmanifest/css/appmanifest_10.acf new file mode 100644 index 000000000..0c9b528dc --- /dev/null +++ b/lgsm/data/appmanifest/css/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984302" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/css/appmanifest_70.acf b/lgsm/data/appmanifest/css/appmanifest_70.acf new file mode 100644 index 000000000..0a417f8db --- /dev/null +++ b/lgsm/data/appmanifest/css/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984304" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/css/appmanifest_90.acf b/lgsm/data/appmanifest/css/appmanifest_90.acf new file mode 100644 index 000000000..3710f9794 --- /dev/null +++ b/lgsm/data/appmanifest/css/appmanifest_90.acf @@ -0,0 +1,49 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688984230" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561201379539094" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" 0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + } + "UserConfig" + { + "mod" "cstrike" + } + "MountedConfig" + { + "mod" "cstrike" + } +} diff --git a/lgsm/data/appmanifest/dmc/appmanifest_10.acf b/lgsm/data/appmanifest/dmc/appmanifest_10.acf new file mode 100644 index 000000000..2ce041bb6 --- /dev/null +++ b/lgsm/data/appmanifest/dmc/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984403" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/dmc/appmanifest_40.acf b/lgsm/data/appmanifest/dmc/appmanifest_40.acf new file mode 100644 index 000000000..11cf69421 --- /dev/null +++ b/lgsm/data/appmanifest/dmc/appmanifest_40.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "40" + "Universe" "1" + "name" "Deathmatch Classic" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984402" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "41" + { + "manifest" "2010889186716175170" + "size" "48239254" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/dmc/appmanifest_70.acf b/lgsm/data/appmanifest/dmc/appmanifest_70.acf new file mode 100644 index 000000000..1b33e8442 --- /dev/null +++ b/lgsm/data/appmanifest/dmc/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984405" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/dmc/appmanifest_90.acf b/lgsm/data/appmanifest/dmc/appmanifest_90.acf new file mode 100644 index 000000000..3fe759c2d --- /dev/null +++ b/lgsm/data/appmanifest/dmc/appmanifest_90.acf @@ -0,0 +1,50 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688984269" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561201891266584" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + "41" "40" + } + "UserConfig" + { + "mod" "dmc" + } + "MountedConfig" + { + "mod" "dmc" + } +} diff --git a/lgsm/data/appmanifest/dod/appmanifest_10.acf b/lgsm/data/appmanifest/dod/appmanifest_10.acf new file mode 100644 index 000000000..afe7cb85a --- /dev/null +++ b/lgsm/data/appmanifest/dod/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688988451" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/dod/appmanifest_30.acf b/lgsm/data/appmanifest/dod/appmanifest_30.acf new file mode 100644 index 000000000..c4acdb3bd --- /dev/null +++ b/lgsm/data/appmanifest/dod/appmanifest_30.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "30" + "Universe" "1" + "name" "Day of Defeat" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688988451" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "31" + { + "manifest" "3826716661969602728" + "size" "391387184" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/dod/appmanifest_70.acf b/lgsm/data/appmanifest/dod/appmanifest_70.acf new file mode 100644 index 000000000..fb91ddb35 --- /dev/null +++ b/lgsm/data/appmanifest/dod/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688988452" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/dod/appmanifest_90.acf b/lgsm/data/appmanifest/dod/appmanifest_90.acf new file mode 100644 index 000000000..c57a3f67f --- /dev/null +++ b/lgsm/data/appmanifest/dod/appmanifest_90.acf @@ -0,0 +1,50 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688988429" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561201442771088" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + "31" "30" + } + "UserConfig" + { + "mod" "dod" + } + "MountedConfig" + { + "mod" "dod" + } +} diff --git a/lgsm/data/appmanifest/hldm/appmanifest_10.acf b/lgsm/data/appmanifest/hldm/appmanifest_10.acf new file mode 100644 index 000000000..de7355ea0 --- /dev/null +++ b/lgsm/data/appmanifest/hldm/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984411" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/hldm/appmanifest_70.acf b/lgsm/data/appmanifest/hldm/appmanifest_70.acf new file mode 100644 index 000000000..0f4b4157f --- /dev/null +++ b/lgsm/data/appmanifest/hldm/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984413" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/hldm/appmanifest_90.acf b/lgsm/data/appmanifest/hldm/appmanifest_90.acf new file mode 100644 index 000000000..d9bfbaa7e --- /dev/null +++ b/lgsm/data/appmanifest/hldm/appmanifest_90.acf @@ -0,0 +1,47 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688984301" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561199593999446" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ns/appmanifest_10.acf b/lgsm/data/appmanifest/ns/appmanifest_10.acf new file mode 100644 index 000000000..edffb84fa --- /dev/null +++ b/lgsm/data/appmanifest/ns/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984412" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ns/appmanifest_70.acf b/lgsm/data/appmanifest/ns/appmanifest_70.acf new file mode 100644 index 000000000..f1866815d --- /dev/null +++ b/lgsm/data/appmanifest/ns/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984414" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ns/appmanifest_90.acf b/lgsm/data/appmanifest/ns/appmanifest_90.acf new file mode 100644 index 000000000..f709c9b5e --- /dev/null +++ b/lgsm/data/appmanifest/ns/appmanifest_90.acf @@ -0,0 +1,49 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688984290" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561199772965246" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + } + "UserConfig" + { + "mod" "cstrike" + } + "MountedConfig" + { + "mod" "cstrike" + } +} diff --git a/lgsm/data/appmanifest/opfor/appmanifest_10.acf b/lgsm/data/appmanifest/opfor/appmanifest_10.acf new file mode 100644 index 000000000..8a3a4fbf4 --- /dev/null +++ b/lgsm/data/appmanifest/opfor/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984434" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/opfor/appmanifest_50.acf b/lgsm/data/appmanifest/opfor/appmanifest_50.acf new file mode 100644 index 000000000..83b939a0c --- /dev/null +++ b/lgsm/data/appmanifest/opfor/appmanifest_50.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "50" + "Universe" "1" + "name" "Half-Life: Opposing Force" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984434" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "51" + { + "manifest" "789184054796507140" + "size" "286265390" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/opfor/appmanifest_70.acf b/lgsm/data/appmanifest/opfor/appmanifest_70.acf new file mode 100644 index 000000000..da3db240e --- /dev/null +++ b/lgsm/data/appmanifest/opfor/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984437" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/opfor/appmanifest_90.acf b/lgsm/data/appmanifest/opfor/appmanifest_90.acf new file mode 100644 index 000000000..1ae893bee --- /dev/null +++ b/lgsm/data/appmanifest/opfor/appmanifest_90.acf @@ -0,0 +1,50 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688984298" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561198622612838" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + "51" "50" + } + "UserConfig" + { + "mod" "gearbox" + } + "MountedConfig" + { + "mod" "gearbox" + } +} diff --git a/lgsm/data/appmanifest/ricochet/appmanifest_10.acf b/lgsm/data/appmanifest/ricochet/appmanifest_10.acf new file mode 100644 index 000000000..8eb50b265 --- /dev/null +++ b/lgsm/data/appmanifest/ricochet/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "appid_10" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688999004" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ricochet/appmanifest_60.acf b/lgsm/data/appmanifest/ricochet/appmanifest_60.acf new file mode 100644 index 000000000..9fcb75c05 --- /dev/null +++ b/lgsm/data/appmanifest/ricochet/appmanifest_60.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "60" + "Universe" "1" + "name" "appid_60" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688999004" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "61" + { + "manifest" "4560730344969588055" + "size" "17605146" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ricochet/appmanifest_70.acf b/lgsm/data/appmanifest/ricochet/appmanifest_70.acf new file mode 100644 index 000000000..a9173d995 --- /dev/null +++ b/lgsm/data/appmanifest/ricochet/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "appid_70" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688999004" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ricochet/appmanifest_90.acf b/lgsm/data/appmanifest/ricochet/appmanifest_90.acf new file mode 100644 index 000000000..cb48442e5 --- /dev/null +++ b/lgsm/data/appmanifest/ricochet/appmanifest_90.acf @@ -0,0 +1,50 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688999004" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561198882404437" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + "61" "60" + } + "UserConfig" + { + "mod" "ricochet" + } + "MountedConfig" + { + "mod" "ricochet" + } +} diff --git a/lgsm/data/appmanifest/tfc/appmanifest_10.acf b/lgsm/data/appmanifest/tfc/appmanifest_10.acf new file mode 100644 index 000000000..71c7c40ff --- /dev/null +++ b/lgsm/data/appmanifest/tfc/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688998186" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/tfc/appmanifest_20.acf b/lgsm/data/appmanifest/tfc/appmanifest_20.acf new file mode 100644 index 000000000..07594e934 --- /dev/null +++ b/lgsm/data/appmanifest/tfc/appmanifest_20.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "20" + "Universe" "1" + "name" "Team Fortress Classic" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688998186" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "21" + { + "manifest" "7841127166138118042" + "size" "124989202" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/tfc/appmanifest_70.acf b/lgsm/data/appmanifest/tfc/appmanifest_70.acf new file mode 100644 index 000000000..0ed30ae60 --- /dev/null +++ b/lgsm/data/appmanifest/tfc/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688998186" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/tfc/appmanifest_90.acf b/lgsm/data/appmanifest/tfc/appmanifest_90.acf new file mode 100644 index 000000000..0bb518bd5 --- /dev/null +++ b/lgsm/data/appmanifest/tfc/appmanifest_90.acf @@ -0,0 +1,50 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688998186" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561201883029803" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + "21" "20" + } + "UserConfig" + { + "mod" "tfc" + } + "MountedConfig" + { + "mod" "tfc" + } +} diff --git a/lgsm/data/appmanifest/ts/appmanifest_10.acf b/lgsm/data/appmanifest/ts/appmanifest_10.acf new file mode 100644 index 000000000..e04a2f26f --- /dev/null +++ b/lgsm/data/appmanifest/ts/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688983936" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ts/appmanifest_70.acf b/lgsm/data/appmanifest/ts/appmanifest_70.acf new file mode 100644 index 000000000..d7d0228e2 --- /dev/null +++ b/lgsm/data/appmanifest/ts/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688983937" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ts/appmanifest_90.acf b/lgsm/data/appmanifest/ts/appmanifest_90.acf new file mode 100644 index 000000000..b560cb4be --- /dev/null +++ b/lgsm/data/appmanifest/ts/appmanifest_90.acf @@ -0,0 +1,49 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688983870" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561202249148738" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + } + "UserConfig" + { + "mod" "cstrike" + } + "MountedConfig" + { + "mod" "cstrike" + } +} diff --git a/lgsm/data/appmanifest/vs/appmanifest_10.acf b/lgsm/data/appmanifest/vs/appmanifest_10.acf new file mode 100644 index 000000000..71c7c40ff --- /dev/null +++ b/lgsm/data/appmanifest/vs/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688998186" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/vs/appmanifest_70.acf b/lgsm/data/appmanifest/vs/appmanifest_70.acf new file mode 100644 index 000000000..a470329f1 --- /dev/null +++ b/lgsm/data/appmanifest/vs/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688983882" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/vs/appmanifest_90.acf b/lgsm/data/appmanifest/vs/appmanifest_90.acf new file mode 100644 index 000000000..ae333872f --- /dev/null +++ b/lgsm/data/appmanifest/vs/appmanifest_90.acf @@ -0,0 +1,49 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688983843" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561200857512115" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + } + "UserConfig" + { + "mod" "cstrike" + } + "MountedConfig" + { + "mod" "cstrike" + } +} diff --git a/lgsm/data/bo_header.jpg b/lgsm/data/bo_header.jpg new file mode 100644 index 000000000..d63ee5c3d Binary files /dev/null and b/lgsm/data/bo_header.jpg differ diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv new file mode 100644 index 000000000..266b358ba --- /dev/null +++ b/lgsm/data/centos-7.csv @@ -0,0 +1,139 @@ +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python3,tar,tmux,unzip,util-linux,wget,xz +steamcmd,glibc.i686,libstdc++.i686 +ac +ahl +ahl2 +ark +arma3 +armar,libcurl,openssl11-libs +ats +av +bb +bb2,libcurl.i686 +bd +bf1942,ncurses-libs.i686 +bfv,compat-libstdc++-33.i686,glibc.i686 +bmdm,ncurses-libs.i686 +bo +bs +bt,libicu,dos2unix,libxml2 +btl +cc +ck,xorg-x11-server-Xvfb +cmw +cod,compat-libstdc++-33.i686 +cod2,compat-libstdc++-33.i686 +cod4 +coduo,compat-libstdc++-33.i686 +codwaw +col +cs +cs2 +cscz +csgo +css,ncurses-libs.i686 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl.i686 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,ncurses-libs.i686 +hcu +hl2dm +hldm +hldms +hw,zlib-devel +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,java-21-openjdk +mcb,libnsl +mh +mohaa,compat-libstdc++-33.i686 +mta,ncurses-libs,libxml2 +nd +nec +nmrih,ncurses-libs.i686 +ns +ns2,speex,tbb +ns2c,speex.i686,tbb.i686 +ohd +onset,mariadb-connector-c +opfor +pc +pc2 +pmc,java-11-openjdk +ps,GConf2 +pvkii +pvr,libcxx +pw +pz,java-11-openjdk rng-tools +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,zlib-devel +rw,java-11-openjdk +samp +sb +sbots +scpsl +scpslsm +sdtd,telnet,expect,libxml2 +sf +sfc,ncurses-libs.i686 +sm,telnet,expect +sof2 +sol +squad +st,libxml2 +stn +sven +terraria +tf +tf2,libcurl.i686 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,glibc-devel,libatomic,pulseaudio-libs-devel +vints,aspnetcore-runtime-7.0 +vpmc,java-11-openjdk +vs +wet +wf +wmc,java-11-openjdk +wurm,xorg-x11-server-Xvfb +xnt +zmr,ncurses-libs.i686 +zps,ncurses-libs.i686 diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv new file mode 100644 index 000000000..bd5b72c33 --- /dev/null +++ b/lgsm/data/centos-8.csv @@ -0,0 +1,139 @@ +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python36,tar,tmux,unzip,util-linux,wget,xz +steamcmd,glibc.i686,libstdc++.i686 +ac +ahl +ahl2 +ark +arma3 +armar,libcurl,openssl-libs +ats +av +bb +bb2,libcurl.i686 +bd +bf1942,ncurses-libs.i686 +bfv,compat-libstdc++-33.i686,glibc.i686 +bmdm,ncurses-libs.i686 +bo +bs +bt,libicu,dos2unix,libxml2 +btl +cc +ck,xorg-x11-server-Xvfb +cmw +cod,compat-libstdc++-33.i686 +cod2,compat-libstdc++-33.i686 +cod4 +coduo,compat-libstdc++-33.i686 +codwaw +col +cs +cs2 +cscz +csgo +css,ncurses-libs.i686 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl.i686 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,ncurses-libs.i686 +hcu +hl2dm +hldm +hldms +hw,zlib-devel +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,java-21-openjdk +mcb,libnsl +mh +mohaa,compat-libstdc++-33.i686 +mta,ncurses-compat-libs,libxml2 +nd +nec +nmrih,ncurses-libs.i686 +ns +ns2,speex,tbb +ns2c,speex.i686,tbb.i686 +ohd +onset,mariadb-connector-c +opfor +pc +pc2 +pmc,java-17-openjdk +ps,GConf2 +pvkii +pvr,libcxx +pw +pz,java-11-openjdk rng-tools +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,zlib-devel +rw,java-11-openjdk +samp +sb +sbots +scpsl +scpslsm +sdtd,telnet,expect,libxml2 +sf +sfc,ncurses-libs.i686 +sm,telnet,expect +sof2 +sol +squad +st,libxml2 +stn +sven +terraria +tf +tf2,libcurl.i686 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,glibc-devel,libatomic,pulseaudio-libs-devel +vints,aspnetcore-runtime-7.0 +vpmc,java-17-openjdk +vs +wet +wf +wmc,java-17-openjdk +wurm,xorg-x11-server-Xvfb +xnt +zmr,ncurses-libs.i686 +zps,ncurses-libs.i686 diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv new file mode 100644 index 000000000..893f3698c --- /dev/null +++ b/lgsm/data/centos-9.csv @@ -0,0 +1,139 @@ +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python3,tar,tmux,unzip,util-linux,wget,xz +steamcmd,glibc.i686,libstdc++.i686 +ac +ahl +ahl2 +ark +arma3 +armar,libcurl,openssl-libs +ats +av +bb +bb2,libcurl.i686 +bd +bf1942,ncurses-libs.i686 +bfv,compat-libstdc++-33.i686,glibc.i686 +bmdm,ncurses-libs.i686 +bo +bs +bt,libicu,dos2unix,libxml2 +btl +cc +ck,xorg-x11-server-Xvfb +cmw +cod,compat-libstdc++-33.i686 +cod2,compat-libstdc++-33.i686 +cod4 +coduo,compat-libstdc++-33.i686 +codwaw +col +cs +cs2 +cscz +csgo +css,ncurses-libs.i686 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl.i686 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,ncurses-libs.i686 +hcu +hl2dm +hldm +hldms +hw,zlib-devel +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,java-17-openjdk +mcb,libnsl +mh +mohaa,compat-libstdc++-33.i686 +mta,ncurses-compat-libs,libxml2 +nd +nec +nmrih,ncurses-libs.i686 +ns +ns2,speex,tbb +ns2c,speex.i686,tbb.i686 +ohd +onset,mariadb-connector-c +opfor +pc +pc2 +pmc,java-17-openjdk +ps,GConf2 +pvkii +pvr,libcxx +pw +pz,java-21-openjdk rng-tools +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,zlib-devel +rw,java-21-openjdk +samp +sb +sbots +scpsl +scpslsm +sdtd,telnet,expect,libxml2 +sf +sfc,ncurses-libs.i686 +sm,telnet,expect +sof2 +sol +squad +st,libxml2 +stn +sven +terraria +tf +tf2,libcurl.i686 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,glibc-devel,libatomic,pulseaudio-libs-devel +vints,aspnetcore-runtime-7.0 +vpmc,java-17-openjdk +vs +wet +wf +wmc,java-17-openjdk +wurm,xorg-x11-server-Xvfb +xnt +zmr,ncurses-libs.i686 +zps,ncurses-libs.i686 diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv new file mode 100644 index 000000000..6bfa1dae4 --- /dev/null +++ b/lgsm/data/debian-10.csv @@ -0,0 +1,139 @@ +ac +ahl +ahl2 +all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,pigz,python3,tar,tmux,unzip,util-linux,uuid-runtime,wget,xz-utils +ark +arma3 +armar,libcurl4 +ats +av +bb +bb2,libcurl4-gnutls-dev:i386 +bd +bf1942,libncurses5:i386,libtinfo5:i386 +bfv,libncurses5:i386,libstdc++5:i386 +bmdm,libncurses5:i386 +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,libtinfo5:i386 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl4-gnutls-dev:i386 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,libtinfo5:i386 +hcu +hl2dm +hldm +hldms +hw,lib32z1 +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,openjdk-11-jre +mcb +mh +mohaa,libstdc++5:i386 +mta,libncursesw5,libxml2-utils +nd +nec +nmrih,libtinfo5:i386 +ns +ns2,speex,libtbb2 +ns2c,speex:i386,libtbb2 +ohd +onset,libmariadb-dev +opfor +pc +pc2 +pmc,openjdk-11-jre +ps,libgconf-2-4 +pvkii +pvr,libc++1 +pw +pz,openjdk-11-jre,rng-tools +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,lib32z1 +rw,openjdk-11-jre +samp +sb +sbots +scpsl,mono-complete +scpslsm,mono-complete +sdtd,telnet,expect,libxml2-utils +sf +sfc,libtinfo5:i386 +sm,telnet,expect +sof2 +sol +squad +st,libxml2-utils +steamcmd,lib32gcc1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd +stn +sven,libssl1.1:i386,zlib1g:i386 +terraria +tf +tf2,libcurl4-gnutls-dev:i386 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,libc6-dev,libatomic1,libpulse-dev +vints,aspnetcore-runtime-7.0 +vpmc,openjdk-11-jre +vs +wet +wf +wmc,openjdk-11-jre +wurm,xvfb +xnt +zmr,libtinfo5:i386 +zps,libtinfo5:i386 diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv new file mode 100644 index 000000000..5441a69b4 --- /dev/null +++ b/lgsm/data/debian-11.csv @@ -0,0 +1,139 @@ +all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat,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,libcurl4 +ats +av +bb +bb2,libcurl4-gnutls-dev:i386 +bd +bf1942,libncurses5:i386,libtinfo5:i386 +bfv,libncurses5:i386,libstdc++5:i386 +bmdm,libncurses5:i386 +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,libtinfo5:i386 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl4-gnutls-dev:i386 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,libtinfo5:i386 +hcu +hl2dm +hldm +hldms +hw,lib32z1 +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,openjdk-17-jre +mcb +mh +mohaa,libstdc++5:i386 +mta,libncursesw5,libxml2-utils +nd +nec +nmrih,libtinfo5:i386 +ns +ns2,speex,libtbb2 +ns2c,speex:i386,libtbb2 +ohd +onset,libmariadb-dev +opfor +pc +pc2 +pmc,openjdk-17-jre +ps,libgconf-2-4 +pvkii +pvr,libc++1 +pw +pz,openjdk-17-jre,rng-tools +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,lib32z1 +rw,openjdk-17-jre +samp +sb +sbots +scpsl,mono-complete +scpslsm,mono-complete +sdtd,telnet,expect,libxml2-utils +sf +sfc,libtinfo5:i386 +sm,telnet,expect +sof2 +sol +squad +st,libxml2-utils +stn +sven,libssl1.1:i386,zlib1g:i386 +terraria +tf +tf2,libcurl4-gnutls-dev:i386 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,libc6-dev,libatomic1,libpulse-dev +vints,aspnetcore-runtime-7.0 +vpmc,openjdk-11-jre +vs +wet +wf +wmc,openjdk-17-jre +wurm,xvfb +xnt +zmr,libtinfo5:i386 +zps,libtinfo5:i386 diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv new file mode 100644 index 000000000..1c0a39930 --- /dev/null +++ b/lgsm/data/debian-12.csv @@ -0,0 +1,139 @@ +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,libcurl4 +ats +av +bb +bb2,libcurl4-gnutls-dev:i386 +bd +bf1942,libncurses5:i386,libtinfo5:i386 +bfv,libncurses5:i386,libstdc++5:i386 +bmdm,libncurses5:i386 +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,libtinfo5:i386 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl4-gnutls-dev:i386 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,libtinfo5:i386 +hcu +hl2dm +hldm +hldms +hw,lib32z1 +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,openjdk-17-jre +mcb +mh +mohaa,libstdc++5:i386 +mta,libncursesw5,libxml2-utils +nd +nec +nmrih,libtinfo5:i386 +ns +ns2,speex,libtbb12 +ns2c,speex:i386,libtbb12 +ohd +onset,libmariadb-dev +opfor +pc +pc2 +pmc,openjdk-17-jre +ps,libgconf-2-4 +pvkii +pvr,libc++1 +pw +pz,openjdk-17-jre,rng-tools5 +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,lib32z1 +rw,openjdk-17-jre +samp +sb +sbots +scpsl,mono-complete +scpslsm,mono-complete +sdtd,telnet,expect,libxml2-utils +sf +sfc,libtinfo5:i386 +sm,telnet,expect +sof2 +sol +squad +st,libxml2-utils +stn +sven,libssl3:i386,zlib1g:i386 +terraria +tf +tf2,libcurl4-gnutls-dev:i386 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,libc6-dev,libatomic1,libpulse-dev +vints,aspnetcore-runtime-7.0 +vpmc,openjdk-17-jre +vs +wet +wf +wmc,openjdk-17-jre +wurm,xvfb +xnt +zmr,libtinfo5:i386 +zps,libtinfo5:i386 diff --git a/lgsm/data/debian-13.csv b/lgsm/data/debian-13.csv new file mode 100644 index 000000000..5ddb19405 --- /dev/null +++ b/lgsm/data/debian-13.csv @@ -0,0 +1,139 @@ +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,libcurl4 +ats +av +bb +bb2,libcurl4-gnutls-dev:i386 +bd +bf1942,libncurses5:i386,libtinfo5:i386 +bfv,libncurses5:i386,libstdc++5:i386 +bmdm,libncurses5:i386 +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,libtinfo5:i386 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl4-gnutls-dev:i386 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,libtinfo5:i386 +hcu +hl2dm +hldm +hldms +hw,lib32z1 +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,openjdk-22-jre +mcb +mh +mohaa,libstdc++5:i386 +mta,libncursesw5,libxml2-utils +nd +nec +nmrih,libtinfo5:i386 +ns +ns2,speex,libtbb12 +ns2c,speex:i386,libtbb12 +ohd +onset,libmariadb-dev +opfor +pc +pc2 +pmc,openjdk-22-jre +ps,libgconf-2-4 +pvkii +pvr,libc++1 +pw +pz,openjdk-22-jre,rng-tools5 +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,lib32z1 +rw,openjdk-22-jre +samp +sb +sbots +scpsl,mono-complete +scpslsm,mono-complete +sdtd,telnet,expect,libxml2-utils +sf +sfc,libtinfo5:i386 +sm,telnet,expect +sof2 +sol +squad +st,libxml2-utils +stn +sven,libssl3:i386,zlib1g:i386 +terraria +tf +tf2,libcurl4-gnutls-dev:i386 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,libc6-dev,libatomic1,libpulse-dev +vints,aspnetcore-runtime-7.0 +vpmc,openjdk-21-jre +vs +wet +wf +wmc,openjdk21-jre +wurm,xvfb +xnt +zmr,libtinfo5:i386 +zps,libtinfo5:i386 diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv new file mode 100644 index 000000000..4e54ac241 --- /dev/null +++ b/lgsm/data/debian-9.csv @@ -0,0 +1,139 @@ +all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,pigz,python3,tar,tmux,unzip,util-linux,wget,xz-utils +steamcmd,lib32gcc1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd +ac +ahl +ahl2 +ark +arma3 +armar,libcurl4 +ats +av +bb +bb2,libcurl4-gnutls-dev:i386 +bd +bf1942,libncurses5:i386,libtinfo5:i386 +bfv,libncurses5:i386,libstdc++5:i386 +bmdm,libncurses5:i386 +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,libtinfo5:i386 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl4-gnutls-dev:i386 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,libtinfo5:i386 +hcu +hl2dm +hldm +hldms +hw,lib32z1 +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,openjdk-8-jre +mcb +mh +mohaa,libstdc++5:i386 +mta,libncursesw5,libxml2-utils +nd +nec +nmrih,libtinfo5:i386 +ns +ns2,speex,libtbb2 +ns2c,speex:i386,libtbb2 +ohd +onset,libmariadb-dev +opfor +pc +pc2 +pmc,openjdk-8-jre +ps,libgconf-2-4 +pvkii +pvr,libc++1 +pw +pz,openjdk-8-jre,rng-tools +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,lib32z1 +rw,openjdk-8-jre +samp +sb +sbots +scpsl,mono-complete +scpslsm,mono-complete +sdtd,telnet,expect,libxml2-utils +sf +sfc,libtinfo5:i386 +sm,telnet,expect +sof2 +sol +squad +st,libxml2-utils +stn +sven,libssl1.1:i386,zlib1g:i386 +terraria +tf +tf2,libcurl4-gnutls-dev:i386 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,libc6-dev,libatomic1,libpulse-dev +vints,aspnetcore-runtime-7.0 +vpmc,openjdk-8-jre +vs +wet +wf +wmc,openjdk-8-jre +wurm,xvfb +xnt +zmr,libtinfo5:i386 +zps,libtinfo5:i386 diff --git a/lgsm/data/gameicons/ac-icon.png b/lgsm/data/gameicons/ac-icon.png new file mode 100644 index 000000000..fcf39841e Binary files /dev/null and b/lgsm/data/gameicons/ac-icon.png differ diff --git a/lgsm/data/gameicons/ahl-icon.png b/lgsm/data/gameicons/ahl-icon.png new file mode 100644 index 000000000..f4e5cb535 Binary files /dev/null and b/lgsm/data/gameicons/ahl-icon.png differ diff --git a/lgsm/data/gameicons/ahl2-icon.png b/lgsm/data/gameicons/ahl2-icon.png new file mode 100644 index 000000000..04d35d040 Binary files /dev/null and b/lgsm/data/gameicons/ahl2-icon.png differ diff --git a/lgsm/data/gameicons/ark-icon.png b/lgsm/data/gameicons/ark-icon.png new file mode 100644 index 000000000..096e7cfbf Binary files /dev/null and b/lgsm/data/gameicons/ark-icon.png differ diff --git a/lgsm/data/gameicons/arma3-icon.png b/lgsm/data/gameicons/arma3-icon.png new file mode 100644 index 000000000..0bb0bc64c Binary files /dev/null and b/lgsm/data/gameicons/arma3-icon.png differ diff --git a/lgsm/data/gameicons/armar-icon.png b/lgsm/data/gameicons/armar-icon.png new file mode 100644 index 000000000..ea79ba088 Binary files /dev/null and b/lgsm/data/gameicons/armar-icon.png differ diff --git a/lgsm/data/gameicons/ats-icon.png b/lgsm/data/gameicons/ats-icon.png new file mode 100644 index 000000000..6495b1073 Binary files /dev/null and b/lgsm/data/gameicons/ats-icon.png differ diff --git a/lgsm/data/gameicons/av-icon.png b/lgsm/data/gameicons/av-icon.png new file mode 100644 index 000000000..4bce455ad Binary files /dev/null and b/lgsm/data/gameicons/av-icon.png differ diff --git a/lgsm/data/gameicons/bb-icon.png b/lgsm/data/gameicons/bb-icon.png new file mode 100644 index 000000000..2c6b7ec88 Binary files /dev/null and b/lgsm/data/gameicons/bb-icon.png differ diff --git a/lgsm/data/gameicons/bb2-icon.png b/lgsm/data/gameicons/bb2-icon.png new file mode 100644 index 000000000..56716418c Binary files /dev/null and b/lgsm/data/gameicons/bb2-icon.png differ diff --git a/lgsm/data/gameicons/bd-icon.png b/lgsm/data/gameicons/bd-icon.png new file mode 100644 index 000000000..93ba9db92 Binary files /dev/null and b/lgsm/data/gameicons/bd-icon.png differ diff --git a/lgsm/data/gameicons/bf1942-icon.png b/lgsm/data/gameicons/bf1942-icon.png new file mode 100644 index 000000000..653ce6a8f Binary files /dev/null and b/lgsm/data/gameicons/bf1942-icon.png differ diff --git a/lgsm/data/gameicons/bfv-icon.png b/lgsm/data/gameicons/bfv-icon.png new file mode 100644 index 000000000..70cae02ee Binary files /dev/null and b/lgsm/data/gameicons/bfv-icon.png differ diff --git a/lgsm/data/gameicons/bmdm-icon.png b/lgsm/data/gameicons/bmdm-icon.png new file mode 100644 index 000000000..4ff37301e Binary files /dev/null and b/lgsm/data/gameicons/bmdm-icon.png differ diff --git a/lgsm/data/gameicons/bo-icon.png b/lgsm/data/gameicons/bo-icon.png new file mode 100644 index 000000000..53f5577d8 Binary files /dev/null and b/lgsm/data/gameicons/bo-icon.png differ diff --git a/lgsm/data/gameicons/bs-icon.png b/lgsm/data/gameicons/bs-icon.png new file mode 100644 index 000000000..712f8d430 Binary files /dev/null and b/lgsm/data/gameicons/bs-icon.png differ diff --git a/lgsm/data/gameicons/bt-icon.png b/lgsm/data/gameicons/bt-icon.png new file mode 100644 index 000000000..d262bf39f Binary files /dev/null and b/lgsm/data/gameicons/bt-icon.png differ diff --git a/lgsm/data/gameicons/btl-icon.png b/lgsm/data/gameicons/btl-icon.png new file mode 100644 index 000000000..615ba7cb9 Binary files /dev/null and b/lgsm/data/gameicons/btl-icon.png differ diff --git a/lgsm/data/gameicons/cc-icon.png b/lgsm/data/gameicons/cc-icon.png new file mode 100644 index 000000000..6249a0f89 Binary files /dev/null and b/lgsm/data/gameicons/cc-icon.png differ diff --git a/lgsm/data/gameicons/ck-icon.png b/lgsm/data/gameicons/ck-icon.png new file mode 100644 index 000000000..a22d81480 Binary files /dev/null and b/lgsm/data/gameicons/ck-icon.png differ diff --git a/lgsm/data/gameicons/cmw-icon.png b/lgsm/data/gameicons/cmw-icon.png new file mode 100644 index 000000000..627490866 Binary files /dev/null and b/lgsm/data/gameicons/cmw-icon.png differ diff --git a/lgsm/data/gameicons/cod-icon.png b/lgsm/data/gameicons/cod-icon.png new file mode 100644 index 000000000..7af55bf2c Binary files /dev/null and b/lgsm/data/gameicons/cod-icon.png differ diff --git a/lgsm/data/gameicons/cod2-icon.png b/lgsm/data/gameicons/cod2-icon.png new file mode 100644 index 000000000..dfd6ee7de Binary files /dev/null and b/lgsm/data/gameicons/cod2-icon.png differ diff --git a/lgsm/data/gameicons/cod4-icon.png b/lgsm/data/gameicons/cod4-icon.png new file mode 100644 index 000000000..25808b182 Binary files /dev/null and b/lgsm/data/gameicons/cod4-icon.png differ diff --git a/lgsm/data/gameicons/coduo-icon.png b/lgsm/data/gameicons/coduo-icon.png new file mode 100644 index 000000000..c8151fee2 Binary files /dev/null and b/lgsm/data/gameicons/coduo-icon.png differ diff --git a/lgsm/data/gameicons/codwaw-icon.png b/lgsm/data/gameicons/codwaw-icon.png new file mode 100644 index 000000000..10f06601d Binary files /dev/null and b/lgsm/data/gameicons/codwaw-icon.png differ diff --git a/lgsm/data/gameicons/col-icon.png b/lgsm/data/gameicons/col-icon.png new file mode 100644 index 000000000..fbd91f9ef Binary files /dev/null and b/lgsm/data/gameicons/col-icon.png differ diff --git a/lgsm/data/gameicons/cs-icon.png b/lgsm/data/gameicons/cs-icon.png new file mode 100644 index 000000000..5e61337e0 Binary files /dev/null and b/lgsm/data/gameicons/cs-icon.png differ diff --git a/lgsm/data/gameicons/cs2-icon.png b/lgsm/data/gameicons/cs2-icon.png new file mode 100644 index 000000000..3cda210bb Binary files /dev/null and b/lgsm/data/gameicons/cs2-icon.png differ diff --git a/lgsm/data/gameicons/cscz-icon.png b/lgsm/data/gameicons/cscz-icon.png new file mode 100644 index 000000000..490174b30 Binary files /dev/null and b/lgsm/data/gameicons/cscz-icon.png differ diff --git a/lgsm/data/gameicons/csgo-icon.png b/lgsm/data/gameicons/csgo-icon.png new file mode 100644 index 000000000..b9ed6ca4d Binary files /dev/null and b/lgsm/data/gameicons/csgo-icon.png differ diff --git a/lgsm/data/gameicons/css-icon.png b/lgsm/data/gameicons/css-icon.png new file mode 100644 index 000000000..e0f099f8a Binary files /dev/null and b/lgsm/data/gameicons/css-icon.png differ diff --git a/lgsm/data/gameicons/ct-icon.png b/lgsm/data/gameicons/ct-icon.png new file mode 100644 index 000000000..5fb048b56 Binary files /dev/null and b/lgsm/data/gameicons/ct-icon.png differ diff --git a/lgsm/data/gameicons/dab-icon.png b/lgsm/data/gameicons/dab-icon.png new file mode 100644 index 000000000..fac2aaf24 Binary files /dev/null and b/lgsm/data/gameicons/dab-icon.png differ diff --git a/lgsm/data/gameicons/dayz-icon.png b/lgsm/data/gameicons/dayz-icon.png new file mode 100644 index 000000000..de66c6112 Binary files /dev/null and b/lgsm/data/gameicons/dayz-icon.png differ diff --git a/lgsm/data/gameicons/dmc-icon.png b/lgsm/data/gameicons/dmc-icon.png new file mode 100644 index 000000000..0d3dad709 Binary files /dev/null and b/lgsm/data/gameicons/dmc-icon.png differ diff --git a/lgsm/data/gameicons/dod-icon.png b/lgsm/data/gameicons/dod-icon.png new file mode 100644 index 000000000..49e963392 Binary files /dev/null and b/lgsm/data/gameicons/dod-icon.png differ diff --git a/lgsm/data/gameicons/dodr-icon.png b/lgsm/data/gameicons/dodr-icon.png new file mode 100644 index 000000000..db4313719 Binary files /dev/null and b/lgsm/data/gameicons/dodr-icon.png differ diff --git a/lgsm/data/gameicons/dods-icon.png b/lgsm/data/gameicons/dods-icon.png new file mode 100644 index 000000000..455a25b8c Binary files /dev/null and b/lgsm/data/gameicons/dods-icon.png differ diff --git a/lgsm/data/gameicons/doi-icon.png b/lgsm/data/gameicons/doi-icon.png new file mode 100644 index 000000000..bd1329216 Binary files /dev/null and b/lgsm/data/gameicons/doi-icon.png differ diff --git a/lgsm/data/gameicons/dst-icon.png b/lgsm/data/gameicons/dst-icon.png new file mode 100644 index 000000000..25b41366c Binary files /dev/null and b/lgsm/data/gameicons/dst-icon.png differ diff --git a/lgsm/data/gameicons/dys-icon.png b/lgsm/data/gameicons/dys-icon.png new file mode 100644 index 000000000..bab210283 Binary files /dev/null and b/lgsm/data/gameicons/dys-icon.png differ diff --git a/lgsm/data/gameicons/eco-icon.png b/lgsm/data/gameicons/eco-icon.png new file mode 100644 index 000000000..c3f995e69 Binary files /dev/null and b/lgsm/data/gameicons/eco-icon.png differ diff --git a/lgsm/data/gameicons/em-icon.png b/lgsm/data/gameicons/em-icon.png new file mode 100644 index 000000000..2c98840b2 Binary files /dev/null and b/lgsm/data/gameicons/em-icon.png differ diff --git a/lgsm/data/gameicons/etl-icon.png b/lgsm/data/gameicons/etl-icon.png new file mode 100644 index 000000000..d81c43fb5 Binary files /dev/null and b/lgsm/data/gameicons/etl-icon.png differ diff --git a/lgsm/data/gameicons/ets2-icon.png b/lgsm/data/gameicons/ets2-icon.png new file mode 100644 index 000000000..11779d255 Binary files /dev/null and b/lgsm/data/gameicons/ets2-icon.png differ diff --git a/lgsm/data/gameicons/fctr-icon.png b/lgsm/data/gameicons/fctr-icon.png new file mode 100644 index 000000000..421235343 Binary files /dev/null and b/lgsm/data/gameicons/fctr-icon.png differ diff --git a/lgsm/data/gameicons/fof-icon.png b/lgsm/data/gameicons/fof-icon.png new file mode 100644 index 000000000..c9e17c4ff Binary files /dev/null and b/lgsm/data/gameicons/fof-icon.png differ diff --git a/lgsm/data/gameicons/gmod-icon.png b/lgsm/data/gameicons/gmod-icon.png new file mode 100644 index 000000000..00ba856c8 Binary files /dev/null and b/lgsm/data/gameicons/gmod-icon.png differ diff --git a/lgsm/data/gameicons/hcu-icon.png b/lgsm/data/gameicons/hcu-icon.png new file mode 100644 index 000000000..f265a5853 Binary files /dev/null and b/lgsm/data/gameicons/hcu-icon.png differ diff --git a/lgsm/data/gameicons/hl2dm-icon.png b/lgsm/data/gameicons/hl2dm-icon.png new file mode 100644 index 000000000..5bf5720ac Binary files /dev/null and b/lgsm/data/gameicons/hl2dm-icon.png differ diff --git a/lgsm/data/gameicons/hldm-icon.png b/lgsm/data/gameicons/hldm-icon.png new file mode 100644 index 000000000..2a9779640 Binary files /dev/null and b/lgsm/data/gameicons/hldm-icon.png differ diff --git a/lgsm/data/gameicons/hldms-icon.png b/lgsm/data/gameicons/hldms-icon.png new file mode 100644 index 000000000..37e2a20b8 Binary files /dev/null and b/lgsm/data/gameicons/hldms-icon.png differ diff --git a/lgsm/data/gameicons/hw-icon.png b/lgsm/data/gameicons/hw-icon.png new file mode 100644 index 000000000..0894332e3 Binary files /dev/null and b/lgsm/data/gameicons/hw-icon.png differ diff --git a/lgsm/data/gameicons/hz-icon.png b/lgsm/data/gameicons/hz-icon.png new file mode 100644 index 000000000..7d2428669 Binary files /dev/null and b/lgsm/data/gameicons/hz-icon.png differ diff --git a/lgsm/data/gameicons/ins-icon.png b/lgsm/data/gameicons/ins-icon.png new file mode 100644 index 000000000..30cfaaf35 Binary files /dev/null and b/lgsm/data/gameicons/ins-icon.png differ diff --git a/lgsm/data/gameicons/inss-icon.png b/lgsm/data/gameicons/inss-icon.png new file mode 100644 index 000000000..0109dd07c Binary files /dev/null and b/lgsm/data/gameicons/inss-icon.png differ diff --git a/lgsm/data/gameicons/ios-icon.png b/lgsm/data/gameicons/ios-icon.png new file mode 100644 index 000000000..d53577676 Binary files /dev/null and b/lgsm/data/gameicons/ios-icon.png differ diff --git a/lgsm/data/gameicons/jc2-icon.png b/lgsm/data/gameicons/jc2-icon.png new file mode 100644 index 000000000..782edabc3 Binary files /dev/null and b/lgsm/data/gameicons/jc2-icon.png differ diff --git a/lgsm/data/gameicons/jc3-icon.png b/lgsm/data/gameicons/jc3-icon.png new file mode 100644 index 000000000..3c1cfff29 Binary files /dev/null and b/lgsm/data/gameicons/jc3-icon.png differ diff --git a/lgsm/data/gameicons/jk2-icon.png b/lgsm/data/gameicons/jk2-icon.png new file mode 100644 index 000000000..8c480a205 Binary files /dev/null and b/lgsm/data/gameicons/jk2-icon.png differ diff --git a/lgsm/data/gameicons/kf-icon.png b/lgsm/data/gameicons/kf-icon.png new file mode 100644 index 000000000..516bf8d6f Binary files /dev/null and b/lgsm/data/gameicons/kf-icon.png differ diff --git a/lgsm/data/gameicons/kf2-icon.png b/lgsm/data/gameicons/kf2-icon.png new file mode 100644 index 000000000..5e3a57c6e Binary files /dev/null and b/lgsm/data/gameicons/kf2-icon.png differ diff --git a/lgsm/data/gameicons/l4d-icon.png b/lgsm/data/gameicons/l4d-icon.png new file mode 100644 index 000000000..319f644f8 Binary files /dev/null and b/lgsm/data/gameicons/l4d-icon.png differ diff --git a/lgsm/data/gameicons/l4d2-icon.png b/lgsm/data/gameicons/l4d2-icon.png new file mode 100644 index 000000000..9a9a3d68b Binary files /dev/null and b/lgsm/data/gameicons/l4d2-icon.png differ diff --git a/lgsm/data/gameicons/mc-icon.png b/lgsm/data/gameicons/mc-icon.png new file mode 100644 index 000000000..ad6904d9c Binary files /dev/null and b/lgsm/data/gameicons/mc-icon.png differ diff --git a/lgsm/data/gameicons/mcb-icon.png b/lgsm/data/gameicons/mcb-icon.png new file mode 100644 index 000000000..963422030 Binary files /dev/null and b/lgsm/data/gameicons/mcb-icon.png differ diff --git a/lgsm/data/gameicons/mh-icon.png b/lgsm/data/gameicons/mh-icon.png new file mode 100644 index 000000000..1f1621f15 Binary files /dev/null and b/lgsm/data/gameicons/mh-icon.png differ diff --git a/lgsm/data/gameicons/mohaa-icon.png b/lgsm/data/gameicons/mohaa-icon.png new file mode 100644 index 000000000..0acd3dcf3 Binary files /dev/null and b/lgsm/data/gameicons/mohaa-icon.png differ diff --git a/lgsm/data/gameicons/mta-icon.png b/lgsm/data/gameicons/mta-icon.png new file mode 100644 index 000000000..25f89c9d8 Binary files /dev/null and b/lgsm/data/gameicons/mta-icon.png differ diff --git a/lgsm/data/gameicons/nd-icon.png b/lgsm/data/gameicons/nd-icon.png new file mode 100644 index 000000000..dbc6a6891 Binary files /dev/null and b/lgsm/data/gameicons/nd-icon.png differ diff --git a/lgsm/data/gameicons/nec-icon.png b/lgsm/data/gameicons/nec-icon.png new file mode 100644 index 000000000..27ba109ea Binary files /dev/null and b/lgsm/data/gameicons/nec-icon.png differ diff --git a/lgsm/data/gameicons/nmrih-icon.png b/lgsm/data/gameicons/nmrih-icon.png new file mode 100644 index 000000000..02631268f Binary files /dev/null and b/lgsm/data/gameicons/nmrih-icon.png differ diff --git a/lgsm/data/gameicons/ns-icon.png b/lgsm/data/gameicons/ns-icon.png new file mode 100644 index 000000000..bb59c4a0e Binary files /dev/null and b/lgsm/data/gameicons/ns-icon.png differ diff --git a/lgsm/data/gameicons/ns2-icon.png b/lgsm/data/gameicons/ns2-icon.png new file mode 100644 index 000000000..4894b0fa4 Binary files /dev/null and b/lgsm/data/gameicons/ns2-icon.png differ diff --git a/lgsm/data/gameicons/ns2c-icon.png b/lgsm/data/gameicons/ns2c-icon.png new file mode 100644 index 000000000..c519b771d Binary files /dev/null and b/lgsm/data/gameicons/ns2c-icon.png differ diff --git a/lgsm/data/gameicons/ohd-icon.png b/lgsm/data/gameicons/ohd-icon.png new file mode 100644 index 000000000..85ccded14 Binary files /dev/null and b/lgsm/data/gameicons/ohd-icon.png differ diff --git a/lgsm/data/gameicons/onset-icon.png b/lgsm/data/gameicons/onset-icon.png new file mode 100644 index 000000000..598455658 Binary files /dev/null and b/lgsm/data/gameicons/onset-icon.png differ diff --git a/lgsm/data/gameicons/opfor-icon.png b/lgsm/data/gameicons/opfor-icon.png new file mode 100644 index 000000000..3ff940ea1 Binary files /dev/null and b/lgsm/data/gameicons/opfor-icon.png differ diff --git a/lgsm/data/gameicons/pc-icon.png b/lgsm/data/gameicons/pc-icon.png new file mode 100644 index 000000000..f115231dd Binary files /dev/null and b/lgsm/data/gameicons/pc-icon.png differ diff --git a/lgsm/data/gameicons/pc2-icon.png b/lgsm/data/gameicons/pc2-icon.png new file mode 100644 index 000000000..8a20b75c8 Binary files /dev/null and b/lgsm/data/gameicons/pc2-icon.png differ diff --git a/lgsm/data/gameicons/pmc-icon.png b/lgsm/data/gameicons/pmc-icon.png new file mode 100644 index 000000000..c58cb7aed Binary files /dev/null and b/lgsm/data/gameicons/pmc-icon.png differ diff --git a/lgsm/data/gameicons/ps-icon.png b/lgsm/data/gameicons/ps-icon.png new file mode 100644 index 000000000..afe81e823 Binary files /dev/null and b/lgsm/data/gameicons/ps-icon.png differ diff --git a/lgsm/data/gameicons/pvkii-icon.png b/lgsm/data/gameicons/pvkii-icon.png new file mode 100644 index 000000000..bf518f6c8 Binary files /dev/null and b/lgsm/data/gameicons/pvkii-icon.png differ diff --git a/lgsm/data/gameicons/pvr-icon.png b/lgsm/data/gameicons/pvr-icon.png new file mode 100644 index 000000000..f471bd5d0 Binary files /dev/null and b/lgsm/data/gameicons/pvr-icon.png differ diff --git a/lgsm/data/gameicons/pw-icon.png b/lgsm/data/gameicons/pw-icon.png new file mode 100644 index 000000000..1772c3bd9 Binary files /dev/null and b/lgsm/data/gameicons/pw-icon.png differ diff --git a/lgsm/data/gameicons/pz-icon.png b/lgsm/data/gameicons/pz-icon.png new file mode 100644 index 000000000..63218d100 Binary files /dev/null and b/lgsm/data/gameicons/pz-icon.png differ diff --git a/lgsm/data/gameicons/q2-icon.png b/lgsm/data/gameicons/q2-icon.png new file mode 100644 index 000000000..e57d4917d Binary files /dev/null and b/lgsm/data/gameicons/q2-icon.png differ diff --git a/lgsm/data/gameicons/q3-icon.png b/lgsm/data/gameicons/q3-icon.png new file mode 100644 index 000000000..7d111da1e Binary files /dev/null and b/lgsm/data/gameicons/q3-icon.png differ diff --git a/lgsm/data/gameicons/q4-icon.png b/lgsm/data/gameicons/q4-icon.png new file mode 100644 index 000000000..dd4c2d7fa Binary files /dev/null and b/lgsm/data/gameicons/q4-icon.png differ diff --git a/lgsm/data/gameicons/ql-icon.png b/lgsm/data/gameicons/ql-icon.png new file mode 100644 index 000000000..5b0e5ceff Binary files /dev/null and b/lgsm/data/gameicons/ql-icon.png differ diff --git a/lgsm/data/gameicons/qw-icon.png b/lgsm/data/gameicons/qw-icon.png new file mode 100644 index 000000000..c5a65f4ca Binary files /dev/null and b/lgsm/data/gameicons/qw-icon.png differ diff --git a/lgsm/data/gameicons/ricochet-icon.png b/lgsm/data/gameicons/ricochet-icon.png new file mode 100644 index 000000000..da9b2a309 Binary files /dev/null and b/lgsm/data/gameicons/ricochet-icon.png differ diff --git a/lgsm/data/gameicons/ro-icon.png b/lgsm/data/gameicons/ro-icon.png new file mode 100644 index 000000000..027c0f662 Binary files /dev/null and b/lgsm/data/gameicons/ro-icon.png differ diff --git a/lgsm/data/gameicons/rtcw-icon.png b/lgsm/data/gameicons/rtcw-icon.png new file mode 100644 index 000000000..d0fb797a7 Binary files /dev/null and b/lgsm/data/gameicons/rtcw-icon.png differ diff --git a/lgsm/data/gameicons/rust-icon.png b/lgsm/data/gameicons/rust-icon.png new file mode 100644 index 000000000..484777503 Binary files /dev/null and b/lgsm/data/gameicons/rust-icon.png differ diff --git a/lgsm/data/gameicons/rw-icon.png b/lgsm/data/gameicons/rw-icon.png new file mode 100644 index 000000000..58d4a949b Binary files /dev/null and b/lgsm/data/gameicons/rw-icon.png differ diff --git a/lgsm/data/gameicons/samp-icon.png b/lgsm/data/gameicons/samp-icon.png new file mode 100644 index 000000000..d20d3faf7 Binary files /dev/null and b/lgsm/data/gameicons/samp-icon.png differ diff --git a/lgsm/data/gameicons/sb-icon.png b/lgsm/data/gameicons/sb-icon.png new file mode 100644 index 000000000..3baf0a116 Binary files /dev/null and b/lgsm/data/gameicons/sb-icon.png differ diff --git a/lgsm/data/gameicons/sbots-icon.png b/lgsm/data/gameicons/sbots-icon.png new file mode 100644 index 000000000..c897b3cce Binary files /dev/null and b/lgsm/data/gameicons/sbots-icon.png differ diff --git a/lgsm/data/gameicons/scpsl-icon.png b/lgsm/data/gameicons/scpsl-icon.png new file mode 100644 index 000000000..2872a7841 Binary files /dev/null and b/lgsm/data/gameicons/scpsl-icon.png differ diff --git a/lgsm/data/gameicons/scpslsm-icon.png b/lgsm/data/gameicons/scpslsm-icon.png new file mode 100644 index 000000000..2872a7841 Binary files /dev/null and b/lgsm/data/gameicons/scpslsm-icon.png differ diff --git a/lgsm/data/gameicons/sdtd-icon.png b/lgsm/data/gameicons/sdtd-icon.png new file mode 100644 index 000000000..04c8f87f8 Binary files /dev/null and b/lgsm/data/gameicons/sdtd-icon.png differ diff --git a/lgsm/data/gameicons/sf-icon.png b/lgsm/data/gameicons/sf-icon.png new file mode 100644 index 000000000..8685b4ad5 Binary files /dev/null and b/lgsm/data/gameicons/sf-icon.png differ diff --git a/lgsm/data/gameicons/sfc-icon.png b/lgsm/data/gameicons/sfc-icon.png new file mode 100644 index 000000000..5f866bd77 Binary files /dev/null and b/lgsm/data/gameicons/sfc-icon.png differ diff --git a/lgsm/data/gameicons/sm-icon.png b/lgsm/data/gameicons/sm-icon.png new file mode 100644 index 000000000..7948e002d Binary files /dev/null and b/lgsm/data/gameicons/sm-icon.png differ diff --git a/lgsm/data/gameicons/sof2-icon.png b/lgsm/data/gameicons/sof2-icon.png new file mode 100644 index 000000000..7da4f30c1 Binary files /dev/null and b/lgsm/data/gameicons/sof2-icon.png differ diff --git a/lgsm/data/gameicons/sol-icon.png b/lgsm/data/gameicons/sol-icon.png new file mode 100644 index 000000000..e2589b0ed Binary files /dev/null and b/lgsm/data/gameicons/sol-icon.png differ diff --git a/lgsm/data/gameicons/squad-icon.png b/lgsm/data/gameicons/squad-icon.png new file mode 100644 index 000000000..adc1464f8 Binary files /dev/null and b/lgsm/data/gameicons/squad-icon.png differ diff --git a/lgsm/data/gameicons/st-icon.png b/lgsm/data/gameicons/st-icon.png new file mode 100644 index 000000000..67ca7ade6 Binary files /dev/null and b/lgsm/data/gameicons/st-icon.png differ diff --git a/lgsm/data/gameicons/stn-icon.png b/lgsm/data/gameicons/stn-icon.png new file mode 100644 index 000000000..8bb7b1e3a Binary files /dev/null and b/lgsm/data/gameicons/stn-icon.png differ diff --git a/lgsm/data/gameicons/sven-icon.png b/lgsm/data/gameicons/sven-icon.png new file mode 100644 index 000000000..a46d41261 Binary files /dev/null and b/lgsm/data/gameicons/sven-icon.png differ diff --git a/lgsm/data/gameicons/terraria-icon.png b/lgsm/data/gameicons/terraria-icon.png new file mode 100644 index 000000000..8f0a253e7 Binary files /dev/null and b/lgsm/data/gameicons/terraria-icon.png differ diff --git a/lgsm/data/gameicons/tf-icon.png b/lgsm/data/gameicons/tf-icon.png new file mode 100644 index 000000000..ace42ff5b Binary files /dev/null and b/lgsm/data/gameicons/tf-icon.png differ diff --git a/lgsm/data/gameicons/tf2-icon.png b/lgsm/data/gameicons/tf2-icon.png new file mode 100644 index 000000000..3f5474ba9 Binary files /dev/null and b/lgsm/data/gameicons/tf2-icon.png differ diff --git a/lgsm/data/gameicons/tfc-icon.png b/lgsm/data/gameicons/tfc-icon.png new file mode 100644 index 000000000..f04580e2c Binary files /dev/null and b/lgsm/data/gameicons/tfc-icon.png differ diff --git a/lgsm/data/gameicons/ti-icon.png b/lgsm/data/gameicons/ti-icon.png new file mode 100644 index 000000000..0c6e126dd Binary files /dev/null and b/lgsm/data/gameicons/ti-icon.png differ diff --git a/lgsm/data/gameicons/ts-icon.png b/lgsm/data/gameicons/ts-icon.png new file mode 100644 index 000000000..271c5bc70 Binary files /dev/null and b/lgsm/data/gameicons/ts-icon.png differ diff --git a/lgsm/data/gameicons/ts3-icon.png b/lgsm/data/gameicons/ts3-icon.png new file mode 100644 index 000000000..1a71ba0ca Binary files /dev/null and b/lgsm/data/gameicons/ts3-icon.png differ diff --git a/lgsm/data/gameicons/tu-icon.png b/lgsm/data/gameicons/tu-icon.png new file mode 100644 index 000000000..80ea98bab Binary files /dev/null and b/lgsm/data/gameicons/tu-icon.png differ diff --git a/lgsm/data/gameicons/tw-icon.png b/lgsm/data/gameicons/tw-icon.png new file mode 100644 index 000000000..cd8ccd809 Binary files /dev/null and b/lgsm/data/gameicons/tw-icon.png differ diff --git a/lgsm/data/gameicons/unt-icon.png b/lgsm/data/gameicons/unt-icon.png new file mode 100644 index 000000000..bd8d94915 Binary files /dev/null and b/lgsm/data/gameicons/unt-icon.png differ diff --git a/lgsm/data/gameicons/ut-icon.png b/lgsm/data/gameicons/ut-icon.png new file mode 100644 index 000000000..8c81e418a Binary files /dev/null and b/lgsm/data/gameicons/ut-icon.png differ diff --git a/lgsm/data/gameicons/ut2k4-icon.png b/lgsm/data/gameicons/ut2k4-icon.png new file mode 100644 index 000000000..3494d31fb Binary files /dev/null and b/lgsm/data/gameicons/ut2k4-icon.png differ diff --git a/lgsm/data/gameicons/ut3-icon.png b/lgsm/data/gameicons/ut3-icon.png new file mode 100644 index 000000000..1713a3531 Binary files /dev/null and b/lgsm/data/gameicons/ut3-icon.png differ diff --git a/lgsm/data/gameicons/ut99-icon.png b/lgsm/data/gameicons/ut99-icon.png new file mode 100644 index 000000000..5ebe6c09c Binary files /dev/null and b/lgsm/data/gameicons/ut99-icon.png differ diff --git a/lgsm/data/gameicons/vh-icon.png b/lgsm/data/gameicons/vh-icon.png new file mode 100644 index 000000000..e74f2604d Binary files /dev/null and b/lgsm/data/gameicons/vh-icon.png differ diff --git a/lgsm/data/gameicons/vints-icon.png b/lgsm/data/gameicons/vints-icon.png new file mode 100644 index 000000000..f6e6748c0 Binary files /dev/null and b/lgsm/data/gameicons/vints-icon.png differ diff --git a/lgsm/data/gameicons/vpmc-icon.png b/lgsm/data/gameicons/vpmc-icon.png new file mode 100644 index 000000000..95d3e0f8a Binary files /dev/null and b/lgsm/data/gameicons/vpmc-icon.png differ diff --git a/lgsm/data/gameicons/vs-icon.png b/lgsm/data/gameicons/vs-icon.png new file mode 100644 index 000000000..0817c14eb Binary files /dev/null and b/lgsm/data/gameicons/vs-icon.png differ diff --git a/lgsm/data/gameicons/wet-icon.png b/lgsm/data/gameicons/wet-icon.png new file mode 100644 index 000000000..e24d585a9 Binary files /dev/null and b/lgsm/data/gameicons/wet-icon.png differ diff --git a/lgsm/data/gameicons/wf-icon.png b/lgsm/data/gameicons/wf-icon.png new file mode 100644 index 000000000..21b6a98cc Binary files /dev/null and b/lgsm/data/gameicons/wf-icon.png differ diff --git a/lgsm/data/gameicons/wmc-icon.png b/lgsm/data/gameicons/wmc-icon.png new file mode 100644 index 000000000..ebdbae8d6 Binary files /dev/null and b/lgsm/data/gameicons/wmc-icon.png differ diff --git a/lgsm/data/gameicons/wurm-icon.png b/lgsm/data/gameicons/wurm-icon.png new file mode 100644 index 000000000..248b42618 Binary files /dev/null and b/lgsm/data/gameicons/wurm-icon.png differ diff --git a/lgsm/data/gameicons/xnt-icon.png b/lgsm/data/gameicons/xnt-icon.png new file mode 100644 index 000000000..f230eb407 Binary files /dev/null and b/lgsm/data/gameicons/xnt-icon.png differ diff --git a/lgsm/data/gameicons/zmr-icon.png b/lgsm/data/gameicons/zmr-icon.png new file mode 100644 index 000000000..d6c61b1d4 Binary files /dev/null and b/lgsm/data/gameicons/zmr-icon.png differ diff --git a/lgsm/data/gameicons/zps-icon.png b/lgsm/data/gameicons/zps-icon.png new file mode 100644 index 000000000..e37f37280 Binary files /dev/null and b/lgsm/data/gameicons/zps-icon.png differ diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv new file mode 100644 index 000000000..7800136bb --- /dev/null +++ b/lgsm/data/rhel-7.csv @@ -0,0 +1,139 @@ +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python36,tar,tmux,unzip,util-linux,wget,xz +steamcmd,glibc.i686,libstdc++.i686 +ac +ahl +ahl2 +ark +arma3 +armar,libcurl,openssl11-libs +ats +av +bb +pw +bb2,libcurl.i686 +bd +bf1942,ncurses-libs.i686 +bfv,compat-libstdc++-33.i686,glibc.i686 +bmdm,ncurses-libs.i686 +bo +bs +bt,libicu,dos2unix,libxml2 +btl +cc +ck,xorg-x11-server-Xvfb +cmw +cod,compat-libstdc++-33.i686 +cod2,compat-libstdc++-33.i686 +cod4 +coduo,compat-libstdc++-33.i686 +codwaw +col +cs +cs2 +cscz +csgo +css,ncurses-libs.i686 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl.i686 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,ncurses-libs.i686 +hcu +hl2dm +hldm +hldms +hw,zlib-devel +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,java-11-openjdk +mcb,libnsl +mh +mohaa,compat-libstdc++-33.i686 +mta,ncurses-libs,libxml2 +nd +nec +nmrih,ncurses-libs.i686 +ns +ns2,speex,tbb +ns2c,speex.i686,tbb.i686 +ohd +onset,mariadb-connector-c +opfor +pc +pc2 +pmc,java-11-openjdk +ps,GConf2 +pvkii +pvr,libcxx +pz,java-11-openjdk rng-tools +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,zlib-devel +rw,java-11-openjdk +samp +sb +sbots +scpsl +scpslsm +sdtd,telnet,expect,libxml2 +sf +sfc,ncurses-libs.i686 +sm,telnet,expect +sof2 +sol +squad +st,libxml2 +stn +sven +terraria +tf +tf2,libcurl.i686 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,glibc-devel,libatomic,pulseaudio-libs-devel +vints,aspnetcore-runtime-7.0 +vpmc,java-11-openjdk +vs +wet +wf +wmc,java-11-openjdk +wurm,xorg-x11-server-Xvfb +xnt +zmr,ncurses-libs.i686 +zps,ncurses-libs.i686 diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv new file mode 100644 index 000000000..f8bb1d492 --- /dev/null +++ b/lgsm/data/rhel-8.csv @@ -0,0 +1,139 @@ +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python36,tar,tmux,unzip,util-linux,wget,xz +steamcmd,glibc.i686,libstdc++.i686 +ac +ahl +ahl2 +ark +arma3 +armar,libcurl,openssl-libs +ats +av +bb +bb2,libcurl.i686 +bd +bf1942,ncurses-libs.i686 +bfv,compat-libstdc++-33.i686,glibc.i686 +bmdm,ncurses-libs.i686 +bo +bs +bt,libicu,dos2unix,libxml2 +btl +cc +ck,xorg-x11-server-Xvfb +cmw +cod,compat-libstdc++-33.i686 +cod2,compat-libstdc++-33.i686 +cod4 +coduo,compat-libstdc++-33.i686 +codwaw +col +cs +cs2 +cscz +csgo +css,ncurses-libs.i686 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl.i686 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,ncurses-libs.i686 +hcu +hl2dm +hldm +hldms +hw,zlib-devel +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,java-21-openjdk +mcb,libnsl +mh +mohaa,compat-libstdc++-33.i686 +mta,ncurses-compat-libs,libxml2 +nd +nec +nmrih,ncurses-libs.i686 +ns +ns2,speex,tbb +ns2c,speex.i686,tbb.i686 +ohd +onset,mariadb-connector-c +opfor +pc +pc2 +pmc,java-21-openjdk +ps,GConf2 +pvkii +pvr,libcxx +pw +pz,java-21-openjdk rng-tools +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,zlib-devel +rw,java-21-openjdk +samp +sb +sbots +scpsl +scpslsm +sdtd,telnet,expect,libxml2 +sf +sfc,ncurses-libs.i686 +sm,telnet,expect +sof2 +sol +squad +st,libxml2 +stn +sven +terraria +tf +tf2,libcurl.i686 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,glibc-devel,libatomic,pulseaudio-libs-devel +vints,aspnetcore-runtime-7.0 +vpmc,java-21-openjdk +vs +wet +wf +wmc,java-21-openjdk +wurm,xorg-x11-server-Xvfb +xnt +zmr,ncurses-libs.i686 +zps,ncurses-libs.i686 diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv new file mode 100644 index 000000000..7dae6338e --- /dev/null +++ b/lgsm/data/rhel-9.csv @@ -0,0 +1,139 @@ +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python3,tar,tmux,unzip,util-linux,wget,xz +steamcmd,glibc.i686,libstdc++.i686 +ac +ahl +ahl2 +ark +arma3 +armar,libcurl,openssl-libs +ats +av +bb +bb2,libcurl.i686 +bd +bf1942,ncurses-libs.i686 +bfv,compat-libstdc++-33.i686,glibc.i686 +bmdm,ncurses-libs.i686 +bo +bs +bt,libicu,dos2unix,libxml2 +btl +cc +ck,xorg-x11-server-Xvfb +cmw +cod,compat-libstdc++-33.i686 +cod2,compat-libstdc++-33.i686 +cod4 +coduo,compat-libstdc++-33.i686 +codwaw +col +cs +cs2 +cscz +csgo +css,ncurses-libs.i686 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl.i686 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,ncurses-libs.i686 +hcu +hl2dm +hldm +hldms +hw,zlib-devel +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,java-21-openjdk +mcb,libnsl +mh +mohaa,compat-libstdc++-33.i686 +mta,ncurses-compat-libs,libxml2 +nd +nec +nmrih,ncurses-libs.i686 +ns +ns2,speex,tbb +ns2c,speex.i686,tbb.i686 +ohd +onset,mariadb-connector-c +opfor +pc +pc2 +pmc,java-21-openjdk +ps,GConf2 +pvkii +pvr,libcxx +pw +pz,java-21-openjdk rng-tools +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,zlib-devel +rw,java-21-openjdk +samp +sb +sbots +scpsl +scpslsm +sdtd,telnet,expect,libxml2 +sf +sfc,ncurses-libs.i686 +sm,telnet,expect +sof2 +sol +squad +st,libxml2 +stn +sven +terraria +tf +tf2,libcurl.i686 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,glibc-devel,libatomic,pulseaudio-libs-devel +vints,aspnetcore-runtime-7.0 +vpmc,java-21-openjdk +vs +wet +wf +wmc,java-21-openjdk +wurm,xorg-x11-server-Xvfb +xnt +zmr,ncurses-libs.i686 +zps,ncurses-libs.i686 diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv new file mode 100644 index 000000000..f8bb1d492 --- /dev/null +++ b/lgsm/data/rocky-8.csv @@ -0,0 +1,139 @@ +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python36,tar,tmux,unzip,util-linux,wget,xz +steamcmd,glibc.i686,libstdc++.i686 +ac +ahl +ahl2 +ark +arma3 +armar,libcurl,openssl-libs +ats +av +bb +bb2,libcurl.i686 +bd +bf1942,ncurses-libs.i686 +bfv,compat-libstdc++-33.i686,glibc.i686 +bmdm,ncurses-libs.i686 +bo +bs +bt,libicu,dos2unix,libxml2 +btl +cc +ck,xorg-x11-server-Xvfb +cmw +cod,compat-libstdc++-33.i686 +cod2,compat-libstdc++-33.i686 +cod4 +coduo,compat-libstdc++-33.i686 +codwaw +col +cs +cs2 +cscz +csgo +css,ncurses-libs.i686 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl.i686 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,ncurses-libs.i686 +hcu +hl2dm +hldm +hldms +hw,zlib-devel +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,java-21-openjdk +mcb,libnsl +mh +mohaa,compat-libstdc++-33.i686 +mta,ncurses-compat-libs,libxml2 +nd +nec +nmrih,ncurses-libs.i686 +ns +ns2,speex,tbb +ns2c,speex.i686,tbb.i686 +ohd +onset,mariadb-connector-c +opfor +pc +pc2 +pmc,java-21-openjdk +ps,GConf2 +pvkii +pvr,libcxx +pw +pz,java-21-openjdk rng-tools +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,zlib-devel +rw,java-21-openjdk +samp +sb +sbots +scpsl +scpslsm +sdtd,telnet,expect,libxml2 +sf +sfc,ncurses-libs.i686 +sm,telnet,expect +sof2 +sol +squad +st,libxml2 +stn +sven +terraria +tf +tf2,libcurl.i686 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,glibc-devel,libatomic,pulseaudio-libs-devel +vints,aspnetcore-runtime-7.0 +vpmc,java-21-openjdk +vs +wet +wf +wmc,java-21-openjdk +wurm,xorg-x11-server-Xvfb +xnt +zmr,ncurses-libs.i686 +zps,ncurses-libs.i686 diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv new file mode 100644 index 000000000..7dae6338e --- /dev/null +++ b/lgsm/data/rocky-9.csv @@ -0,0 +1,139 @@ +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python3,tar,tmux,unzip,util-linux,wget,xz +steamcmd,glibc.i686,libstdc++.i686 +ac +ahl +ahl2 +ark +arma3 +armar,libcurl,openssl-libs +ats +av +bb +bb2,libcurl.i686 +bd +bf1942,ncurses-libs.i686 +bfv,compat-libstdc++-33.i686,glibc.i686 +bmdm,ncurses-libs.i686 +bo +bs +bt,libicu,dos2unix,libxml2 +btl +cc +ck,xorg-x11-server-Xvfb +cmw +cod,compat-libstdc++-33.i686 +cod2,compat-libstdc++-33.i686 +cod4 +coduo,compat-libstdc++-33.i686 +codwaw +col +cs +cs2 +cscz +csgo +css,ncurses-libs.i686 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl.i686 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,ncurses-libs.i686 +hcu +hl2dm +hldm +hldms +hw,zlib-devel +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,java-21-openjdk +mcb,libnsl +mh +mohaa,compat-libstdc++-33.i686 +mta,ncurses-compat-libs,libxml2 +nd +nec +nmrih,ncurses-libs.i686 +ns +ns2,speex,tbb +ns2c,speex.i686,tbb.i686 +ohd +onset,mariadb-connector-c +opfor +pc +pc2 +pmc,java-21-openjdk +ps,GConf2 +pvkii +pvr,libcxx +pw +pz,java-21-openjdk rng-tools +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,zlib-devel +rw,java-21-openjdk +samp +sb +sbots +scpsl +scpslsm +sdtd,telnet,expect,libxml2 +sf +sfc,ncurses-libs.i686 +sm,telnet,expect +sof2 +sol +squad +st,libxml2 +stn +sven +terraria +tf +tf2,libcurl.i686 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,glibc-devel,libatomic,pulseaudio-libs-devel +vints,aspnetcore-runtime-7.0 +vpmc,java-21-openjdk +vs +wet +wf +wmc,java-21-openjdk +wurm,xorg-x11-server-Xvfb +xnt +zmr,ncurses-libs.i686 +zps,ncurses-libs.i686 diff --git a/lgsm/data/rust_header.jpg b/lgsm/data/rust_header.jpg new file mode 100644 index 000000000..e4006b070 Binary files /dev/null and b/lgsm/data/rust_header.jpg differ diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index ac703ffe9..0f350b55d 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -1,108 +1,138 @@ -ac,acserver,Assetto Corsa -ahl,ahlserver,Action half-life -ahl2,ahl2server,Action: Source -ark,arkserver,ARK: Survival Evolved -arma3,arma3server,ARMA 3 -av,avserver,Avorion -bb,bbserver,BrainBread -bb2,bb2server,BrainBread 2 -bd,bdserver,Base Defense -bf1942,bf1942server,Battlefield 1942 -bmdm,bmdmserver,Black Mesa: Deathmatch -bo,boserver,Ballistic Overkill -bs,bsserver,Blade Symphony -bt,btserver,Barotrauma -bt1944,bt1944server,Battalion 1944 -cc,ccserver,Codename CURE -cmw,cmwserver,Chivalry: Medieval Warfare -cod,codserver,Call of Duty -cod2,cod2server,Call of Duty 2 -cod4,cod4server,Call of Duty 4 -coduo,coduoserver,Call of Duty: United Offensive -codwaw,codwawserver,Call of Duty: World at War -cs,csserver,Counter-Strike 1.6 -cscz,csczserver,Counter-Strike: Condition Zero -csgo,csgoserver,Counter-Strike: Global Offensive -css,cssserver,Counter-Strike: Source -dab,dabserver,Double Action: Boogaloo -dmc,dmcserver,Deathmatch Classic -dod,dodserver,Day of Defeat -dods,dodsserver,Day of Defeat: Source -doi,doiserver,Day of Infamy -dst,dstserver,Don't Starve Together -dys,dysserver,Dystopia -eco,ecoserver,Eco -em,emserver,Empires Mod -etl,etlserver,ET: Legacy -fctr,fctrserver,Factorio -fof,fofserver,Fistful of Frags -ges,gesserver,GoldenEye: Source -gmod,gmodserver,Garrys Mod -hl2dm,hl2dmserver,Half-Life 2: Deathmatch -hldm,hldmserver,Half-Life: Deathmatch -hldms,hldmsserver,Half-Life Deathmatch: Source -hw,hwserver,Hurtworld -ins,insserver,Insurgency -inss,inssserver,Insurgency: Sandstorm -ios,iosserver,IOSoccer -jc2,jc2server,Just Cause 2 -jc3,jc3server,Just Cause 3 -kf,kfserver,Killing Floor -kf2,kf2server,Killing Floor 2 -l4d,l4dserver,Left 4 Dead -l4d2,l4d2server,Left 4 Dead 2 -mc,mcserver,Minecraft -mcb,mcbserver,Minecraft Bedrock -mh,mhserver,MORDHAU -mohaa,mohaaserver,Medal of Honor: Allied Assault -mta,mtaserver,Multi Theft Auto -mumble,mumbleserver,Mumble -nd,ndserver,Nuclear Dawn -nmrih,nmrihserver,No More Room in Hell -ns,nsserver,Natural Selection -ns2,ns2server,Natural Selection 2 -ns2c,ns2cserver,NS2: Combat -onset,onsetserver,Onset -opfor,opforserver,Opposing Force -pc,pcserver,Project Cars -pstbs,pstbsserver,Post Scriptum: The Bloody Seventh -pvkii,pvkiiserver,Pirates Vikings & Knights II -pz,pzserver,Project Zomboid -q2,q2server,Quake 2 -q3,q3server,Quake 3: Arena -ql,qlserver,Quake Live -qw,qwserver,Quake World -ricochet,ricochetserver,Ricochet -ro,roserver,Red Orchestra: Ostfront 41-45 -rtcw,rtcwserver,Return to Castle Wolfenstein -rust,rustserver,Rust -rw,rwserver,Rising World -samp,sampserver,San Andreas Multiplayer -sb,sbserver,Starbound -sbots,sbotsserver,StickyBots -sdtd,sdtdserver,7 Days to Die -sfc,sfcserver,SourceForts Classic -sof2,sof2server,Soldier Of Fortune 2: Gold Edition -sol,solserver,Soldat -squad,squadserver,Squad -ss3,ss3server,Serious Sam 3: BFE -st,stserver,Stationeers -sven,svenserver,Sven Co-op -terraria,terrariaserver,Terraria -tf2,tf2server,Team Fortress 2 -tfc,tfcserver,Team Fortress Classic -ts,tsserver,The Specialists -ts3,ts3server,Teamspeak 3 -tu,tuserver,Tower Unite -tw,twserver,Teeworlds -unt,untserver,Unturned -ut,utserver,Unreal Tournament -ut2k4,ut2k4server,Unreal Tournament 2004 -ut3,ut3server,Unreal Tournament 3 -ut99,ut99server,Unreal Tournament 99 -vs,vsserver,Vampire Slayer -wet,wetserver,Wolfenstein: Enemy Territory -wf,wfserver,Warfork -wurm,wurmserver,Wurm Unlimited -zmr,zmrserver,Zombie Master: Reborn -zps,zpsserver,Zombie Panic! Source \ No newline at end of file +shortname,gameservername,gamename,os +ac,acserver,Assetto Corsa,ubuntu-24.04 +ahl,ahlserver,Action Half-Life,ubuntu-24.04 +ahl2,ahl2server,Action: Source,ubuntu-24.04 +ark,arkserver,ARK: Survival Evolved,ubuntu-24.04 +arma3,arma3server,ARMA 3,ubuntu-24.04 +armar,armarserver,Arma Reforger,ubuntu-24.04 +ats,atsserver,American Truck Simulator,ubuntu-24.04 +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 +bmdm,bmdmserver,Black Mesa: Deathmatch,ubuntu-24.04 +bo,boserver,Ballistic Overkill,ubuntu-24.04 +bs,bsserver,Blade Symphony,ubuntu-24.04 +bt,btserver,Barotrauma,ubuntu-24.04 +btl,btlserver,BATTALION: Legacy,ubuntu-20.04 +cc,ccserver,Codename CURE,ubuntu-24.04 +ck,ckserver,Core Keeper,ubuntu-24.04 +cmw,cmwserver,Chivalry: Medieval Warfare,ubuntu-24.04 +cod,codserver,Call of Duty,ubuntu-24.04 +cod2,cod2server,Call of Duty 2,ubuntu-24.04 +cod4,cod4server,Call of Duty 4,ubuntu-24.04 +coduo,coduoserver,Call of Duty: United Offensive,ubuntu-24.04 +codwaw,codwawserver,Call of Duty: World at War,ubuntu-24.04 +col,colserver,Colony Survival,ubuntu-24.04 +cs,csserver,Counter-Strike 1.6,ubuntu-24.04 +cs2,cs2server,Counter-Strike 2,ubuntu-24.04 +cscz,csczserver,Counter-Strike: Condition Zero,ubuntu-24.04 +csgo,csgoserver,Counter-Strike: Global Offensive,ubuntu-24.04 +css,cssserver,Counter-Strike: Source,ubuntu-24.04 +ct,ctserver,Craftopia,ubuntu-24.04 +dab,dabserver,Double Action: Boogaloo,ubuntu-24.04 +dayz,dayzserver,DayZ,ubuntu-24.04 +dmc,dmcserver,Deathmatch Classic,ubuntu-24.04 +dod,dodserver,Day of Defeat,ubuntu-24.04 +dodr,dodrserver,Day of Dragons,ubuntu-24.04 +dods,dodsserver,Day of Defeat: Source,ubuntu-24.04 +doi,doiserver,Day of Infamy,ubuntu-24.04 +dst,dstserver,Don't Starve Together,ubuntu-24.04 +dys,dysserver,Dystopia,ubuntu-24.04 +eco,ecoserver,Eco,ubuntu-24.04 +em,emserver,Empires Mod,ubuntu-24.04 +etl,etlserver,ET: Legacy,ubuntu-24.04 +ets2,ets2server,Euro Truck Simulator 2,ubuntu-24.04 +fctr,fctrserver,Factorio,ubuntu-24.04 +fof,fofserver,Fistful of Frags,ubuntu-24.04 +gmod,gmodserver,Garrys Mod,ubuntu-24.04 +hcu,hcuserver,HYPERCHARGE: Unboxed,ubuntu-24.04 +hl2dm,hl2dmserver,Half-Life 2: Deathmatch,ubuntu-24.04 +hldm,hldmserver,Half-Life: Deathmatch,ubuntu-24.04 +hldms,hldmsserver,Half-Life Deathmatch: Source,ubuntu-24.04 +hw,hwserver,Hurtworld,ubuntu-24.04 +hz,hzserver,Humanitz,ubuntu-24.04 +ins,insserver,Insurgency,ubuntu-24.04 +inss,inssserver,Insurgency: Sandstorm,ubuntu-24.04 +ios,iosserver,IOSoccer,ubuntu-24.04 +jc2,jc2server,Just Cause 2,ubuntu-24.04 +jc3,jc3server,Just Cause 3,ubuntu-24.04 +jk2,jk2server,Jedi Knight II: Jedi Outcast,ubuntu-24.04 +kf,kfserver,Killing Floor,ubuntu-24.04 +kf2,kf2server,Killing Floor 2,ubuntu-24.04 +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 +mh,mhserver,MORDHAU,ubuntu-24.04 +mohaa,mohaaserver,Medal of Honor: Allied Assault,ubuntu-24.04 +mta,mtaserver,Multi Theft Auto,ubuntu-24.04 +nd,ndserver,Nuclear Dawn,ubuntu-24.04 +nec,necserver,Necesse,ubuntu-24.04 +nmrih,nmrihserver,No More Room in Hell,ubuntu-24.04 +ns,nsserver,Natural Selection,ubuntu-24.04 +ns2,ns2server,Natural Selection 2,ubuntu-24.04 +ns2c,ns2cserver,NS2: Combat,ubuntu-24.04 +ohd,ohdserver,Operation: Harsh Doorstop,ubuntu-24.04 +onset,onsetserver,Onset,ubuntu-20.04 +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 +pz,pzserver,Project Zomboid,ubuntu-24.04 +q2,q2server,Quake 2,ubuntu-24.04 +q3,q3server,Quake 3: Arena,ubuntu-24.04 +q4,q4server,Quake 4,ubuntu-24.04 +ql,qlserver,Quake Live,ubuntu-24.04 +qw,qwserver,Quake World,ubuntu-24.04 +ricochet,ricochetserver,Ricochet,ubuntu-24.04 +ro,roserver,Red Orchestra: Ostfront 41-45,ubuntu-24.04 +rtcw,rtcwserver,Return to Castle Wolfenstein,ubuntu-24.04 +rust,rustserver,Rust,ubuntu-24.04 +rw,rwserver,Rising World,ubuntu-24.04 +samp,sampserver,San Andreas Multiplayer,ubuntu-24.04 +sb,sbserver,Starbound,ubuntu-24.04 +sbots,sbotsserver,StickyBots,ubuntu-24.04 +scpsl,scpslserver,SCP: Secret Laboratory,ubuntu-24.04 +scpslsm,scpslsmserver,SCP: Secret Laboratory ServerMod,ubuntu-24.04 +sdtd,sdtdserver,7 Days to Die,ubuntu-24.04 +sf,sfserver,Satisfactory,ubuntu-24.04 +sfc,sfcserver,SourceForts Classic,ubuntu-24.04 +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 +st,stserver,Stationeers,ubuntu-24.04 +stn,stnserver,Survive the Nights,ubuntu-24.04 +sven,svenserver,Sven Co-op,ubuntu-20.04 +terraria,terrariaserver,Terraria,ubuntu-24.04 +tf,tfserver,The Front,ubuntu-24.04 +tf2,tf2server,Team Fortress 2,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 +ts3,ts3server,Teamspeak 3,ubuntu-24.04 +tu,tuserver,Tower Unite,ubuntu-24.04 +tw,twserver,Teeworlds,ubuntu-24.04 +unt,untserver,Unturned,ubuntu-24.04 +ut,utserver,Unreal Tournament,ubuntu-24.04 +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 +vpmc,vpmcserver,Velocity Proxy MC,ubuntu-24.04 +vs,vsserver,Vampire Slayer,ubuntu-24.04 +wet,wetserver,Wolfenstein: Enemy Territory,ubuntu-24.04 +wf,wfserver,Warfork,ubuntu-24.04 +wmc,wmcserver,WaterfallMC,ubuntu-24.04 +wurm,wurmserver,Wurm Unlimited,ubuntu-24.04 +xnt,xntserver,Xonotic,ubuntu-24.04 +zmr,zmrserver,Zombie Master: Reborn,ubuntu-24.04 +zps,zpsserver,Zombie Panic! Source,ubuntu-24.04 diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv new file mode 100644 index 000000000..51f769c1a --- /dev/null +++ b/lgsm/data/ubuntu-16.04.csv @@ -0,0 +1,139 @@ +all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,pigz,python3,tar,tmux,unzip,util-linux,uuid-runtime,wget,xz-utils +steamcmd,lib32gcc1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd +ac +ahl +ahl2 +ark +arma3 +armar,libcurl4 +ats +av +bb +pw +bb2,libcurl4-gnutls-dev:i386 +bd +bf1942,libncurses5:i386,libtinfo5:i386 +bfv,libncurses5:i386,libstdc++5:i386 +bmdm,libncurses5:i386 +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,libtinfo5:i386 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl4-gnutls-dev:i386 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,libtinfo5:i386 +hcu +hl2dm +hldm +hldms +hw,lib32z1 +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,openjdk-8-jre +mcb +mh +mohaa,libstdc++5:i386 +mta +nd +nec +nmrih,libtinfo5:i386 +ns +ns2,speex,libtbb2 +ns2c,speex:i386,libtbb2 +ohd +onset,libmariadb-dev +opfor +pc +pc2 +pmc,openjdk-8-jre +ps,libgconf-2-4 +pvkii +pvr,libc++1 +pz,openjdk-8-jre,rng-tools +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,lib32z1 +rw,openjdk-8-jre +samp +sb +sbots +scpsl,mono-complete +scpslsm,mono-complete +sdtd,telnet,expect,libxml2-utils +sf +sfc,libtinfo5:i386 +sm,telnet,expect +sof2 +sol +squad +st,libxml2-utils +stn +sven,libssl1.1:i386,zlib1g:i386 +terraria +tf +tf2,libcurl4-gnutls-dev:i386 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,libc6-dev,libatomic1,libpulse-dev +vints,aspnetcore-runtime-7.0 +vpmc,openjdk-8-jre +vs +wet +wf +wmc,openjdk-8-jre +wurm,xvfb +xnt +zmr,libtinfo5:i386 +zps,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv new file mode 100644 index 000000000..7ca2d86c6 --- /dev/null +++ b/lgsm/data/ubuntu-18.04.csv @@ -0,0 +1,139 @@ +all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,pigz,python3,tar,tmux,unzip,util-linux,uuid-runtime,wget,xz-utils +steamcmd,lib32gcc1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd +ac +ahl +ahl2 +ark +arma3 +armar,libcurl4 +ats +av +pw +bb +bb2,libcurl4-gnutls-dev:i386 +bd +bf1942,libncurses5:i386,libtinfo5:i386 +bfv,libncurses5:i386,libstdc++5:i386 +bmdm,libncurses5:i386 +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,libtinfo5:i386 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl4-gnutls-dev:i386 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,libtinfo5:i386 +hcu +hl2dm +hldm +hldms +hw,lib32z1 +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,openjdk-11-jre +mcb +mh +mohaa,libstdc++5:i386 +mta,libncursesw5,libxml2-utils +nd +nec +nmrih,libtinfo5:i386 +ns +ns2,speex,libtbb2 +ns2c,speex:i386,libtbb2 +ohd +onset,libmariadb-dev +opfor +pc +pc2 +pmc,openjdk-11-jre +ps,libgconf-2-4 +pvkii +pvr,libc++1 +pz,openjdk-11-jre,rng-tools +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,lib32z1 +rw,openjdk-11-jre +samp +sb +sbots +scpsl,mono-complete +scpslsm,mono-complete +sdtd,telnet,expect,libxml2-utils +sf +sfc,libtinfo5:i386 +sm,telnet,expect +sof2 +sol +squad +st,libxml2-utils +stn +sven,libssl1.1:i386,zlib1g:i386 +terraria +tf +tf2,libcurl4-gnutls-dev:i386 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,libc6-dev,libatomic1,libpulse-dev +vints,aspnetcore-runtime-7.0 +vpmc,openjdk-11-jre +vs +wet +wf +wmc,openjdk-11-jre +wurm,xvfb +xnt +zmr,libtinfo5:i386 +zps,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv new file mode 100644 index 000000000..f16d8b3be --- /dev/null +++ b/lgsm/data/ubuntu-20.04.csv @@ -0,0 +1,139 @@ +all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,pigz,python3,tar,tmux,unzip,util-linux,uuid-runtime,wget,xz-utils +steamcmd,lib32gcc1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd +ac +ahl +ahl2 +ark +arma3 +armar,libcurl4 +ats +av +bb +bb2,libcurl4-gnutls-dev:i386 +bd +bf1942,libncurses5:i386,libtinfo5:i386 +bfv,libncurses5:i386,libstdc++5:i386 +bmdm,libncurses5:i386 +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,libtinfo5:i386 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl4-gnutls-dev:i386 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,libtinfo5:i386 +hcu +hl2dm +hldm +hldms +hw,lib32z1 +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,openjdk-21-jre +mcb +mh +mohaa,libstdc++5:i386 +mta,libncursesw5,libxml2-utils +nd +nec +nmrih,libtinfo5:i386 +ns +ns2,speex,libtbb2 +ns2c,speex:i386,libtbb2 +ohd +onset,libmariadb-dev +opfor +pc +pc2 +pmc,openjdk-21-jre +ps,libgconf-2-4 +pvkii +pvr,libc++1 +pw +pz,openjdk-21-jre,rng-tools +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,lib32z1 +rw,openjdk-21-jre +samp +sb +sbots +scpsl,mono-complete +scpslsm,mono-complete +sdtd,telnet,expect,libxml2-utils +sf +sfc,libtinfo5:i386 +sm,telnet,expect +sof2 +sol +squad +st,libxml2-utils +stn +sven,libssl1.1:i386,zlib1g:i386 +terraria +tf +tf2,libcurl4-gnutls-dev:i386 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,libc6-dev,libatomic1,libpulse-dev +vints,aspnetcore-runtime-7.0 +vpmc,openjdk-11-jre +vs +wet +wf +wmc,openjdk-21-jre +wurm,xvfb +xnt +zmr,libtinfo5:i386 +zps,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv new file mode 100644 index 000000000..e84f4dddd --- /dev/null +++ b/lgsm/data/ubuntu-22.04.csv @@ -0,0 +1,139 @@ +all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat,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,libcurl4 +ats +av +bb +bb2,libcurl4-gnutls-dev:i386 +bd +bf1942,libncurses5:i386,libtinfo5:i386 +bfv,libncurses5:i386,libstdc++5:i386 +bmdm,libncurses5:i386 +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,libtinfo5:i386 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl4-gnutls-dev:i386 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,libtinfo5:i386 +hcu +hl2dm +hldm +hldms +hw,lib32z1 +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,openjdk-21-jre +mcb +mh +mohaa,libstdc++5:i386 +mta,libncursesw5,libxml2-utils +nd +nec +nmrih,libtinfo5:i386 +ns +ns2,speex,libtbb2 +ns2c,speex:i386,libtbb2 +ohd +onset,libmariadb-dev +opfor +pc +pc2 +pmc,openjdk-21-jre +ps,libgconf-2-4 +pvkii +pvr,libc++1 +pw +pz,openjdk-21-jre,rng-tools5 +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,lib32z1 +rw,openjdk-21-jre +samp +sb +sbots +scpsl,mono-complete +scpslsm,mono-complete +sdtd,telnet,expect,libxml2-utils +sf +sfc,libtinfo5:i386 +sm,telnet,expect +sof2 +sol +squad +st,libxml2-utils +stn +sven,libssl1.1:i386,zlib1g:i386 +terraria +tf +tf2,libcurl4-gnutls-dev:i386 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,libc6-dev,libatomic1,libpulse-dev +vints,aspnetcore-runtime-7.0 +vpmc,openjdk-21-jre +vs +wet +wf +wmc,openjdk-21-jre +wurm,xvfb +xnt +zmr,libtinfo5:i386 +zps,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-23.04.csv b/lgsm/data/ubuntu-23.04.csv new file mode 100644 index 000000000..c0135abd7 --- /dev/null +++ b/lgsm/data/ubuntu-23.04.csv @@ -0,0 +1,139 @@ +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,libcurl4 +ats +av +bb +bb2,libcurl4-gnutls-dev:i386 +bd +bf1942,libncurses5:i386,libtinfo5:i386 +bfv,libncurses5:i386,libstdc++5:i386 +bmdm,libncurses5:i386 +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,libtinfo5:i386 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl4-gnutls-dev:i386 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,libtinfo5:i386 +hcu +hl2dm +hldm +hldms +hw,lib32z1 +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,openjdk-21-jre +mcb +mh +mohaa,libstdc++5:i386 +mta,libncursesw5,libxml2-utils +nd +nec +nmrih,libtinfo5:i386 +ns +ns2,speex,libtbb2 +ns2c,speex:i386,libtbb2 +ohd +onset,libmariadb-dev +opfor +pc +pc2 +pmc,openjdk-21-jre +ps,libgconf-2-4 +pvkii +pvr,libc++1 +pw +pz,openjdk-21-jre,rng-tools5 +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,lib32z1 +rw,openjdk-21-jre +samp +sb +sbots +scpsl,mono-complete +scpslsm,mono-complete +sdtd,telnet,expect,libxml2-utils +sf +sfc,libtinfo5:i386 +sm,telnet,expect +sof2 +sol +squad +st,libxml2-utils +stn +sven,libssl1.1:i386,zlib1g:i386 +terraria +tf +tf2,libcurl4-gnutls-dev:i386 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,libc6-dev,libatomic1,libpulse-dev +vints,aspnetcore-runtime-7.0 +vpmc,openjdk-21-jre +vs +wet +wf +wmc,openjdk-21-jre +wurm,xvfb +xnt +zmr,libtinfo5:i386 +zps,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-23.10.csv b/lgsm/data/ubuntu-23.10.csv new file mode 100644 index 000000000..c0135abd7 --- /dev/null +++ b/lgsm/data/ubuntu-23.10.csv @@ -0,0 +1,139 @@ +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,libcurl4 +ats +av +bb +bb2,libcurl4-gnutls-dev:i386 +bd +bf1942,libncurses5:i386,libtinfo5:i386 +bfv,libncurses5:i386,libstdc++5:i386 +bmdm,libncurses5:i386 +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,libtinfo5:i386 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl4-gnutls-dev:i386 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,libtinfo5:i386 +hcu +hl2dm +hldm +hldms +hw,lib32z1 +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,openjdk-21-jre +mcb +mh +mohaa,libstdc++5:i386 +mta,libncursesw5,libxml2-utils +nd +nec +nmrih,libtinfo5:i386 +ns +ns2,speex,libtbb2 +ns2c,speex:i386,libtbb2 +ohd +onset,libmariadb-dev +opfor +pc +pc2 +pmc,openjdk-21-jre +ps,libgconf-2-4 +pvkii +pvr,libc++1 +pw +pz,openjdk-21-jre,rng-tools5 +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,lib32z1 +rw,openjdk-21-jre +samp +sb +sbots +scpsl,mono-complete +scpslsm,mono-complete +sdtd,telnet,expect,libxml2-utils +sf +sfc,libtinfo5:i386 +sm,telnet,expect +sof2 +sol +squad +st,libxml2-utils +stn +sven,libssl1.1:i386,zlib1g:i386 +terraria +tf +tf2,libcurl4-gnutls-dev:i386 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,libc6-dev,libatomic1,libpulse-dev +vints,aspnetcore-runtime-7.0 +vpmc,openjdk-21-jre +vs +wet +wf +wmc,openjdk-21-jre +wurm,xvfb +xnt +zmr,libtinfo5:i386 +zps,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv new file mode 100644 index 000000000..c0135abd7 --- /dev/null +++ b/lgsm/data/ubuntu-24.04.csv @@ -0,0 +1,139 @@ +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,libcurl4 +ats +av +bb +bb2,libcurl4-gnutls-dev:i386 +bd +bf1942,libncurses5:i386,libtinfo5:i386 +bfv,libncurses5:i386,libstdc++5:i386 +bmdm,libncurses5:i386 +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,libtinfo5:i386 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl4-gnutls-dev:i386 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,libtinfo5:i386 +hcu +hl2dm +hldm +hldms +hw,lib32z1 +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,openjdk-21-jre +mcb +mh +mohaa,libstdc++5:i386 +mta,libncursesw5,libxml2-utils +nd +nec +nmrih,libtinfo5:i386 +ns +ns2,speex,libtbb2 +ns2c,speex:i386,libtbb2 +ohd +onset,libmariadb-dev +opfor +pc +pc2 +pmc,openjdk-21-jre +ps,libgconf-2-4 +pvkii +pvr,libc++1 +pw +pz,openjdk-21-jre,rng-tools5 +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,lib32z1 +rw,openjdk-21-jre +samp +sb +sbots +scpsl,mono-complete +scpslsm,mono-complete +sdtd,telnet,expect,libxml2-utils +sf +sfc,libtinfo5:i386 +sm,telnet,expect +sof2 +sol +squad +st,libxml2-utils +stn +sven,libssl1.1:i386,zlib1g:i386 +terraria +tf +tf2,libcurl4-gnutls-dev:i386 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,libc6-dev,libatomic1,libpulse-dev +vints,aspnetcore-runtime-7.0 +vpmc,openjdk-21-jre +vs +wet +wf +wmc,openjdk-21-jre +wurm,xvfb +xnt +zmr,libtinfo5:i386 +zps,libtinfo5:i386 diff --git a/lgsm/functions/README.md b/lgsm/functions/README.md deleted file mode 100644 index 01de5f0c7..000000000 --- a/lgsm/functions/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Linux Game Server Manager - Functions - -These functions are universal functions that work in all scripts. - -## Function Names -Functions have been named to give an idea of what the function does. - -* core: Essential functions that will always run first. -* command: Primary command function. -* check: Runs checks that will either halt on or fix an issue. -* dev: development functions. -* fix: Applies a game server specific fix. -* info: retrieves information from a source such as config file or the OS. -* install: Functions related to the installer. -* monitor: Functions related to monitor. -* update: Functions that update the game server. diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh deleted file mode 100644 index 5f8fe156e..000000000 --- a/lgsm/functions/alert.sh +++ /dev/null @@ -1,202 +0,0 @@ -#!/bin/bash -# LinuxGSM alert.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Overall function for managing alerts. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_alert_log(){ - info_distro.sh - info_config.sh - info_messages.sh - if [ -f "${alertlog}" ]; then - rm -f "${alertlog:?}" - fi - - { - fn_info_message_head - fn_info_message_distro - fn_info_message_server_resource - fn_info_message_gameserver_resource - fn_info_message_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 -} - -fn_alert_test(){ - fn_script_log_info "Sending test alert" - alertsubject="Alert - ${selfname} - Test" - alertemoji="🚧" - alertsound="1" - alerturl="not enabled" - alertbody="Testing LinuxGSM Alert. No action to be taken." -} - -fn_alert_restart(){ - fn_script_log_info "Sending alert: Restarted: ${executable} not running" - alertsubject="Alert - ${selfname} - Restarted" - alertemoji="🚨" - alertsound="2" - alerturl="not enabled" - alertbody="${selfname} ${executable} not running" -} - -fn_alert_restart_query(){ - fn_script_log_info "Sending alert: Restarted: ${selfname}" - alertsubject="Alert - ${selfname} - Restarted" - alertemoji="🚨" - alertsound="2" - alerturl="not enabled" - alertbody="Unable to query: ${selfname}" -} - -fn_alert_update(){ - fn_script_log_info "Sending alert: Updated" - alertsubject="Alert - ${selfname} - Updated" - alertemoji="🎮" - alertsound="1" - alerturl="not enabled" - alertbody="${gamename} received update" -} - -fn_alert_permissions(){ - fn_script_log_info "Sending alert: Permissions error" - alertsubject="Alert - ${selfname}: Permissions error" - alertemoji="❗" - alertsound="2" - alerturl="not enabled" - alertbody="${selfname} has permissions issues" -} - -fn_alert_config(){ - fn_script_log_info "Sending alert: New _default.cfg" - alertsubject="Alert - ${selfname} - New _default.cfg" - alertemoji="🎮" - alertsound="1" - alerturl="not enabled" - alertbody="${selfname} has received a new _default.cfg. Check file for changes." -} - -if [ "${alert}" == "permissions" ]; then - fn_alert_permissions -elif [ "${alert}" == "restart" ]; then - fn_alert_restart -elif [ "${alert}" == "restartquery" ]; then - fn_alert_restart_query -elif [ "${alert}" == "test" ]; then - fn_alert_test -elif [ "${alert}" == "update" ]; then - fn_alert_update -elif [ "${alert}" == "config" ]; then - fn_alert_config -fi - -# Generate alert log. -fn_alert_log - -# Generates the more info link. -if [ "${postalert}" == "on" ]&&[ -n "${postalert}" ]; then - exitbypass=1 - command_postdetails.sh -elif [ "${postalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_warn_nl "More Info not enabled" - fn_script_log_warn "More Info alerts not enabled" -elif [ -z "${posttarget}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_error_nl "posttarget not set" - fn_script_error "posttarget not set" -elif [ -z "${postdays}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_error_nl "postdays not set" - fn_script_error "postdays not set" -fi - -if [ "${discordalert}" == "on" ]&&[ -n "${discordalert}" ]; then - alert_discord.sh -elif [ "${discordalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_warn_nl "Discord alerts not enabled" - fn_script_log_warn "Discord alerts not enabled" -elif [ -z "${discordtoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_error_nl "Discord token not set" - echo -e "* https://docs.linuxgsm.com/alerts/discord" - fn_script_error "Discord token not set" -fi - -if [ "${emailalert}" == "on" ]&&[ -n "${email}" ]; then - alert_email.sh -elif [ "${emailalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_warn_nl "Email alerts not enabled" - fn_script_log_warn "Email alerts not enabled" -elif [ -z "${email}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_error_nl "Email not set" - fn_script_log_error "Email not set" -fi - -if [ "${iftttalert}" == "on" ]&&[ -n "${iftttalert}" ]; then - alert_ifttt.sh -elif [ "${iftttalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_warn_nl "IFTTT alerts not enabled" - fn_script_log_warn "IFTTT alerts not enabled" -elif [ -z "${ifttttoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_error_nl "IFTTT token not set" - echo -e "* https://docs.linuxgsm.com/alerts/ifttt" - fn_script_error "IFTTT token not set" -fi - -if [ "${mailgunalert}" == "on" ]&&[ -n "${mailgunalert}" ]; then - alert_mailgun.sh -elif [ "${mailgunalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_warn_nl "Mailgun alerts not enabled" - fn_script_log_warn "Mailgun alerts not enabled" -elif [ -z "${mailguntoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_error_nl "Mailgun token not set" - echo -e "* https://docs.linuxgsm.com/alerts/mailgun" - fn_script_error "Mailgun token not set" -fi - -if [ "${pushbulletalert}" == "on" ]&&[ -n "${pushbullettoken}" ]; then - alert_pushbullet.sh -elif [ "${pushbulletalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_warn_nl "Pushbullet alerts not enabled" - fn_script_log_warn "Pushbullet alerts not enabled" -elif [ -z "${pushbullettoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_error_nl "Pushbullet token not set" - echo -e "* https://docs.linuxgsm.com/alerts/pushbullet" - fn_script_error "Pushbullet token not set" -fi - -if [ "${pushoveralert}" == "on" ]&&[ -n "${pushoveralert}" ]; then - alert_pushover.sh -elif [ "${pushoveralert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_warn_nl "Pushover alerts not enabled" - fn_script_log_warn "Pushover alerts not enabled" -elif [ -z "${pushovertoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_error_nl "Pushover token not set" - echo -e "* https://docs.linuxgsm.com/alerts/pushover" - fn_script_error "Pushover token not set" -fi - -if [ "${telegramalert}" == "on" ]&&[ -n "${telegramtoken}" ]; then - alert_telegram.sh -elif [ "${telegramalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_warn_nl "Telegram Messages not enabled" - fn_script_log_warn "Telegram Messages not enabled" -elif [ -z "${telegramtoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_error_nl "Telegram token not set." - echo -e "* https://docs.linuxgsm.com/alerts/telegram" - fn_script_error "Telegram token not set." -elif [ -z "${telegramchatid}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_error_nl "Telegram chat id not set." - echo -e "* https://docs.linuxgsm.com/alerts/telegram" - fn_script_error "Telegram chat id not set." -fi - -if [ "${slackalert}" == "on" ]&&[ -n "${slackalert}" ]; then - alert_slack.sh -elif [ "${slackalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_warn_nl "Slack alerts not enabled" - fn_script_log_warn "Slack alerts not enabled" -elif [ -z "${slacktoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then - fn_print_error_nl "Slack token not set" - echo -e "* https://docs.linuxgsm.com/alerts/slack" - fn_script_error "Slack token not set" -fi diff --git a/lgsm/functions/alert_discord.sh b/lgsm/functions/alert_discord.sh deleted file mode 100644 index 3ed12fe97..000000000 --- a/lgsm/functions/alert_discord.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -# LinuxGSM alert_discord.sh function -# Author: Daniel Gibbs -# Contributor: faflfama, diamondburned -# Website: https://linuxgsm.com -# Description: Sends Discord alert. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -if ! command -v jq > /dev/null; then - fn_print_fail_nl "Sending Discord alert: jq is missing." - fn_script_log_fatal "Sending Discord alert: jq is missing." -fi - -escaped_servername=$(echo -n "${servername}" | jq -sRr "@json") -escaped_alertbody=$(echo -n "${alertbody}" | jq -sRr "@json") - -json=$(cat < /dev/null; then - fn_print_fail_nl "Sending Slack alert: jq is missing." - fn_script_log_fatal "Sending Slack alert: jq is missing." -fi - -json=$(cat < -# Website: https://bytegaming.de -# Description: Sends Telegram Messenger alert. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -json=$(cat <${alertsubject} ${alertemoji}\n\nMessage\n${alertbody}\n\nGame\n${gamename}\n\nServer name\n${servername}\n\nHostname\n${HOSTNAME}\n\nServer IP\n${alertip}:${port}\n\nMore info\n${alerturl}", - "disable_web_page_preview": "yes", -EOF -) - -fn_print_dots "Sending Telegram alert" -telegramsend=$(curl -sSL -H "Content-Type: application/json" -X POST -d """${json}""" ${curlcustomstring} "https://api.telegram.org/bot${telegramtoken}/sendMessage" | grep "error_code") - -if [ "${telegramsend}" ]; then - fn_print_fail_nl "Sending Telegram alert: ${telegramsend}" - fn_script_log_fatal "Sending Telegram alert: ${telegramsend}" -else - fn_print_ok_nl "Sending Telegram alert" - fn_script_log_pass "Sent Telegram alert" -fi diff --git a/lgsm/functions/check.sh b/lgsm/functions/check.sh deleted file mode 100644 index 3e8fa90a2..000000000 --- a/lgsm/functions/check.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/bash -# LinuxGSM check.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Overall function for managing checks. -# Runs checks that will either halt on or fix an issue. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -# Every command that requires checks just references check.sh. -# check.sh selects which checks to run by using arrays. - -if [ "${commandname}" != "INSTALL" ]; then - check_root.sh -fi - -if [ "${commandname}" != "UPDATE-LGSM" ]; then - check_version.sh -fi - -check_tmuxception.sh - -if [ "$(whoami)" != "root" ]; then - if [ "${commandname}" != "MONITOR" ]; then - check_permissions.sh - fi -fi - -if [ "${commandname}" != "INSTALL" ]&&[ "${commandname}" != "UPDATE-LGSM" ]&&[ "${commandname}" != "DETAILS" ]&&[ "${commandname}" != "POST-DETAILS" ]; then - check_system_dir.sh -fi - -allowed_commands_array=( START DEBUG ) -for allowed_command in "${allowed_commands_array[@]}" -do - if [ "${allowed_command}" == "${commandname}" ]; then - check_executable.sh - fi -done - -if [ "$(whoami)" != "root" ]; then - allowed_commands_array=( DEBUG START INSTALL ) - for allowed_command in "${allowed_commands_array[@]}" - do - if [ "${allowed_command}" == "${commandname}" ]; then - check_glibc.sh - fi - done -fi - -allowed_commands_array=( BACKUP CONSOLE DEBUG DETAILS MAP-COMPRESSOR FASTDL MODS-INSTALL MODS-REMOVE MODS-UPDATE MONITOR POST-DETAILS RESTART START STOP TEST-ALERT CHANGE-PASSWORD UPDATE UPDATE-LGSM VALIDATE WIPW ) -for allowed_command in "${allowed_commands_array[@]}" -do - if [ "${allowed_command}" == "${commandname}" ]; then - check_logs.sh - fi -done - -allowed_commands_array=( DEBUG START STOP ) -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 ) -for allowed_command in "${allowed_commands_array[@]}" -do - if [ "${allowed_command}" == "${commandname}" ]; then - check_config.sh - fi -done - -allowed_commands_array=( DEBUG DETAILS POST_DETAILS MONITOR START STOP DEV-QUERY-RAW ) -for allowed_command in "${allowed_commands_array[@]}" -do - if [ "${allowed_command}" == "${commandname}" ]; then - if [ -z "${installflag}" ]; then - check_ip.sh - fi - fi -done - -allowed_commands_array=( DEBUG START VALIDATE ) -for allowed_command in "${allowed_commands_array[@]}" -do - if [ "${allowed_command}" == "${commandname}" ]; then - if [ "${appid}" ]; then - check_steamcmd.sh - fi - fi -done - -allowed_commands_array=( DETAILS MONITOR START STOP CHANGE-PASSWORD UPDATE VALIDATE ) -for allowed_command in "${allowed_commands_array[@]}" -do - if [ "${allowed_command}" == "${commandname}" ]; then - check_status.sh - fi -done - -allowed_commands_array=( DEBUG START INSTALL ) -for allowed_command in "${allowed_commands_array[@]}" -do - if [ "${allowed_command}" == "${commandname}" ]; then - check_system_requirements.sh - fi -done diff --git a/lgsm/functions/check_config.sh b/lgsm/functions/check_config.sh deleted file mode 100644 index c799904f2..000000000 --- a/lgsm/functions/check_config.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# LinuxGSM check_config.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Checks if the server config is missing and warns the user if needed. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -if [ ! -f "${servercfgfullpath}" ]; then - if [ "${shortname}" != "hw" ]&&[ "${shortname}" != "ut3" ]&&[ "${shortname}" != "kf2" ]; then - fn_print_dots "" - fn_print_warn_nl "Configuration file missing!" - echo -e "${servercfgfullpath}" - fn_script_log_warn "Configuration file missing!" - fn_script_log_warn "${servercfgfullpath}" - install_config.sh - fi -fi - -if [ "${shortname}" == "rust" ]; then - if [ -z "${rconpassword}" ]; then - fn_print_dots "" - fn_print_fail_nl "RCON password is not set!" - echo -e " * Not setting an RCON password causes issues with ${gamename}" - fn_script_log_fatal "RCON password is not set" - fn_script_log_fatal "Not setting an RCON password causes issues with ${gamename}" - core_exit.sh - elif [ "${rconpassword}" == "CHANGE_ME" ]; then - fn_print_dots "" - fn_print_warn_nl "Default RCON Password detected!" - echo -e " * Having ${rconpassword} as a password is not very safe." - fn_script_log_warn "Default RCON Password detected" - fi -fi diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh deleted file mode 100644 index 52f651e1b..000000000 --- a/lgsm/functions/check_deps.sh +++ /dev/null @@ -1,576 +0,0 @@ -#!/bin/bash -# LinuxGSM check_deps.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Checks if required dependencies are installed for LinuxGSM. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_install_mono_repo(){ - if [ "${monostatus}" != "0" ]; then - fn_print_dots "Adding Mono repository" - if [ "${autoinstall}" == "1" ]; then - sudo -n true > /dev/null 2>&1 - else - sudo -v > /dev/null 2>&1 - fi - if [ $? -eq 0 ]; then - fn_print_info_nl "Automatically adding Mono repository." - fn_script_log_info "Automatically adding Mono repository." - echo -en ".\r" - sleep 1 - echo -en "..\r" - sleep 1 - echo -en "...\r" - sleep 1 - echo -en " \r" - if [ "${distroid}" == "ubuntu" ]; then - if [ "${distroversion}" == "18.04" ]; then - cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-bionic main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt-get update" - eval "${cmd}" - elif [ "${distroversion}" == "16.04" ]; then - cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt-get install apt-transport-https;echo 'deb https://download.mono-project.com/repo/ubuntu stable-xenial main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt-get update" - eval "${cmd}" - elif [ "${distroversion}" == "14.04" ]; then - cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt-get install apt-transport-https;echo 'deb https://download.mono-project.com/repo/ubuntu stable-trusty main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt-get update" - eval "${cmd}" - else - fn_print_warn_nl "Installing Mono repository." - echo -e "Mono auto install not available for ${distroname}" - echo -e " Follow instructions on mono site to install the latest version of Mono." - echo -e " https://www.mono-project.com/download/stable/#download-lin" - monoautoinstall="1" - fi - elif [ "${distroid}" == "debian" ]; then - if [ "${distroversion}" == "10" ]; then - cmd="sudo apt-get install apt-transport-https dirmngr;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-buster main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt-get update" - eval "${cmd}" - elif [ "${distroversion}" == "9" ]; then - cmd="sudo apt-get install apt-transport-https dirmngr;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-stretch main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt-get update" - eval "${cmd}" - elif [ "${distroversion}" == "8" ]; then - cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt-get install apt-transport-https;echo 'deb https://download.mono-project.com/repo/debian stable-jessie main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt-get update" - eval "${cmd}" - else - echo -e "Mono auto install not available for ${distroname}" - echo -e " Follow instructions on mono site to install the latest version of Mono." - echo -e " https://www.mono-project.com/download/stable/#download-lin" - monoautoinstall="1" - fi - elif [ "${distroid}" == "centos" ]; then - if [ "${distroversion}" == "8" ]; then - cmd="rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo'" - eval "${cmd}" - elif [ "${distroversion}" == "7" ]; then - cmd="rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'" - eval "${cmd}" - else - echo -e "Mono auto install not available for ${distroname}" - echo -e " Follow instructions on mono site to install the latest version of Mono." - echo -e " https://www.mono-project.com/download/stable/#download-lin" - monoautoinstall="1" - fi - elif [ "${distroid}" == "fedora" ]; then - cmd="rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF'; su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'; dnf update" - eval "${cmd}" - else - echo -e "Mono auto install not available for ${distroname}" - echo -e " Follow instructions on mono site to install the latest version of Mono." - echo -e " https://www.mono-project.com/download/stable/#download-lin" - monoautoinstall="1" - fi - if [ "${monoautoinstall}" != "1" ]; then - if [ $? != 0 ]; then - fn_print_failure_nl "Unable to install Mono repository." - fn_script_log_fatal "Unable to installMono repository." - monoautoinstall=1 - else - fn_print_complete_nl "Installing Mono repository completed." - fn_script_log_pass "Installing Mono repository completed." - monoautoinstall=0 - fi - fi - else - fn_print_information_nl "Installing Mono repository." - echo -e "" - fn_print_warning_nl "$(whoami) does not have sudo access. Manually install Mono repository." - fn_script_log_warn "$(whoami) does not have sudo access. Manually install Mono repository." - echo -e "* Follow instructions on mono site to install the latest version of Mono." - echo -e " https://www.mono-project.com/download/stable/#download-lin" - fi - fi -} - -fn_install_universe_repo(){ - # Defensive coding - As this is an ubuntu only issue then check to make sure this fix is needed, and we are using ubuntu. - if [ "${jquniversemissing}" != "0" ]&&[ "${distroid}" == "ubuntu" ]; then - fn_print_warning_nl "Ubuntu 18.04.1 contains a bug which means the sources.list file does not populate with the Ubuntu universe repository." - fn_print_information_nl "Attempting to add universe repository." - if [ "${autoinstall}" == "1" ]; then - sudo -n true > /dev/null 2>&1 - else - sudo -v > /dev/null 2>&1 - fi - if [ $? -eq 0 ]; then - echo -en ".\r" - sleep 1 - echo -en "..\r" - sleep 1 - echo -en "...\r" - sleep 1 - echo -en " \r" - cmd="sudo apt-add-repository universe" - eval "${cmd}" - if [ $? -eq 0 ]; then - fn_print_complete_nl "Installing universe repository completed." - fn_script_log_pass "Installing universe repository completed." - else - fn_print_failure_nl "Unable to install universe repository." - fn_script_log_fatal "Unable to install universe repository." - fi - else - fn_print_warning_nl "$(whoami) does not have sudo access. Manually add Universe repository." - fn_script_log_warn "$(whoami) does not have sudo access. Manually add Universe repository." - echo -e "* Please run the following command as a user with sudo access, and re-run the installation" - echo -e "" - echo -e " sudo apt-add-repository universe" - fi - fi -} - -fn_deps_detector(){ - # Checks if dependency is missing. -if [ "${javacheck}" == "1" ]; then - # Added for users using Oracle JRE to bypass check. - depstatus=0 - deptocheck="${javaversion}" - unset javacheck - - elif [ "${deptocheck}" == "jq" ]&&[ "${distroid}" == "ubuntu" ]&&[ "${distroversion}" == "18.04" ]&& ! grep -qE "^deb .*universe" /etc/apt/sources.list; then - # #1985 ubuntu 18.04.1 bug does not set sources.list correctly which means universe is not active by default - # If the universe repo does not exist, mark as dependency missing and universe missing. - depstatus=1 - jquniversemissing=1 - elif [ "${deptocheck}" == "mono-complete" ]; then - if [ "$(command -v mono 2>/dev/null)" ]&&[ "$(mono --version 2>&1 | grep -Po '(?<=version )\d')" -ge 5 ]; then - # Mono >= 5.0.0 already installed. - depstatus=0 - else - # Mono not installed or installed Mono < 5.0.0. - depstatus=1 - monostatus=1 - fi - elif [ "$(command -v dpkg-query 2>/dev/null)" ]; then - dpkg-query -W -f='${Status}' "${deptocheck}" 2>/dev/null | grep -q -P '^install ok installed' - depstatus=$? - elif [ "$(command -v rpm 2>/dev/null)" ]; then - rpm -q "${deptocheck}" > /dev/null 2>&1 - depstatus=$? - fi - - if [ "${depstatus}" == "0" ]; then - # If dependency is found. - missingdep=0 - if [ "${commandname}" == "INSTALL" ]; then - echo -e "${green}${deptocheck}${default}" - fn_sleep_time - fi - else - # If dependency is not found. - missingdep=1 - if [ "${commandname}" == "INSTALL" ]; then - echo -e "${red}${deptocheck}${default}" - fn_sleep_time - fi - # Define required dependencies for SteamCMD. - if [ "${appid}" ]; then - if [ "${deptocheck}" == "glibc.i686" ]||[ "${deptocheck}" == "libstdc++64.i686" ]||[ "${deptocheck}" == "lib32gcc1" ]||[ "${deptocheck}" == "lib32stdc++6" ]; then - steamcmdfail=1 - fi - fi - fi - - # Missing dependencies are added to array_deps_missing. - if [ "${missingdep}" == "1" ]; then - array_deps_missing+=("${deptocheck}") - fi -} - -fn_deps_email(){ - # Adds postfix to required dependencies if email alert is enabled. - if [ "${emailalert}" == "on" ]; then - if [ -f /usr/bin/mailx ]; then - if [ -d /etc/exim4 ]; then - array_deps_required+=( exim4 ) - elif [ -d /etc/sendmail ]; then - array_deps_required+=( sendmail ) - elif [ "$(command -v dpkg-query 2>/dev/null)" ]; then - array_deps_required+=( mailutils postfix ) - elif [ "$(command -v rpm 2>/dev/null)" ]; then - array_deps_required+=( mailx postfix ) - fi - else - if [ "$(command -v dpkg-query 2>/dev/null)" ]; then - array_deps_required+=( mailutils postfix ) - elif [ "$(command -v rpm 2>/dev/null)" ]; then - array_deps_required+=( mailx postfix ) - fi - fi - fi -} - -fn_found_missing_deps(){ - if [ "${#array_deps_missing[*]}" != "0" ]; then - - fn_print_warning_nl "Missing dependencies: ${red}${array_deps_missing[*]}${default}" - fn_script_log_warn "Missing dependencies: ${array_deps_missing[*]}" - fn_sleep_time - if [ "${monostatus}" ]; then - fn_install_mono_repo - fi - if [ "${jqstatus}" ]; then - fn_print_warning_nl "jq is not available in the ${distroname} repository." - echo -e " * https://docs.linuxgsm.com/requirements/jq" - fi - if [ "${autoinstall}" == "1" ]; then - sudo -n true > /dev/null 2>&1 - else - sudo -v > /dev/null 2>&1 - fi - if [ $? -eq 0 ]; then - fn_print_information_nl "Automatically installing missing dependencies." - fn_script_log_info "Automatically installing missing dependencies." - echo -en ".\r" - sleep 1 - echo -en "..\r" - sleep 1 - echo -en "...\r" - sleep 1 - echo -en " \r" - if [ "$(command -v dpkg-query 2>/dev/null)" ]; then - cmd="echo steamcmd steam/question select \"I AGREE\" | sudo debconf-set-selections; echo steamcmd steam/license note '' | sudo debconf-set-selections; sudo dpkg --add-architecture i386; sudo apt-get update; sudo apt-get -y install ${array_deps_missing[*]}" - eval "${cmd}" - elif [ "$(command -v dnf 2>/dev/null)" ]; then - cmd="sudo dnf -y install ${array_deps_missing[*]}" - eval "${cmd}" - elif [ "$(command -v yum 2>/dev/null)" ]; then - cmd="sudo yum -y install ${array_deps_missing[*]}" - eval "${cmd}" - fi - if [ $? != 0 ]; then - fn_print_failure_nl "Unable to install dependencies." - fn_script_log_fatal "Unable to install dependencies." - echo -e "" - fn_print_warning_nl "Manually install dependencies." - fn_script_log_warn "Manually install dependencies." - if [ "$(command -v dpkg-query 2>/dev/null)" ]; then - echo -e " sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[*]}" - elif [ "$(command -v dnf 2>/dev/null)" ]; then - echo -e " sudo dnf install ${array_deps_missing[*]}" - elif [ "$(command -v yum 2>/dev/null)" ]; then - echo -e " sudo yum install ${array_deps_missing[*]}" - fi - if [ "${steamcmdfail}" ]; then - echo -e "" - if [ "${commandname}" == "INSTALL" ]; then - fn_print_failure_nl "Missing dependencies required to run SteamCMD." - fn_script_log_fatal "Missing dependencies required to run SteamCMD." - core_exit.sh - else - fn_print_error_nl "Missing dependencies required to run SteamCMD." - fn_script_log_error "Missing dependencies required to run SteamCMD." - fi - fi - else - fn_print_complete_nl "Install dependencies completed." - fn_script_log_pass "Install dependencies completed." - fi - else - fn_print_warning_nl "$(whoami) does not have sudo access. Manually install dependencies." - fn_script_log_warn "$(whoami) does not have sudo access. Manually install dependencies." - echo -e "" - if [ "$(command -v dpkg-query 2>/dev/null)" ]; then - echo -e "sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[*]}" - elif [ "$(command -v dnf 2>/dev/null)" ]; then - echo -e "sudo dnf install ${array_deps_missing[*]}" - elif [ "$(command -v yum 2>/dev/null)" ]; then - echo -e "sudo yum install ${array_deps_missing[*]}" - fi - if [ "${steamcmdfail}" ]; then - echo -e "" - if [ "${commandname}" == "INSTALL" ]; then - fn_print_failure_nl "Missing dependencies required to run SteamCMD." - fn_script_log_fatal "Missing dependencies required to run SteamCMD." - core_exit.sh - else - fn_print_error_nl "Missing dependencies required to run SteamCMD." - fn_script_log_error "Missing dependencies required to run SteamCMD." - fi - fi - echo -e "" - fi - if [ "${commandname}" == "INSTALL" ]; then - sleep 5 - fi - else - if [ "${commandname}" == "INSTALL" ]; then - fn_print_information_nl "Required dependencies already installed." - fn_script_log_info "Required dependencies already installed." - fi - fi -} - -fn_check_loop(){ - # Loop though required depenencies. - for deptocheck in ${array_deps_required[*]} - do - fn_deps_detector - done - - # user to be informed of any missing dependencies. - fn_found_missing_deps -} - -# Generate require dependencies for debian based systems. -fn_deps_build_debian(){ - # Generate array of missing deps. - array_deps_missing=() - - # LinuxGSM requirements. - array_deps_required=( curl wget ca-certificates file bsdmainutils util-linux python3 tar bzip2 gzip unzip binutils bc jq tmux netcat ) - - # All servers except ts3, mumble, GTA and minecraft servers require libstdc++6 and lib32gcc1. - if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${shortname}" != "mc" ]&&[ "${engine}" != "renderware" ]; then - if [ "${arch}" == "x86_64" ]; then - array_deps_required+=( lib32gcc1 lib32stdc++6 ) - else - array_deps_required+=( lib32stdc++6 ) - fi - fi - # If requires steamcmd. - if [ "${appid}" ]; then - # Will not use apt if non-free repo is missing or Ubuntu 14.04 - if [ "${distroversion}" == "14.04" ]||[ "${distroid}" == "debian" ]&& ! grep -qE "^deb .*non-free" /etc/apt/sources.list; then - : - else - array_deps_required+=( steamcmd ) - fi - fi - - # Game Specific requirements. - - # Natural Selection 2 (x64 only) - if [ "${shortname}" == "ns2" ]; then - array_deps_required+=( speex libtbb2 ) - # NS2: Combat - elif [ "${shortname}" == "ns2c" ]; then - array_deps_required+=( speex:i386 libtbb2 ) - # 7 Days to Die - elif [ "${shortname}" == "sdtd" ]; then - array_deps_required+=( telnet expect ) - # Battlefield 1942, Counter-Strike: Source, Garry's Mod, No More Room in Hell, Source Forts Classic, Zombie Master Reborn and Zombie Panic: Source - elif [ "${shortname}" == "bf1942" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "nmrih" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "zmr" ]||[ "${shortname}" == "zps" ]; then - if [ "${arch}" == "x86_64" ]; then - array_deps_required+=( libtinfo5:i386 ) - else - array_deps_required+=( libtinfo5 ) - fi - # Brainbread 2, Don't Starve Together & Team Fortress 2 - elif [ "${shortname}" == "bb2" ]||[ "${shortname}" == "dst" ]||[ "${shortname}" == "tf2" ]; then - array_deps_required+=( libcurl4-gnutls-dev:i386 ) - if [ "${shortname}" == "tf2" ]; then - array_deps_required+=( libtcmalloc-minimal4:i386 ) - fi - # Call of Duty & Medal of Honor: Allied Assault - elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]||[ "${shortname}" == "mohaa" ]; then - array_deps_required+=( libstdc++5:i386 ) - # Factorio - elif [ "${shortname}" == "fctr" ]; then - array_deps_required+=( xz-utils ) - # Hurtword/Rust - elif [ "${shortname}" == "hw" ]||[ "${shortname}" == "rust" ]; then - array_deps_required+=( lib32z1 ) - # Minecraft, Rising World, Wurm - elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "rw" ]||[ "${shortname}" == "wurm" ]; then - javaversion=$(java -version 2>&1 | grep "version") - if [ "${javaversion}" ]; then - # Added for users using Oracle JRE to bypass the check. - javacheck=1 - else - array_deps_required+=( default-jre ) - fi - # Onset - elif [ "${shortname}" == "onset" ]; then - array_deps_required+=( libmariadbclient-dev ) - # Project Zomboid - elif [ "${shortname}" == "pz" ]; then - if java -version 2>&1 | grep "version"; then - # Added for users using Oracle JRE to bypass the check. - javacheck=1 - array_deps_required+=( rng-tools ) - else - array_deps_required+=( default-jre rng-tools ) - fi - # GoldenEye: Source - elif [ "${shortname}" == "ges" ]; then - array_deps_required+=( zlib1g:i386 libldap-2.4-2:i386 ) - # Sven Co-op - elif [ "${shortname}" == "sven" ]; then - array_deps_required+=( libssl1.1:i386 zlib1g:i386 ) - # Unreal Engine - elif [ "${executable}" == "./ucc-bin" ]; then - # UT2K4 - if [ -f "${executabledir}/ut2004-bin" ]; then - array_deps_required+=( libsdl1.2debian libstdc++5:i386 ) - # UT99 - else - array_deps_required+=( libsdl1.2debian ) - fi - # Unreal Tournament - elif [ "${shortname}" == "ut" ]; then - array_deps_required+=( unzip ) - # Unturned - elif [ "${shortname}" == "unt" ]; then - array_deps_required+=( mono-complete ) - # Wurm: Unlimited - elif [ "${shortname}" == "wurm" ]; then - array_deps_required+=( xvfb ) - elif [ "${shortname}" == "pstbs" ]; then - array_deps_required+=( libgconf-2-4 ) - fi - fn_deps_email - fn_check_loop -} - -fn_deps_build_redhat(){ - # Generate array of missing deps. - array_deps_missing=() - - # LinuxGSM requirements. - # CentOS - if [ "${distroversion}" == "7" ]; then - array_deps_required=( epel-release curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat ) - elif [ "${distroversion}" == "8" ]; then - array_deps_required=( epel-release curl wget util-linux python36 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat ) - elif [ "${distroid}" == "fedora" ]; then - array_deps_required=( curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat ) - elif [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then - array_deps_required=( curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat ) - else - array_deps_required=( curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat ) - fi - - # All servers except ts3, mumble, multi theft auto and minecraft servers require glibc.i686 and libstdc++.i686. - if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${shortname}" != "mc" ]&&[ "${engine}" != "renderware" ]; then - if [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then - array_deps_required+=( glibc.i686 libstdc++64.i686 ) - else - array_deps_required+=( glibc.i686 libstdc++.i686 ) - fi - fi - - # Game Specific requirements. - - # Natural Selection 2 (x64 only) - if [ "${shortname}" == "ns2" ]; then - array_deps_required+=( speex tbb ) - # NS2: Combat - elif [ "${shortname}" == "ns2c" ]; then - array_deps_required+=( speex.i686 tbb.i686 ) - # 7 Days to Die - elif [ "${shortname}" == "sdtd" ]; then - array_deps_required+=( telnet expect ) - # Battlefield 1942, Counter-Strike: Source, Garry's Mod, No More Room in Hell, Source Forts Classic, Zombie Master Reborn and Zombie Panic: Source - elif [ "${shortname}" == "bf1942" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "nmrih" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "zmr" ]||[ "${shortname}" == "zps" ]; then - array_deps_required+=( ncurses-libs.i686 ) - # Brainbread 2, Don't Starve Together & Team Fortress 2 - elif [ "${shortname}" == "bb2" ]||[ "${shortname}" == "dst" ]||[ "${shortname}" == "tf2" ]; then - array_deps_required+=( libcurl.i686 ) - if [ "${shortname}" == "tf2" ]; then - array_deps_required+=( gperftools-libs.i686 ) - fi - # Call of Duty & Medal of Honor: Allied Assault - elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]||[ "${shortname}" == "mohaa" ]; then - array_deps_required+=( compat-libstdc++-33.i686 ) - # Factorio - elif [ "${shortname}" == "fctr" ]; then - array_deps_required+=( xz ) - # Hurtword/Rust - elif [ "${shortname}" == "hw" ]||[ "${shortname}" == "rust" ]; then - array_deps_required+=( zlib-devel ) - # Minecraft, Rising World, Wurm - elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "rw" ]||[ "${shortname}" == "wurm" ]; then - javaversion=$(java -version 2>&1 | grep "version") - if [ "${javaversion}" ]; then - # Added for users using Oracle JRE to bypass the check. - javacheck=1 - else - array_deps_required+=( java-11-openjdk ) - fi - # Onset - elif [ "${shortname}" == "onset" ]; then - array_deps_required+=( mariadb-connector-c ) - # Project Zomboid - elif [ "${shortname}" == "pz" ]; then - if java -version 2>&1 | grep "version"; then - # Added for users using Oracle JRE to bypass the check. - javacheck=1 - array_deps_required+=( rng-tools ) - else - array_deps_required+=( java-11-openjdk rng-tools ) - fi - # GoldenEye: Source - elif [ "${shortname}" == "ges" ]; then - array_deps_required+=( zlib.i686 openldap.i686 ) - # Sven Co-op - elif [ "${shortname}" == "sven" ]; then - : # not compatible - # Unreal Engine - elif [ "${executable}" == "./ucc-bin" ]; then - # UT2K4 - if [ -f "${executabledir}/ut2004-bin" ]; then - array_deps_required+=( compat-libstdc++-33.i686 SDL.i686 bzip2 ) - # UT99 - else - array_deps_required+=( SDL.i686 bzip2 ) - fi - # Unreal Tournament - elif [ "${shortname}" == "ut" ]; then - array_deps_required+=( unzip ) - # Unturned - elif [ "${shortname}" == "unt" ]; then - array_deps_required+=( mono-complete ) - # Wurm: Unlimited - elif [ "${shortname}" == "wurm" ]; then - array_deps_required+=( xorg-x11-server-Xvfb ) - elif [ "${shortname}" == "pstbs" ]; then - array_deps_required+=( GConf2 ) - fi - fn_deps_email - fn_check_loop -} - -if [ "${commandname}" == "INSTALL" ]; then - if [ "$(whoami)" == "root" ]; then - echo -e "" - echo -e "${lightyellow}Checking Dependencies as root${default}" - echo -e "=================================" - fn_print_information_nl "Checking any missing dependencies for ${gamename} server only." - fn_print_information_nl "This will NOT install a ${gamename} server." - fn_sleep_time - else - echo -e "" - echo -e "${lightyellow}Checking Dependencies${default}" - echo -e "=================================" - fi -fi - -# Filter checking in to Debian or Red Hat Based. -info_distro.sh -if [ -f "/etc/debian_version" ]; then - fn_deps_build_debian -elif [ -f "/etc/redhat-release" ]; then - fn_deps_build_redhat -else - fn_print_warning_nl "${distroname} dependency checking unavailable." -fi diff --git a/lgsm/functions/check_glibc.sh b/lgsm/functions/check_glibc.sh deleted file mode 100644 index 02f7ad459..000000000 --- a/lgsm/functions/check_glibc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# LinuxGSM check_glibc.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Checks if the server has the correct Glibc version. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -info_distro.sh - -if [ "${glibc}" == "null" ]; then - # Glibc is not required. - : -elif [ -z "${glibc}" ]; then - fn_print_dots "glibc" - fn_print_error_nl "glibc requirement unknown" - fn_script_log_error "glibc requirement unknown" -elif [ "$(printf '%s\n'${glibc}'\n' "${glibcversion}" | sort -V | head -n 1)" != "${glibc}" ]; then - fn_print_dots "glibc" - fn_print_error_nl "glibc requirements not met" - fn_script_log_error "glibc requirements not met" - echo -en "\n" - echo -e " * glibc required: ${glibc}" - echo -e " * glibc installed: ${red}${glibcversion}${default}" - echo -en "\n" - fn_print_information_nl "distro upgrade is required" - fn_script_log_info "distro upgrade is required" -fi diff --git a/lgsm/functions/check_ip.sh b/lgsm/functions/check_ip.sh deleted file mode 100644 index d8c4f3ed5..000000000 --- a/lgsm/functions/check_ip.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash -# LinuxGSM check_ip.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Automatically identifies the server interface IP. -# If multiple interfaces are detected the user will need to manually set using ip="0.0.0.0". - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -if [ "${travistest}" != "1" ]; then - if [ ! -f "/bin/ip" ]; then - ipcommand="/sbin/ip" - else - ipcommand="ip" - fi - getip=$(${ipcommand} -o -4 addr | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|sort -u|grep -v 127.0.0) - getipwc=$(${ipcommand} -o -4 addr | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|sort -u|grep -vc 127.0.0) - info_config.sh - info_parms.sh - - # IP is not set to specific IP. - if [ "${ip}" == "0.0.0.0" ]||[ "${ip}" == "" ]; then - fn_print_dots "Check IP" - # Multiple interfaces. - if [ "${getipwc}" -ge "2" ]; then - if [ "${commandname}" == "details" ]; then - fn_print_warn "Check IP: Multiple IP addresses found." - else - fn_print_fail "Check IP: Multiple IP addresses found." - fi - echo -en "\n" - # IP is set within game config. - if [ "${ipsetinconfig}" == "1" ]; then - fn_print_information "Specify the IP you want to bind within ${servercfg}.\n" - echo -en " * location: ${servercfgfullpath}\n" - echo -en "\n" - echo -en "Set ${ipinconfigvar} to one of the following:\n" - fn_script_log_fatal "Multiple IP addresses found." - fn_script_log_fatal "Specify the IP you want to bind within: ${servercfgfullpath}." - # IP is set within LinuxGSM config. - else - fn_print_information_nl "Specify the IP you want to bind within a LinuxGSM config file.\n" - echo -en " * location: ${configdirserver}\n" - echo -en "\n" - echo -en "Set ip=\"0.0.0.0\" to one of the following:\n" - fn_script_log_fatal "Multiple IP addresses found." - fn_script_log_fatal "Specify the IP you want to bind within: ${configdirserver}." - fi - echo -en "${getip}\n" - echo -en "\n" - echo -en "https://linuxgsm.com/network-interfaces\n" - echo -en "" - # Do not exit for details and postdetails commands. - if [ "${commandname}" != "DETAILS" ]||[ "${commandname}" != "POST-DETAILS" ]; then - fn_script_log_fatal "https://linuxgsm.com/network-interfaces\n" - core_exit.sh - else - ip="NOT SET" - fi - # Single interface. - elif [ "${ipsetinconfig}" == "1" ]; then - fn_print_fail "Check IP: IP address not set in game config." - echo -en "\n" - fn_print_information "Specify the IP you want to bind within ${servercfg}.\n" - echo -en " * location: ${servercfgfullpath}\n" - echo -en "\n" - echo -en "Set ${ipinconfigvar} to the following:\n" - echo -en "${getip}\n" - echo -en "\n" - echo -en "https://linuxgsm.com/network-interfaces\n" - echo -en "" - fn_script_log_fatal "IP address not set in game config." - fn_script_log_fatal "Specify the IP you want to bind within: ${servercfgfullpath}." - fn_script_log_fatal "https://linuxgsm.com/network-interfaces\n" - if [ "${commandname}" != "DETAILS" ]; then - core_exit.sh - fi - else - fn_print_info_nl "Check IP: ${getip}" - fn_script_log_info "IP automatically set as: ${getip}" - ip="${getip}" - fi - fi -fi diff --git a/lgsm/functions/check_last_update.sh b/lgsm/functions/check_last_update.sh deleted file mode 100644 index 52e4cfce0..000000000 --- a/lgsm/functions/check_last_update.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# LinuxGSM check_last_update.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Checks lock file to see when last update happened. -# Will reboot server if instance not rebooted since update. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -if [ -f "${lockdir}/${selfname}-laststart.lock" ]; then - laststart=$(cat "${lockdir}/${selfname}-laststart.lock") -fi -if [ -f "${lockdir}/lastupdate.lock" ]; then - lastupdate=$(cat "${lockdir}/lastupdate.lock") -fi - -check_status.sh -if [ -f "${lockdir}/lastupdate.lock" ]&&[ "${status}" != "0" ]; then - if [ ! -f "${lockdir}/${selfname}-laststart.lock" ]||[ "${laststart}" -lt "${lastupdate}" ]; then - fn_print_info "${selfname} has not been restarted since last update" - fn_script_log_info "${selfname} has not been restarted since last update" - command_restart.sh - fi -fi diff --git a/lgsm/functions/check_logs.sh b/lgsm/functions/check_logs.sh deleted file mode 100644 index 694b1678a..000000000 --- a/lgsm/functions/check_logs.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# LinuxGSM check_logs.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Checks if log files exist. - -functionselfname="$(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 - install_logs.sh -} - -# Create directories for the script and console logs. -if [ ! -d "${lgsmlogdir}" ]||[ ! -d "${consolelogdir}" ]; then - fn_check_logs -fi - -# Create gamelogdir. -# If variable exists gamelogdir exists and log/server does not. -if [ "${gamelogdir}" ]&&[ -d "${gamelogdir}" ]&&[ ! -d "${logdir}/server" ]; then - fn_check_logs -fi diff --git a/lgsm/functions/check_root.sh b/lgsm/functions/check_root.sh deleted file mode 100644 index b6886938f..000000000 --- a/lgsm/functions/check_root.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# LinuxGSM check_root.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Checks if the user tried to run the script as root. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -if [ "$(whoami)" = "root" ]; then - if [ "${commandname}" != "INSTALL" ]; then - fn_print_fail_nl "Do NOT run this script as root!" - if [ -d "${lgsmlogdir}" ]; then - fn_script_log_fatal "${selfname} attempted to run as root." - fi - core_exit.sh - fi -fi diff --git a/lgsm/functions/check_status.sh b/lgsm/functions/check_status.sh deleted file mode 100644 index 178adcf6b..000000000 --- a/lgsm/functions/check_status.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# LinuxGSM check_status.sh function -# Author: Daniel Gibbs -# Contributor: UltimateByte -# Website: https://linuxgsm.com -# Description: Checks the process status of the server. Either online or offline. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -status=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | grep -Ecx "^${sessionname}") diff --git a/lgsm/functions/check_steamcmd.sh b/lgsm/functions/check_steamcmd.sh deleted file mode 100644 index aa4140bbe..000000000 --- a/lgsm/functions/check_steamcmd.sh +++ /dev/null @@ -1,157 +0,0 @@ -#!/bin/bash -# LinuxGSM check_steamcmd.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Checks if SteamCMD is installed correctly. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_install_steamcmd(){ - if [ ${shortname} == "ark" ]&&[ "${installsteamcmd}" == "1" ]; then - steamcmddir="${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" - fi - if [ ! -d "${steamcmddir}" ]; then - mkdir -p "${steamcmddir}" - fi - remote_fileurl="${1}" - remote_fileurl_backup="${2}" - remote_fileurl_name="${3}" - remote_fileurl_backup_name="${4}" - local_filedir="${5}" - local_filename="${6}" - chmodx="${7:-0}" - run="${8:-0}" - forcedl="${9:-0}" - md5="${10:-0}" - fn_fetch_file "http://media.steampowered.com/client/steamcmd_linux.tar.gz" "" "" "" "${tmpdir}" "steamcmd_linux.tar.gz" "" "norun" "noforce" "nomd5" - fn_dl_extract "${tmpdir}" "steamcmd_linux.tar.gz" "${steamcmddir}" - chmod +x "${steamcmddir}/steamcmd.sh" -} - -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." - if [ -d "${lgsmlogdir}" ]; then - fn_script_log_fatal "Steam login not set. Update steamuser in ${configdirserver}" - fi - core_exit.sh - fi - # Anonymous user is set if steamuser is missing. - if [ -z "${steamuser}" ]; then - if [ -d "${lgsmlogdir}" ]; then - fn_script_log_info "Using anonymous Steam login" - fi - steamuser="anonymous" - steampass='' - fi -} - -fn_check_steamcmd(){ - # Checks if SteamCMD exists when starting or updating a server. - # 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_install_steamcmd - else - fn_print_warn_nl "SteamCMD is missing" - fn_script_log_warn "SteamCMD is missing" - fn_install_steamcmd - fi - elif [ "${commandname}" == "INSTALL" ]; then - fn_print_information "SteamCMD is already installed..." - fn_print_ok_eol_nl - fi -} - -fn_check_steamcmd_dir(){ - # Worksround that pre-installs the correct steam directories to ensure all packages use the correct Standard. - # https://github.com/ValveSoftware/steam-for-linux/issues/6976#issuecomment-610446347 - - # Create Steam installation directory. - if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then - mkdir -p "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" - fi - - # Create common Steam directory. - if [ ! -d "${HOME}/.steam" ]; then - mkdir -p "${HOME}/.steam" - fi - - # Symbolic links to Steam installation directory. - if [ ! -L "${HOME}/.steam/root" ]; then - if [ -d "${HOME}/.steam/root" ]; then - rm "${HOME}/.steam/root" - fi - ln -s "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" "${HOME}/.steam/root" - fi - - if [ ! -L "${HOME}/.steam/steam" ]; then - if [ -d "${HOME}/.steam/steam" ]; then - rm -rf "${HOME}/.steam/steam" - fi - ln -s "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" "${HOME}/.steam/steam" - fi -} - -fn_check_steamcmd_dir_legacy(){ - # Remove old Steam installation directories ~/Steam and ${rootdir}/steamcmd - if [ -d "${rootdir}/steamcmd" ]&&[ "${steamcmddir}" == "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then - rm -rf "${rootdir:?}/steamcmd" - fi - - if [ -d "${HOME}/Steam" ]&&[ "${steamcmddir}" == "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then - rm -rf "${HOME}/Steam" - fi -} - -fn_check_steamcmd_ark(){ - # Checks if SteamCMD exists in - # Engine/Binaries/ThirdParty/SteamCMD/Linux - # to allow ark mods to work - if [ ! -f "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamcmd.sh" ]; then - installsteamcmd=1 - if [ "${commandname}" == "INSTALL" ]; then - fn_install_steamcmd - else - fn_print_warn_nl "ARK mods SteamCMD is missing" - fn_script_log_warn "ARK mods SteamCMD is missing" - fn_install_steamcmd - fi - elif [ "${commandname}" == "INSTALL" ]; then - fn_print_information "ARK mods SteamCMD is already installed..." - fn_print_ok_eol_nl - fi -} - -fn_check_steamcmd_clear(){ -# Will remove steamcmd dir if steamcmd package is installed. -if [ "$(command -v steamcmd 2>/dev/null)" ]&&[ -d "${rootdir}/steamcmd" ]; then - rm -rf "${steamcmddir:?}" - exitcode=$? - if [ ${exitcode} -ne 0 ]; then - fn_script_log_fatal "Removing ${rootdir}/steamcmd" - else - fn_script_log_pass "Removing ${rootdir}/steamcmd" - fi -fi -} - -fn_check_steamcmd_exec(){ - if [ "$(command -v steamcmd 2>/dev/null)" ]; then - steamcmdcommand="steamcmd" - else - steamcmdcommand="./steamcmd.sh" - fi -} - -fn_check_steamcmd_clear -fn_check_steamcmd -if [ ${shortname} == "ark" ]; then - fn_check_steamcmd_ark -fi -fn_check_steamcmd_dir -fn_check_steamcmd_dir_legacy -fn_check_steamcmd_user -fn_check_steamcmd_exec diff --git a/lgsm/functions/check_system_dir.sh b/lgsm/functions/check_system_dir.sh deleted file mode 100644 index ce7ff5ba5..000000000 --- a/lgsm/functions/check_system_dir.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# LinuxGSM check_system_dir.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Checks if systemdir/serverfiles is accessible. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -if [ "${commandname}" != "VALIDATE" ]; then - checkdir="${serverfiles}" -else - checkdir="${systemdir}" -fi - -if [ ! -d "${checkdir}" ]; then - fn_print_fail_nl "Cannot access ${checkdir}: No such directory" - if [ -d "${lgsmlogdir}" ]; then - fn_script_log_fatal "Cannot access ${checkdir}: No such directory." - fi - core_exit.sh -fi diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/functions/check_system_requirements.sh deleted file mode 100644 index 8b7db5a3c..000000000 --- a/lgsm/functions/check_system_requirements.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# LinuxGSM check_system_requirements.sh -# Author: Daniel Gibbs -# Contributor: UltimateByte -# Website: https://linuxgsm.com -# Description: Checks RAM requirements - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -info_distro.sh - -# RAM requirements in megabytes for each game or engine. - -if [ "${shortname}" == "ark" ]; then - ramrequirementmb="4000" - ramrequirementgb="4" -elif [ "${shortname}" == "bt" ]; then - ramrequirementmb="1000" - ramrequirementgb="1" -elif [ "${shortname}" == "mh" ]; then - ramrequirementmb="4000" - ramrequirementgb="4" -elif [ "${shortname}" == "arma3" ]; then - ramrequirementmb="1000" - ramrequirementgb="1" -elif [ "${shortname}" == "rust" ]; then - ramrequirementmb="4000" - ramrequirementgb="4" -elif [ "${shortname}" == "mc" ]; then - ramrequirementmb="1000" - ramrequirementgb="1" -elif [ "${shortname}" == "pstbs" ]; then - ramrequirementmb="2000" - ramrequirementgb="2" -elif [ "${shortname}" == "ns2" ]||[ "${shortname}" == "ns2c" ]; then - ramrequirementmb="1000" - ramrequirementgb="1" -elif [ "${shortname}" == "st" ]; then - ramrequirementmb="1000" - ramrequirementgb="1" -fi - -# If the game or engine has a minimum RAM Requirement, compare it to system's available RAM. -if [ "${ramrequirementmb}" ]; then - if [ "${physmemtotalmb}" -lt "${ramrequirementmb}" ]; then - fn_print_dots "Check RAM" - # Warn the user. - fn_print_warn_nl "Check RAM: ${ramrequirementgb}G required, ${physmemtotal} available" - echo " * ${gamename} server may fail to run or experience poor performance." - fn_sleep_time - fi -fi diff --git a/lgsm/functions/command_console.sh b/lgsm/functions/command_console.sh deleted file mode 100644 index 18e674652..000000000 --- a/lgsm/functions/command_console.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# LinuxGSM command_console.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Gives access to the server tmux console. - -commandname="CONSOLE" -commandaction="Access console" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -check.sh -fn_print_header -if [ "${shortname}" == "rust" ]||[ "${shortname}" == "hw" ]||[ "${shortname}" == "ark" ]; then - fn_print_information_nl "${gamename} does not produce a verbose output to the console" - fn_print_information_nl "${gamename} does not allow server commands to be entered in to the console" -fi -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" -echo -e "" -if ! fn_prompt_yn "Continue?" Y; then - return -fi -fn_print_dots "Accessing console" -check_status.sh -if [ "${status}" != "0" ]; then - fn_print_ok_nl "Accessing console" - fn_script_log_pass "Console accessed" - tmux attach-session -t "${sessionname}" - fn_print_ok_nl "Closing console" - fn_script_log_pass "Console closed" -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 -fi - -core_exit.sh diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh deleted file mode 100644 index c2abc0ba0..000000000 --- a/lgsm/functions/command_details.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# LinuxGSM command_details.sh function -# Author: Daniel Gibbs -# Contributor: UltimateByte -# Website: https://linuxgsm.com -# Description: Displays server information. - -commandname="DETAILS" -commandaction="Viewing details" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -# Run checks and gathers details to display. -check.sh -info_config.sh -info_parms.sh -info_distro.sh -info_messages.sh -if [ "${querymode}" == "2" ]||[ "${querymode}" == "3" ]; then - query_gamedig.sh -fi -fn_info_message_distro -fn_info_message_server_resource -fn_info_message_gameserver_resource -fn_info_message_gameserver -fn_info_message_script -fn_info_message_backup -# Some game servers do not have parms. -if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "jc2" ]&&[ "${shortname}" != "dst" ]&&[ "${shortname}" != "pz" ]&&[ "${engine}" != "renderware" ]; then - fn_parms - fn_info_message_commandlineparms -fi -fn_info_message_ports -fn_info_message_select_engine -fn_info_message_statusbottom - -core_exit.sh diff --git a/lgsm/functions/command_dev_clear_functions.sh b/lgsm/functions/command_dev_clear_functions.sh deleted file mode 100644 index 0c2faa375..000000000 --- a/lgsm/functions/command_dev_clear_functions.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# command_dev_clear_functions.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Deletes the contents of the functions dir. - -commandname="DEV-CLEAR-MODULES" -commandaction="Clearing modules" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -echo -e "=================================" -echo -e "Clear Functions" -echo -e "=================================" -echo -e "" -if fn_prompt_yn "Do you want to delete all functions?" Y; then - rm -rfv "${functionsdir:?}/"* - rm -rfv "${configdirdefault:?}/"* - fn_script_log_info "Cleared modules directory" - fn_script_log_info "Cleared default config directory" -fi - -core_exit.sh diff --git a/lgsm/functions/command_dev_detect_ldd.sh b/lgsm/functions/command_dev_detect_ldd.sh deleted file mode 100644 index 850845179..000000000 --- a/lgsm/functions/command_dev_detect_ldd.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# command_dev_detect_ldd.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Automatically detects required deps using ldd. -# Can check a file or directory recursively. - -commandname="DEV-DETECT-LDD" -commandaction="Developer detect ldd" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -echo -e "=================================" -echo -e "Shared Object dependencies Checker" -echo -e "=================================" - -if [ -z "${serverfiles}" ]; then - dir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") -fi - -if [ -d "${serverfiles}" ]; then - echo -e "Checking directory: " - echo -e "${serverfiles}" -elif [ -f "${serverfiles}" ]; then - echo -e "Checking file: " - echo -e "${serverfiles}" -fi -echo -e "" -touch "${tmpdir}/detect_ldd.tmp" -touch "${tmpdir}/detect_ldd_not_found.tmp" - -files=$(find "${serverfiles}" | wc -l) -find "${serverfiles}" -type f -print0 | -while IFS= read -r -d $'\0' line; do - if ldd "${line}" 2>/dev/null | grep -v "not a dynamic executable" - then - echo -e "${line}" >> "${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" - then - 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" - fi - fi - echo -n "$i / $files" $'\r' - ((i++)) -done -echo -e "" -echo -e "" -echo -e "All" -echo -e "=================================" -cat "${tmpdir}/detect_ldd.tmp" - -echo -e "" -echo -e "Not Found" -echo -e "=================================" -cat "${tmpdir}/detect_ldd_not_found.tmp" - -rm -f "${tmpdir:?}/detect_ldd.tmp" -rm -f "${tmpdir:?}/detect_ldd_not_found.tmp" - -core_exit.sh diff --git a/lgsm/functions/command_dev_query_raw.sh b/lgsm/functions/command_dev_query_raw.sh deleted file mode 100644 index 22ed232ec..000000000 --- a/lgsm/functions/command_dev_query_raw.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash -# command_dev_query_raw.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Raw gamedig output of the server. - -commandname="DEV-QUERY-RAW" -commandaction="Developer query raw" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -check.sh -info_config.sh -info_parms.sh - -echo -e "" -echo -e "Query Port - Raw Output" -echo -e "==================================================================" -echo -e "" -echo -e "Ports" -echo -e "=================================" -echo -e "" -echo -e "PORT: ${port}" -echo -e "QUERY PORT: ${queryport}" -echo -e "" -echo -e "Gamedig Raw Output" -echo -e "=================================" -echo -e "" -if [ ! "$(command -v gamedig 2>/dev/null)" ]; 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 - -query_gamedig.sh -echo -e "${gamedigcmd}" -echo"" -echo "${gamedigraw}" | jq - -echo -e "" -echo -e "gsquery Raw Output" -echo -e "=================================" -echo -e "" -echo -e "./query_gsquery.py -a \"${ip}\" -p \"${queryport}\" -e \"${querytype}\"" -echo -e "" -if [ ! -f "${functionsdir}/query_gsquery.py" ]; then - fn_fetch_file_github "lgsm/functions" "query_gsquery.py" "${functionsdir}" "chmodx" "norun" "noforce" "nomd5" -fi -"${functionsdir}"/query_gsquery.py -a "${ip}" -p "${queryport}" -e "${querytype}" - -echo -e "" -echo -e "TCP Raw Output" -echo -e "=================================" -echo -e "" -echo -e "bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}''" -echo -e "" -bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}'' -querystatus="$?" -echo -e "" -if [ "${querystatus}" == "0" ]; then - echo -e "TCP query PASS" -else - echo -e "TCP query FAIL" -fi - -echo -e "" -echo -e "Game Port - Raw Output" -echo -e "==================================================================" -echo -e "" -echo -e "TCP Raw Output" -echo -e "=================================" -echo -e "" -echo -e "bash -c 'exec 3<> /dev/tcp/'${ip}'/'${port}''" -echo -e "" -bash -c 'exec 3<> /dev/tcp/'${ip}'/'${port}'' -querystatus="$?" -echo -e "" -if [ "${querystatus}" == "0" ]; then - echo -e "TCP query PASS" -else - echo -e "TCP query FAIL" -fi - -exitcode=0 -core_exit.sh diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh deleted file mode 100644 index 3a333a578..000000000 --- a/lgsm/functions/command_monitor.sh +++ /dev/null @@ -1,249 +0,0 @@ -#!/bin/bash -# LinuxGSM command_monitor.sh function -# Author: Daniel Gibbs -# Contributor: UltimateByte -# Website: https://linuxgsm.com -# Description: Monitors server by checking for running processes -# then passes to gamedig and gsquery. - -commandname="MONITOR" -commandaction="Monitoring" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_monitor_check_lockfile(){ - # Monitor does not run it lockfile is not found. - if [ ! -f "${lockdir}/${selfname}.lock" ]; then - 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_eol_nl - fn_script_log_error "Checking lockfile: No lockfile found: ERROR" - echo -e "* Start ${selfname} to run monitor." - core_exit.sh - fi - - # Fix if lockfile is not unix time or contains letters - if [ -f "${lockdir}/${selfname}.lock" ]&&[[ "$(cat "${lockdir}/${selfname}.lock")" =~ [A-Za-z] ]]; then - date '+%s' > "${lockdir}/${selfname}.lock" - fi -} - -fn_monitor_check_update(){ - # Monitor will check if update is already running. - if [ "$(pgrep "${selfname} update" | wc -l)" != "0" ]; then - fn_print_dots "Checking active updates: " - fn_print_checking_eol - fn_script_log_info "Checking active updates: CHECKING" - fn_print_error_nl "Checking active updates: SteamCMD is currently checking for updates: " - fn_print_error_eol - fn_script_log_error "Checking active updates: SteamCMD is currently checking for updates: ERROR" - core_exit.sh - fi -} - -fn_monitor_check_session(){ - fn_print_dots "Checking session: " - fn_print_checking_eol - fn_script_log_info "Checking session: CHECKING" - # uses status var from check_status.sh - if [ "${status}" != "0" ]; then - fn_print_ok "Checking session: " - fn_print_ok_eol_nl - fn_script_log_pass "Checking session: OK" - else - fn_print_error "Checking session: " - fn_print_fail_eol_nl - fn_script_log_fatal "Checking session: FAIL" - alert="restart" - alert.sh - fn_script_log_info "Checking session: Monitor is restarting ${selfname}" - command_restart.sh - core_exit.sh - fi -} - -fn_monitor_check_queryport(){ - # Monitor will check queryport is set before continuing. - if [ -z "${queryport}" ]||[ "${queryport}" == "0" ]; then - fn_print_dots "Checking port: " - fn_print_checking_eol - fn_script_log_info "Checking port: CHECKING" - if [ -n "${rconenabled}" ]&&[ "${rconenabled}" != "true" ]&&[ ${shortname} == "av" ]; then - fn_print_warn "Checking port: Unable to query as rconport, rcon not enabled: " - fn_script_log_warn "Checking port: Unable to query rconport, rcon not enabled: WARN" - else - fn_print_error "Checking port: Unable to query queryport is not set: " - fn_script_log_error "Checking port: Unable to query as queryport is not set: ERROR" - fi - core_exit.sh - fi -} - -fn_query_gsquery(){ - if [ ! -f "${functionsdir}/query_gsquery.py" ]; then - fn_fetch_file_github "lgsm/functions" "query_gsquery.py" "${functionsdir}" "chmodx" "norun" "noforce" "nomd5" - fi - "${functionsdir}"/query_gsquery.py -a "${ip}" -p "${queryport}" -e "${querytype}" > /dev/null 2>&1 - querystatus="$?" -} - -fn_query_tcp(){ - bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}'' > /dev/null 2>&1 - querystatus="$?" -} - -fn_monitor_query(){ -# Will loop and query up to 5 times every 15 seconds. -# Query will wait up to 60 seconds to confirm server is down as server can become non-responsive during map changes. -totalseconds=0 -for queryattempt in {1..5}; do - fn_print_dots "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " - fn_print_querying_eol - fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt} : QUERYING" - # querydelay - if [ "$(cat "${lockdir}/${selfname}.lock")" -gt "$(date "+%s" -d "${querydelay} mins ago")" ]; then - 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" - fn_script_log_info "Server started: $(date -d @$(cat lgsm/lock/bmdmserver.lock))" - fn_script_log_info "Current time: $(date)" - monitorpass=1 - core_exit.sh - # will use query method selected in fn_monitor_loop - # gamedig - elif [ "${querymethod}" == "gamedig" ]; then - query_gamedig.sh - # gsquery - elif [ "${querymethod}" == "gsquery" ]; then - fn_query_gsquery - #tcp query - elif [ "${querymethod}" == "tcp" ]; then - fn_query_tcp - fi - - if [ "${querystatus}" == "0" ]; then - # Server query OK. - fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " - fn_print_ok_eol_nl - fn_script_log_pass "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt}: OK" - monitorpass=1 - if [ "${querystatus}" == "0" ]; then - # Add query data to log. - if [ "${gdname}" ]; then - fn_script_log_info "Server name: ${gdname}" - fi - if [ "${gdplayers}" ]; then - fn_script_log_info "Players: ${gdplayers}/${gdmaxplayers}" - fi - if [ "${gdbots}" ]; then - fn_script_log_info "Bots: ${gdbots}" - fi - if [ "${gdmap}" ]; then - fn_script_log_info "Map: ${gdmap}" - fi - if [ "${gdgamemode}" ]; then - fn_script_log_info "Game Mode: ${gdgamemode}" - fi - - # send LinuxGSM stats if monitor is OK. - if [ "${stats}" == "on" ]||[ "${stats}" == "y" ]; then - info_stats.sh - fi - fi - core_exit.sh - else - # Server query FAIL. - fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " - fn_print_fail_eol - fn_script_log_warn "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt}: FAIL" - # Monitor will try gamedig (if supported) for first 30s then gsquery before restarting. - if [ "${querymethod}" == "gsquery" ]||[ "${querymethod}" == "tcp" ]; then - # 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}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " - fn_print_fail_eol_nl - fn_script_log_warn "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt}: FAIL" - # Send alert if enabled. - alert="restartquery" - alert.sh - command_restart.sh - core_exit.sh - fi - elif [ "${querymethod}" == "gamedig" ]; then - # gamedig will fail and try gsquery if longer than 30s - if [ "${totalseconds}" -ge "29" ]; then - break - fi - fi - - # 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}" - sleep 0.5 - totalseconds=$((totalseconds + 1)) - if [ "${seconds}" == "15" ]; then - break - fi - done - fi -done -} - -fn_monitor_loop(){ - # loop though query methods selected by querymode. - totalseconds=0 - if [ "${querymode}" == "2" ]; then - local query_methods_array=( gamedig gsquery ) - elif [ "${querymode}" == "3" ]; then - local query_methods_array=( gamedig ) - elif [ "${querymode}" == "4" ]; then - local query_methods_array=( gsquery ) - elif [ "${querymode}" == "5" ]; then - local query_methods_array=( tcp ) - fi - for querymethod in "${query_methods_array[@]}" - do - # Will check if gamedig is installed and bypass if not. - if [ "${querymethod}" == "gamedig" ]; then - if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; then - if [ -z "${monitorpass}" ]; then - fn_monitor_query - fi - else - fn_script_log_info "gamedig is not installed" - fn_script_log_info "https://docs.linuxgsm.com/requirements/gamedig" - fi - else - # will not query if query already passed. - if [ -z "${monitorpass}" ]; then - fn_monitor_query - fi - fi - done -} - -monitorflag=1 -check.sh -core_logs.sh -info_config.sh -info_parms.sh - -# query pre-checks -fn_monitor_check_lockfile -fn_monitor_check_update -fn_monitor_check_session -# Monitor will not continue if session only check. -if [ "${querymode}" != "1" ]; then - fn_monitor_check_queryport - - # Add a querydelay of 1 min if var missing. - if [ -z "${querydelay}" ]; then - querydelay="1" - fi - - fn_monitor_loop -fi -core_exit.sh diff --git a/lgsm/functions/command_postdetails.sh b/lgsm/functions/command_postdetails.sh deleted file mode 100644 index a0afa2905..000000000 --- a/lgsm/functions/command_postdetails.sh +++ /dev/null @@ -1,125 +0,0 @@ -#!/bin/bash -# LinuxGSM command_postdetails.sh function -# Author: CedarLUG -# Contributor: CedarLUG -# Website: https://linuxgsm.com -# Description: Strips sensitive information out of Details output - -commandname="POST-DETAILS" -commandaction="Posting details" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -# Set posttarget to the appropriately-defined post destination. - -# The options for posttarget are: -# The default destination - hastebin -# posttarget="https://hastebin.com" -# -# Secondary destination - pastebin -# posttarget="http://pastebin.com -# -# Third option - leave on the filesystem -# posttarget= -# -# All of these options can be specified/overridden from the top-level -# invocation, as in: -# rustserver@gamerig:~$ posttarget="http://pastebin.com" ./rustserver pd -# to post to pastebin, or -# rustserver@gamerig:~$ posttarget= ./rustserver pd -# to leave the output on the filesystem. -posttarget=${posttarget="https://termbin.com"} - -# For pastebin, you can set the expiration period. -# use 1 week as the default, other options are '24h' for a day, etc. -# This, too, may be overridden from the command line at the top-level. -postexpire="${postexpire="30D"}" - -# source all of the functions defined in the details command. -info_messages.sh - -fn_bad_postdetailslog() { - fn_print_fail_nl "Unable to create temporary file ${postdetailslog}." - core_exit.sh -} - -# Remove any existing postdetails.log file. -if [ -f "${postdetailslog}" ]; then - rm -f "${postdetailslog:?}" -fi - -# Rather than a one-pass sed parser, default to using a temporary directory. -if [ "${exitbypass}" ]; then - postdetailslog="${alertlog}" -else - # Run checks and gathers details to display. - check.sh - info_config.sh - info_parms.sh - info_distro.sh - info_messages.sh - query_gamedig.sh - touch "${postdetailslog}" || fn_bad_postdetailslog - { - fn_info_message_distro - fn_info_message_server_resource - fn_info_message_gameserver_resource - fn_info_message_gameserver - fn_info_message_script - fn_info_message_backup - # Some game servers do not have parms. - if [ "${shortname}" != "jc2" ]&&[ "${shortname}" != "jc3" ]&&[ "${shortname}" != "dst" ]&&[ "${shortname}" != "pz" ]&&[ "${engine}" != "renderware" ]; then - fn_parms - fn_info_message_commandlineparms - fi - fn_info_message_ports - fn_info_message_select_engine - fn_info_message_statusbottom - } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | tee -a "${postdetailslog}" > /dev/null 2>&1 -fi -# Pastebin -if [ "${posttarget}" == "http://pastebin.com" ] ; then - fn_print_dots "pastbin.com for ${postexpire}" - # grab the return from 'value' from an initial visit to pastebin. - csrftoken=$(curl -s "${posttarget}" | sed -n 's/^.*input type="hidden" name="csrf_token_post" value="\(.*\)".*$/\1/p') - # - # Use the csrftoken to then post the content. - # - link=$(curl -s "${posttarget}/post.php" -D - -F "submit_hidden=submit_hidden" \ - -F "post_key=${csrftoken}" -F "paste_expire_date=${postexpire}" \ - -F "paste_name=${gamename} Debug Info" \ - -F "paste_format=8" -F "paste_private=0" \ - -F "paste_type=bash" -F "paste_code=<${postdetailslog}" | - awk '/^location: / { print $2 }' | sed "s/\n//g") - - # Output the resulting link. - fn_print_ok_nl "pastbin.com for ${postexpire}" - fn_script_log_pass "pastbin.com for ${postexpire}" - pdurl="${posttarget}${link}" -# Hastebin -elif [ "${posttarget}" == "https://hastebin.com" ] ; then - fn_print_dots "hastebin.com" - # hastebin is a bit simpler. If successful, the returned result - # should look like: {"something":"key"}, putting the reference that - # we need in "key". TODO - error handling. -CedarLUG - link=$(curl -H "HTTP_X_REQUESTED_WITH:XMLHttpRequest" -s -d "$(<${postdetailslog})" "${posttarget}/documents" | cut -d\" -f4) - fn_print_ok_nl "hastebin.com for ${postexpire}" - fn_script_log_pass "hastebin.com for ${postexpire}" - pdurl="${posttarget}/${link}" -# Termbin -elif [ "${posttarget}" == "https://termbin.com" ] ; then - 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}" -fi -echo -e "" -echo -e "Please share the following url for support: " -echo -e "${pdurl}" -fn_script_log_info "${pdurl}" - -if [ -z "${exitbypass}" ]; then - core_exit.sh -else - alerturl="${pdurl}" -fi diff --git a/lgsm/functions/command_restart.sh b/lgsm/functions/command_restart.sh deleted file mode 100644 index 8a08c04ff..000000000 --- a/lgsm/functions/command_restart.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# LinuxGSM command_restart.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Restarts the server. - -commandname="MODS-INSTALL" -commandaction="Restarting" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -info_config.sh -exitbypass=1 -command_stop.sh -command_start.sh - -core_exit.sh diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh deleted file mode 100644 index d0487e5d4..000000000 --- a/lgsm/functions/command_start.sh +++ /dev/null @@ -1,203 +0,0 @@ -#!/bin/bash -# LinuxGSM command_start.sh function -# Author: Daniel Gibbs -# Contributor: UltimateByte -# Website: https://linuxgsm.com -# Description: Starts the server. - -commandname="START" -commandaction="Starting" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_start_teamspeak3(){ - if [ ! -f "${servercfgfullpath}" ]; then - fn_print_warn_nl "${servercfgfullpath} is missing" - fn_script_log_warn "${servercfgfullpath} is missing" - echo " * Creating blank ${servercfg}" - fn_script_log_info "Creating blank ${servercfg}" - fn_sleep_time - echo " * ${servercfg} can remain blank by default." - fn_script_log_info "${servercfgfullpath} can remain blank by default." - fn_sleep_time - echo " * ${servercfg} is located in ${servercfgfullpath}." - fn_script_log_info "${servercfg} is located in ${servercfgfullpath}." - sleep 5 - touch "${servercfgfullpath}" - fi - # Accept license. - if [ ! -f "${executabledir}/.ts3server_license_accepted" ]; then - install_eula.sh - fi - fn_start_tmux -} - -fn_start_tmux(){ - if [ "${parmsbypass}" ]; then - parms="" - else - fn_parms - fi - # check for tmux size variables. - if [[ "${servercfgtmuxwidth}" =~ ^[0-9]+$ ]]; then - sessionwidth="${servercfgtmuxwidth}" - else - sessionwidth="80" - fi - if [[ "${servercfgtmuxheight}" =~ ^[0-9]+$ ]]; then - sessionheight="${servercfgtmuxheight}" - else - sessionheight="23" - fi - - # Log rotation. - fn_script_log_info "Rotating log files" - if [ "${engine}" == "unreal2" ]&&[ -f "${gamelog}" ]; then - mv "${gamelog}" "${gamelogdate}" - fi - if [ -f "${lgsmlog}" ]; then - mv "${lgsmlog}" "${lgsmlogdate}" - fi - if [ -f "${consolelog}" ]; then - mv "${consolelog}" "${consolelogdate}" - fi - - # Create lockfile - date '+%s' > "${lockdir}/${selfname}.lock" - cd "${executabledir}" || exit - tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${executable} ${parms}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" - - # Create logfile. - touch "${consolelog}" - - # Create last start lock file - date +%s > "${lockdir}/${selfname}-laststart.lock" - - # Get tmux version. - tmuxversion=$(tmux -V | sed "s/tmux //" | sed -n '1 p') - # Tmux compiled from source will return "master", therefore ignore it. - if [ "$(tmux -V | sed "s/tmux //" | sed -n '1 p')" == "master" ]; then - fn_script_log "Tmux version: master (user compiled)" - echo -e "Tmux version: master (user compiled)" >> "${consolelog}" - if [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then - tmux pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" - fi - elif [ "${tmuxversion}" ]; then - # Get the digit version of tmux. - tmuxversion=$(tmux -V | sed "s/tmux //" | sed -n '1 p' | tr -cd '[:digit:]') - # tmux pipe-pane not supported in tmux versions < 1.6. - if [ "${tmuxversion}" -lt "16" ]; then - echo -e "Console logging disabled: Tmux => 1.6 required - https://linuxgsm.com/tmux-upgrade - Currently installed: $(tmux -V)" > "${consolelog}" - - # Console logging disabled: Bug in tmux 1.8 breaks logging. - elif [ "${tmuxversion}" -eq "18" ]; then - echo -e "Console logging disabled: Bug in tmux 1.8 breaks logging - https://linuxgsm.com/tmux-upgrade - Currently installed: $(tmux -V)" > "${consolelog}" - # Console logging enable or not set. - elif [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then - tmux pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" - fi - else - echo -e "Unable to detect tmux version" >> "${consolelog}" - fn_script_log_warn "Unable to detect tmux version" - fi - - # Console logging disabled. - if [ "${consolelogging}" == "off" ]; then - echo -e "Console logging disabled by user" >> "${consolelog}" - fn_script_log_info "Console logging disabled by user" - fi - fn_sleep_time - - # If the server fails to start. - check_status.sh - if [ "${status}" == "0" ]; then - fn_print_fail_nl "Unable to start ${servername}" - fn_script_log_fatal "Unable to start ${servername}" - if [ -s "${lgsmlogdir}/.${selfname}-tmux-error.tmp" ]; then - fn_print_fail_nl "Unable to start ${servername}: Tmux error:" - fn_script_log_fatal "Unable to start ${servername}: Tmux error:" - echo -e "" - echo -e "Command" - echo -e "=================================" - echo -e "tmux new-session -d -s \"${sessionname}\" \"${executable} ${parms}\"" | tee -a "${lgsmlog}" - echo -e "" - echo -e "Error" - echo -e "=================================" - cat "${lgsmlogdir}/.${selfname}-tmux-error.tmp" | tee -a "${lgsmlog}" - - # Detected error https://linuxgsm.com/support - if grep -c "Operation not permitted" "${lgsmlogdir}/.${selfname}-tmux-error.tmp" - then - echo -e "" - echo -e "Fix" - echo -e "=================================" - if ! grep "tty:" /etc/group | grep "$(whoami)"; then - echo -e "$(whoami) is not part of the tty group." - fn_script_log_info "$(whoami) is not part of the tty group." - group=$(grep tty /etc/group) - echo -e "" - echo -e " ${group}" - fn_script_log_info "${group}" - echo -e "" - echo -e "Run the following command with root privileges." - echo -e "" - echo -e " usermod -G tty $(whoami)" - echo -e "" - echo -e "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" - fn_script_log_info "https://linuxgsm.com/support" - fi - fi - fi - core_exit.sh - else - fn_print_ok "${servername}" - fn_script_log_pass "Started ${servername}" - fi - rm "${lgsmlogdir:?}/.${selfname}-tmux-error.tmp" - echo -en "\n" -} - -check.sh - -# Is the server already started. -# $status comes from check_status.sh, which is run by check.sh for this command -if [ "${status}" != "0" ]; then - fn_print_dots "${servername}" - fn_print_info_nl "${servername} is already running" - fn_script_log_error "${servername} is already running" - if [ -z "${exitbypass}" ]; then - core_exit.sh - fi -fi -if [ -z "${fixbypass}" ]; then - fix.sh -fi -info_config.sh -core_logs.sh - -# Will check for updates is updateonstart is yes. -if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateonstart}" == "on" ]; then - exitbypass=1 - unset updateonstart - command_update.sh - commandname="START" - commandaction="Starting" -fi - -fn_print_dots "${servername}" - -if [ "${shortname}" == "ts3" ]; then - fn_start_teamspeak3 -else - fn_start_tmux -fi - -core_exit.sh diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh deleted file mode 100644 index 88109a147..000000000 --- a/lgsm/functions/command_update.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# LinuxGSM command_update.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Handles updating of servers. - -commandname="UPDATE" -commandaction="Updating" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_print_dots "" -check.sh -core_logs.sh -check_last_update.sh - -if [ "${shortname}" == "ts3" ]; then - update_ts3.sh -elif [ "${shortname}" == "mc" ]; then - update_minecraft.sh -elif [ "${shortname}" == "mcb" ]; then - update_minecraft_bedrock.sh -elif [ "${shortname}" == "mumble" ]; then - update_mumble.sh -elif [ "${shortname}" == "fctr" ]; then - update_factorio.sh -elif [ "${shortname}" == "mta" ]; then - update_mta.sh -else - update_steamcmd.sh -fi - -core_exit.sh diff --git a/lgsm/functions/command_update_functions.sh b/lgsm/functions/command_update_functions.sh deleted file mode 100644 index e69de29bb..000000000 diff --git a/lgsm/functions/command_update_linuxgsm.sh b/lgsm/functions/command_update_linuxgsm.sh deleted file mode 100644 index c32bf321f..000000000 --- a/lgsm/functions/command_update_linuxgsm.sh +++ /dev/null @@ -1,200 +0,0 @@ -#!/bin/bash -# LinuxGSM command_update_linuxgsm.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Deletes the functions dir to allow re-downloading of functions from GitHub. - -commandname="UPDATE-LGSM" -commandaction="Updating LinuxGSM" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -check.sh - -fn_print_dots "" -fn_script_log_info "Updating LinuxGSM" - -fn_print_dots "Selecting repo" -fn_script_log_info "Selecting repo" -# Select remotereponame -curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1>/dev/null -if [ $? != "0" ]; then - curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1>/dev/null - if [ $? != "0" ]; then - fn_print_fail_nl "Selecting repo: Unable to to access GitHub or Bitbucket repositories" - fn_script_log_fatal "Selecting repo: Unable to to access GitHub or Bitbucket repositories" - core_exit.sh - else - remotereponame="Bitbucket" - fn_print_ok_nl "Selecting repo: ${remotereponame}" - fi -else - remotereponame="GitHub" - fn_print_ok_nl "Selecting repo: ${remotereponame}" -fi - -# Check linuxsm.sh -echo -en "checking ${remotereponame} linuxgsm.sh...\c" -if [ "${remotereponame}" == "GitHub" ]; then - curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1>/dev/null -else - curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1>/dev/null -fi -if [ $? != "0" ]; then - fn_print_fail_eol_nl - fn_script_log_fatal "Checking ${remotereponame} linuxgsm.sh" - fn_script_log_fatal "Curl returned error: $?" - core_exit.sh -fi - -if [ "${remotereponame}" == "GitHub" ]; then - tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh")) -else - tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh")) -fi - -if [ "${tmp_script_diff}" != "" ]; then - fn_print_update_eol_nl - fn_script_log_update "Checking ${remotereponame} linuxgsm.sh" - rm -f "${tmpdir:?}/linuxgsm.sh" - fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "nochmodx" "norun" "noforcedl" "nomd5" -else - fn_print_ok_eol_nl - fn_script_log_pass "Checking ${remotereponame} 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" -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}" - if [ ! -d "${backupdir}/script" ]; then - mkdir -p "${backupdir}/script" - fi - cp "${rootdir}/${selfname}" "${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak" - if [ $? -ne 0 ]; then - fn_print_fail_eol_nl - fn_script_log_fatal "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 location ${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak" - fi - - echo -en "copying ${selfname}...\c" - fn_script_log_info "copying ${selfname}" - cp "${tmpdir}/linuxgsm.sh" "${rootdir}/${selfname}" - sed -i "s+shortname=\"core\"+shortname=\"${shortname}\"+g" "${rootdir}/${selfname}" - sed -i "s+gameservername=\"core\"+gameservername=\"${gameservername}\"+g" "${rootdir}/${selfname}" - sed -i "s+gamename=\"core\"+gamename=\"${gamename}\"+g" "${rootdir}/${selfname}" - sed -i "s+githubuser=\"GameServerManagers\"+githubuser=\"${githubuser}\"+g" "${rootdir}/${selfname}" - sed -i "s+githubrepo=\"LinuxGSM\"+githubrepo=\"${githubrepo}\"+g" "${rootdir}/${selfname}" - sed -i "s+githubbranch=\"master\"+githubbranch=\"${githubbranch}\"+g" "${rootdir}/${selfname}" - - if [ $? != "0" ]; then - fn_print_fail_eol_nl - fn_script_log_fatal "copying ${selfname}" - core_exit.sh - else - fn_print_ok_eol_nl - fn_script_log_pass "copying ${selfname}" - fi -else - fn_print_ok_eol_nl - fn_script_log_info "Checking ${selfname}" -fi - -# Check _default.cfg. -echo -en "checking ${remotereponame} config _default.cfg...\c" -fn_script_log_info "Checking ${remotereponame} config _default.cfg" -if [ "${remotereponame}" == "GitHub" ]; then - curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null -else - curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null -fi -if [ $? != "0" ]; then - fn_print_fail_eol_nl - fn_script_log_fatal "Checking ${remotereponame} config _default.cfg" - fn_script_log_fatal "Curl returned error: $?" - core_exit.sh -fi - -if [ "${remotereponame}" == "GitHub" ]; then - config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl -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 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) -fi - -if [ "${config_file_diff}" != "" ]; then - fn_print_update_eol_nl - fn_script_log_update "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" "nomd5" - alert="config" - alert.sh -else - fn_print_ok_eol_nl - fn_script_log_pass "Checking ${remotereponame} config _default.cfg" -fi - -# Check and update modules. -if [ -n "${functionsdir}" ]; then - if [ -d "${functionsdir}" ]; then - cd "${functionsdir}" || exit - for functionfile in * - do - # check if module exists in the repo and remove if missing. - # commonly used if module names change. - echo -en "checking ${remotereponame} module ${functionfile}...\c" - github_file_url_dir="lgsm/functions" - if [ "${remotereponame}" == "GitHub" ]; then - curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null - else - curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null - fi - if [ $? -ne 0 ]; then - fn_print_error_eol_nl - fn_script_log_error "Checking ${remotereponame} module ${functionfile}" - echo -en "removing module ${functionfile}...\c" - if ! rm -f "${functionfile:?}"; then - fn_print_fail_eol_nl - fn_script_log_fatal "Removing module ${functionfile}" - core_exit.sh - else - fn_print_ok_eol_nl - fn_script_log_pass "Removing module ${functionfile}" - fi - else - # compare file - if [ "${remotereponame}" == "GitHub" ]; then - function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}")) - else - function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}")) - fi - - # results - if [ "${function_file_diff}" != "" ]; then - fn_print_update_eol_nl - fn_script_log_update "Checking ${remotereponame} module ${functionfile}" - rm -rf "${functionsdir:?}/${functionfile}" - fn_update_function - else - fn_print_ok_eol_nl - fn_script_log_pass "Checking ${remotereponame} module ${functionfile}" - fi - fi - done - fi -fi - -fn_print_ok_nl "Updating functions" -fn_script_log_pass "Updating functions" - -core_exit.sh diff --git a/lgsm/functions/command_validate.sh b/lgsm/functions/command_validate.sh deleted file mode 100644 index 276458e48..000000000 --- a/lgsm/functions/command_validate.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/bash -# LinuxGSM command_validate.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Runs a server validation. - -commandname="VALIDATE" -commandaction="Validating" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_validate(){ - fn_script_log_warn "Validating server: SteamCMD: Validate might overwrite some customised files" - totalseconds=3 - for seconds in {3..1}; do - fn_print_warn "Validating server: SteamCMD: Validate might overwrite some customised files: ${totalseconds}" - totalseconds=$((totalseconds - 1)) - sleep 1 - if [ "${seconds}" == "0" ]; then - break - fi - done - fn_print_warn_nl "Validating server: SteamCMD: Validate might overwrite some customised files" - fn_print_start_nl "Validating server: SteamCMD" - fn_script_log_info "Validating server: SteamCMD" - if [ -d "${steamcmddir}" ]; then - cd "${steamcmddir}" || exit - fi - # Detects if unbuffer command is available, for 32 bit distributions only. - info_distro.sh - if [ "$(command -v stdbuf)" ]&&[ "${arch}" != "x86_64" ]; then - unbuffer="stdbuf -i0 -o0 -e0" - fi - - # If GoldSrc (appid 90) servers. GoldSrc (appid 90) require extra commands. - if [ "${appid}" == "90" ]; then - # If using a specific branch. - if [ -n "${branch}" ]; then - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" "${branch}" +app_update "${appid}" -beta "${branch}" validate +quit | tee -a "${lgsmlog}" - else - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" "${branch}" +app_update "${appid}" validate +quit | tee -a "${lgsmlog}" - fi - elif [ "${shortname}" == "ac" ]; then - ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" validate +quit - local exitcode=$? - # All other servers. - elif [ -n "${branch}" ]; then - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" validate +quit | tee -a "${lgsmlog}" - else - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" validate +quit | tee -a "${lgsmlog}" - fi - - exitcode=$? - fn_print_dots "Validating server: SteamCMD" - if [ "${exitcode}" != "0" ]; then - fn_print_fail_nl "Validating server: SteamCMD" - fn_script_log_fatal "Validating server: SteamCMD: FAIL" - else - fn_print_ok_nl "Validating server: SteamCMD" - fn_script_log_pass "Validating server: SteamCMD: OK" - fi - core_exit.sh -} - -fn_stop_warning(){ - fn_print_warn "Validating server: SteamCMD: ${selfname} will be stopped during validation" - fn_script_log_warn "Validating server: SteamCMD: ${selfname} will be stopped during validation" - totalseconds=3 - for seconds in {3..1}; do - fn_print_warn "Validating server: SteamCMD: ${selfname} will be stopped during validation: ${totalseconds}" - totalseconds=$((totalseconds - 1)) - sleep 1 - if [ "${seconds}" == "0" ]; then - break - fi - done - fn_print_warn_nl "Validating server: SteamCMD: ${selfname} will be stopped during validation" -} - -fn_print_dots "Validating server" -fn_print_dots "Validating server: SteamCMD" -check.sh -if [ "${status}" != "0" ]; then - fn_stop_warning - exitbypass=1 - command_stop.sh - fn_validate - exitbypass=1 - command_start.sh -else - fn_validate -fi - -core_exit.sh diff --git a/lgsm/functions/command_wipe.sh b/lgsm/functions/command_wipe.sh deleted file mode 100644 index 5b5abf552..000000000 --- a/lgsm/functions/command_wipe.sh +++ /dev/null @@ -1,206 +0,0 @@ -#!/bin/bash -# LinuxGSM command_backup.sh function -# Author: Daniel Gibbs -# Contributor: UltimateByte -# Website: https://linuxgsm.com -# Description: Wipes server data, useful after updates for some games like Rust - -commandname="WIPE" -commandaction="Wiping" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -check.sh -fn_print_header -fn_script_log "Entering ${gamename} ${commandaction}" - -# Process to server wipe. -fn_wipe_server_process(){ - check_status.sh - if [ "${status}" != "0" ]; then - exitbypass=1 - command_stop.sh - fn_wipe_server_remove_files - exitbypass=1 - command_start.sh - else - fn_wipe_server_remove_files - fi - echo -e "server data wiped" - fn_script_log "server data wiped." -} - -# Provides an exit code upon error. -fn_wipe_exit_code(){ - ((exitcode=$?)) - if [ ${exitcode} -ne 0 ]; then - fn_script_log_fatal "${currentaction}" - core_exit.sh - else - fn_print_ok_eol_nl - fi -} - -# Removes files to wipe server. -fn_wipe_server_remove_files(){ - # Rust Wipe. - if [ "${shortname}" == "rust" ]; then - # Wipe pocedural map. - if [ "$(find "${serveridentitydir}" -type f -name "proceduralmap.*.map")" ]; then - currentaction="Removing map file(s): ${serveridentitydir}/proceduralmap.*.map" - echo -en "Removing procedural map proceduralmap.*.map file(s)..." - fn_sleep_time - fn_script_log "${currentaction}" - find "${serveridentitydir:?}" -type f -name "proceduralmap.*.map" -delete - fn_wipe_exit_code - fn_sleep_time - else - fn_print_information_nl "No procedural map file to remove" - fn_script_log_info "No procedural map file to remove." - fi - # Wipe procedural map save. - if [ "$(find "${serveridentitydir}" -type f -name "proceduralmap.*.sav")" ]; then - currentaction="Removing procedural map save(s): ${serveridentitydir}/proceduralmap.*.sav" - echo -en "Removing map saves proceduralmap.*.sav file(s)..." - fn_sleep_time - fn_script_log "${currentaction}" - find "${serveridentitydir:?}" -type f -name "proceduralmap.*.sav" -delete - fn_wipe_exit_code - fn_sleep_time - else - fn_print_information_nl "No procedural map save to remove" - fn_script_log_info "No procedural map save to remove." - fi - # Wipe Barren map. - if [ "$(find "${serveridentitydir}" -type f -name "barren*.map")" ]; then - currentaction="Removing map file(s): ${serveridentitydir}/barren*.map" - echo -en "Removing barren map barren*.map file(s)..." - fn_sleep_time - fn_script_log "${currentaction}" - find "${serveridentitydir:?}" -type f -name "barren*.map" -delete - fn_wipe_exit_code - fn_sleep_time - else - fn_print_information_nl "No barren map file to remove" - fn_script_log_info "No barren map file to remove." - fi - # Wipe barren map save. - if [ "$(find "${serveridentitydir}" -type f -name "barren*.sav")" ]; then - currentaction="Removing barren map save(s): ${serveridentitydir}/barren*.sav" - echo -en "Removing barren map saves barren*.sav file(s)..." - fn_sleep_time - fn_script_log "${currentaction}" - find "${serveridentitydir:?}" -type f -name "barren*.sav" -delete - fn_wipe_exit_code - fn_sleep_time - else - fn_print_information_nl "No barren map save to remove" - fn_script_log_info "No barren map save to remove." - fi - # Wipe user dir, might be a legacy thing, maybe to be removed. - if [ -d "${serveridentitydir}/user" ]; then - currentaction="Removing user directory: ${serveridentitydir}/user" - echo -en "Removing user directory..." - fn_sleep_time - fn_script_log "${currentaction}" - rm -rf "${serveridentitydir:?}/user" - fn_wipe_exit_code - fn_sleep_time - # We do not print additional information if there is nothing to remove since this might be obsolete. - fi - # Wipe storage dir, might be a legacy thing, maybe to be removed. - if [ -d "${serveridentitydir}/storage" ]; then - currentaction="Removing storage directory: ${serveridentitydir}/storage" - echo -en "Removing storage directory..." - fn_sleep_time - fn_script_log "${currentaction}" - rm -rf "${serveridentitydir:?}/storage" - fn_wipe_exit_code - fn_sleep_time - # We do not print additional information if there is nothing to remove since this might be obsolete. - fi - # Wipe sv.files. - if [ "$(find "${serveridentitydir}" -type f -name "sv.files.*.db")" ]; then - currentaction="Removing server misc files: ${serveridentitydir}/sv.files.*.db" - echo -en "Removing server misc srv.files*.db file(s)..." - fn_sleep_time - fn_script_log "${currentaction}" - find "${serveridentitydir:?}" -type f -name "sv.files.*.db" -delete - fn_wipe_exit_code - fn_sleep_time - # No further information if not found because it should I could not get this file showing up. - fi - # Wipe player death files. - if [ "$(find "${serveridentitydir}" -type f -name "player.deaths.*.db")" ]; then - currentaction="Removing player death files: ${serveridentitydir}/player.deaths.*.db" - echo -en "Removing player deaths player.deaths.*.db file(s)..." - fn_sleep_time - fn_script_log "${currentaction}" - find "${serveridentitydir:?}" -type f -name "player.deaths.*.db" -delete - fn_wipe_exit_code - fn_sleep_time - else - fn_print_information_nl "No player death to remove" - fn_script_log_info "No player death to remove." - fi - # Wipe blueprints only if wipeall command was used. - if [ "${wipeall}" == "1" ]; then - if [ "$(find "${serveridentitydir}" -type f -name "player.blueprints.*.db")" ]; then - currentaction="Removing blueprint file(s): ${serveridentitydir}/player.blueprints.*.db" - echo -en "Removing blueprints player.blueprints.*.db file(s)..." - fn_sleep_time - fn_script_log "${currentaction}" - find "${serveridentitydir:?}" -type f -name "player.blueprints.*.db" -delete - fn_wipe_exit_code - fn_sleep_time - else - fn_print_information_nl "No blueprint file to remove" - fn_script_log_info "No blueprint file to remove." - fi - elif [ "$(find "${serveridentitydir}" -type f -name "player.blueprints.*.db")" ]; then - fn_print_information_nl "Keeping blueprints" - fn_script_log_info "Keeping blueprints." - else - fn_print_information_nl "No blueprints found" - fn_script_log_info "No blueprints found." - fn_sleep_time - fi - # Wipe some logs that might be there. - if [ "$(find "${serveridentitydir}" -type f -name "Log.*.txt")" ]; then - currentaction="Removing log files: ${serveridentitydir}/Log.*.txt" - echo -en "Removing Log files..." - fn_sleep_time - fn_script_log "${currentaction}" - find "${serveridentitydir:?}" -type f -name "Log.*.txt" -delete - fn_wipe_exit_code - fn_sleep_time - # We do not print additional information if there are no logs to remove. - fi - # You can add an "elif" here to add another game or engine. - fi -} - -# Check if there is something to wipe, prompt the user, and call appropriate functions. -# Rust Wipe. -if [ "${shortname}" == "rust" ]; then - if [ -d "${serveridentitydir}/storage" ]||[ -d "${serveridentitydir}/user" ]||[ -n "$(find "${serveridentitydir}" -type f -name "proceduralmap*.sav")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "barren*.sav")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "Log.*.txt")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "player.deaths.*.db")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "player.blueprints.*.db")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "sv.files.*.db")" ]; then - fn_print_warning_nl "Any user, storage, log and map data from ${serveridentitydir} will be erased." - if ! fn_prompt_yn "Continue?" Y; then - core_exit.sh - fi - fn_script_log_info "User selects to erase any user, storage, log and map data from ${serveridentitydir}" - fn_sleep_time - fn_wipe_server_process - else - fn_print_information_nl "No data to wipe was found" - fn_script_log_info "No data to wipe was found." - core_exit.sh - fi -# You can add an "elif" here to add another game or engine. -else - # Game not listed. - fn_print_information_nl "Wipe is not available for this game" - fn_script_log_info "Wipe is not available for this game." - core_exit.sh -fi - -core_exit.sh diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh deleted file mode 100644 index 89ee784db..000000000 --- a/lgsm/functions/core_dl.sh +++ /dev/null @@ -1,336 +0,0 @@ -#!/bin/bash -# LinuxGSM core_dl.sh function -# Author: Daniel Gibbs -# Contributor: UltimateByte -# Website: https://linuxgsm.com -# Description: Deals with all downloads for LinuxGSM. - -# remote_fileurl: The URL of the file: http://example.com/dl/File.tar.bz2 -# local_filedir: location the file is to be saved: /home/server/lgsm/tmp -# local_filename: name of file (this can be different from the url name): file.tar.bz2 -# chmodx: Optional, set to "chmodx" to make file executable using chmod +x -# run: Optional, set run to execute the file after download -# forcedl: Optional, force re-download of file even if exists -# md5: Optional, set an md5 sum and will compare it against the file. -# -# Downloads can be defined in code like so: -# fn_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" -# fn_fetch_file "http://example.com/file.tar.bz2" "/some/dir" "file.tar.bz2" "chmodx" "run" "forcedl" "10cd7353aa9d758a075c600a6dd193fd" - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -# Emptys contents of the LinuxGSM tmpdir. -fn_clear_tmp(){ - echo -en "clearing LinuxGSM tmp directory..." - if [ -d "${tmpdir}" ]; then - rm -rf "${tmpdir:?}/"* - local exitcode=$? - if [ ${exitcode} -eq 0 ]; then - fn_print_ok_eol_nl - fn_script_log_pass "clearing LinuxGSM tmp directory" - else - fn_print_error_eol_nl - fn_script_log_error "clearing LinuxGSM tmp directory" - fi - fi -} - -fn_dl_md5(){ - # Runs MD5 Check if available. - if [ "${md5}" != "0" ]&&[ "${md5}" != "nomd5" ]; then - echo -en "verifying ${local_filename} with MD5..." - fn_sleep_time - md5sumcmd=$(md5sum "${local_filedir}/${local_filename}"|awk '{print $1;}') - if [ "${md5sumcmd}" != "${md5}" ]; then - fn_print_fail_eol_nl - echo -e "${local_filename} returned MD5 checksum: ${md5sumcmd}" - echo -e "expected MD5 checksum: ${md5}" - fn_script_log_fatal "Verifying ${local_filename} with MD5" - fn_script_log_info "${local_filename} returned MD5 checksum: ${md5sumcmd}" - fn_script_log_info "Expected MD5 checksum: ${md5}" - core_exit.sh - else - fn_print_ok_eol_nl - fn_script_log_pass "Verifying ${local_filename} with MD5" - fn_script_log_info "${local_filename} returned MD5 checksum: ${md5sumcmd}" - fn_script_log_info "Expected MD5 checksum: ${md5}" - fi - fi -} - -# Extracts bzip2, gzip or zip files. -# Extracts can be defined in code like so: -# fn_dl_extract "${local_filedir}" "${local_filename}" "${extractdir}" -# fn_dl_extract "/home/gameserver/lgsm/tmp" "file.tar.bz2" "/home/gamserver/serverfiles" -fn_dl_extract(){ - local_filedir="${1}" - local_filename="${2}" - extractdir="${3}" - # Extracts archives. - echo -en "extracting ${local_filename}..." - mime=$(file -b --mime-type "${local_filedir}/${local_filename}") - if [ ! -d "${extractdir}" ]; then - mkdir "${extractdir}" - fi - if [ "${mime}" == "application/gzip" ]||[ "${mime}" == "application/x-gzip" ]; then - extractcmd=$(tar -zxf "${local_filedir}/${local_filename}" -C "${extractdir}") - elif [ "${mime}" == "application/x-bzip2" ]; then - extractcmd=$(tar -jxf "${local_filedir}/${local_filename}" -C "${extractdir}") - elif [ "${mime}" == "application/x-xz" ]; then - extractcmd=$(tar -xf "${local_filedir}/${local_filename}" -C "${extractdir}") - elif [ "${mime}" == "application/zip" ]; then - extractcmd=$(unzip -qo -d "${extractdir}" "${local_filedir}/${local_filename}") - fi - local exitcode=$? - if [ ${exitcode} -ne 0 ]; then - fn_print_fail_eol_nl - fn_script_log_fatal "Extracting download" - if [ -f "${lgsmlog}" ]; then - echo -e "${extractcmd}" >> "${lgsmlog}" - fi - echo -e "${extractcmd}" - core_exit.sh - else - fn_print_ok_eol_nl - fn_script_log_pass "Extracting download" - fi -} - -# Trap to remove file download if canceled before completed. -fn_fetch_trap(){ - echo -e "" - echo -en "downloading ${local_filename}..." - fn_print_canceled_eol_nl - fn_script_log_info "Downloading ${local_filename}...CANCELED" - fn_sleep_time - 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 -} - -fn_fetch_file(){ - remote_fileurl="${1}" - remote_fileurl_backup="${2}" - remote_fileurl_name="${3}" - remote_fileurl_backup_name="${4}" - local_filedir="${5}" - local_filename="${6}" - chmodx="${7:-0}" - run="${8:-0}" - forcedl="${9:-0}" - md5="${10:-0}" - - # Download file if missing or download forced. - if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then - # If backup fileurl exists include it. - if [ -n "${remote_fileurl_backup}" ]; then - # counter set to 0 to allow second try - counter=0 - remote_fileurls_array=( remote_fileurl remote_fileurl_backup ) - else - # counter set to 1 to not allow second try - 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}" - fileurl_name="${remote_fileurl_name}" - elif [ "${remote_fileurl_array}" == "remote_fileurl_backup" ]; then - fileurl="${remote_fileurl_backup}" - fileurl_name="${remote_fileurl_backup_name}" - fi - counter=$((counter+1)) - if [ ! -d "${local_filedir}" ]; then - mkdir -p "${local_filedir}" - fi - # Trap will remove part downloaded files if canceled. - trap fn_fetch_trap INT - # Larger files show a progress bar. - if [ "${local_filename##*.}" == "bz2" ]||[ "${local_filename##*.}" == "gz" ]||[ "${local_filename##*.}" == "zip" ]||[ "${local_filename##*.}" == "jar" ]||[ "${local_filename##*.}" == "xz" ]; then - echo -en "downloading ${local_filename}..." - fn_sleep_time - echo -en "\033[1K" - curlcmd=$(curl --progress-bar --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}") - echo -en "downloading ${local_filename}..." - else - echo -en "fetching ${fileurl_name} ${local_filename}...\c" - curlcmd=$(curl -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) - fi - local exitcode=$? - - # 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 "${local_filedir:?}/${local_filename:?}" - local exitcode=2 - fi - fi - - # On first try will error. On second try will fail. - if [ ${exitcode} -ne 0 ]; then - if [ ${counter} -ge 2 ]; then - fn_print_fail_eol_nl - if [ -f "${lgsmlog}" ]; then - fn_script_log_fatal "Downloading ${local_filename}" - fn_script_log_fatal "${fileurl}" - fi - core_exit.sh - else - fn_print_error_eol_nl - if [ -f "${lgsmlog}" ]; then - fn_script_log_error "Downloading ${local_filename}" - fn_script_log_error "${fileurl}" - fi - fi - else - fn_print_ok_eol - sleep 0.3 - echo -en "\033[2K\\r" - if [ -f "${lgsmlog}" ]; then - fn_script_log_pass "Downloading ${local_filename}" - fi - - # Make file executable if chmodx is set. - if [ "${chmodx}" == "chmodx" ]; then - chmod +x "${local_filedir}/${local_filename}" - fi - - # Remove trap. - trap - INT - - break - fi - done - fi - - if [ -f "${local_filedir}/${local_filename}" ]; then - fn_dl_md5 - # Execute file if run is set. - if [ "${run}" == "run" ]; then - # shellcheck source=/dev/null - source "${local_filedir}/${local_filename}" - fi - fi -} - -# GitHub file download functions. -# Used to simplify downloading specific files from GitHub. - -# github_file_url_dir: the directory of the file in the GitHub: lgsm/functions -# github_file_url_name: the filename of the file to download from GitHub: core_messages.sh -# githuburl: the full GitHub url - -# remote_fileurl: The URL of the file: http://example.com/dl/File.tar.bz2 -# local_filedir: location the file is to be saved: /home/server/lgsm/tmp -# local_filename: name of file (this can be different from the url name): file.tar.bz2 -# chmodx: Optional, set to "chmodx" to make file executable using chmod +x -# run: Optional, set run to execute the file after download -# forcedl: Optional, force re-download of file even if exists -# md5: Optional, set an md5 sum and will compare it against the file. - -# Fetches files from the Git repo. -fn_fetch_file_github(){ - github_file_url_dir="${1}" - github_file_url_name="${2}" - if [ "${legacymode}" == "1" ]; then - # For legacy versions - code can be removed at a future date - 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}" - elif [ "${githubbranch}" == "master" ]&&[ "${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="${3}" - local_filename="${github_file_url_name}" - chmodx="${4:-0}" - run="${5:-0}" - forcedl="${6:-0}" - md5="${7:-0}" - # Passes vars to the file download function. - fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" -} - -# Fetches config files from the Git repo. -fn_fetch_config(){ - github_file_url_dir="${1}" - github_file_url_name="${2}" - if [ "${githubbranch}" == "master" ]&&[ "${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="${3}" - local_filename="${4}" - chmodx="nochmodx" - run="norun" - forcedl="noforce" - md5="nomd5" - # Passes vars to the file download function. - fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" -} - -# Fetches modules from the Git repo during first download. -fn_fetch_function(){ - github_file_url_dir="lgsm/functions" - github_file_url_name="${functionfile}" - if [ "${githubbranch}" == "master" ]&&[ "${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="${functionsdir}" - local_filename="${github_file_url_name}" - chmodx="chmodx" - run="run" - forcedl="noforce" - md5="nomd5" - # Passes vars to the file download function. - fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" -} - -# Fetches modules from the Git repo during update-lgsm. -fn_update_function(){ - github_file_url_dir="lgsm/functions" - github_file_url_name="${functionfile}" - if [ "${githubbranch}" == "master" ]&&[ "${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="${functionsdir}" - local_filename="${github_file_url_name}" - chmodx="chmodx" - run="norun" - forcedl="noforce" - md5="nomd5" - # Passes vars to the file download function. - fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" - -} - -# Check that curl is installed -if [ ! "$(command -v curl 2>/dev/null)" ]; then - echo -e "[ FAIL ] Curl is not installed" - exit 1 -fi diff --git a/lgsm/functions/core_exit.sh b/lgsm/functions/core_exit.sh deleted file mode 100644 index e2b439abd..000000000 --- a/lgsm/functions/core_exit.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# LinuxGSM core_exit.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Handles exiting of LinuxGSM by running and reporting an exit code. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_exit_dev_debug(){ - if [ -f "${rootdir}/.dev-debug" ]; then - echo -e "" - echo -e "${functionselfname} exiting with code: ${exitcode}" - if [ -f "${rootdir}/dev-debug.log" ]; then - grep "functionfile=" "${rootdir}/dev-debug.log" | sed 's/functionfile=//g' > "${rootdir}/dev-debug-function-order.log" - fi - fi -} - -# If running dependency check as root will remove any files that belong to root user. -if [ "$(whoami)" == "root" ]; then - find "${lgsmdir}"/ -group root -prune -exec rm -rf {} + > /dev/null 2>&1 - find "${logdir}"/ -group root -prune -exec rm -rf {} + > /dev/null 2>&1 -fi - -if [ "${exitbypass}" ]; then - unset exitbypass -elif [ "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then - # List LinuxGSM version in logs - fn_script_log_info "LinuxGSM version: ${version}" - if [ "${exitcode}" == "1" ]; then - fn_script_log_fatal "${functionselfname} exiting with code: ${exitcode}" - elif [ "${exitcode}" == "2" ]; then - fn_script_log_error "${functionselfname} exiting with code: ${exitcode}" - elif [ "${exitcode}" == "3" ]; then - fn_script_log_warn "${functionselfname} exiting with code: ${exitcode}" - else - fn_script_log_warn "${functionselfname} exiting with code: ${exitcode}" - fi - fn_exit_dev_debug - # remove trap. - trap - INT - exit "${exitcode}" -elif [ "${exitcode}" ]&&[ "${exitcode}" == "0" ]; then - # List LinuxGSM version in logs - fn_script_log_info "LinuxGSM version: ${version}" - fn_script_log_pass "${functionselfname} exiting with code: ${exitcode}" - fn_exit_dev_debug - # remove trap. - trap - INT - exit "${exitcode}" -else - # List LinuxGSM version in logs - fn_script_log_info "LinuxGSM version: ${version}" - fn_print_error "No exit code set" - fn_script_log_pass "${functionselfname} exiting with code: NOT SET" - fn_exit_dev_debug - # remove trap. - trap - INT - exit "${exitcode}" -fi diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh deleted file mode 100644 index 4b0387194..000000000 --- a/lgsm/functions/core_functions.sh +++ /dev/null @@ -1,750 +0,0 @@ -#!/bin/bash -# LinuxGSM core_functions.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Defines all functions to allow download and execution of functions using fn_fetch_function. -# This function is called first before any other function. Without this file other functions will not load. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -modulesversion="v20.3.3" - -# Core - -core_dl.sh(){ -functionfile="${FUNCNAME[0]}" -if [ "$(type fn_fetch_core_dl 2>/dev/null)" ]; then - fn_fetch_core_dl "lgsm/functions" "core_dl.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" -else - fn_bootstrap_fetch_file_github "lgsm/functions" "core_dl.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" -fi -} - -core_messages.sh(){ -functionfile="${FUNCNAME[0]}" -if [ "$(type fn_fetch_core_dl 2>/dev/null)" ]; then - fn_fetch_core_dl "lgsm/functions" "core_messages.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" -else - fn_bootstrap_fetch_file_github "lgsm/functions" "core_messages.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" -fi -} - -core_legacy.sh(){ -functionfile="${FUNCNAME[0]}" -if [ "$(type fn_fetch_core_dl 2>/dev/null)" ]; then - fn_fetch_core_dl "lgsm/functions" "core_legacy.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" -else - fn_bootstrap_fetch_file_github "lgsm/functions" "core_legacy.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" -fi -} - -core_exit.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -core_getopt.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -core_trap.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Commands - -command_backup.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_console.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_debug.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_details.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_donate.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_postdetails.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_test_alert.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_monitor.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_start.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_stop.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_validate.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_install.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_install_resources_mta.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_squad_license.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_mods_install.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_mods_update.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_mods_remove.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_fastdl.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_ts3_server_pass.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_restart.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_wipe.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Checks - -check.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_config.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_deps.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_executable.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_glibc.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_ip.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_last_update.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_logs.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_permissions.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_root.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_status.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_steamcmd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_system_dir.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_system_requirements.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_tmuxception.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -check_version.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Compress - -compress_unreal2_maps.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -compress_ut99_maps.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Mods - -mods_list.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -mods_core.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Dev - -command_dev_clear_functions.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_dev_debug.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_dev_detect_deps.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_dev_detect_glibc.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_dev_detect_ldd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_dev_query_raw.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Fix - -fix.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_ark.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_av.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_arma3.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_cmw.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_csgo.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_dst.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_ges.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_hw.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_ins.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_kf.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_kf2.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_mcb.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_mta.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_nmrih.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_onset.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_ro.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_rust.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_rw.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_sfc.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_steamcmd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_terraria.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_tf2.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_tu.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_ut3.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_rust.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_sdtd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_sof2.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_ss3.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_ts3.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_ut2k4.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_ut.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_unt.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_wurm.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fix_zmr.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Info - -info_stats.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -info_config.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -info_distro.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -info_gamedig.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -info_messages.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -info_parms.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Alert - -alert.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -alert_discord.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -alert_email.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -alert_ifttt.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -alert_mailgun.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -alert_pushbullet.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -alert_pushover.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -alert_telegram.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -alert_slack.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} -# Logs - -core_logs.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Query - -query_gamedig.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Update - -command_update_functions.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_update_linuxgsm.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -command_update.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -update_ts3.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -update_minecraft.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -update_minecraft_bedrock.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -update_mumble.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -update_mta.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -update_factorio.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -update_steamcmd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -fn_update_functions.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# -## Installer functions -# - -fn_autoinstall(){ -autoinstall=1 -command_install.sh -} - -install_complete.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_config.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_factorio_save.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_dst_token.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_eula.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_gsquery.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_gslt.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_header.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_logs.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_retry.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_server_dir.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} -install_server_files.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_stats.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_steamcmd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_ts3.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_ts3db.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_ut2k4.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_dl_ut2k4.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -install_ut2k4_key.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -# Calls code required for legacy servers -core_legacy.sh - -# Creates tmp dir if missing -if [ ! -d "${tmpdir}" ]; then - mkdir -p "${tmpdir}" -fi - -# Creates lock dir if missing -if [ ! -d "${lockdir}" ]; then - mkdir -p "${lockdir}" -fi - -# Calls on-screen messages (bootstrap) -core_messages.sh - -#Calls file downloader (bootstrap) -core_dl.sh - -# Calls the global Ctrl-C trap -core_trap.sh diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh deleted file mode 100644 index 1ddc15ce2..000000000 --- a/lgsm/functions/core_getopt.sh +++ /dev/null @@ -1,203 +0,0 @@ -#!/bin/bash -# LinuxGSM core_getopt.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: getopt arguments. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -### Define all commands here. -## User commands | Trigger commands | Description -# Standard commands. -cmd_install=( "i;install" "command_install.sh" "Install the server." ) -cmd_auto_install=( "ai;auto-install" "fn_autoinstall" "Install the server without prompts." ) -cmd_start=( "st;start" "command_start.sh" "Start the server." ) -cmd_stop=( "sp;stop" "command_stop.sh" "Stop the server." ) -cmd_restart=( "r;restart" "command_restart.sh" "Restart the server." ) -cmd_details=( "dt;details" "command_details.sh" "Display server information." ) -cmd_postdetails=( "pd;postdetails" "command_postdetails.sh" "Post details to termbin.com (removing passwords)." ) -cmd_backup=( "b;backup" "command_backup.sh" "Create backup archives of the server." ) -cmd_update_linuxgsm=( "ul;update-lgsm;uf;update-functions" "command_update_linuxgsm.sh" "Check and apply any LinuxGSM updates." ) -cmd_test_alert=( "ta;test-alert" "command_test_alert.sh" "Send a test alert." ) -cmd_monitor=( "m;monitor" "command_monitor.sh" "Check server status and restart if crashed." ) -cmd_donate=( "do;donate" "command_donate.sh" "Donation options." ) -# Console servers only. -cmd_console=( "c;console" "command_console.sh" "Access server console." ) -cmd_debug=( "d;debug" "command_debug.sh" "Start server directly in your terminal." ) -# Update servers only. -cmd_update=( "u;update" "command_update.sh" "Check and apply any server updates." ) -cmd_force_update=( "fu;force-update;update-restart;ur" "forceupdate=1; command_update.sh" "Apply server updates bypassing check." ) -# SteamCMD servers only. -cmd_validate=( "v;validate" "command_validate.sh" "Validate server files with SteamCMD." ) -# Server with mods-install. -cmd_mods_install=( "mi;mods-install" "command_mods_install.sh" "View and install available mods/addons." ) -cmd_mods_remove=( "mr;mods-remove" "command_mods_remove.sh" "View and remove an installed mod/addon." ) -cmd_mods_update=( "mu;mods-update" "command_mods_update.sh" "Update installed mods/addons." ) -# Server specific. -cmd_change_password=( "pw;change-password" "command_ts3_server_pass.sh" "Change TS3 serveradmin password." ) -cmd_install_default_resources=( "ir;install-default-resources" "command_install_resources_mta.sh" "Install the MTA default resources." ) -cmd_wipe=( "wi;wipe" "command_wipe.sh" "Wipe your main game server data." ) -cmd_wipeall=( "wa;wipeall" "wipeall=1; command_wipe.sh" "Wipe your game server data and blueprints." ) -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_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." ) -cmd_fastdl=( "fd;fastdl" "command_fastdl.sh" "Build a FastDL directory." ) -# Dev commands. -cmd_dev_debug=( "dev;developer" "command_dev_debug.sh" "Enable developer Mode." ) -cmd_dev_detect_deps=( "dd;detect-deps" "command_dev_detect_deps.sh" "Detect required dependencies." ) -cmd_dev_detect_glibc=( "dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect required glibc." ) -cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect required dynamic dependencies." ) -cmd_dev_query_raw=( "qr;query-raw" "command_dev_query_raw.sh" "The raw output of gamedig and gsquery." ) -cmd_dev_clear_functions=( "cf;clear-functions" "command_dev_clear_functions.sh" "Delete the contents of the functions dir." ) - - -### Set specific opt here. - -currentopt=( "${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monitor[@]}" "${cmd_test_alert[@]}" "${cmd_details[@]}" "${cmd_postdetails[@]}" ) - -# Update LGSM. -currentopt+=( "${cmd_update_linuxgsm[@]}" ) - -# Exclude noupdate games here. -if [ "${engine}" != "quake" ]&&[ "${engine}" != "idtech2" ]&&[ "${engine}" != "idtech3" ]&&[ "${engine}" != "iw2.0" ]&&[ "${engine}" != "iw3.0" ]&&[ "${shortname}" != "bf1942" ]&&[ "${shortname}" != "samp" ]; then - currentopt+=( "${cmd_update[@]}" ) - # force update for SteamCMD only or MTA. - if [ "${appid}" ]||[ "${shortname}" == "mta" ]; then - currentopt+=( "${cmd_force_update[@]}" ) - fi -fi - -# Validate command. -if [ "${appid}" ]; then - currentopt+=( "${cmd_validate[@]}" ) -fi - -# Backup. -currentopt+=( "${cmd_backup[@]}" ) - -# Console & Debug -currentopt+=( "${cmd_console[@]}" "${cmd_debug[@]}" ) - -## Game server exclusive commands. - -# FastDL command. -if [ "${engine}" == "source" ]; then - currentopt+=( "${cmd_fastdl[@]}" ) -fi - -# TeamSpeak exclusive. -if [ "${shortname}" == "ts3" ]; then - currentopt+=( "${cmd_change_password[@]}" ) -fi - -# Unreal exclusive. -if [ "${shortname}" == "rust" ]; then - currentopt+=( "${cmd_wipe[@]}" "${cmd_wipeall[@]}" ) -fi -if [ "${engine}" == "unreal2" ]; then - if [ "${shortname}" == "ut2k4" ]; then - currentopt+=( "${cmd_install_cdkey[@]}" "${cmd_map_compressor_u2[@]}" ) - else - currentopt+=( "${cmd_map_compressor_u2[@]}" ) - fi -fi -if [ "${engine}" == "unreal" ]; then - currentopt+=( "${cmd_map_compressor_u99[@]}" ) -fi - -# DST exclusive. -if [ "${shortname}" == "dst" ]; then - currentopt+=( "${cmd_install_dst_token[@]}" ) -fi - -# MTA exclusive. -if [ "${shortname}" == "mta" ]; then - currentopt+=( "${cmd_install_default_resources[@]}" ) -fi - -# Squad license exclusive. -if [ "${shortname}" == "squad" ]; then - currentopt+=( "${cmd_install_squad_license[@]}" ) -fi - -## Mods commands. -if [ "${engine}" == "source" ]||[ "${shortname}" == "rust" ]||[ "${shortname}" == "hq" ]||[ "${shortname}" == "sdtd" ]; then - currentopt+=( "${cmd_mods_install[@]}" "${cmd_mods_remove[@]}" "${cmd_mods_update[@]}" ) -fi - -## Installer. -currentopt+=( "${cmd_install[@]}" "${cmd_auto_install[@]}" ) - -## Developer commands. -currentopt+=( "${cmd_dev_debug[@]}" ) -if [ -f ".dev-debug" ]; then - currentopt+=( "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_clear_functions[@]}" ) -fi - -## Donate. -currentopt+=( "${cmd_donate[@]}" ) - -### Build list of available commands. -optcommands=() -index="0" -for ((index="0"; index < ${#currentopt[@]}; index+=3)); do - cmdamount=$(echo -e "${currentopt[index]}" | awk -F ';' '{ print NF }') - for ((cmdindex=1; cmdindex <= cmdamount; cmdindex++)); do - optcommands+=( "$(echo -e "${currentopt[index]}" | awk -F ';' -v x=${cmdindex} '{ print $x }')" ) - done -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}" - # 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]}" - fi - done - } | column -s $'\t' -t - fn_script_log_pass "Display commands" - core_exit.sh -} - -# Check if command existw and run corresponding scripts, or display script usage. -if [ -z "${getopt}" ]; then - fn_opt_usage -fi -# If command exists. -for i in "${optcommands[@]}"; do - if [ "${i}" == "${getopt}" ] ; then - # Seek and run command. - index="0" - for ((index="0"; index < ${#currentopt[@]}; index+=3)); do - currcmdamount=$(echo -e "${currentopt[index]}" | awk -F ';' '{ print NF }') - for ((currcmdindex=1; currcmdindex <= currcmdamount; currcmdindex++)); do - if [ "$(echo -e "${currentopt[index]}" | awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then - # Run command. - eval "${currentopt[index+1]}" - # Exit should occur in modules. Should this not happen print an error - fn_print_error2_nl "Command did not exit correctly: ${getopt}" - fn_script_log_error "Command did not exit correctly: ${getopt}" - core_exit.sh - fi - done - done - fi -done - -# If we're executing this, it means command was not found. -fn_print_error2_nl "Unknown command: $0 ${getopt}" -fn_script_log_error "Unknown command: $0 ${getopt}" -fn_opt_usage -core_exit.sh diff --git a/lgsm/functions/core_legacy.sh b/lgsm/functions/core_legacy.sh deleted file mode 100644 index 3450d5842..000000000 --- a/lgsm/functions/core_legacy.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -# LinuxGSM core_legacy.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Code for backwards compatability with older versions of LinuxGSM. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -# This is to help the transition to v20.3.0 and above -legacy_versions_array=( v20.2.1 v20.2.0 v20.1.5 v20.1.4 v20.1.3 v20.1.2 v20.1.1 v20.1.0 v19.12.5 v19.12.4 v19.12.3 v19.12.2 v19.12.1 v19.12.0 ) -for legacy_version in "${legacy_versions_array[@]}" -do - if [ "${version}" == "${legacy_version}" ]; then - legacymode=1 - fi -done - -if [ -z "${serverfiles}" ]; then - serverfiles="${filesdir}" -fi - -if [ -z "${logdir}" ]; then - logdir="${rootdir}/log" -fi - -if [ -z "${lgsmlogdir}" ]; then - lgsmlogdir="${scriptlogdir}" -fi - -if [ -z "${lgsmlog}" ]; then - lgsmlog="${scriptlog}" -fi - -if [ -z "${lgsmlogdate}" ]; then - lgsmlogdate="${scriptlogdate}" -fi - -if [ -z "${steamcmddir}" ]; then - steamcmddir="${HOME}/.steam/steamcmd" -fi - -if [ -z "${lgsmdir}" ]; then - lgsmdir="${rootdir}/lgsm" -fi - -if [ -z "${tmpdir}" ]; then - tmpdir="${lgsmdir}/tmp" -fi - -if [ -z "${alertlog}" ]; then - alertlog="${emaillog}" -fi - -if [ -z "${servicename}" ]; then - servicename="${selfname}" -fi - -# Alternations to workshop variables. -if [ -z "${wsapikey}" ]; then - if [ "${workshopauth}" ]; then - wsapikey="${workshopauth}" - elif [ "${authkey}" ]; then - wsapikey="${authkey}" - fi -fi - -if [ -z "${wscollectionid}" ]; then - if [ "${workshopauth}" ]; then - wscollectionid="${ws_collection_id}" - elif [ "${authkey}" ]; then - wscollectionid="${workshopcollectionid}" - fi -fi - -if [ -z "${wsstartmap}" ]; then - if [ "${ws_start_map}" ]; then - wscollectionid="${ws_start_map}" - fi -fi diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh deleted file mode 100644 index 8a13cc6ea..000000000 --- a/lgsm/functions/core_messages.sh +++ /dev/null @@ -1,531 +0,0 @@ -#!/bin/bash -# LinuxGSM core_messages.sh function -# Author: Daniel Gibbs -# Contributor: s-eam -# Website: https://linuxgsm.com -# Description: Defines on-screen messages such as [ OK ] and how script logs look. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -# nl: new line: message is following by a new line. -# eol: end of line: message is placed at the end of the current line. -fn_ansi_loader(){ - if [ "${ansi}" != "off" ]; then - # echo colors - default="\e[0m" - black="\e[30m" - red="\e[31m" - lightred="\e[91m" - green="\e[32m" - lightgreen="\e[92m" - yellow="\e[33m" - lightyellow="\e[93m" - blue="\e[34m" - lightblue="\e[94m" - magenta="\e[35m" - lightmagenta="\e[95m" - cyan="\e[36m" - lightcyan="\e[96m" - darkgrey="\e[90m" - lightgrey="\e[37m" - white="\e[97m" - fi - # carriage return & erase to end of line. - creeol="\r\033[K" -} - -fn_sleep_time(){ - if [ "${sleeptime}" != "0" ]||[ "${travistest}" != "1" ]; then - if [ -z "${sleeptime}" ]; then - sleeptime=0.5 - fi - sleep "${sleeptime}" - fi -} - -# Log display -######################## -## Feb 28 14:56:58 ut99-server: Monitor: -fn_script_log(){ - if [ -d "${lgsmlogdir}" ]; then - if [ -n "${commandname}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: ${1}" >> "${lgsmlog}" - else - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${1}" >> "${lgsmlog}" - fi - fi -} - -## 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 - exitcode=0 -} - -## Feb 28 14:56:58 ut99-server: Monitor: FATAL: -fn_script_log_fatal(){ - 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 - 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 - 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 - 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: INFO: -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 -} - -# On-Screen - Automated functions -################################## - -# [ .... ] -fn_print_dots(){ - if [ "${commandaction}" ]; then - echo -en "${creeol}[ .... ] ${commandaction} ${selfname}: $*" - else - echo -en "${creeol}[ .... ] $*" - fi - fn_sleep_time -} - -fn_print_dots_nl(){ - if [ "${commandaction}" ]; then - echo -e "${creeol}[ .... ] ${commandaction} ${selfname}: $*" - else - echo -e "${creeol}[ .... ] $*" - fi - fn_sleep_time - 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_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" -} - -# [ 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_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" -} - -# [ 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_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" -} - -# [ 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_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" -} - -# [ 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_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" -} - -# [ 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_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" -} - -# On-Screen - Interactive messages -################################## - -# No More Room in Hell Debug -# ================================= -fn_print_header(){ - echo -e "" - echo -e "${lightyellow}${gamename} ${commandaction}${default}" - echo -e "=================================${default}" -} - -# Complete! -fn_print_complete(){ - echo -en "${green}Complete!${default} $*" - fn_sleep_time -} - -fn_print_complete_nl(){ - echo -e "${green}Complete!${default} $*" - fn_sleep_time -} - -# Failure! -fn_print_failure(){ - echo -en "${red}Failure!${default} $*" - fn_sleep_time -} - -fn_print_failure_nl(){ - echo -e "${red}Failure!${default} $*" - fn_sleep_time -} - -# Error! -fn_print_error2(){ - echo -en "${red}Error!${default} $*" - fn_sleep_time -} - -fn_print_error2_nl(){ - echo -e "${red}Error!${default} $*" - fn_sleep_time -} - -# Warning! -fn_print_warning(){ - echo -en "${lightyellow}Warning!${default} $*" - fn_sleep_time -} - -fn_print_warning_nl(){ - echo -e "${lightyellow}Warning!${default} $*" - fn_sleep_time -} - -# Information! -fn_print_information(){ - echo -en "${cyan}Information!${default} $*" - fn_sleep_time -} - -fn_print_information_nl(){ - echo -e "${cyan}Information!${default} $*" - fn_sleep_time -} - -# Y/N Prompt -fn_prompt_yn(){ - local prompt="$1" - local initial="$2" - - if [ "${initial}" == "Y" ]; then - prompt+=" [Y/n] " - elif [ "${initial}" == "N" ]; then - prompt+=" [y/N] " - else - prompt+=" [y/n] " - fi - - while true; do - read -e -i "${initial}" -p "${prompt}" -r yn - case "${yn}" in - [Yy]|[Yy][Ee][Ss]) return 0 ;; - [Nn]|[Nn][Oo]) return 1 ;; - *) echo -e "Please answer yes or no." ;; - esac - done -} - -# On-Screen End of Line -################################## - -# OK -fn_print_ok_eol(){ - echo -en "${green}OK${default}" - fn_sleep_time -} - -fn_print_ok_eol_nl(){ - echo -e "${green}OK${default}" - fn_sleep_time -} - -# FAIL -fn_print_fail_eol(){ - echo -en "${red}FAIL${default}" - fn_sleep_time -} - -fn_print_fail_eol_nl(){ - echo -e "${red}FAIL${default}" - fn_sleep_time -} - -# ERROR -fn_print_error_eol(){ - echo -en "${red}ERROR${default}" - fn_sleep_time -} - -fn_print_error_eol_nl(){ - echo -e "${red}ERROR${default}" - fn_sleep_time -} - -# WAIT -fn_print_wait_eol(){ - echo -en "${cyan}WAIT${default}" - fn_sleep_time -} - -fn_print_wait_eol_nl(){ - echo -e "${cyan}WAIT${default}" - fn_sleep_time -} - -# WARN -fn_print_warn_eol(){ - echo -en "${lightyellow}WARN${default}" - fn_sleep_time -} - -fn_print_warn_eol_nl(){ - echo -e "${lightyellow}WARN${default}" - fn_sleep_time -} - -# INFO -fn_print_info_eol(){ - echo -en "${cyan}INFO${default}" - fn_sleep_time -} - -fn_print_info_eol_nl(){ - echo -e "${cyan}INFO${default}" - fn_sleep_time -} - -# QUERYING -fn_print_querying_eol(){ - echo -en "${cyan}QUERYING${default}" - fn_sleep_time -} - -fn_print_querying_eol_nl(){ - echo -e "${cyan}QUERYING${default}" - fn_sleep_time -} - -# CHECKING -fn_print_checking_eol(){ - echo -en "${cyan}CHECKING${default}" - fn_sleep_time -} - -fn_print_checking_eol_nl(){ - echo -e "${cyan}CHECKING${default}" - fn_sleep_time -} - -# DELAY -fn_print_delay_eol(){ - echo -en "${green}DELAY${default}" - fn_sleep_time -} - -fn_print_delay_eol_nl(){ - echo -e "${green}DELAY${default}" - fn_sleep_time -} - -# CANCELED -fn_print_canceled_eol(){ - echo -en "${lightyellow}CANCELED${default}" - fn_sleep_time -} - -fn_print_canceled_eol_nl(){ - echo -e "${lightyellow}CANCELED${default}" - fn_sleep_time -} - -# REMOVED -fn_print_removed_eol(){ - echo -en "${red}REMOVED${default}" - fn_sleep_time -} - -fn_print_removed_eol_nl(){ - echo -e "${red}REMOVED${default}" - fn_sleep_time -} - -# UPDATE -fn_print_update_eol(){ - echo -en "${cyan}UPDATE${default}" - fn_sleep_time -} - -fn_print_update_eol_nl(){ - echo -e "${cyan}UPDATE${default}" - fn_sleep_time -} - -fn_print_ascii_logo(){ - echo -e "" - echo -e " mdMMMMbm" - echo -e " mMMMMMMMMMMm" - echo -e " mMMMMMMMMMMMMm" - echo -e " mMMMMMMMMMMMMMMm" - echo -e " hMMMV^VMMV^VMMMh" - echo -e " MMMMM MM MMMMM" - echo -e " hMMs vv sMMh" - echo -e " hMMM: :MMMh" - echo -e " .hMMMh hMMMh." - echo -e " -dMMMh ${lightgrey}__${default} hMMMd-" - echo -e " :mMMMs ${lightgrey}||${default} sMMMm:" - echo -e " :MMMM+ ${lightgrey}||${default} ${red}_${default} +NMMN:" - echo -e " .mMMM+ ${lightgrey}========${default} +MMMm." - echo -e " yMMMy ${darkgrey}##############${default} yMMMy" - echo -e " mMMM: ${darkgrey}##############${default} :MMMm" - echo -e " mMM ${lightyellow}nn${default} ${lightyellow}nn${default} ${lightyellow}nn${default} ${lightyellow}nn${default} MMm" - echo -e " o ${lightyellow}nNNNNNNNn${default} ${lightyellow}nNNNNNNNn${default} o" - echo -e " ${lightyellow}nNNNNNNNNNn${default} ${lightyellow}nNNNNNNNNNn${default}" - echo -e " ${lightyellow}nNNNNNNNNNNN${default} ${lightyellow}NNNNNNNNNNNn${default}" - echo -e " ${lightyellow}+NNNNNNNNN:${default} ${lightyellow}:NNNNNNNNN+${default}" - echo -e " ${lightyellow}nNNNNNNN${default} /\ ${lightyellow}NNNNNNNn${default}" - echo -e " ${lightyellow}nnnnn${default} db ${lightyellow}nnnnn${default}" - echo -e "" - echo -e "${lightyellow}888${default} ${lightyellow}d8b${default} ${default}.d8888b. .d8888b. 888b d888" - echo -e "${lightyellow}888 Y8P ${default}d88P Y88b d88P Y88b 8888b d8888" - echo -e "${lightyellow}888${default} ${default}888${default} 888 Y88b. 88888b.d88888" - echo -e "${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}88888b.${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} 888 Y888b. 888Y88888P888" - echo -e "${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}88b${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}Y8bd8P${default} 888 88888 Y88b. 888 Y888P 888" - echo -e "${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}X88K${default} 888 888 888 888 Y8P 888" - echo -e "${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}Y88b${default} ${lightyellow}88Y${default} ${lightyellow}.d8pq8b.${default} Y88b d88P Y88b d88P 888 * 888" - echo -e "${lightyellow}LinuxGSM${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}Y8888Y${default} ${lightyellow}888${default} ${lightyellow}888${default} Y2012P88 Y8888P 888 888" - echo -e "" -} diff --git a/lgsm/functions/core_trap.sh b/lgsm/functions/core_trap.sh deleted file mode 100644 index f943c5c33..000000000 --- a/lgsm/functions/core_trap.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# LinuxGSM core_trap.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Handles CTRL-C trap to give an exit code. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_exit_trap(){ - echo -e "" - core_exit.sh -} - -# trap to give an exit code. -trap fn_exit_trap INT diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh deleted file mode 100644 index a42f0e51d..000000000 --- a/lgsm/functions/fix.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/bash -# LinuxGSM fix.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Overall function for managing fixes. -# Runs functions that will fix an issue. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -# Messages that are displayed for some fixes. -fn_fix_msg_start(){ - fn_print_dots "Applying ${fixname} fix: ${gamename}" - fn_print_info "Applying ${fixname} fix: ${gamename}" - fn_script_log_info "Applying ${fixname} fix: ${gamename}" -} - -fn_fix_msg_start_nl(){ - fn_print_dots "Applying ${fixname} fix: ${gamename}" - fn_print_info "Applying ${fixname} fix: ${gamename}" - fn_script_log_info "Applying ${fixname} fix: ${gamename}" -} - -fn_fix_msg_end(){ - if [ $? -ne 0 ]; then - fn_print_error_nl "Applying ${fixname} fix: ${gamename}" - fn_script_log_error "Applying ${fixname} fix: ${gamename}" - else - fn_print_ok_nl "Applying ${fixname} fix: ${gamename}" - fn_script_log_pass "Applying ${fixname} fix: ${gamename}" - fi -} - -# Fixes that are run on start. -if [ "${commandname}" != "INSTALL" ]&&[ -z "${fixbypass}" ]; then - if [ "${appid}" ]; then - fix_steamcmd.sh - fi - - if [ "${shortname}" == "arma3" ]; then - fix_arma3.sh - elif [ "${shortname}" == "ark" ]; then - fix_ark.sh - elif [ "${shortname}" == "csgo" ]; then - fix_csgo.sh - elif [ "${shortname}" == "cmw" ]; then - fix_cmw.sh - elif [ "${shortname}" == "dst" ]; then - fix_dst.sh - elif [ "${shortname}" == "ges" ]; then - fix_ges.sh - elif [ "${shortname}" == "hw" ]; then - fix_hw.sh - elif [ "${shortname}" == "ins" ]; then - fix_ins.sh - elif [ "${shortname}" == "nmrih" ]; then - fix_nmrih.sh - elif [ "${shortname}" == "onset" ]; then - fix_onset.sh - elif [ "${shortname}" == "rust" ]; then - fix_rust.sh - elif [ "${shortname}" == "rw" ]; then - fix_rw.sh - elif [ "${shortname}" == "sdtd" ]; then - fix_sdtd.sh - elif [ "${shortname}" == "sfc" ]; then - fix_sfc.sh - elif [ "${shortname}" == "sof2" ]; then - fix_sof2.sh - elif [ "${shortname}" == "ss3" ]; then - fix_ss3.sh - elif [ "${shortname}" == "tf2" ]; then - fix_tf2.sh - elif [ "${shortname}" == "terraria" ]; then - fix_terraria.sh - elif [ "${shortname}" == "ts3" ]; then - fix_ts3.sh - elif [ "${shortname}" == "tu" ]; then - fix_tu.sh - elif [ "${shortname}" == "mcb" ]; then - fix_mcb.sh - elif [ "${shortname}" == "mta" ]; then - fix_mta.sh - elif [ "${shortname}" == "unt" ]; then - fix_unt.sh - elif [ "${shortname}" == "wurm" ]; then - fix_wurm.sh - elif [ "${shortname}" == "zmr" ]; then - fix_zmr.sh - fi -fi - -# Fixes that are run on install only. -if [ "${commandname}" == "INSTALL" ]; then - if [ "${shortname}" == "av" ]||[ "${shortname}" == "cmw" ]||[ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "onset" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then - echo -e "" - echo -e "Applying Post-Install Fixes" - echo -e "=================================" - fn_sleep_time - postinstall=1 - if [ "${shortname}" == "av" ]; then - fix_av.sh - elif [ "${shortname}" == "kf" ]; then - fix_kf.sh - elif [ "${shortname}" == "kf2" ]; then - fix_kf2.sh - elif [ "${shortname}" == "ro" ]; then - fix_ro.sh - elif [ "${shortname}" == "ut2k4" ]; then - fix_ut2k4.sh - elif [ "${shortname}" == "ut" ]; then - fix_ut.sh - elif [ "${shortname}" == "ut3" ]; then - fix_ut3.sh - else - fn_print_information_nl "No fixes required." - fi - fi -fi diff --git a/lgsm/functions/fix_arma3.sh b/lgsm/functions/fix_arma3.sh deleted file mode 100644 index f71fcde7b..000000000 --- a/lgsm/functions/fix_arma3.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_arma3.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves an issue with ARMA3. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -# Fixes: 20150 Segmentation fault (core dumped) error. -if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3" ]||[ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3 - Other Profiles" ]; then - fixname="20150 Segmentation fault (core dumped)" - fn_fix_msg_start - mkdir -p "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3 - Other Profiles" - fn_fix_msg_end -fi diff --git a/lgsm/functions/fix_av.sh b/lgsm/functions/fix_av.sh deleted file mode 100644 index bf9ff2b4b..000000000 --- a/lgsm/functions/fix_av.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_av.sh function -# Author: Christian Birk -# Website: https://linuxgsm.com -# Description: Resolves startup issue with Avorion - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" - -if [ "${postinstall}" == "1" ]; then - fn_parms(){ - parms="--datapath ${avdatapath} --galaxy-name ${avgalaxy} --init-folders-only" - } - - fn_print_information "starting ${gamename} server to generate configs." - fn_sleep_time - # go to the executeable dir and start the init of the server - cd "${systemdir}" || return 2 - fn_parms - "${executabledir}/${executable}" ${parms} -fi diff --git a/lgsm/functions/fix_cmw.sh b/lgsm/functions/fix_cmw.sh deleted file mode 100644 index 7dc502be6..000000000 --- a/lgsm/functions/fix_cmw.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_cmw.sh function -# Author: Christian Birk -# Website: https://linuxgsm.com -# Description: Resolves the issue of the not starting server on linux - -fixname="steam_appid.txt" - -if [ ! -f "${executabledir}/steam_appid.txt" ]; then - fn_fix_msg_start - echo 219640 > "${executabledir}/steam_appid.txt" - fn_fix_msg_end -fi - - -if [ ! -f "${executabledir}/lib/steamclient.so" ]; then - fixname="steamclient.so" - fn_fix_msg_start - if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then - cp "${steamcmddir}/linux32/steamclient.so" "${executabledir}/lib/steamclient.so" - elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then - cp "${steamcmddir}/linux32/steamclient.so" "${executabledir}/lib/steamclient.so" - fi - fn_fix_msg_end -fi - -if [ ! -f "${servercfgfullpath}" ]; then - fn_fix_msg_start - fixname="copy config" - mkdir "${servercfgdir}" - cp "${systemdir}/UDKGame/Config/"*.ini "${servercfgdir}" - fn_fix_msg_end -fi diff --git a/lgsm/functions/fix_ges.sh b/lgsm/functions/fix_ges.sh deleted file mode 100644 index 6065f9ba8..000000000 --- a/lgsm/functions/fix_ges.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_ges.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves various issues with GoldenEye: Source. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -# Fixes: MALLOC_CHECK_ needing to be set to 0. -export MALLOC_CHECK_=0 diff --git a/lgsm/functions/fix_hw.sh b/lgsm/functions/fix_hw.sh deleted file mode 100644 index 6230f7b46..000000000 --- a/lgsm/functions/fix_hw.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_hw.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves various issues with Hurtworld. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -if [ "${shortname}" == "hw" ]; then - # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. - if [ ! -f "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" ]; then - fixname="steamclient.so x86" - fn_fix_msg_start - if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then - cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" >> "${lgsmlog}" - elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then - cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" >> "${lgsmlog}" - else - : - fi - fn_fix_msg_end - fi - if [ ! -f "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" ]; then - fixname="steamclient.so x86_64" - fn_fix_msg_start - if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then - cp "${steamcmddir}/linux64/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" >> "${lgsmlog}" - elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then - cp "${steamcmddir}/linux64/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" >> "${lgsmlog}" - else - : - fi - fn_fix_msg_end - fi -fi diff --git a/lgsm/functions/fix_kf.sh b/lgsm/functions/fix_kf.sh deleted file mode 100644 index f0c29ee6f..000000000 --- a/lgsm/functions/fix_kf.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_kf.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves various issues with Killing Floor. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -echo -e "Applying WebAdmin ROOst.css fix." -echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" -sed -i 's/none}/none;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" -sed -i 's/underline}/underline;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" -fn_sleep_time -echo -e "Applying WebAdmin CharSet fix." -echo -e "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" -sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/UWeb.int" -fn_sleep_time -echo -e "applying server name fix." -fn_sleep_time -echo -e "forcing server restart..." -fn_sleep_time -exitbypass=1 -command_start.sh -sleep 5 -exitbypass=1 -command_stop.sh -exitbypass=1 -command_start.sh -sleep 5 -exitbypass=1 -command_stop.sh diff --git a/lgsm/functions/fix_kf2.sh b/lgsm/functions/fix_kf2.sh deleted file mode 100644 index 77edd77e8..000000000 --- a/lgsm/functions/fix_kf2.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_kf2.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves various issues with Killing Floor 2. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_parms(){ -parms="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\"" -} - -fn_print_information "starting ${gamename} server to generate configs." -fn_sleep_time -exitbypass=1 -command_start.sh -sleep 10 -exitbypass=1 -command_stop.sh diff --git a/lgsm/functions/fix_nmrih.sh b/lgsm/functions/fix_nmrih.sh deleted file mode 100644 index 2c9d8c743..000000000 --- a/lgsm/functions/fix_nmrih.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_nmrih.sh function -# Author: Denperidge -# Description: Create symlinks for renamed No More Room In Hell serverfiles. -# Solution from Steam Community post: https://steamcommunity.com/app/224260/discussions/2/1732089092441769414/ - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -ln -s "${serverfiles}/bin/vphysics_srv.so" "${serverfiles}/bin/vphysics.so" -ln -s "${serverfiles}/bin/studiorender_srv.so" "${serverfiles}/bin/studiorender.so" -ln -s "${serverfiles}/bin/soundemittersystem_srv.so" "${serverfiles}/bin/soundemittersystem.so" -ln -s "${serverfiles}/bin/shaderapiempty_srv.so" "${serverfiles}/bin/shaderapiempty.so" -ln -s "${serverfiles}/bin/scenefilecache_srv.so" "${serverfiles}/bin/scenefilecache.so" -ln -s "${serverfiles}/bin/replay_srv.so" "${serverfiles}/bin/replay.so" -ln -s "${serverfiles}/bin/materialsystem_srv.so" "${serverfiles}/bin/materialsystem.so" diff --git a/lgsm/functions/fix_ro.sh b/lgsm/functions/fix_ro.sh deleted file mode 100644 index 9f08d56d7..000000000 --- a/lgsm/functions/fix_ro.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_ro.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves various issues with Red Orchestra. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -echo -e "Applying WebAdmin ROOst.css fix." -echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" -sed -i 's/none}/none;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" -sed -i 's/underline}/underline;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" -fn_sleep_time -echo -e "Applying WebAdmin CharSet fix." -echo -e "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" -sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/uweb.int" -fn_sleep_time -echo -e "Applying Steam AppID fix." -sed -i 's/1210/1200/g' "${systemdir}/steam_appid.txt" -fn_sleep_time -echo -e "applying server name fix." -fn_sleep_time -echo -e "forcing server restart..." -fn_sleep_time -exitbypass=1 -command_start.sh -sleep 5 -exitbypass=1 -command_stop.sh -exitbypass=1 -command_start.sh -sleep 5 -exitbypass=1 -command_stop.sh diff --git a/lgsm/functions/fix_rust.sh b/lgsm/functions/fix_rust.sh deleted file mode 100644 index 9ceff7b29..000000000 --- a/lgsm/functions/fix_rust.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_rust.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves startup issue with Rust. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -# Fixes: [Raknet] Server Shutting Down (Shutting Down). -export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${systemdir}/RustDedicated_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_rw.sh b/lgsm/functions/fix_rw.sh deleted file mode 100644 index b02ec343e..000000000 --- a/lgsm/functions/fix_rw.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_rw.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves various issues with Rising World. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" diff --git a/lgsm/functions/fix_sdtd.sh b/lgsm/functions/fix_sdtd.sh deleted file mode 100644 index 91c94897a..000000000 --- a/lgsm/functions/fix_sdtd.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_sdtd.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves various issues with 7 Days to Die. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" diff --git a/lgsm/functions/fix_sof2.sh b/lgsm/functions/fix_sof2.sh deleted file mode 100644 index 51224c8e0..000000000 --- a/lgsm/functions/fix_sof2.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_rust.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves various issues with Soldier of Fortune 2. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -# Fixes: error while loading shared libraries: libcxa.so.1 -export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" diff --git a/lgsm/functions/fix_ss3.sh b/lgsm/functions/fix_ss3.sh deleted file mode 100644 index 6bea53861..000000000 --- a/lgsm/functions/fix_ss3.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_ss3.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves various issues with Serious Sam 3. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -# Fixes: https://steamcommunity.com/app/41070/discussions/0/353916981477716386/ -if [ ! -f "${serverfiles}/Bin/steamclient.so" ]||[ "$(diff "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/Bin/steamclient.so" 2>/dev/null)" ]; then - fixname="steamclient.so" - fn_fix_msg_start - cp -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/Bin/steamclient.so" - fn_fix_msg_end -fi - -# Fixes: .steam/bin32/libsteam.so: cannot open shared object file: No such file or directory -if [ ! -f "${HOME}/.steam/bin32/libsteam.so" ]; then - fixname="libsteam.so" - fn_fix_msg_start - mkdir -pv "${HOME}/.steam/bin32" >> "${lgsmlog}" - cp "${serverfiles}/Bin/libsteam.so" "${HOME}/.steam/bin32/libsteam.so" >> "${lgsmlog}" - fn_fix_msg_end -fi diff --git a/lgsm/functions/fix_steamcmd.sh b/lgsm/functions/fix_steamcmd.sh deleted file mode 100644 index 0a2f774f1..000000000 --- a/lgsm/functions/fix_steamcmd.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_steamcmd.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves various issues related to SteamCMD. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -# Helps fix: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so. -if [ ! -f "${HOME}/.steam/sdk64/steamclient.so" ]; then - fixname="steamclient.so sdk64" - fn_fix_msg_start - mkdir -pv "${HOME}/.steam/sdk64" >> "${lgsmlog}" - if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then - cp "${steamcmddir}/linux64/steamclient.so" "${HOME}/.steam/sdk64/steamclient.so" >> "${lgsmlog}" - elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then - cp "${steamcmddir}/linux64/steamclient.so" "${HOME}/.steam/sdk64/steamclient.so" >> "${lgsmlog}" - fi - fn_fix_msg_end -fi - -# Helps fix: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so. -if [ ! -f "${HOME}/.steam/sdk32/steamclient.so" ]; then - fixname="steamclient.so sdk32" - fn_fix_msg_start - mkdir -pv "${HOME}/.steam/sdk32" >> "${lgsmlog}" - if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then - cp "${steamcmddir}/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so" >> "${lgsmlog}" - elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then - cp "${steamcmddir}/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so" >> "${lgsmlog}" - fi - fn_fix_msg_end -fi diff --git a/lgsm/functions/fix_terraria.sh b/lgsm/functions/fix_terraria.sh deleted file mode 100644 index 712416bd8..000000000 --- a/lgsm/functions/fix_terraria.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_terraria.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves an issue with Terraria. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -export TERM=xterm diff --git a/lgsm/functions/fix_tf2.sh b/lgsm/functions/fix_tf2.sh deleted file mode 100644 index 59b841226..000000000 --- a/lgsm/functions/fix_tf2.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_tf2.sh function -# Author: Vector Sigma -# Website: https://github.com/vectorsigma -# Description: Resolves various issues with Team Fortress 2. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -# Fixes: Team Fortress 2 Segmentation fault for Red-Hat Distros #2062. -if [ -f "/etc/redhat-release" ]&&[ ! -f "${serverfiles}/bin/libcurl-gnutls.so.4" ]; then - fixname="libcurl-gnutls.so.4" - fn_fix_msg_start - ln -s "/usr/lib/libcurl.so.4" "${serverfiles}/bin/libcurl-gnutls.so.4" - fn_fix_msg_end -fi diff --git a/lgsm/functions/fix_ts3.sh b/lgsm/functions/fix_ts3.sh deleted file mode 100644 index b019012f7..000000000 --- a/lgsm/functions/fix_ts3.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_ts3.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves various issues with Teamspeak 3. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -# Fixes: makes libmariadb2 available #1924. -if [ ! -f "${serverfiles}/libmariadb.so.2" ]; then - fixname="libmariadb.so.2" - fn_fix_msg_start - cp "${serverfiles}/redist/libmariadb.so.2" "${serverfiles}/libmariadb.so.2" - fn_fix_msg_end -fi diff --git a/lgsm/functions/fix_tu.sh b/lgsm/functions/fix_tu.sh deleted file mode 100644 index 1f01fd7b3..000000000 --- a/lgsm/functions/fix_tu.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_tu.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves various issues with Tower Unite. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -if [ "${shortname}" == "tu" ]; then - # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. - if [ ! -f "${executabledir}/steamclient.so" ]; then - fixname="steamclient.so" - fn_fix_msg_start - cp -v "${serverfiles}/linux64/steamclient.so" "${executabledir}/steamclient.so" >> "${lgsmlog}" - fn_fix_msg_end - fi -fi diff --git a/lgsm/functions/fix_unt.sh b/lgsm/functions/fix_unt.sh deleted file mode 100644 index 60f3d2edf..000000000 --- a/lgsm/functions/fix_unt.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_rust.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves startup issue with Unturned. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -# steamclient.so: cannot open shared object file: No such file or directory -export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" diff --git a/lgsm/functions/fix_ut.sh b/lgsm/functions/fix_ut.sh deleted file mode 100644 index f9c81348a..000000000 --- a/lgsm/functions/fix_ut.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_ut.sh function -# Author: Alexander Hurd -# Website: https://linuxgsm.com -# Description: Resolves various issues with Unreal Tournament. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -#Set Binary Executable -echo -e "chmod +x ${executabledir}/${executable}" -chmod +x "${executabledir}/${executable}" -fn_sleep_time diff --git a/lgsm/functions/fix_ut3.sh b/lgsm/functions/fix_ut3.sh deleted file mode 100644 index e6c018d00..000000000 --- a/lgsm/functions/fix_ut3.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_ut2.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves various issues with Unreal Tournament 3. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_parms(){ -parms="server VCTF-Suspense?Game=UTGameContent.UTVehicleCTFGame_Content?bIsDedicated=true?bIsLanMatch=false?bUsesStats=false?bShouldAdvertise=false?PureServer=1?bAllowJoinInProgress=true?ConfigSubDir=${selfname} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}" -} - -fn_print_information "starting ${gamename} server to generate configs." -fn_sleep_time -exitbypass=1 -command_start.sh -sleep 10 -exitbypass=1 -command_stop.sh diff --git a/lgsm/functions/fix_wurm.sh b/lgsm/functions/fix_wurm.sh deleted file mode 100644 index 809651d55..000000000 --- a/lgsm/functions/fix_wurm.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_wurm.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves various issues with Wurm Unlimited. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -# Copies steamclient.so to correct location. -if [ ! -f "${serverfiles}/nativelibs" ]; then - cp -f "${serverfiles}/linux64/steamclient.so" "${serverfiles}/nativelibs" -fi - -# First run requires start with no parms. -# After first run new dirs are created. -if [ ! -d "${serverfiles}/Creative" ]; then - parmsbypass=1 - fixbypass=1 - exitbypass=1 - command_start.sh - sleep 10 - exitbypass=1 - command_stop.sh - unset parmsbypass -fi diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh deleted file mode 100644 index 743c657e0..000000000 --- a/lgsm/functions/info_config.sh +++ /dev/null @@ -1,1620 +0,0 @@ -#!/bin/bash -# LinuxGSM info_config.sh function -# Author: Daniel Gibbs -# Contributor: UltimateByte -# Website: https://linuxgsm.com -# Description: Gets specific details from config files. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -## Examples of filtering to get info from config files. -# sed 's/foo//g' - remove foo -# tr -cd '[:digit:]' leave only digits -# tr -d '=\"; ' remove selected characters =\"; -# grep -v "foo" filter out lines that contain foo -# cut -f1 -d "/" remove everything after / - - -fn_info_config_assettocorsa(){ - if [ ! -f "${servercfgfullpath}" ]; then - httpport="${zero}" - port="${zero}" - queryport="${zero}" - servername="${unavailable}" - adminpassword="${unavailable}" - else - httpport=$(grep "HTTP_PORT" "${servercfgfullpath}" | tr -cd '[:digit:]') - port=$(grep "TCP_PORT" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport="${port}" - servername=$(grep "NAME" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/NAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| head -n 1) - adminpassword=$(grep "ADMIN_PASSWORD" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMIN_PASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not Set - httpport=${httpport:-"0"} - port=${port:-"0"} - queryport=${queryport:-"0"} - servername=${servername:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - - fi -} - -fn_info_config_justcause2(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" - else - servername=$(grep "Name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverdescription=$(grep "Description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - port=$(grep "BindPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - queryport="${port}" - ip=$(grep "BindIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/BindIP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="BindIP" - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${queryport:-"0"} - fi -} - -fn_info_config_justcause3(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverdescription="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - queryPort="${zero}" - steamport="${zero}" - tickrate="${zero}" - else - servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverdescription=$(grep "description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "\"maxPlayers\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - port=$(grep "\"port\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$(grep "\"queryPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - steamport=$(grep "\"steamPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - tickrate=$(grep "\"maxTickRate\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - - ip=$(grep "host" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/host//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="host" - - # Not Set - servername=${servername:-"NOT SET"} - serverdescription=${serverdescription:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers=:-"0"} - port=${port=:-"0"} - queryport=${queryport=:-"0"} - steamport=${steamport=:-"0"} - tickrate=${tickrate=:-"0"} - fi -} - -fn_info_config_ark(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - else - servername=$(grep "SessionName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/SessionName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - # Not Set - servername=${servername:-"NOT SET"} - fi -} - -fn_info_config_ballistic_overkill(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - port="${zero}" - queryport="${zero}" - maxplayers="${unavailable}" - else - servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "Password=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "ServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$((port + 1)) - maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - maxplayers=${maxplayers:-"NOT SET"} - fi -} - -fn_info_config_barotrauma(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - port="${zero}" - queryport="${zero}" - maxplayers="${unavailable}" - else - servername=$(grep -Po 'name="\K.*(?=")' "${servercfgfullpath}") # Assuming GNU grep is used - serverpassword=$(grep -Po 'password="\K.*(?=")' "${servercfgfullpath}") # Assuming GNU grep is used - port=$(grep " port=" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$(grep "queryport=" "${servercfgfullpath}" | tr -cd '[:digit:]') - maxplayers=$(grep "maxplayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - maxplayers=${maxplayers:-"0"} - fi -} - -fn_info_config_battalion1944(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - else - servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - fi -} - -fn_info_config_bf1942(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" - else - - servername=$(grep "game.serverName " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName //g' | tr -d '=\";,:' | xargs) - serverpassword=$(grep "game.serverPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/game.serverPassword//g' | tr -d '=\";,:' | xargs) - maxplayers=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - queryport="22000" - - ip=$(grep "game.serverIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverIP//g' | tr -d '=\";,:' | xargs) - ipsetinconfig=1 - ipinconfigvar="game.serverIP" - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - fi -} - -fn_info_config_chivalry(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - else - servername=$(egrep "^ServerName" "${servercfgfullpath}" | sed 's/^ServerName=//') - adminpassword=$(egrep "^AdminPassword" "${servercfgfullpath}" | sed 's/^AdminPassword=//') - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - port=${port:-"0"} - fi -} - -fn_info_config_cod(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - rconpassword="${unavailable}" - else - servername=$(grep "sv_hostname " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | xargs) - rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not Set - servername=${servername:-"NOT SET"} - rconpassword=${rconpassword=:-"NOT SET"} - fi -} - -fn_info_config_cod2(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - rconpassword="${unavailable}" - else - servername=$(grep "sv_hostname " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | xargs) - rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not Set - servername=${servername:-"NOT SET"} - rconpassword=${rconpassword=:-"NOT SET"} - fi -} - -fn_info_config_cod4(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - rconpassword="${unavailable}" - else - servername=$(grep "sv_hostname " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | xargs) - rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not Set - servername=${servername:-"NOT SET"} - rconpassword=${rconpassword=:-"NOT SET"} - fi -} - -fn_info_config_codwaw(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - rconpassword="${unavailable}" - else - servername=$(grep "sv_hostname " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | xargs) - rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not Set - servername=${servername:-"NOT SET"} - rconpassword=${rconpassword=:-"NOT SET"} - fi -} - -fn_info_config_dontstarve(){ - if [ ! -f "${clustercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - gamemode="${unavailable}" - tickrate="${zero}" - masterport="${zero}" - else - servername=$(grep "cluster_name" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/cluster_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "cluster_password" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/cluster_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "max_players" "${clustercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - gamemode=$(grep "game_mode" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/game_mode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - tickrate=$(grep "tick_rate" "${clustercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - masterport=$(grep "master_port" "${clustercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - ip=$(grep "bind_ip" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bind_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="bind_ip" - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - gamemode=${gamemode:-"NOT SET"} - tickrate=${tickrate:-"0"} - masterport=${masterport:-"0"} - fi - - if [ ! -f "${servercfgfullpath}" ]; then - port="${zero}" - steamauthenticationport="${zero}" - steammasterserverport="${zero}" - else - port=$(grep "server_port" "${servercfgfullpath}" | grep "^server_port" | grep -v "#" | tr -cd '[:digit:]') - steamauthenticationport=$(grep "authentication_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - steammasterserverport=$(grep "master_server_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not Set - port=${port:-"0"} - steamauthenticationport=${steamauthenticationport:-"0"} - steammasterserverport=${steammasterserverport:-"0"} - fi -} - -fn_info_config_eco(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - gamemode="${unavailable}" - tickrate="${zero}" - port="${zero}" - webadminport="${zero}" - public="" - else - servername=$(grep "Description" "${servercfgdir}/Network.eco" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "Password" "${servercfgdir}/Network.eco" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxConnections" "${servercfgdir}/Network.eco" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/MaxConnections//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "\"GameServerPort\"" "${servercfgdir}/Network.eco" | tr -cd '[:digit:]') - webadminport=$(grep "\"WebServerPort\"" "${servercfgdir}/Network.eco" | tr -cd '[:digit:]') - public=$(grep "PublicServer" "${servercfgdir}/Network.eco" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/PublicServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers=:-"0"} - port=${port=:-"0"} - webadminport=${webadminport=:-"0"} - public=${public=:-"NOT SET"} - fi -} - -fn_info_config_factorio(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="Factorio Server" - serverpassword="${unavailable}" - maxplayers="${zero}" - else - servername="Factorio Server" - serverpassword=$(grep "game_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/game_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "\"max_players\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers=:-"0"} - fi -} - -fn_info_config_inss(){ - if [ ! -f "${servercfgfullpath}" ]; then - rconenabled="${unavailable}" - rconpassword="${unavailable}" - rconport="${zero}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" - queryenabled="${unavailable}" - rconport="${zero}" - gamemode="${unavailable}" - gameworld="${unavailable}" - else - rconenabled=$(grep "bEnabled" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconport=$(grep "ListenPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - - # Not Set - rconenabled=${rconenabled:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - rconport=${rconport:-"0"} - fi -} - -fn_info_config_minecraft(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - rconpassword="${unavailable}" - rconport="${zero}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" - queryenabled="${unavailable}" - gamemode="${unavailable}" - gameworld="${unavailable}" - else - servername=$(grep "motd" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/motd//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "rcon.password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon.password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconport=$(grep "rcon.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "server-port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - queryport=$(grep "query.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - if [ -z "${queryport}" ]; then - queryport=${port} - fi - queryenabled=$(grep "enable-query" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/enable-query//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - gamemode=$(grep "gamemode" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - ip=$(grep "server-ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/server-ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="server-ip" - - # Not Set - servername=${servername:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - rconport=${rconport:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} - port=${port:-"NOT SET"} - queryport=${queryport:-"NOT SET"} - queryenabled="${queryenabled:-"NOT SET"}" - gamemode=${gamemode:-"NOT SET"} - gameworld=${gameworld:-"NOT SET"} - fi -} - -fn_info_config_minecraft_bedrock(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - maxplayers="${zero}" - port="${zero}" - port6="${zero}" - queryport="${zero}" - gamemode="${unavailable}" - gameworld="${unavailable}" - else - servername=$(grep "server-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "server-port\b" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port6=$(grep "server-portv6\b" "${servercfgfullpath}" | sed 's/v6//g' | grep -v "#" | tr -cd '[:digit:]') - queryport=${port} - gamemode=$(grep "gamemode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/gamemode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not Set - servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} - port=${port:-"NOT SET"} - port6=${port6:-"NOT SET"} - queryport=${queryport:-"NOT SET"} - gamemode=${gamemode:-"NOT SET"} - gameworld=${gameworld:-"NOT SET"} - fi -} - -fn_info_config_onset(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - maxplayers="${zero}" - port="${zero}" - httpport="${zero}" - queryport="${zero}" - else - servername=$(grep -v "servername_short" "${servercfgfullpath}" | grep "servername" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/servername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' ) - maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - httpport=$((port-2)) - queryport=$((port-1)) - - # Not Set - servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} - port=${port:-"NOT SET"} - httpport=${httpport:-"NOT SET"} - queryport=${queryport:-"NOT SET"} - fi -} - -fn_info_config_mohaa(){ - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - else - rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not Set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} - -#Post Scriptum: The bloody Seventh -fn_info_config_pstbs(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - maxplayers="${unavailable}" - reservedslots="${unavailable}" - else - servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=";,:' | sed -e 's/^[ \t]//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') - reservedslots=$(grep "NumReservedSlots=" "${servercfgfullpath}" | tr -cd '[:digit:]') - fi - - if [ ! -f "${servercfgdir}/Rcon.cfg" ]; then - rconport=${unavailable} - rconpassword=${unavailable} - else - rconport=$(grep "Port=" "${servercfgdir}/Rcon.cfg" | tr -cd '[:digit:]') - rconpassword=$(grep "Password=" "${servercfgdir}/Rcon.cfg" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - fi - - rconport=${rconport:-"0"} - if [ -z "${rconpassword}" ]||[ ${#rconpassword} == 1 ]; then - rconpassword="NOT SET" - fi - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - numreservedslots=${numreservedslots:-"0"} -} - -fn_info_config_projectcars(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" - steamport="${zero}" - else - servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "password " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - port=$(grep "hostPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - queryport=$(grep "queryPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - steamport=$(grep "steamPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} - port=${port:-"NOT SET"} - queryport=${queryport:-"NOT SET"} - steamport=${steamport:-"NOT SET"} - fi -} - -fn_info_config_projectzomboid(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - rconpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - gameworld="${unavailable}" - else - servername=$(grep "PublicName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/PublicName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Password" | sed -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "RCONPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/RCONPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "DefaultPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - gameworld=$(grep "Map" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Map" | sed -e '/^#/d' -e 's/Map//g' | tr -d '=\";' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} - port=${port:-"NOT SET"} - gameworld=${gameworld:-"NOT SET"} - fi -} - -fn_info_config_quakeworld(){ - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - else - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not Set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} - -fn_info_config_quake2(){ - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - else - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not Set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} - -fn_info_config_quake3(){ - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - else - rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not Set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} - -fn_info_config_quakelive(){ - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" - rconport="${zero}" - statsport="${zero}" - else - rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "sv_maxClients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - port=$(grep "net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - queryport="${port}" - rconport=$(grep "zmq_rcon_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - statsport=$(grep "zmq_stats_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - - ip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="set net_ip" - - # Not Set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${queryport:-"0"} - rconport=${rconport:-"0"} - statsport=${statsport:-"0"} - fi -} - -fn_info_config_realvirtuality(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - adminpassword="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - else - servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - adminpassword=$(grep "passwordAdmin" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/passwordAdmin//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - - # Not Set - servername=${servername:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} - -fn_info_config_risingworld(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - rconpassword="${unavailable}" - rconport="${zero}" - maxplayers="${zero}" - port="${zero}" - gamemode="${unavailable}" - gameworld="${unavailable}" - else - servername=$(grep "server_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "server_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconport=$(grep "rcon_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - maxplayers=$(grep "settings_max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "server_port" "${servercfgfullpath}" | grep -v "database_mysql_server_port" | grep -v "#" | tr -cd '[:digit:]') - gamemode=$(grep "gamemode" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - gameworld=$(grep "server_world_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_world_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - javaram=$(grep "server_memory" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_memory//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ip=$(grep "server_ip" "${servercfgfullpath}" | grep -v "database_mysql_server_ip" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/server_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="server-ip" - - # Not Set - servername=${servername:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - rconport=${rconport:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} - port=${port:-"NOT SET"} - gamemode=${gamemode:-"NOT SET"} - gameworld=${gameworld:-"NOT SET"} - fi -} - -fn_info_config_rtcw(){ - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - else - rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not Set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} - -fn_info_config_seriousengine35(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - rconpassword="${unavailable}" - gamemode="${unavailable}" - maxplayers="${zero}" - port="${zero}" - else - servername=$(grep "prj_strMultiplayerSessionName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/prj_strMultiplayerSessionName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "rcts_strAdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/rcts_strAdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - gamemode=$(grep "gam_idGameMode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/gam_idGameMode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "gam_ctMaxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - port=$(grep "prj_uwPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - - # Not Set - servername=${servername:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - gamemode=${gamemode:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - fi -} - -#StickyBots -fn_info_config_sbots(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - maxplayers="${unavailable}" - else - servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=";,:' | sed -e 's/^[ \t]//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') - fi - - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} -} - -fn_info_config_sof2(){ - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - else - rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not Set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} - -fn_info_config_source(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - rconpassword="${unavailable}" - else - servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "sv_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/sv_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - fi -} - -fn_info_config_starbound(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - queryenabled="${unavailable}" - rconenabled="${unavailable}" - rconpassword="${unavailable}" - port="21025" - queryport="21025" - rconport="21026" - maxplayers="8" - else - servername=$(grep "serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/serverName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - queryenabled=$(grep "runQueryServer" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/runQueryServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconenabled=$(grep "runRconServer" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/runRconServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "rconServerPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/rconServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "gameServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$(grep "queryServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - rconport=$(grep "rconServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | tr -cd '[:digit:]') - - # Not Set - servername=${servername:-"NOT SET"} - queryenabled=${queryenabled:-"NOT SET"} - rconenabled=${rconenabled:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - port=${port:-"21025"} - queryport=${queryport:-"21025"} - rconport=${rconport:-"21026"} - maxplayers=${maxplayers:-"8"} - fi -} - -fn_info_config_teamspeak3(){ - if [ ! -f "${servercfgfullpath}" ]; then - dbplugin="${unavailable}" - port="9987" - queryport="10011" - fileport="30033" - else - dbplugin=$(grep "dbplugin=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/dbplugin=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "default_voice_port" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$(grep "query_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - fileport=$(grep "filetransfer_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - ip=$(grep "voice_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/voice_ip//g' | sed 's/,.*//' | tr -d '=\";,' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="voice_ip" - - # Not Set - port=${port:-"9987"} - queryport=${queryport:-"10011"} - fileport=${fileport:-"30033"} - fi -} - -fn_info_config_mumble(){ - if [ ! -f "${servercfgfullpath}" ]; then - port="64738" - queryport="${port}" - servername="Mumble" - else - port=$(grep "port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^;/d' -e 's/port//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - queryport="${port}" - - ip=$(grep "host=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^;/d' -e 's/host=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="voice_ip" - - # Not Set - port=${port:-"64738"} - queryport=${queryport:-"64738"} - servername="Mumble Port ${port}" - fi -} - -fn_info_config_samp(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="unnamed server" - serverpassword="${unavailable}" - rconpassword="${unavailable}" - port="7777" - maxplayers="50" - else - servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not Set - servername=${servername:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - port=${port:-"8303"} - maxplayers=${maxplayers:-"12"} - fi -} - -fn_info_config_teeworlds(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="unnamed server" - serverpassword="${unavailable}" - rconpassword="${unavailable}" - port="8303" - queryport="8303" - maxplayers="12" - else - servername=$(grep "sv_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^password" | sed -e '/^#/d' -e 's/^password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "sv_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "sv_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - queryport="${port}" - maxplayers=$(grep "sv_max_clients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - port=${port:-"8303"} - queryport=${port:-"8303"} - maxplayers=${maxplayers:-"12"} - fi -} - -fn_info_config_terraria(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - port="${zero}" - gameworld="${unavailable}" - maxplayers="${zero}" - queryport="${zero}" - else - servername=$(grep "worldname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/worldname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "port" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=${port:-"0"} - gameworld=$(grep "world=" "${servercfgfullpath}" | grep -v "//" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/world=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - - # Not Set - servername=${servername:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - gameworld=${gameworld:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} - -fn_info_config_towerunite(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - maxplayers="${zero}" - else - servername=$(grep "ServerTitle" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerTitle//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not Set - servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} - -fn_info_config_unreal(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - port="${zero}" - queryport="${zero}" - queryportgs="${zero}" - webadminenabled="${unavailable}" - webadminport="${zero}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" - else - servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - port=$(grep "Port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]') - queryport=$((port + 1)) - queryportgs=$(grep "OldQueryPortNumber" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - webadminenabled=$(grep "bEnabled" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - webadminport=$(grep "ListenPort" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - webadminuser=$(grep "AdminUsername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminUsername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - webadminpass=$(grep "UTServerAdmin.UTServerAdmin" "${servercfgfullpath}" -A 4 | grep "AdminPassword" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - queryportgs=${queryportgs:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"0"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} - fi -} - -fn_info_config_unreal2(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - port="${zero}" - queryport="${zero}" - queryportgs="${zero}" - webadminenabled="${unavailable}" - webadminport="${zero}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" - else - servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - port=$(grep "Port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]') - queryport=$((port + 1)) - queryportgs=$(grep "OldQueryPortNumber" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - webadminenabled=$(grep "bEnabled" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - webadminport=$(grep "ListenPort" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - webadminuser=$(grep "AdminName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - webadminpass="${adminpassword}" - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - queryportgs=${queryportgs:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"0"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} - fi -} - -fn_info_config_unreal3(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - maxplayers="${unavailable}" - webadminenabled="${unavailable}" - webadminport="${zero}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" - else - servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - webadminenabled=$(grep "bEnabled" "${servercfgdir}/UTWeb.ini" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - webadminport=$(grep "ListenPort" "${servercfgdir}/UTWeb.ini" | grep -v "#" | tr -cd '[:digit:]') - webadminuser="Admin" - webadminpass=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"0"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} - fi -} - -fn_info_config_ut(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - else - servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') - - # Not set - servername=${servername:-"NOT SET"} - fi -} - -fn_info_config_warfork(){ - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - maxplayers="${zero}" - else - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not Set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} - -fn_info_config_kf2(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - port="${unavailable}" - queryport="${unavailable}" - webadminenabled="${unavailable}" - webadminport="${zero}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" - else - servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "Port" "${servercfgdir}/LinuxServer-KFEngine.ini" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]') - webadminenabled=$(grep "bEnabled" "${servercfgdir}/KFWeb.ini" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - webadminport=$(grep "ListenPort" "${servercfgdir}/KFWeb.ini" | grep -v "#" | tr -cd '[:digit:]') - webadminuser="Admin" - webadminpass=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - port=${port:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"0"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} - fi -} - -fn_info_config_sdtd(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - port="${zero}" - queryport="${zero}" - webadminenabled="${unavailable}" - webadminport="${zero}" - webadminpass="${unavailable}" - telnetenabled="${unavailable}" - telnetport="${zero}" - telnetpass="${unavailable}" - maxplayers="${unavailable}" - gamemode="${unavailable}" - gameworld="${unavailable}" - else - servername=$(grep "ServerName" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - port=$(grep "ServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=${port:-"0"} - - webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - webadminpass=$(grep "ControlPanelPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - telnetenabled=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - telnetpass=$(grep "TelnetPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - - maxplayers=$(grep "ServerMaxPlayerCount" "${servercfgfullpath}" | tr -cd '[:digit:]') - gamemode=$(grep "GameMode" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - gameworld=$(grep "GameWorld" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"0"} - webadminpass=${webadminpass:-"NOT SET"} - telnetenabled=${telnetenabled:-"NOT SET"} - telnetport=${telnetport:-"0"} - telnetpass=${telnetpass:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} - gamemode=${gamemode:-"NOT SET"} - gameworld=${gameworld:-"NOT SET"} - fi -} - -fn_info_config_mta(){ - if [ ! -f "${servercfgfullpath}" ]; then - ip="${zero}" - port="${unavailable}" - httpport="${unavailable}" - ase="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - else - port=$(grep -m 1 "serverport" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') - httpport=$(grep -m 1 "httpport" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') - servername=$(grep -m 1 "servername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<") - serverpassword=$(grep -m 1 "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<") - maxplayers=$(grep -m 1 "maxplayers" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') - ase=$(grep -m 1 "ase" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') - if [ "${ase}" == "1" ]; then - ase="Enabled" - else - ase="Disabled" - fi - # ip=$(grep -m 1 "serverip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<") - # ipsetinconfig=1 - # ipinconfigvar="serverip" - - # Not Set - port=${port:-"22003"} - httpport=${httpport:-"22005"} - ase=${ase:-"Disabled"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} - -fn_info_config_wolfensteinenemyterritory(){ - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" - else - port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - queryport="${port}" - rconpassword=$(grep "set zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - - ip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="set net_ip" - - # Not Set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"27960"} - queryport=${queryport:-"27960"} - fi -} - -fn_info_config_etlegacy(){ - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" - else - port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - queryport="${port}" - rconpassword=$(grep "set rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - - ip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="set net_ip" - - # Not Set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"27960"} - queryport=${queryport:-"27960"} - fi -} - -fn_info_config_wurmunlimited(){ - if [ ! -f "${servercfgfullpath}" ]; then - port="${zero}" - queryport="${zero}" - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - maxplayers="${zero}" - else - - port=$(grep "EXTERNALPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - queryport=$(grep "QUERYPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - servername=$(grep "SERVERNAME=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERNAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "SERVERPASSWORD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERPASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - adminpassword=$(grep "ADMINPWD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMINPWD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MAXPLAYERS=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - ip=$(grep "IP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/IP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="IP" - - # Not Set - port=${port:-"3724"} - queryport=${queryport:-"27017"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} - -fn_info_config_squad(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - maxplayers="${unavailable}" - else - servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') - fi - - if [ ! -f "${servercfgdir}/Rcon.cfg" ]; then - rconport=${unavailable} - rconpassword=${unavailable} - else - rconport=$(grep "Port=" "${servercfgdir}/Rcon.cfg" | tr -cd '[:digit:]') - rconpassword=$(grep "Password=" "${servercfgdir}/Rcon.cfg" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - fi - - rconport=${rconport:-"0"} - if [ -z "${rconpassword}" ]||[ ${#rconpassword} == 1 ]; then - rconpassword="NOT SET" - fi - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} -} - -fn_info_config_stationeers(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - rconpassword="${unavailable}" - maxplayers="${unavailable}" - else - servername=$(grep "SERVERNAME" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERNAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "PASSWORD" "${servercfgfullpath}" | grep "^PASSWORD" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/PASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "RCONPASSWORD" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/RCONPASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MAXPLAYER" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/MAXPLAYER//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} - -fn_info_config_mordhau(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - rconpassword="${unavailable}" - maxplayers="${unavailable}" - else - servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') - serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | awk -F '=' '{print $2}') - rconpassword=$(grep "AdminPassword" "${servercfgfullpath}" | awk -F '=' '{print $2}') - maxplayers=$(grep "MaxSlots" "${servercfgfullpath}" | awk -F '=' '{print $2}') - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} - - -fn_info_config_avorion() { - if [ ! -f "${servercfgfullpath}" ]; then - maxplayers="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - rconpassword="${unavailable}" - rconport="${unavailable}" - rconenabled="${unavailable}" - queryport="${unavailable}" - else - maxplayers=$(grep "maxPlayers=" "${servercfgfullpath}" | sed 's/maxPlayers=//') - servername=$(grep "name=" "${servercfgfullpath}" | sed 's/name=//') - serverpassword=$(grep "password=" "${servercfgfullpath}" | sed 's/password=//') - rconpassword=$(grep "rconPassword=" "${servercfgfullpath}" | sed 's/rconPassword=//') - rconport=$(grep "rconPort=" "${servercfgfullpath}" | sed 's/rconPort=//') - if [ -n "${rconpassword}" ]; then - rconenabled="true" - queryport="${rconport}" - fi - - # Not set - maxplayers=${maxplayers:-"NOT SET"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - rconport=${rconport:-"0"} - rconenabled=${rconenabled:-"false"} - queryport=${queryport:-"0"} - fi -} - -fn_info_config_soldat(){ - if [ ! -f "${servercfgfullpath}" ]; then - adminpassword="${unavailable}" - maxplayers="${unavailable}" - port="${zero}" - queryport="${zero}" - servername="${unavailable}" - serverpassword="${unavailable}" - else - adminpassword=$(grep "Admin_Password=" "${servercfgfullpath}" | awk -F '=' '{print $2}') - maxplayers=$(grep "Max_Players=" "${servercfgfullpath}" | tr -cd '[:digit:]') - port=$(grep "Port=" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport="${port}" - servername=$(grep "Server_Name=" "${servercfgfullpath}" | awk -F '=' '{print $2}') - serverpassword=$(grep "Game_Password=" "${servercfgfullpath}" | awk -F '=' '{print $2}') - - # Not set - adminpassword=${adminpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"23073"} - queryport=${queryport:-"23083"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - fi -} - -# Assetto Corsa -if [ "${shortname}" == "ac" ]; then - fn_info_config_assettocorsa -# ARK: Survival Evolved -elif [ "${shortname}" == "ark" ]; then - fn_info_config_ark -# Avorion -elif [ "${shortname}" == "av" ]; then - fn_info_config_avorion -# Ballistic Overkill -elif [ "${shortname}" == "bo" ]; then - fn_info_config_ballistic_overkill -# Barotrauma -elif [ "${shortname}" == "bt" ]; then - fn_info_config_barotrauma -# Battalion 1944 -elif [ "${shortname}" == "bt1944" ]; then - fn_info_config_battalion1944 -# Battlefield: 1942 -elif [ "${shortname}" == "bf1942" ]; then - fn_info_config_bf1942 -# Chivalry: Medieval Warfare -elif [ "${shortname}" == "cmw" ]; then - fn_info_config_chivalry -# Call of Duty -elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]; then - fn_info_config_cod -# Call of Duty 2 -elif [ "${shortname}" == "cod2" ]; then - fn_info_config_cod2 -# Call of Duty 4 -elif [ "${shortname}" == "cod4" ]; then - fn_info_config_cod4 -# Call of Duty: World at War -elif [ "${shortname}" == "codwaw" ]; then - fn_info_config_codwaw -# Dont Starve Together -elif [ "${shortname}" == "dst" ]; then - fn_info_config_dontstarve -# Eco -elif [ "${shortname}" == "eco" ]; then - fn_info_config_eco -# Factorio -elif [ "${shortname}" == "fctr" ]; then - fn_info_config_factorio -# Insurgency: Sandstorm -elif [ "${shortname}" == "inss" ]; then - fn_info_config_inss -# Just Cause 2 -elif [ "${shortname}" == "jc2" ]; then - fn_info_config_justcause2 -# Just Cause 3 -elif [ "${shortname}" == "jc3" ]; then - fn_info_config_justcause3 -# Killing Floor 2 -elif [ "${shortname}" == "kf2" ]; then - fn_info_config_kf2 -# Medal of Honor: Allied Assault -elif [ "${shortname}" == "mohaa" ]; then - fn_info_config_mohaa -# QuakeWorld -elif [ "${shortname}" == "qw" ]; then - fn_info_config_quakeworld -# Quake 2 -elif [ "${shortname}" == "q2" ]; then - fn_info_config_quake2 -# Quake 3 -elif [ "${shortname}" == "q3" ]; then - fn_info_config_quake3 -# Quake Live -elif [ "${shortname}" == "ql" ]; then - fn_info_config_quakelive -# Minecraft -elif [ "${shortname}" == "mc" ]; then - fn_info_config_minecraft -# Minecraft Bedrock -elif [ "${shortname}" == "mcb" ]; then - fn_info_config_minecraft_bedrock -# Onset -elif [ "${shortname}" == "onset" ]; then - fn_info_config_onset -# Post Scriptum: The Bloody Seventh -elif [ "${shortname}" == "pstbs" ]; then - fn_info_config_pstbs -# Project Cars -elif [ "${shortname}" == "pc" ]; then - fn_info_config_projectcars -# Project Zomboid -elif [ "${shortname}" == "pz" ]; then - fn_info_config_projectzomboid -# ARMA 3 -elif [ "${shortname}" == "arma3" ]; then - fn_info_config_realvirtuality -# Return to Castle Wolfenstein -elif [ "${shortname}" == "rtcw" ]; then - fn_info_config_rtcw -# Rising World -elif [ "${shortname}" == "rw" ]; then - fn_info_config_risingworld -# Serious Sam -elif [ "${shortname}" == "ss3" ]; then - fn_info_config_seriousengine35 -# Soldat -elif [ "${shortname}" == "sol" ]; then - fn_info_config_soldat -# Soldier Of Fortune 2: Gold Edition -elif [ "${shortname}" == "sof2" ]; then - fn_info_config_sof2 -# Source Engine Games -elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then - fn_info_config_source -# Starbound -elif [ "${shortname}" == "sb" ]; then - fn_info_config_starbound -# Teamspeak 3 -elif [ "${shortname}" == "ts3" ]; then - fn_info_config_teamspeak3 -# Mumble -elif [ "${shortname}" == "mumble" ]; then - fn_info_config_mumble -# San Andreas Multiplayer -elif [ "${shortname}" == "samp" ]; then - fn_info_config_samp -# StickyBots -elif [ "${shortname}" == "pstbs" ]; then - fn_info_config_sbots -# Teeworlds -elif [ "${shortname}" == "tw" ]; then - fn_info_config_teeworlds -# Terraria -elif [ "${shortname}" == "terraria" ]; then - fn_info_config_terraria -# Tower Unite -elif [ "${shortname}" == "tu" ]; then - fn_info_config_towerunite -# Unreal engine -elif [ "${engine}" == "unreal" ]; then - fn_info_config_unreal -# Unreal 2 engine -elif [ "${engine}" == "unreal2" ]; then - fn_info_config_unreal2 -# Unreal 3 engine -elif [ "${engine}" == "unreal3" ]; then - fn_info_config_unreal3 -elif [ "${shortname}" == "ut" ]; then - fn_info_config_ut -# 7 Day To Die (unity3d) -elif [ "${shortname}" == "sdtd" ]; then - fn_info_config_sdtd -elif [ "${shortname}" == "wet" ]; then - fn_info_config_wolfensteinenemyterritory -elif [ "${shortname}" == "wf" ]; then - fn_info_config_warfork -elif [ "${shortname}" == "etl" ]; then - fn_info_config_etlegacy -elif [ "${shortname}" == "wurm" ]; then - fn_info_config_wurmunlimited -elif [ "${shortname}" == "mta" ]; then - fn_info_config_mta -elif [ "${shortname}" == "squad" ]; then - fn_info_config_squad -# Stationeers -elif [ "${shortname}" == "st" ]; then - fn_info_config_stationeers -elif [ "${shortname}" == "mh" ]; then - fn_info_config_mordhau -fi diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh deleted file mode 100644 index 1e2a519f4..000000000 --- a/lgsm/functions/info_distro.sh +++ /dev/null @@ -1,284 +0,0 @@ -#!/bin/bash -# LinuxGSM info_distro.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Variables providing useful info on the Operating System such as disk and performace info. -# Used for command_details.sh, command_debug.sh and alert.sh. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -### Game Server pid -if [ "${status}" == "1" ]; then - gameserverpid=$(tmux list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $2}') -fi -### Distro information - -## Distro -# Returns architecture, kernel and distro/os. -arch=$(uname -m) -kernel=$(uname -r) - -# Distro Name - Ubuntu 16.04 LTS -# Distro Version - 16.04 -# Distro ID - ubuntu -# Distro Codename - xenial - -# Gathers distro info from various sources filling in missing gaps. -distro_info_array=( os-release lsb_release hostnamectl debian_version redhat-release ) -for distro_info in "${distro_info_array[@]}" -do - if [ -f "/etc/os-release" ]&&[ "${distro_info}" == "os-release" ]; then - distroname=$(grep PRETTY_NAME /etc/os-release | sed 's/PRETTY_NAME=//g' | tr -d '="' | sed 's/\"//g') - distroversion=$(grep VERSION_ID /etc/os-release | sed 's/VERSION_ID=//g' | sed 's/\"//g') - distroid=$(grep ID /etc/os-release | grep -v _ID | grep -v ID_ | sed 's/ID=//g' | sed 's/\"//g') - distrocodename=$(grep VERSION_CODENAME /etc/os-release | sed 's/VERSION_CODENAME=//g' | sed 's/\"//g') - elif [ "$(command -v lsb_release 2>/dev/null)" ]&&[ "${distro_info}" == "lsb_release" ]; then - if [ -z "${distroname}" ];then - distroname=$(lsb_release -sd) - elif [ -z "${distroversion}" ]; then - distroversion=$(lsb_release -sr) - elif [ -z "${distroid}" ]; then - distroid=$(lsb_release -si) - elif [ -z "${distrocodename}" ]; then - distrocodename=$(lsb_release -sc) - fi - elif [ "$(command -v hostnamectl 2>/dev/null)" ]&&[ "${distro_info}" == "hostnamectl" ]; then - if [ -z "${distroname}" ];then - distroname=$(hostnamectl | grep "Operating System" | sed 's/Operating System: //g') - fi - elif [ -f "/etc/debian_version" ]&&[ "${distro_info}" == "debian_version" ]; then - if [ -z "${distroname}" ]; then - distroname="Debian $(cat /etc/debian_version)" - elif [ -z "${distroversion}" ]; then - distroversion=$(cat /etc/debian_version) - elif [ -z "${distroid}" ]; then - distroid="debian" - fi - elif [ -f "/etc/redhat-release" ]&&[ "${distro_info}" == "redhat-release" ]; then - if [ -z "${distroname}" ]; then - distroname=$(cat /etc/redhat-release) - elif [ -z "${distroversion}" ]; then - distroversion=$(rpm -qa \*-release | grep -Ei "oracle|redhat|centos|fedora" | cut -d"-" -f3) - elif [ -z "${distroid}" ]; then - distroid=$(awk '{print $1}' /etc/redhat-release) - fi - fi -done - -## Glibc version -# e.g: 1.17 -glibcversion=$(ldd --version | sed -n '1s/.* //p') - -## tmux version -# e.g: tmux 1.6 -if [ ! "$(command -V tmux 2>/dev/null)" ]; then - tmuxv="${red}NOT INSTALLED!${default}" -else - if [ "$(tmux -V | sed "s/tmux //" | sed -n '1 p' | tr -cd '[:digit:]')" -lt "16" ]; then - tmuxv="$(tmux -V) (>= 1.6 required for console log)" - else - tmuxv=$(tmux -V) - fi -fi - -## Uptime -uptime=$(/dev/null)" ]; then - # Issue #2005 - Kernel 3.14+ contains MemAvailable which should be used. All others will be calculated. - - # get the raw KB values of these fields. - physmemtotalkb=$(grep MemTotal /proc/meminfo | awk '{print $2}') - physmemfreekb=$(grep ^MemFree /proc/meminfo | awk '{print $2}') - physmembufferskb=$(grep ^Buffers /proc/meminfo | awk '{print $2}') - physmemcachedkb=$(grep ^Cached /proc/meminfo | awk '{print $2}') - physmemreclaimablekb=$(grep ^SReclaimable /proc/meminfo | awk '{print $2}') - - # check if MemAvailable Exists. - if grep -q ^MemAvailable /proc/meminfo; then - physmemactualfreekb=$(grep ^MemAvailable /proc/meminfo | awk '{print $2}') - else - physmemactualfreekb=$((physmemfreekb+physmembufferskb+physmemcachedkb)) - fi - - # Available RAM and swap. - physmemtotalmb=$((physmemtotalkb/1024)) - physmemtotal=$(numfmt --to=iec --from=iec --suffix=B "${physmemtotalkb}K") - physmemfree=$(numfmt --to=iec --from=iec --suffix=B "${physmemactualfreekb}K") - physmemused=$(numfmt --to=iec --from=iec --suffix=B "$((physmemtotalkb-physmemfreekb-physmembufferskb-physmemcachedkb-physmemreclaimablekb))K") - physmemavailable=$(numfmt --to=iec --from=iec --suffix=B "${physmemactualfreekb}K") - physmemcached=$(numfmt --to=iec --from=iec --suffix=B "$((physmemcachedkb+physmemreclaimablekb))K") - - swaptotal=$(numfmt --to=iec --from=iec --suffix=B "$(grep ^SwapTotal /proc/meminfo | awk '{print $2}')K") - swapfree=$(numfmt --to=iec --from=iec --suffix=B "$(grep ^SwapFree /proc/meminfo | awk '{print $2}')K") - swapused=$(numfmt --to=iec --from=iec --suffix=B "$(($(grep ^SwapTotal /proc/meminfo | awk '{print $2}')-$(grep ^SwapFree /proc/meminfo | awk '{print $2}')))K") - # RAM usage of the game server pid - # MB - if [ "${gameserverpid}" ]; then - memused=$(ps --forest -o rss -g "${gameserverpid}" | awk '{s+=$1} END {print s}'| awk '{$1/=1024;printf "%.0f",$1}{print $2}') - # % - pmemused=$(ps --forest -o %mem -g "${gameserverpid}" | awk '{s+=$1} END {print s}') - fi -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 - humanreadable="-h" - fi - physmemtotalmb=$(free -m | awk '/Mem:/ {print $2}') - physmemtotal=$(free ${humanreadable} | awk '/Mem:/ {print $2}') - physmemfree=$(free ${humanreadable} | awk '/Mem:/ {print $4}') - physmemused=$(free ${humanreadable} | awk '/Mem:/ {print $3}') - - oldfree=$(free ${humanreadable} | awk '/cache:/') - if [ "${oldfree}" ]; then - physmemavailable="n/a" - physmemcached="n/a" - else - physmemavailable=$(free ${humanreadable} | awk '/Mem:/ {print $7}') - physmemcached=$(free ${humanreadable} | awk '/Mem:/ {print $6}') - fi - - swaptotal=$(free ${humanreadable} | awk '/Swap:/ {print $2}') - swapused=$(free ${humanreadable} | awk '/Swap:/ {print $3}') - swapfree=$(free ${humanreadable} | awk '/Swap:/ {print $4}') -fi - -### Disk information - -## Available disk space on the partition. -filesystem=$(LC_ALL=C df -hP "${rootdir}" | tail -n 1 | awk '{print $1}') -totalspace=$(LC_ALL=C df -hP "${rootdir}" | tail -n 1 | awk '{print $2}') -usedspace=$(LC_ALL=C df -hP "${rootdir}" | tail -n 1 | awk '{print $3}') -availspace=$(LC_ALL=C df -hP "${rootdir}" | tail -n 1 | awk '{print $4}') - -## LinuxGSM used space total. -rootdirdu=$(du -sh "${rootdir}" 2> /dev/null | awk '{print $1}') -if [ -z "${rootdirdu}" ]; then - rootdirdu="0M" -fi - -## LinuxGSM used space in serverfiles dir. -serverfilesdu=$(du -sh "${serverfiles}" 2> /dev/null | awk '{print $1}') -if [ -z "${serverfilesdu}" ]; then - serverfilesdu="0M" -fi - -## LinuxGSM used space total minus backup dir. -rootdirduexbackup=$(du -sh --exclude="${backupdir}" "${serverfiles}" 2> /dev/null | awk '{print $1}') -if [ -z "${rootdirduexbackup}" ]; then - rootdirduexbackup="0M" -fi - -## Backup info -if [ -d "${backupdir}" ]; then - # Used space in backups dir. - backupdirdu=$(du -sh "${backupdir}" | awk '{print $1}') - # If no backup dir, size is 0M. - if [ -z "${backupdirdu}" ]; then - backupdirdu="0M" - fi - - # number of backups set to 0 by default. - backupcount=0 - - # If there are backups in backup dir. - if [ "$(find "${backupdir}" -name "*.tar.gz" | wc -l)" -ne "0" ]; then - # number of backups. - backupcount=$(find "${backupdir}"/*.tar.gz | wc -l) - # most recent backup. - lastbackup=$(find "${backupdir}"/*.tar.gz | head -1) - # date of most recent backup. - lastbackupdate=$(date -r "${lastbackup}") - # no of days since last backup. - lastbackupdaysago=$(( ( $(date +'%s') - $(date -r "${lastbackup}" +'%s') )/60/60/24 )) - # size of most recent backup. - lastbackupsize=$(du -h "${lastbackup}" | awk '{print $1}') - fi -fi - -# Network Interface name -netint=$(ip -o addr | grep "${ip}" | awk '{print $2}') -netlink=$(ethtool "${netint}" 2>/dev/null| grep Speed | awk '{print $2}') - -# External IP address -if [ -z "${extip}" ]; then - extip=$(curl -4 -m 3 ifconfig.co 2>/dev/null) - exitcode=$? - # Should ifconfig.co return an error will use last known IP. - if [ ${exitcode} -eq 0 ]; then - if [[ "${extip}" != *"DOCTYPE"* ]]; then - echo -e "${extip}" > "${tmpdir}/extip.txt" - else - if [ -f "${tmpdir}/extip.txt" ]; then - extip=$(cat "${tmpdir}/extip.txt") - else - echo -e "x.x.x.x" - fi - fi - else - if [ -f "${tmpdir}/extip.txt" ]; then - extip=$(cat "${tmpdir}/extip.txt") - else - echo -e "x.x.x.x" - fi - fi -fi - -# Alert IP address -if [ "${displayip}" ]; then - alertip="${displayip}" -elif [ "${extip}" ]; then - alertip="${extip}" -else - alertip="${ip}" -fi - -# Steam Master Server - checks if detected by master server. -if [ "$(command -v jq 2>/dev/null)" ]; then - if [ "${ip}" ]&&[ "${port}" ]; then - if [ "${steammaster}" == "true" ]; then - masterserver=$(curl -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${ip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null) - if [ "${masterserver}" == "0" ]; then - masterserver=$(curl -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${extip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null) - fi - if [ "${masterserver}" == "0" ]; then - displaymasterserver="false" - else - displaymasterserver="true" - fi - fi - fi -fi - -# 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 - glibc="2.14" - fi -fi diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh deleted file mode 100644 index 063914497..000000000 --- a/lgsm/functions/info_messages.sh +++ /dev/null @@ -1,1569 +0,0 @@ -#!/bin/bash -# LinuxGSM info_messages.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Defines server info messages for details and alerts. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -# Standard Details -# This applies to all engines - -fn_info_message_head(){ - echo -e "" - echo -e "${lightyellow}Summary${default}" - fn_messages_separator - echo -e "Message" - echo -e "${alertbody}" - echo -e "" - echo -e "Game" - echo -e "${gamename}" - echo -e "" - echo -e "Server name" - echo -e "${servername}" - echo -e "" - echo -e "Hostname" - echo -e "${HOSTNAME}" - echo -e "" - echo -e "Server IP" - if [ "${multiple_ip}" == "1" ]; then - echo -e "NOT SET" - else - echo -e "${ip}:${port}" - fi -} - -fn_info_message_distro(){ - # - # Distro Details - # ===================================== - # Distro: Ubuntu 14.04.4 LTS - # Arch: x86_64 - # Kernel: 3.13.0-79-generic - # Hostname: hostname - # tmux: tmux 1.8 - # glibc: 2.19 - - echo -e "" - echo -e "${lightyellow}Distro Details${default}" - fn_messages_separator - { - echo -e "${lightblue}Distro:\t${default}${distroname}" - echo -e "${lightblue}Arch:\t${default}${arch}" - echo -e "${lightblue}Kernel:\t${default}${kernel}" - echo -e "${lightblue}Hostname:\t${default}${HOSTNAME}" - echo -e "${lightblue}Uptime:\t${default}${days}d, ${hours}h, ${minutes}m" - echo -e "${lightblue}tmux:\t${default}${tmuxv}" - echo -e "${lightblue}glibc:\t${default}${glibcversion}" - } | column -s $'\t' -t -} - -fn_info_message_server_resource(){ - # - # Server Resource - # ========================================================================================================================================================================================================================================== - # CPU - # Model: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz - # Cores: 4 - # Frequency: 2499.994 MHz - # Avg Load: 0.20, 0.08, 0.01 - # - # Memory - # Mem: total used free cached available - # Physical: 7.8GB 598MB 7.0GB 4.0GB 7.0GB - # Swap: 512MB 0B 512MB - # - # Storage - # Filesystem: /dev/sda - # Total: 157G - # Used: 138G - # Available: 12G - - echo -e "" - echo -e "${lightyellow}Server Resource${default}" - fn_messages_separator - { - echo -e "${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" - echo -e "${lightblue}Avg Load:\t${default}${load}" - } | column -s $'\t' -t - echo -e "" - { - echo -e "${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 "${lightblue}Filesystem:\t${default}${filesystem}" - echo -e "${lightblue}Total:\t\t${default}${totalspace}" - echo -e "${lightblue}Used:\t\t${default}${usedspace}" - echo -e "${lightblue}Available:\t${default}${availspace}" - } | column -s $'\t' -t - echo -e "" - { - echo -e "${lightyellow}Network${default}" - if [ -n "${netint}" ]; then - echo -e "${lightblue}Interface:\t${default}${netint}" - fi - if [ -n "${netlink}" ]; then - echo -e "${lightblue}Link Speed:\t${default}${netlink}" - fi - echo -e "${lightblue}IP:\t${default}${ip}" - if [ "${ip}" != "${extip}" ]; then - echo -e "${lightblue}Internet IP:\t${default}${extip}" - fi - } | column -s $'\t' -t -} - -fn_info_message_gameserver_resource(){ - # Game Server Resource Usage - # ========================================================================================================================================================================================================================================== - # CPU Used: 2.5% - # Mem Used: 2.1% 171MB - # - # Storage - # Total: 21G - # Serverfiles: 20G - # Backups: 20K - - echo -e "" - echo -e "${lightyellow}Game Server Resource Usage${default}" - fn_messages_separator - { - if [ "${status}" == "1" ]; then - echo -e "${lightblue}CPU Used:\t${default}${cpuused}%${default}" - echo -e "${lightblue}Mem Used:\t${default}${pmemused}%\t${memused}MB${default}" - else - echo -e "${lightblue}CPU Used:\t${default}0%${default}" - echo -e "${lightblue}Mem Used:\t${default}0%\t0MB${default}" - fi - } | column -s $'\t' -t - echo -e "" - { - echo -e "${lightyellow}Storage${default}" - echo -e "${lightblue}Total:\t${default}${rootdirdu}" - echo -e "${lightblue}Serverfiles:\t${default}${serverfilesdu}" - if [ -d "${backupdir}" ]; then - echo -e "${lightblue}Backups:\t${default}${backupdirdu}" - fi - } | column -s $'\t' -t -} - -fn_info_message_gameserver(){ - # Counter-Strike: Global Offensive Server Details - # ========================================================================================================================================================================================================================================== - # Server name: LinuxGSM - # Server IP: 80.70.189.230:27015 - # Server password: NOT SET - # RCON password: adminF54CC0VR - # Players: 0/16 - # Current map: de_mirage - # Default map: de_mirage - # Game type: 0 - # Game mode: 0 - # Tick rate: 64 - # Master Server: true - # Status: ONLINE - - echo -e "" - echo -e "${lightgreen}${gamename} Server Details${default}" - fn_info_message_password_strip - fn_messages_separator - { - # Server name - if [ -n "${gdname}" ]; then - echo -e "${lightblue}Server name:\t${default}${gdname}" - elif [ -n "${servername}" ]; then - echo -e "${lightblue}Server name:\t${default}${servername}" - fi - - # Server description - if [ -n "${serverdescription}" ]; then - echo -e "${lightblue}Server Description:\t${default}${serverdescription}" - fi - - # Branch - if [ -n "${branch}" ]; then - echo -e "${lightblue}Branch:\t${default}${branch}" - fi - - # Server ip - if [ "${multiple_ip}" == "1" ]; then - echo -e "${lightblue}Server IP:\t${default}NOT SET" - else - echo -e "${lightblue}Server IP:\t${default}${ip}:${port}" - fi - - # Internet ip - if [ -n "${extip}" ]; then - if [ "${ip}" != "${extip}" ]; then - echo -e "${lightblue}Internet IP:\t${default}${extip}:${port}" - fi - fi - - # Display ip - if [ -n "${displayip}" ]; then - echo -e "${lightblue}Display IP:\t${default}${displayip}:${port}" - fi - - # Server password - if [ -n "${serverpassword}" ]; then - echo -e "${lightblue}Server password:\t${default}${serverpassword}" - fi - - # Query enabled (Starbound) - if [ -n "${queryenabled}" ]; then - echo -e "${lightblue}Query enabled:\t${default}${queryenabled}" - fi - - # RCON enabled (Starbound) - if [ -n "${rconenabled}" ]; then - echo -e "${lightblue}RCON enabled:\t${default}${rconenabled}" - fi - - # RCON password - if [ -n "${rconpassword}" ]; then - echo -e "${lightblue}RCON password:\t${default}${rconpassword}" - fi - - # RCON web (Rust) - if [ -n "${rconweb}" ]; then - echo -e "${lightblue}RCON web:\t${default}${rconweb}" - fi - - # Admin password - if [ -n "${adminpassword}" ]; then - echo -e "${lightblue}Admin password:\t${default}${adminpassword}" - fi - - # Stats password (Quake Live) - if [ -n "${statspassword}" ]; then - echo -e "${lightblue}Stats password:\t${default}${statspassword}" - fi - - # Players - if [ "${querystatus}" != "0" ]; then - if [ -n "${maxplayers}" ]; then - echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}" - fi - else - if [ -n "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then - echo -e "${lightblue}Players:\t${default}${gdplayers}/${gdmaxplayers}" - elif [ -n "${gdplayers}" ]&&[ -n "${maxplayers}" ]; then - echo -e "${lightblue}Players:\t${default}${gdplayers}/${maxplayers}" - elif [ -z "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then - echo -e "${lightblue}Players:\t${default}0/${gdmaxplayers}" - elif [ -n "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]; then - echo -e "${lightblue}Players:\t${default}${gdplayers}/∞" - elif [ -z "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]&&[ -n "${maxplayers}" ]; then - echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}" - fi - fi - - # Bots - if [ -n "${gdbots}" ]; then - echo -e "${lightblue}Bots:\t${default}${gdbots}" - fi - - # Current map - if [ -n "${gdmap}" ]; then - echo -e "${lightblue}Current map:\t${default}${gdmap}" - fi - - # Default map - if [ -n "${defaultmap}" ]; then - echo -e "${lightblue}Default map:\t${default}${defaultmap}" - fi - - if [ -n "${defaultscenario}" ]; then - # Current scenario - if [ -n "${gdgamemode}" ]; then - echo -e "${lightblue}Current scenario:\t${default}${gdgamemode}" - fi - else - # Current game mode - if [ -n "${gdgamemode}" ]; then - echo -e "${lightblue}Current game mode:\t${default}${gdgamemode}" - fi - fi - - # Default scenario - if [ -n "${defaultscenario}" ]; then - echo -e "${lightblue}Default scenario:\t${default}${defaultscenario}" - fi - - # Game type - if [ -n "${gametype}" ]; then - echo -e "${lightblue}Game type:\t${default}${gametype}" - fi - - # Game mode - if [ -n "${gamemode}" ]; then - echo -e "${lightblue}Game mode:\t${default}${gamemode}" - fi - - # Game world - if [ -n "${gameworld}" ]; then - echo -e "${lightblue}Game world:\t${default}${gameworld}" - fi - - # Tick rate - if [ -n "${tickrate}" ]; then - echo -e "${lightblue}Tick rate:\t${default}${tickrate}" - fi - - # Sharding (Don't Starve Together) - if [ -n "${sharding}" ]; then - echo -e "${lightblue}Sharding:\t${default}${sharding}" - fi - - # Master (Don't Starve Together) - if [ -n "${master}" ]; then - echo -e "${lightblue}Master:\t${default}${master}" - fi - - # Shard (Don't Starve Together) - if [ -n "${shard}" ]; then - echo -e "${lightblue}Shard:\t${default}${shard}" - fi - - # Cluster (Don't Starve Together) - if [ -n "${cluster}" ]; then - echo -e "${lightblue}Cluster:\t${default}${cluster}" - fi - - # Cave (Don't Starve Together) - if [ -n "${cave}" ]; then - echo -e "${lightblue}Cave:\t${default}${cave}" - fi - - # Creativemode (Hurtworld) - if [ -n "${creativemode}" ]; then - echo -e "${lightblue}Creativemode:\t${default}${creativemode}" - fi - - # TeamSpeak dbplugin - if [ -n "${dbplugin}" ]; then - echo -e "${lightblue}dbplugin:\t${default}${dbplugin}" - fi - - # ASE (Multi Theft Auto) - if [ -n "${ase}" ]; then - echo -e "${lightblue}ASE:\t${default}${ase}" - fi - - # Save interval (Rust) - if [ -n "${saveinterval}" ]; then - echo -e "${lightblue}ASE:\t${default}${saveinterval} s" - fi - - # Random map rotation mode (Squad and Post Scriptum) - if [ -n "${randommap}" ]; then - echo -e "${lightblue}Map rotation:\t${default}${randommap}" - fi - - # Listed on Master server - if [ -n "${displaymasterserver}" ]; then - if [ "${displaymasterserver}" == "true" ]; then - echo -e "${lightblue}Master server:\t${green}${displaymasterserver}${default}" - else - echo -e "${lightblue}Master server:\t${red}${displaymasterserver}${default}" - fi - fi - - # Online status - if [ "${status}" == "0" ]; then - echo -e "${lightblue}Status:\t${red}OFFLINE${default}" - else - echo -e "${lightblue}Status:\t${green}ONLINE${default}" - fi - } | column -s $'\t' -t - echo -e "" -} - -fn_info_message_script(){ - # - # csgoserver Script Details - #========================================================================================================================================================================================================================================== - # Script name: csgoserver - # LinuxGSM version: v19.9.0 - # glibc required: 2.15 - # Discord alert: off - # Slack alert: off - # Email alert: off - # Pushbullet alert: off - # IFTTT alert: off - # Mailgun (email) alert: off - # Pushover alert: off - # Telegram alert: off - # Update on start: off - # User: lgsm - # Location: /home/lgsm/csgoserver - # Config file: /home/lgsm/csgoserver/serverfiles/csgo/cfg/csgoserver.cfg - - - echo -e "${lightgreen}${selfname} Script Details${default}" - fn_messages_separator - { - # Script name - echo -e "${lightblue}Script name:\t${default}${selfname}" - - # LinuxGSM version - if [ -n "${version}" ]; then - echo -e "${lightblue}LinuxGSM version:\t${default}${version}" - fi - - # glibc required - if [ -n "${glibc}" ]; then - if [ "${glibc}" == "null" ]; then - # Glibc is not required. - : - 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 - 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}" - fi - fi - - # Discord alert - echo -e "${lightblue}Discord alert:\t${default}${discordalert}" - # Slack alert - echo -e "${lightblue}Slack alert:\t${default}${slackalert}" - # Email alert - echo -e "${lightblue}Email alert:\t${default}${emailalert}" - # Pushbullet alert - echo -e "${lightblue}Pushbullet alert:\t${default}${pushbulletalert}" - # IFTTT alert - echo -e "${lightblue}IFTTT alert:\t${default}${iftttalert}" - # Mailgun alert - echo -e "${lightblue}Mailgun (email) alert:\t${default}${mailgunalert}" - # Pushover alert - echo -e "${lightblue}Pushover alert:\t${default}${pushoveralert}" - # Telegram alert - echo -e "${lightblue}Telegram alert:\t${default}${telegramalert}" - # Update on start - if [ -n "${updateonstart}" ]; then - echo -e "${lightblue}Update on start:\t${default}${updateonstart}" - fi - - # User - echo -e "${lightblue}User:\t${default}$(whoami)" - - # Script location - echo -e "${lightblue}Location:\t${default}${rootdir}" - - # Config file location - if [ -n "${servercfgfullpath}" ]; then - if [ -f "${servercfgfullpath}" ]; then - echo -e "${lightblue}Config file:\t${default}${servercfgfullpath}" - elif [ -d "${servercfgfullpath}" ]; then - echo -e "${lightblue}Config dir:\t${default}${servercfgfullpath}" - else - echo -e "${lightblue}Config file:\t${default}${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})" - fi - fi - - # Network config file location (ARMA 3) - if [ -n "${networkcfgfullpath}" ]; then - echo -e "${lightblue}Network config file:\t${default}${networkcfgfullpath}" - fi - } | column -s $'\t' -t -} - -fn_info_message_backup(){ - # - # Backups - # ===================================== - # No. of backups: 1 - # Latest backup: - # date: Fri May 6 18:34:19 UTC 2016 - # file: /home/lgsm/qlserver/backups/ql-server-2016-05-06-183239.tar.gz - # size: 945M - - echo -e "" - echo -e "${lightgreen}Backups${default}" - fn_messages_separator - if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then - echo -e "No Backups created" - else - { - echo -e "${lightblue}No. of backups:\t${default}${backupcount}" - echo -e "${lightblue}Latest backup:${default}" - if [ "${lastbackupdaysago}" == "0" ]; then - echo -e "${lightblue} date:\t${default}${lastbackupdate} (less than 1 day ago)" - elif [ "${lastbackupdaysago}" == "1" ]; then - echo -e "${lightblue} date:\t${default}${lastbackupdate} (1 day ago)" - else - echo -e "${lightblue} date:\t${default}${lastbackupdate} (${lastbackupdaysago} days ago)" - fi - echo -e "${lightblue} file:\t${default}${lastbackup}" - echo -e "${lightblue} size:\t${default}${lastbackupsize}" - } | column -s $'\t' -t - fi -} - -fn_info_message_commandlineparms(){ - # - # Command-line Parameters - # ===================================== - # ./run_server_x86.sh +set net_strict 1 - - echo -e "" - echo -e "${lightgreen}Command-line Parameters${default}" - fn_info_message_password_strip - fn_messages_separator - if [ "${serverpassword}" == "NOT SET" ]; then - unset serverpassword - fi - fn_parms - echo -e "${executable} ${parms}" -} - -fn_info_message_ports(){ - # Ports - # ===================================== - # Change ports by editing the parameters in: - # /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg - - echo -e "" - echo -e "${lightgreen}Ports${default}" - fn_messages_separator - echo -e "${lightblue}Change ports by editing the parameters in:${default}" - - parmslocation="${red}UNKNOWN${default}" - # engines/games that require editing in the config file. - local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Minecraft Bedrock" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "seriousengine35" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" "wurm") - for port_edit in "${ports_edit_array[@]}" - do - if [ "${shortname}" == "ut3" ]; then - parmslocation="${servercfgdir}/UTWeb.ini" - elif [ "${shortname}" == "kf2" ]; then - parmslocation="${servercfgdir}/LinuxServer-KFEngine.ini\n${servercfgdir}/KFWeb.ini" - elif [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then - parmslocation="${servercfgfullpath}" - fi - done - # engines/games that require editing the parms. - local ports_edit_array=( "Avorion" "goldsrc" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "qfusion" "Rust" "Soldat" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned" ) - for port_edit in "${ports_edit_array[@]}" - do - if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then - parmslocation="${configdirserver}" - fi - done - echo -e "${parmslocation}" - echo -e "" - echo -e "${lightblue}Useful port diagnostic command:${default}" -} - -fn_info_message_statusbottom(){ - echo -e "" - if [ "${status}" == "0" ]; then - echo -e "${lightblue}Status:\t${red}OFFLINE${default}" - else - echo -e "${lightblue}Status:\t${green}ONLINE${default}" - fi - echo -e "" -} - -fn_info_logs(){ - echo -e "" - echo -e "${selfname} Logs" - echo -e "=================================" - - if [ -n "${lgsmlog}" ]; then - echo -e "\nScript log\n===================" - if [ ! "$(ls -A "${lgsmlogdir}")" ]; then - echo -e "${lgsmlogdir} (NO LOG FILES)" - elif [ ! -s "${lgsmlog}" ]; then - echo -e "${lgsmlog} (LOG FILE IS EMPTY)" - else - echo -e "${lgsmlog}" - tail -25 "${lgsmlog}" - fi - echo -e "" - fi - - if [ -n "${consolelog}" ]; then - echo -e "\nConsole log\n====================" - if [ ! "$(ls -A "${consolelogdir}")" ]; then - echo -e "${consolelogdir} (NO LOG FILES)" - elif [ ! -s "${consolelog}" ]; then - echo -e "${consolelog} (LOG FILE IS EMPTY)" - else - echo -e "${consolelog}" - tail -25 "${consolelog}" | awk '{ sub("\r$", ""); print }' - fi - echo -e "" - fi - - if [ -n "${gamelogdir}" ]; then - echo -e "\nServer log\n===================" - if [ ! "$(ls -A "${gamelogdir}")" ]; then - echo -e "${gamelogdir} (NO LOG FILES)" - else - echo -e "${gamelogdir}" - # dos2unix sed 's/\r//' - tail "${gamelogdir}"/* 2>/dev/null | grep -v "==>" | sed '/^$/d' | sed 's/\r//' | tail -25 - fi - echo -e "" - fi -} - -# Engine/Game Specific details - -fn_info_message_assettocorsa(){ - echo -e "netstat -atunp| grep acServer" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> HTTP\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_ark(){ - echo -e "netstat -atunp | grep ShooterGame" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - # Don't do arithmetics if ever the port wasn't a numeric value - if [ "${port}" -eq "${port}" ]; then - echo -e "> RAW\tINBOUND\t$((port+1))\tudp" - fi - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" - } | column -s $'\t' -t -} - -fn_info_message_avorion() { - echo "netstat -atunp | grep Avorion" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" - } | column -s $'\t' -t -} - -fn_info_message_ballisticoverkill(){ - echo -e "netstat -atunp | grep BODS.x86" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_battalion1944(){ - echo -e "netstat -atunp | grep BattalionServ" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - # Don't do arithmetics if ever the port wasn't a numeric value - # unconfirmed - http://wiki.battaliongame.com/Community_Servers#Firewalls_.2F_Port_Forwarding - if [ "${port}" -eq "${port}" ]; then - echo -e "> Steam\tINBOUND\t$((port+1))\tudp" - echo -e "> Unused\tINBOUND\t$((port+2))\ttcp" - fi - echo -e "> Query\tINBOUND\t${queryport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_cod(){ - echo -e "netstat -atunp | grep cod_lnxded" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_coduo(){ - echo -e "netstat -atunp | grep coduo_lnxded" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_chivalry(){ - fn_info_message_password_strip - echo -e "netstat -atunp | grep UDKGame" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> RCON\tINBOUND\t27960\ttcp" - } | column -s $'\t' -t -} - -fn_info_message_cod2(){ - echo -e "netstat -atunp | grep cod2_lnxded" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_cod4(){ - echo -e "netstat -atunp" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_codwaw(){ - echo -e "netstat -atunp | grep codwaw_lnxded" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_dst(){ - echo -e "netstat -atunp | grep dontstarve" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game: Server\tINBOUND\t${port}\tudp" - echo -e "> Game: Master\tINBOUND\t${masterport}\tudp" - echo -e "> Steam: Auth\tINBOUND\t${steamauthenticationport}\tudp" - echo -e "> Steam: Master\tINBOUND\t${steammasterserverport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_eco(){ - echo -e "netstat -atunp | grep mono" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp" - } | column -s $'\t' -t -} - - -fn_info_message_etlegacy(){ - echo -e "netstat -atunp | grep etlded" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_factorio(){ - echo -e "netstat -atunp | grep factorio" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" - } | column -s $'\t' -t -} - -fn_info_message_goldsrc(){ - echo -e "netstat -atunp | grep hlds_linux" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp" - echo -e "< Client\tOUTBOUND\t${clientport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_hurtworld(){ - echo -e "netstat -atunp | grep Hurtworld" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_inss(){ - echo -e "netstat -atunp | grep Insurgency" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" - } | column -s $'\t' -t -} - -fn_info_message_justcause2(){ - echo -e "netstat -atunp | grep Jcmp-Server" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_justcause3(){ - echo -e "netstat -atunp | grep Server" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> Steam\tINBOUND\t${steamport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_minecraft(){ - echo -e "netstat -atunp | grep java" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\ttcp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> Rcon\tINBOUND\t${rconport}\ttcp" - } | column -s $'\t' -t -} - -fn_info_message_minecraft_bedrock(){ - echo -e "netstat -atunp | grep bedrock_serv" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Game\tINBOUND\t${port6}\tudp6" - } | column -s $'\t' -t -} - -fn_info_message_onset(){ - echo -e "netstat -atunp | grep OnsetServer" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> HTTP\tINBOUND\t${httpport}\ttcp" - } | column -s $'\t' -t -} - -fn_info_message_mohaa(){ - echo -e "netstat -atunp | grep mohaa_lnxded" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_mumble(){ - echo -e "netstat -atunp | grep murmur" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Voice\tINBOUND\t${port}\tudp" - echo -e "> ServerQuery\tINBOUND\t${port}\ttcp" - } | column -s $'\t' -t -} -fn_info_message_pstbs(){ - echo -e "netstat -atunp | grep PostScriptum" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" - } | column -s $'\t' -t -} - -fn_info_message_projectcars(){ - echo -e "netstat -atunp | grep DedicatedS" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> Steam\tINBOUND\t${steamport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_projectzomboid(){ - echo -e "netstat -atunp | grep ProjectZomb" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_quake(){ - echo -e "netstat -atunp | grep mvdsv" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_quake2(){ - echo -e "netstat -atunp | grep quake2" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_quake3(){ - echo -e "netstat -atunp | grep q3ded" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_quakelive(){ - echo -e "netstat -atunp | grep qzeroded" - echo -e "" - if [ -z "${port}" ]||[ -z "${rconport}" ]||[ -z "${statsport}" ]; then - echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}." - echo -e "" - fi - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" - echo -e "> Rcon\tINBOUND\t${rconport}\tudp" - echo -e "> Stats\tINBOUND\t${statsport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_arma3(){ - echo -e "netstat -atunp | grep arma3server" - echo -e "" - # Default port - if [ -z "${port}" ]; then - port="2302" - fi - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - # Don't do arithmetics if ever the port wasn't a numeric value - if [ "${port}" -eq "${port}" ]; then - echo -e "> Query Steam\tINBOUND\t$((port+1))\tudp" - echo -e "> Steam: Master traffic\tINBOUND\t$((port+2))\tudp" - echo -e "> Undocumented Port\tINBOUND\t$((port+3))\tudp" - fi - } | column -s $'\t' -t -} - -fn_info_message_bf1942(){ - echo -e "netstat -atunp | grep bf1942_lnxd" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" - echo -e "> Query Steam\tINBOUND\t${queryport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_risingworld(){ - echo -e "netstat -atunp | grep java" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp" - echo -e "> Query HTTP\tINBOUND\t${httpqueryport}\ttcp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" - } | column -s $'\t' -t -} - -fn_info_message_rtcw(){ - echo -e "netstat -atunp | grep iowolfded" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_rust(){ - echo -e "netstat -atunp | grep Rust" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" - } | column -s $'\t' -t -} - -fn_info_message_samp(){ - echo -e "netstat -atunp | grep samp03svr" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp" - } | column -s $'\t' -t -} - - -fn_info_message_ss3(){ - echo -e "netstat -atunp | grep Sam3_Ded" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\ttcp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_sbots(){ - echo -e "netstat -atunp | grep blank1" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_sdtd(){ - fn_info_message_password_strip - echo -e "netstat -atunp | grep 7DaysToDie" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp" - echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp" - } | column -s $'\t' -t - echo -e "" - echo -e "${lightgreen}${servername} WebAdmin${default}" - fn_messages_separator - { - echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}" - echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}" - echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}" - } | column -s $'\t' -t - echo -e "" - echo -e "${lightgreen}${servername} Telnet${default}" - fn_messages_separator - { - echo -e "${lightblue}Telnet enabled:\t${default}${telnetenabled}" - echo -e "${lightblue}Telnet address:\t${default}${ip} ${telnetport}" - echo -e "${lightblue}Telnet password:\t${default}${telnetpass}" - } | column -s $'\t' -t -} - -fn_info_message_sof2(){ - echo -e "netstat -atunp | grep sof2ded" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_source(){ - echo -e "netstat -atunp | grep srcds_linux" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp" - echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp" - echo -e "< Client\tOUTBOUND\t${clientport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_spark(){ - fn_info_message_password_strip - echo -e "netstat -atunp | grep server_linux" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp" - } | column -s $'\t' -t - echo -e "" - echo -e "${lightgreen}${servername} WebAdmin${default}" - fn_messages_separator - { - echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}/index.html" - echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}" - echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}" - } | column -s $'\t' -t -} - -fn_info_message_squad(){ - echo -e "netstat -atunp | grep SquadServer" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" - } | column -s $'\t' -t -} - -fn_info_message_starbound(){ - echo -e "netstat -atunp | grep starbound" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\ttcp" - echo -e "> Query\tINBOUND\t${queryport}\ttcp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" - } | column -s $'\t' -t -} - -fn_info_message_stationeers(){ - echo -e "netstat -atunp | grep rocketstation" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\ttcp" - echo -e "> Query\tINBOUND\t${queryport}\ttcp" - } | column -s $'\t' -t -} - -fn_info_message_teamspeak3(){ - echo -e "netstat -atunp | grep ts3server" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Voice\tINBOUND\t${port}\tudp" - echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp" - echo -e "> File transfer\tINBOUND\t${fileport}\ttcp" - } | column -s $'\t' -t -} - -fn_info_message_teeworlds(){ - echo -e "netstat -atunp | grep teeworlds" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\Query\tINBOUND\t${port}\ttcp" - } | column -s $'\t' -t -} - -fn_info_message_terraria(){ - echo -e "netstat -atunp | grep Terraria" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\ttcp" - } | column -s $'\t' -t -} - -fn_info_message_towerunite(){ - echo -e "netstat -atunp | grep TowerServer" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\ttcp" - # Don't do arithmetics if ever the port wasn't a numeric value - if [ "${port}" -eq "${port}" ]; then - echo -e "> Steam\tINBOUND\t$((port+1))\tudp" - fi - echo -e "> Query\tINBOUND\t${queryport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_unreal(){ - fn_info_message_password_strip - echo -e "netstat -atunp | grep ucc-bin" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE" - echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - if [ "${engine}" == "unreal" ]; then - echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp" - fi - if [ "${engine}" != "unreal" ]&&[ "${appid}" != "223250" ]; then - echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}" - fi - if [ "${appid}" == "215360" ]; then - echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp" - else - echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp" - fi - if [ "${appid}" ]; then - if [ "${appid}" == "223250" ]; then - echo -e "< Steam\tINBOUND\t20610\tudp" - else - echo -e "< Steam\tINBOUND\t20660\tudp" - fi - fi - echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" - } | column -s $'\t' -t - echo -e "" - echo -e "${lightgreen}${servername} WebAdmin${default}" - fn_messages_separator - { - echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}" - echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}" - echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}" - echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}" - } | column -s $'\t' -t -} - -fn_info_message_unreal2(){ - fn_info_message_password_strip - echo -e "netstat -atunp | grep ucc-bin" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE" - echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - if [ "${appid}" != "223250" ]; then - echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}" - fi - echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" - } | column -s $'\t' -t - echo -e "" - echo -e "${lightgreen}${servername} WebAdmin${default}" - fn_messages_separator - { - echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}" - echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}" - echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}" - echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}" - } | column -s $'\t' -t -} - -fn_info_message_unreal3(){ - fn_info_message_password_strip - echo -e "netstat -atunp | grep ut3-bin" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" - } | column -s $'\t' -t - echo -e "" - echo -e "${lightgreen}${servername} WebAdmin${default}" - fn_messages_separator - { - echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}" - echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}" - echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}" - echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}" - } | column -s $'\t' -t -} - -fn_info_message_unturned(){ - echo -e "netstat -atunp | grep Unturned" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_ut(){ - echo -e "netstat -atunp | grep UE4Server" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_kf2(){ - fn_info_message_password_strip - echo -e "netstat -atunp | grep KFGame" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\ttcp\tPort=${port}" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> Steam\tINBOUND\t20560\tudp" - echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" - } | column -s $'\t' -t - echo -e "" - echo -e "${lightgreen}${servername} WebAdmin${default}" - fn_messages_separator - { - echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}" - echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}" - echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}" - echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}" - } | column -s $'\t' -t -} - -fn_info_message_wolfensteinenemyterritory(){ - echo -e "netstat -atunp | grep etded" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - - -fn_info_message_wurmunlimited(){ - echo -e "netstat -atunp | grep WurmServer" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\ttcp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_mta(){ - echo -e "netstat -atunp | grep mta-server" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tOUTBOUND\t${port}\tudp" - echo -e "> HTTP Server\tINBOUND\t${httpport}\ttcp" - if [ "${ase}" == "Enabled" ]; then - echo -e "> Query Port\tOUTBOUND\t${queryport}\tudp" - fi - } | column -s $'\t' -t -} - -fn_info_message_mordhau(){ - echo -e "netstat -atunp | grep Mord" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> BeaconPort\tINBOUND\t${beaconport}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_barotrauma(){ - echo -e "netstat -atunp | grep /./Server.bin" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t$((port+1))\tudp" - } | column -s $'\t' -t -} - -fn_info_message_soldat() { - echo -e "netstat -atunp | grep soldat" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> FILES\tINBOUND\t$((port+10))\ttcp" - } | column -s $'\t' -t -} - -fn_info_message_warfork(){ - echo -e "netstat -atunp | grep wf_server" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> HTTP\tINBOUND\t${httpport}\ttcp" - } | column -s $'\t' -t -} - -fn_info_message_select_engine(){ - # Display details depending on game or engine. - if [ "${shortname}" == "ac" ]; then - fn_info_message_assettocorsa - elif [ "${shortname}" == "ark" ]; then - fn_info_message_ark - elif [ "${shortname}" == "av" ]; then - fn_info_message_avorion - elif [ "${shortname}" == "arma3" ]; then - fn_info_message_arma3 - elif [ "${shortname}" == "bo" ]; then - fn_info_message_ballisticoverkill - elif [ "${shortname}" == "bt" ]; then - fn_info_message_barotrauma - elif [ "${shortname}" == "bt1944" ]; then - fn_info_message_battalion1944 - elif [ "${shortname}" == "cmw" ]; then - fn_info_message_chivalry - elif [ "${shortname}" == "cod" ]; then - fn_info_message_cod - elif [ "${shortname}" == "coduo" ]; then - fn_info_message_coduo - elif [ "${shortname}" == "cod2" ]; then - fn_info_message_cod2 - elif [ "${shortname}" == "cod4" ]; then - fn_info_message_cod4 - elif [ "${shortname}" == "codwaw" ]; then - fn_info_message_codwaw - elif [ "${shortname}" == "dst" ]; then - fn_info_message_dst - elif [ "${shortname}" == "eco" ]; then - fn_info_message_eco - elif [ "${shortname}" == "etl" ]; then - fn_info_message_etlegacy - elif [ "${shortname}" == "fctr" ]; then - fn_info_message_factorio - elif [ "${shortname}" == "hw" ]; then - fn_info_message_hurtworld - elif [ "${shortname}" == "inss" ]; then - fn_info_message_inss - elif [ "${shortname}" == "jc2" ]; then - fn_info_message_justcause2 - elif [ "${shortname}" == "jc3" ]; then - fn_info_message_justcause3 - elif [ "${shortname}" == "kf2" ]; then - fn_info_message_kf2 - elif [ "${shortname}" == "mcb" ]; then - fn_info_message_minecraft_bedrock - elif [ "${shortname}" == "onset" ]; then - fn_info_message_onset - elif [ "${shortname}" == "pz" ]; then - fn_info_message_projectzomboid - elif [ "${shortname}" == "pstbs" ]; then - fn_info_message_pstbs - elif [ "${shortname}" == "pc" ]; then - fn_info_message_projectcars - elif [ "${shortname}" == "qw" ]; then - fn_info_message_quake - elif [ "${shortname}" == "q2" ]; then - fn_info_message_quake2 - elif [ "${shortname}" == "q3" ]; then - fn_info_message_quake3 - elif [ "${shortname}" == "ql" ]; then - fn_info_message_quakelive - elif [ "${shortname}" == "samp" ]; then - fn_info_message_samp - elif [ "${shortname}" == "sdtd" ]; then - fn_info_message_sdtd - elif [ "${shortname}" == "squad" ]; then - fn_info_message_squad - elif [ "${shortname}" == "st" ]; then - fn_info_message_stationeers - elif [ "${shortname}" == "sof2" ]; then - fn_info_message_sof2 - elif [ "${shortname}" == "sol" ]; then - fn_info_message_soldat - elif [ "${shortname}" == "st" ]; then - fn_info_message_starbound - elif [ "${shortname}" == "sbots" ]; then - fn_info_message_sbots - elif [ "${shortname}" == "ss3" ]; then - fn_info_message_ss3 - elif [ "${shortname}" == "terraria" ]; then - fn_info_message_terraria - elif [ "${shortname}" == "ts3" ]; then - fn_info_message_teamspeak3 - elif [ "${shortname}" == "tu" ]; then - fn_info_message_towerunite - elif [ "${shortname}" == "tw" ]; then - fn_info_message_teeworlds - elif [ "${shortname}" == "unt" ]; then - fn_info_message_unturned - elif [ "${shortname}" == "ut" ]; then - fn_info_message_ut - elif [ "${shortname}" == "mc" ]; then - fn_info_message_minecraft - elif [ "${shortname}" == "mh" ]; then - fn_info_message_mordhau - elif [ "${shortname}" == "mohaa" ]; then - fn_info_message_mohaa - elif [ "${shortname}" == "mta" ]; then - fn_info_message_mta - elif [ "${shortname}" == "mumble" ]; then - fn_info_message_mumble - elif [ "${shortname}" == "bf1942" ]; then - fn_info_message_bf1942 - elif [ "${shortname}" == "rtcw" ]; then - fn_info_message_rtcw - elif [ "${shortname}" == "rust" ]; then - fn_info_message_rust - elif [ "${shortname}" == "wf" ]; then - fn_info_message_warfork - elif [ "${shortname}" == "wurm" ]; then - fn_info_message_wurmunlimited - elif [ "${shortname}" == "rw" ]; then - fn_info_message_risingworld - elif [ "${shortname}" == "wet" ]; then - fn_info_message_wolfensteinenemyterritory - elif [ "${engine}" == "goldsrc" ]; then - fn_info_message_goldsrc - elif [ "${engine}" == "source" ]; then - fn_info_message_source - elif [ "${engine}" == "spark" ]; then - fn_info_message_spark - elif [ "${engine}" == "unreal" ]; then - fn_info_message_unreal - elif [ "${engine}" == "unreal2" ]; then - fn_info_message_unreal2 - elif [ "${engine}" == "unreal3" ]; then - fn_info_message_unreal3 - else - fn_print_error_nl "Unable to detect server engine." - fi -} - -# Separator is different for details -fn_messages_separator(){ - if [ "${commandname}" == "details" ]; then - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = - else - echo -e "=================================" - fi -} - -# Removes the passwords form all but details -fn_info_message_password_strip(){ - if [ "${commandname}" != "DETAILS" ]; then - if [ "${serverpassword}" ]; then - serverpassword="********" - fi - - if [ "${rconpassword}" ]; then - rconpassword="********" - fi - - if [ "${adminpassword}" ]; then - adminpassword="********" - fi - - if [ "${statspassword}" ]; then - statspassword="********" - fi - - if [ "${webadminpass}" ]; then - webadminpass="********" - fi - - if [ "${telnetpass}" ]; then - telnetpass="********" - fi - - if [ "${wsapikey}" ]; then - wsapikey="********" - fi - - if [ "${gslt}" ]; then - gslt="********" - fi - - fi -} diff --git a/lgsm/functions/info_parms.sh b/lgsm/functions/info_parms.sh deleted file mode 100644 index 1a6a42bb8..000000000 --- a/lgsm/functions/info_parms.sh +++ /dev/null @@ -1,300 +0,0 @@ -#!/bin/bash -# LinuxGSM info_parms.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: If specific parms are not set then this will be displayed in details. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -## Examples of filtering to get info from config files -# sed 's/foo//g' - remove foo -# tr -cd '[:digit:]' leave only digits -# tr -d '=\"; ' remove selected charectors =\"; -# grep -v "foo" filter out lines that contain foo - -unavailable="${red}UNAVAILABLE${default}" -zero="${red}0${default}" - -fn_info_parms_ark(){ - port=${port:-"0"} - queryport=${queryport:-"0"} - rconport=${rconport:-"0"} - maxplayers=${maxplayers:-"0"} -} - -fn_info_parms_barotrauma(){ - port=${port:-"0"} - queryport=${queryport:-"0"} -} - -fn_info_parms_cod(){ - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${port:-"0"} -} - -fn_info_parms_dst(){ - sharding=${sharding:-"NOT SET"} - master=${master:-"NOT SET"} - shard=${shard:-"NOT SET"} - cluster=${cluster:-"NOT SET"} - cave=${cave:-"NOT SET"} -} - -fn_info_parms_factorio(){ - port=${port:-"0"} - rconport=${rconport:-"0"} - rconpassword=${rconpassword:-"NOT SET"} -} - -fn_info_parms_hurtworld(){ - servername=${servername:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - maxplayers=${maxplayers:-"0"} - defaultmap=${defaultmap:-"NOT SET"} - creativemode=${creativemode:-"NOT SET"} -} - -fn_info_parms_inss(){ - port=${port:-"0"} - queryport=${queryport:-"0"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - defaultmap=${defaultmap:-"NOT SET"} - defaultscenario=${defaultscenario:-"NOT SET"} - maxplayers=${maxplayers:-"0"} -} - -fn_info_parms_kf2(){ - queryport=${queryport:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - - -fn_info_parms_mordhau(){ - port=${port:-"0"} - queryport=${queryport:-"0"} - beaconport=${beaconport:-"0"} -} - -fn_info_parms_mohaa(){ - port=${port:-"0"} - queryport=${port:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_mta(){ - queryport=$((port + 123)) -} - -fn_info_parms_projectzomboid(){ - adminpassword=${adminpassword:-"NOT SET"} - queryport=${port:-"0"} -} - -fn_info_parms_quakeworld(){ - port=${port:-"0"} - queryport=${port:-"0"} -} - -fn_info_parms_quake2(){ - port=${port:-"0"} - queryport=${port:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_realvirtuality(){ - port=${port:-"0"} - queryport=$((port + 1)) -} - -fn_info_parms_risingworld(){ - servername=${servername:-"NOT SET"} - port=${port:-"0"} - httpqueryport=$((port - 1)) -} - -fn_info_parms_rtcw(){ - port=${port:-"0"} - queryport="${port:-"0"}" - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_rust(){ - servername=${servername:-"NOT SET"} - port=${port:-"0"} - queryport=${port:-"0"} - rconport=${rconport:-"0"} - rconpassword=${rconpassword:-"NOT SET"} - rconweb=${rconweb:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - saveinterval=${saveinterval:-"0"} - tickrate=${tickrate:-"0"} -} - -fn_info_parms_samp(){ - queryport=${port:-"0"} -} - -fn_info_parms_sof2(){ - port=${port:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_source(){ - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${port:-"0"} - clientport=${clientport:-"0"} -} - -fn_info_parms_spark(){ - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=$((port + 1)) - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} - webadminport=${webadminport:-"0"} - mods=${mods:-"NOT SET"} -} - -fn_info_parms_stickybots(){ - port=${port:-"0"} - queryport=${queryport:-"0"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} -} - -fn_info_parms_sof2(){ - port=${port:-"0"} - queryport=${port:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_ss3(){ - port=${port:-"0"} - queryport=$((port + 1)) -} - -fn_info_parms_towerunite(){ - port=${port:-"0"} - queryport=${queryport:-"0"} -} - -fn_info_parms_teeworlds(){ - queryport=${port:-"0"} -} - -fn_info_parms_unreal(){ - defaultmap=${defaultmap:-"NOT SET"} - queryport=$((port + 1)) -} - -fn_info_parms_unreal2(){ - defaultmap=${defaultmap:-"NOT SET"} - queryport=$((port + 1)) -} - -fn_info_parms_unreal3(){ - port=${port:-"0"} - queryport=${queryport:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_unturned(){ - servername=${selfname:-"NOT SET"} - port=${port:-"0"} -} - -fn_info_parms_ut(){ - port=${port:-"0"} -} - -fn_info_parms_wf(){ - port=${port:-"0"} - queryport="${port:-"0"}" - webadminport=${webadminport:-"0"} -} - -# ARK: Survival Evolved -if [ "${shortname}" == "ark" ]; then - fn_info_parms_ark -# ARMA 3 -elif [ "${shortname}" == "arma3" ]; then - fn_info_parms_realvirtuality -# Barotrauma -elif [ "${shortname}" == "bt" ]; then - fn_info_parms_barotrauma -# Call of Duty -elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${engine}" == "iw2.0" ]||[ "${engine}" == "iw3.0" ]; then - fn_info_parms_cod -# Factorio -elif [ "${shortname}" == "fctr" ]; then - fn_info_parms_factorio -elif [ "${shortname}" == "inss" ]; then - fn_info_parms_inss -elif [ "${shortname}" == "kf2" ]; then - fn_info_parms_kf2 -elif [ "${shortname}" == "mohaa" ]; then - fn_info_parms_mohaa -# Project Zomboid -elif [ "${shortname}" == "pz" ]; then - fn_info_parms_projectzomboid -elif [ "${shortname}" == "qw" ]; then - fn_info_parms_quakeworld -elif [ "${shortname}" == "q2" ]||[ "${shortname}" == "q3" ]; then - fn_info_parms_quake2 -elif [ "${shortname}" == "rtcw" ]; then - fn_info_parms_rtcw -# Rust -elif [ "${shortname}" == "rust" ]; then - fn_info_parms_rust -elif [ "${shortname}" == "samp" ]; then - fn_info_parms_samp -# Rising World -elif [ "${shortname}" == "rw" ]; then - fn_info_parms_risingworld -# Soldier Of Fortune 2: Gold Edition -elif [ "${shortname}" == "sof2" ]; then - fn_info_parms_sof2 -# Sticky Bots -elif [ "${shortname}" == "sbots" ]; then - fn_info_parms_stickybots -# Serious Sam -elif [ "${shortname}" == "ss3" ]; then - fn_info_parms_ss3 -elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then - fn_info_parms_source -# Spark -elif [ "${engine}" == "spark" ]; then - fn_info_parms_spark -elif [ "${shortname}" == "tu" ]; then - fn_info_parms_towerunite -elif [ "${shortname}" == "tw" ]; then - fn_info_parms_teeworlds -elif [ "${shortname}" == "mh" ]; then - fn_info_parms_mordhau -elif [ "${shortname}" == "mta" ]; then - fn_info_parms_mta -# Unreal/Unreal 2 engine -elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then - fn_info_parms_unreal -# Unreal 3 engine -elif [ "${engine}" == "unreal3" ]; then - fn_info_parms_unreal3 -elif [ "${shortname}" == "unt" ]; then - fn_info_parms_unturned -elif [ "${shortname}" == "ut" ]; then - fn_info_parms_ut -# Warfork -elif [ "${shortname}" == "wf" ]; then - fn_info_parms_wf -fi diff --git a/lgsm/functions/info_stats.sh b/lgsm/functions/info_stats.sh deleted file mode 100644 index 9bdee07fd..000000000 --- a/lgsm/functions/info_stats.sh +++ /dev/null @@ -1,155 +0,0 @@ -#!/bin/bash -# LinuxGSM info_stats.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Collect optional Stats sent to LinuxGSM project. -# Uses Google analytics. - -local modulegroup="INFO" -local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -info_distro.sh - -# remove uuid that was used in v20.2.0 and below -if [ -f "${datadir}/uuid.txt" ]; then - rm "${datadir:?}/uuid.txt" -fi - -# generate uuid's -# this consists of a standard uuid and a docker style name -# to allow human readable uuid's. -# e.g angry_proskuriakova_38a9ef76-4ae3-46a6-a895-7af474831eba - -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 "lgsm/data" "name-left.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" - fi - if [ ! -f "${datadir}/name-right.csv" ]; then - fn_fetch_file_github "lgsm/data" "name-right.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" - fi - - # generate instance uuid - if [ -n "$(command -v uuidgen 2>/dev/null)" ]; then - uuid="$(uuidgen)" - else - uuid="$(cat /proc/sys/kernel/random/uuid)" - fi - - nameleft="$(shuf -n 1 "${datadir}/name-left.csv")" - nameright="$(shuf -n 1 "${datadir}/name-right.csv")" - echo "instance_${nameleft}_${nameright}_${uuid}" > "${datadir}/uuid-${selfname}.txt" - # generate install uuid if missing - if [ ! -f "${datadir}/uuid-install.txt" ];then - echo "${nameleft}_${nameright}_${uuid}" > "${datadir}/uuid-install.txt" - fi -fi - -uuidinstance=$(cat "${datadir}/uuid-${selfname}.txt") -uuidinstall=$(cat "${datadir}/uuid-install.txt") -# machine-id is a unique id set on OS install -uuidhardware=$(cat "/etc/machine-id") - -# results are rounded up to reduce number of different results in analytics. -# nearest 100Mhz. -cpuusedmhzroundup="$(((cpuusedmhz + 99) / 100 * 100))" -# nearest 100MB -memusedroundup="$(((memused + 99) / 100 * 100))" - -# Spliting the metrics in to 3 propertys allows more accurate metrics on numbers of invidual instances, installs and hardware. -# Instance Property - UA-165287622-1 -# Install Property - UA-165287622-2 -# Hardware Property - UA-165287622-3 - -## Distro. -curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - -## Game Server Name. -curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - -## LinuxGSM Version. -curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - -## CPU usage of a game server. -if [ -n "${cpuusedmhzroundup}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi -## Ram usage of a game server. -if [ -n "${memusedroundup}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi -## Disk usage of a game server. -if [ -n "${serverfilesdu}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi - -## CPU Model. -if [ -n "${cpumodel}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - -fi - -## CPU Frequency. -if [ -n "${cpufreqency}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi - -## Server RAM. -if [ -n "${physmemtotal}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi - -## Server Disk. -if [ -n "${totalspace}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi - -## Summary Stats -curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "v=1" > /dev/null 2>&1 - -fn_script_log_info "Send LinuxGSM stats" -fn_script_log_info "* uuid-${selfname}: ${uuidinstance}" -fn_script_log_info "* uuid-install: ${uuidinstall}" -fn_script_log_info "* uuid-hardware: ${uuidhardware}" -fn_script_log_info "* Game Name: ${gamename}" -fn_script_log_info "* Distro Name: ${distroname}" -fn_script_log_info "* Game Server CPU Used: ${cpuusedmhzroundup}MHz" -fn_script_log_info "* Game Server RAM Used: ${memusedroundup}MB" -fn_script_log_info "* Game Server Disk Used: ${serverfilesdu}" -fn_script_log_info "* Server CPU Model: ${cpumodel}" -fn_script_log_info "* Server CPU Frequency: ${cpufreqency}" -fn_script_log_info "* Server RAM: ${physmemtotal}" -fn_script_log_info "* Server Disk: ${totalspace}" diff --git a/lgsm/functions/install_complete.sh b/lgsm/functions/install_complete.sh deleted file mode 100644 index 62eec08a2..000000000 --- a/lgsm/functions/install_complete.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# LinuxGSM install_complete.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Prints installation completion message and hints. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -echo -e "" -echo -e "=================================" -echo -e "Install Complete!" -fn_script_log_info "Install Complete!" -echo -e "" -echo -e "To start server type:" -echo -e "./${selfname} start" -echo -e "" -core_exit.sh diff --git a/lgsm/functions/install_factorio_save.sh b/lgsm/functions/install_factorio_save.sh deleted file mode 100644 index 71690a7a7..000000000 --- a/lgsm/functions/install_factorio_save.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# LinuxGSM install_factorio_save.sh function -# Author: Kristian Polso -# Website: https://linuxgsm.com -# Description: Creates the initial save file for Factorio - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -echo -e "" -echo -e "${lightyellow}Creating initial Factorio savefile${default}" -echo -e "=================================" -fn_sleep_time -check_glibc.sh -"${executabledir}"/factorio --create "${serverfiles}/save1" diff --git a/lgsm/functions/install_gslt.sh b/lgsm/functions/install_gslt.sh deleted file mode 100644 index 27d384936..000000000 --- a/lgsm/functions/install_gslt.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# LinuxGSM install_gslt.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Configures GSLT. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -echo -e "" -echo -e "${lightyellow}Game Server Login Token${default}" -echo -e "=================================" -fn_sleep_time -if [ "${shortname}" == "csgo" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "nmrih" ]||[ "${shortname}" == "bs" ]; then - 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" - 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 "" -if [ -z "${autoinstall}" ]; then - if [ "${shortname}" != "tu" ]; then - echo -e "Enter token below (Can be blank)." - echo -n "GSLT TOKEN: " - read -r token - if ! grep -q "^gslt=" "${configdirserver}/${selfname}.cfg" > /dev/null 2>&1; then - echo -e "\ngslt=\"${token}\"" >> "${configdirserver}/${selfname}.cfg" - else - sed -i -e "s/gslt=\"[^\"]*\"/gslt=\"${token}\"/g" "${configdirserver}/${selfname}.cfg" - fi - fi -fi -fn_sleep_time -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}." -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." -fi -echo -e "" diff --git a/lgsm/functions/install_header.sh b/lgsm/functions/install_header.sh deleted file mode 100644 index f67860dd4..000000000 --- a/lgsm/functions/install_header.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# LinuxGSM install_header.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Prints installation header. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -clear -fn_print_ascii_logo -fn_sleep_time -echo -e "=================================" -echo -e "${lightyellow}Linux${default}GSM_" -echo -e "by Daniel Gibbs" -echo -e "${lightblue}Game:${default} ${gamename}" -echo -e "${lightblue}Website:${default} https://linuxgsm.com" -echo -e "${lightblue}Contributors:${default} https://linuxgsm.com/contrib" -echo -e "${lightblue}Donate:${default} https://linuxgsm.com/donate" -echo -e "=================================" -fn_sleep_time diff --git a/lgsm/functions/install_logs.sh b/lgsm/functions/install_logs.sh deleted file mode 100644 index 21c63ccbb..000000000 --- a/lgsm/functions/install_logs.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/bash -# LinuxGSM install_logs.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Creates log directories. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -if [ "${checklogs}" != "1" ]; then - echo -e "" - echo -e "${lightyellow}Creating log directories${default}" - echo -e "=================================" -fi -fn_sleep_time -# Create LinuxGSM logs. -echo -en "installing log dir: ${logdir}..." -mkdir -p "${logdir}" -if [ $? -ne 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 [ $? -ne 0 ]; then - fn_print_fail_eol_nl - core_exit.sh -else - fn_print_ok_eol_nl -fi -echo -en "creating LinuxGSM log: ${lgsmlog}..." -touch "${lgsmlog}" -if [ $? -ne 0 ]; then - fn_print_fail_eol_nl - core_exit.sh -else - fn_print_ok_eol_nl -fi -# Create Console logs. -if [ "${consolelogdir}" ]; then - echo -en "installing console log dir: ${consolelogdir}..." - mkdir -p "${consolelogdir}" - if [ $? -ne 0 ]; 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 - fn_print_fail_eol_nl - core_exit.sh - else - fn_print_ok_eol_nl - fi -fi - -# Create Game logs. -if [ "${gamelogdir}" ]&&[ ! -d "${gamelogdir}" ]; then - echo -en "installing game log dir: ${gamelogdir}..." - if ! mkdir -p "${gamelogdir}"; then - fn_print_fail_eol_nl - core_exit.sh - else - fn_print_ok_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 ! ln -nfs "${gamelogdir}" "${logdir}/server"; then - fn_print_fail_eol_nl - core_exit.sh - else - fn_print_ok_eol_nl - fi - fi -fi - -# If server uses SteamCMD create a symbolic link to the Steam logs. -if [ -d "${rootdir}/Steam/logs" ]; then - if [ ! -L "${logdir}/steamcmd" ]; then - echo -en "creating symlink to steam log dir: ${logdir}/steamcmd -> ${rootdir}/Steam/logs..." - if ! ln -nfs "${rootdir}/Steam/logs" "${logdir}/steamcmd"; then - fn_print_fail_eol_nl - core_exit.sh - else - fn_print_ok_eol_nl - fi - fi -fi -fn_script_log_info "Logs installed" diff --git a/lgsm/functions/install_modules.sh b/lgsm/functions/install_modules.sh deleted file mode 100644 index c512b69a3..000000000 --- a/lgsm/functions/install_modules.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# LinuxGSM install_modules.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Downloads all modules on install - -echo -e "" -echo -e "${lightyellow}Downloading LinuxGSM Modules${default}" -echo -e "=================================" - -fn_fetch_file "https://github.com/GameServerManagers/LinuxGSM/archive/master.tar.gz" "${tmpdir}" "master.tar.gz" "nochmodx" "norun" "noforce" "nomd5" -fn_dl_extract "${tmpdir}" "master.tar.gz" "${tmpdir}" -cp "${tmpdir}/LinuxGSM-master/lgsm/functions"/*.sh "${functionsdir}" -cp "${tmpdir}/LinuxGSM-master/lgsm/functions"/*.py "${functionsdir}" -chmod +x "${functionsdir}"/* -command_update_linuxgsm.sh diff --git a/lgsm/functions/install_retry.sh b/lgsm/functions/install_retry.sh deleted file mode 100644 index 2d6e3df7b..000000000 --- a/lgsm/functions/install_retry.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# LinuxGSM install_retry.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Asks for installation retry after failure. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -if fn_prompt_yn "Retry install?" Y; then - command_install.sh; core_exit.sh -else - core_exit.sh -fi diff --git a/lgsm/functions/install_server_dir.sh b/lgsm/functions/install_server_dir.sh deleted file mode 100644 index cfd586dc4..000000000 --- a/lgsm/functions/install_server_dir.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# LinuxGSM install_server_dir.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Creates the server directory. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -echo -e "" -echo -e "${lightyellow}Server Directory${default}" -echo -e "=================================" -fn_sleep_time -if [ -d "${serverfiles}" ]; then - fn_print_warning_nl "A server is already installed here." -fi -pwd -echo -e "" -if [ -z "${autoinstall}" ]; then - if ! fn_prompt_yn "Continue?" Y; then - exit - fi -fi -if [ ! -d "${serverfiles}" ]; then - mkdir -v "${serverfiles}" -fi diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh deleted file mode 100644 index 9593401ce..000000000 --- a/lgsm/functions/install_server_files.sh +++ /dev/null @@ -1,206 +0,0 @@ -#!/bin/bash -# LinuxGSM install_server_files.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Installs server files. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_install_server_files(){ - 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" - 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" - 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}"; local_filename="cod-lnxded-1.5-large.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="ee0ad1ccbfa1fd27fde01a4a431a5c2f" - 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" - 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" - 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" - 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" - elif [ "${shortname}" == "etl" ]; then - remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/etlegacy-v2.76-i386-et-260b.tar.xz"; local_filedir="${tmpdir}"; local_filename="etlegacy-v2.75-i386-et-260b.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="178a00233cec1e25b69d130107ce1a79" - elif [ "${shortname}" == "ges" ]; then - remote_fileurl="http://linuxgsm.download/GoldenEyeSource/GoldenEye_Source_v5.0.6_full_server.tar.xz"; local_filedir="${tmpdir}"; local_filename="GoldenEye_Source_v5.0.6_full_server.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="e31481f280eed40c9145816bd4f6dc45" - 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" - 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" - 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" - 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" - 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" - 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" - 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" - 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" - 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" - elif [ "${shortname}" == "ut2k4" ]; then - remote_fileurl="http://linuxgsm.download/UnrealTournament2004/ut2004-server-3369-2-ultimate-linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="ut2004-server-3369-2-ultimate-linux.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="8ebcb9b8f703905053d13a35c3af3e79" - elif [ "${shortname}" == "ut99" ]; then - remote_fileurl="http://linuxgsm.download/UnrealTournament99/ut99-server-451-ultimate-linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="ut99-server-451-ultimate-linux.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="42c6839f8cb95907eeef71a1838aa1f7" - 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" - 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" - 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" - 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" - 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" - 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" - fi - fn_fetch_file "${remote_fileurl}" "" "" "" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" - fn_dl_extract "${local_filedir}" "${local_filename}" "${serverfiles}" -} - -fn_install_server_files_steamcmd(){ - counter="0" - while [ "${counter}" == "0" ]||[ "${exitcode}" != "0" ]; do - counter=$((counter+1)) - if [ -d "${steamcmddir}" ]; then - cd "${steamcmddir}" || exit - fi - if [ "${counter}" -le "10" ]; then - # Attempt 1-4: Standard attempt. - # Attempt 5-6: Validate attempt. - # Attempt 7-8: Validate, delete long name dir. - # Attempt 9-10: Validate, delete long name dir, re-download SteamCMD. - # Attempt 11: Failure. - - if [ "${counter}" -ge "2" ]; then - fn_print_warning_nl "SteamCMD did not complete the download, retrying: Attempt ${counter}" - fn_script_log "SteamCMD did not complete the download, retrying: Attempt ${counter}" - fi - - if [ "${counter}" -ge "7" ]; then - echo -e "Removing $(find "${serverfiles}" -type d -print0 | grep -Ez '[^/]{30}$')" - find "${serverfiles}" -type d -print0 | grep -Ez '[^/]{30}$' | xargs -0 rm -rf - fi - if [ "${counter}" -ge "9" ]; then - rm -rf "${steamcmddir:?}" - check_steamcmd.sh - fi - - # Detects if unbuffer command is available for 32 bit distributions only. - info_distro.sh - if [ "$(command -v stdbuf 2>/dev/null)" ]&&[ "${arch}" != "x86_64" ]; then - unbuffer="stdbuf -i0 -o0 -e0" - fi - - if [ "${counter}" -le "4" ]; then - # If GoldSrc (appid 90) servers. GoldSrc (appid 90) require extra commands. - if [ "${appid}" == "90" ]; then - # If using a specific branch. - if [ -n "${branch}" ]; then - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" +quit - else - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" +quit - fi - elif [ "${shortname}" == "ac" ]; then - ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" +quit - # All other servers. - else - if [ -n "${branch}" ]; then - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update -beta "${branch}" +quit - else - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" +quit - fi - fi - local exitcode=$? - elif [ "${counter}" -ge "5" ]; then - # If GoldSrc (appid 90) servers. GoldSrc (appid 90) require extra commands. - if [ "${appid}" == "90" ]; then - # If using a specific branch. - if [ -n "${branch}" ]; then - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" validate +quit - else - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" validate +quit - fi - local exitcode=$? - elif [ "${shortname}" == "ac" ]; then - ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" +quit - local exitcode=$? - # All other servers. - else - if [ -n "${branch}" ]; then - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" validate +quit - else - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" validate +quit - fi - local exitcode=$? - fi - fi - elif [ "${counter}" -ge "11" ]; then - fn_print_failure_nl "SteamCMD did not complete the download, too many retrys" - fn_script_log "SteamCMD did not complete the download, too many retrys" - break - fi - done - - # GoldSrc (appid 90) servers commonly fail to download all the server files required. - # Validating a few of times may reduce the chance of this issue. - if [ "${appid}" == "90" ]; then - fn_print_information_nl "GoldSrc servers commonly fail to download all the server files required. Validating a few of times may reduce the chance of this issue." - counter="0" - while [ "${counter}" -le "4" ]; do - counter=$((counter+1)) - if [ -n "${branch}" ]; then - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" "${branch}" validate +quit - else - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" validate +quit - fi - local exitcode=$? - done - fi -} - -echo -e "" -echo -e "${lightyellow}Installing ${gamename} Server${default}" -echo -e "=================================" -fn_sleep_time - -if [ "${appid}" ]; then - fn_install_server_files_steamcmd -fi - -if [ "${shortname}" == "ts3" ]; then - update_ts3.sh -elif [ "${shortname}" == "mc" ]; then - install_eula.sh - update_minecraft.sh -elif [ "${shortname}" == "mcb" ]; then - update_minecraft_bedrock.sh -elif [ "${shortname}" == "mumble" ]; then - update_mumble.sh -elif [ "${shortname}" == "mta" ]; then - update_mta.sh -elif [ "${shortname}" == "fctr" ]; then - update_factorio.sh - install_factorio_save.sh -elif [ -z "${appid}" ]||[ "${shortname}" == "ahl" ]||[ "${shortname}" == "bd" ]||[ "${shortname}" == "bb" ]||[ "${shortname}" == "ges" ]||[ "${shortname}" == "ns" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "sol" ]||[ "${shortname}" == "ts" ]||[ "${shortname}" == "vs" ]||[ "${shortname}" == "zmr" ]; then - if [ "${shortname}" == "ut" ]; then - install_eula.sh - fi - fn_install_server_files -fi - -if [ -z "${autoinstall}" ]; then - echo -e "" - echo -e "=================================" - if ! fn_prompt_yn "Was the install successful?" Y; then - install_retry.sh - fi -fi diff --git a/lgsm/functions/install_stats.sh b/lgsm/functions/install_stats.sh deleted file mode 100644 index 355b7fa67..000000000 --- a/lgsm/functions/install_stats.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# LinuxGSM install_stats.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Enabled LinuxGSM Stats. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -echo -e "" -echo -e "${lightyellow}LinuxGSM Stats${default}" -echo -e "=================================" -fn_sleep_time -echo -e "Assist LinuxGSM development by sending anonymous stats to developers." -echo -e "More info: https://docs.linuxgsm.com/configuration/linuxgsm-stats" -echo -e "The following info will be sent:" -echo -e "* game server" -echo -e "* distro" -echo -e "* game server resource usage" -echo -e "* server hardware info" -if [ -z "${autoinstall}" ]; then - if fn_prompt_yn "Allow anonymous usage statistics?" Y; then - echo "stats=\"on\"" >> "${configdirserver}/common.cfg" - 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" -fi diff --git a/lgsm/functions/install_steamcmd.sh b/lgsm/functions/install_steamcmd.sh deleted file mode 100644 index 40acf435b..000000000 --- a/lgsm/functions/install_steamcmd.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# LinuxGSM install_steamcmd.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Downloads SteamCMD on install. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -echo -e "" -echo -e "${lightyellow}Installing SteamCMD${default}" -echo -e "=================================" -fn_sleep_time -check_steamcmd.sh diff --git a/lgsm/functions/mods_list.sh b/lgsm/functions/mods_list.sh deleted file mode 100644 index 6485faa45..000000000 --- a/lgsm/functions/mods_list.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/bash -# LinuxGSM mods_list.sh function -# Author: Daniel Gibbs -# Contributor: UltimateByte -# Website: https://linuxgsm.com -# Description: Lists and defines available mods for LinuxGSM supported servers; works along with mods_core.sh. -# Usage: To add a mod, you need to add an array variable following the guide to set proper values; -# Usage: Then add this array to the mods_global_array. -# Usage: If needed, you can scrape the download URL first. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -# Get a proper URL for mods that don't provide a good one (optional) -fn_script_log_info "Retrieving latest mods URLs" -# Metamod -metamodmversion="1.10" -metamodscrapeurl="https://mms.alliedmods.net/mmsdrop/${metamodmversion}/mmsource-latest-linux" -metamodlatestfile=$(wget "${metamodscrapeurl}" -q -O -) -metamoddownloadurl="https://www.metamodsource.net/latest.php?os=linux&version=${metamodmversion}" -metamodurl="${metamoddownloadurl}" -# Sourcemod -sourcemodmversion="1.10" -sourcemodscrapeurl="https://sm.alliedmods.net/smdrop/${sourcemodmversion}/sourcemod-latest-linux" -sourcemodlatestfile=$(wget "${sourcemodscrapeurl}" -q -O -) -sourcemoddownloadurl="https://www.sourcemod.net/latest.php?os=linux&version=${sourcemodmversion}" -sourcemodurl="${sourcemoddownloadurl}" -# Steamworks -steamworksscrapeurl="https://users.alliedmods.net/~kyles/builds/SteamWorks" -steamworkslatestfile=$(curl -sL ${steamworksscrapeurl} | grep -m 1 linux | cut -d '"' -f 4) -steamworksdownloadurl="${steamworksscrapeurl}/${steamworkslatestfile}" -steamworksurl="${steamworksdownloadurl}" -# CS:GO Mods -get5scrapepath=$(curl -sL https://ci.splewis.net/job/get5/lastSuccessfulBuild/api/xml | grep -oP "\K(.+)(?=)") -get5latestfile=$(echo -e "${get5scrapepath}" | xargs -n 1 -I @ sh -c "echo -e "basename "@""") -get5downloadurl="https://ci.splewis.net/job/get5/lastSuccessfulBuild/artifact/${get5scrapepath}" -get5url="${get5downloadurl}" -# Oxide -oxiderustlatestlink="https://umod.org/games/rust/download/develop" # fix for linux build 06.09.2019 -oxidehurtworldlatestlink=$(curl -sL https://api.github.com/repos/OxideMod/Oxide.Hurtworld/releases/latest | grep browser_download_url | cut -d '"' -f 4 | grep "Oxide.Hurtworld.zip") -oxidesdtdlatestlink=$(curl -sL https://api.github.com/repos/OxideMod/Oxide.SevenDaysToDie/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url' ) - -# Define mods information (required) - -# Separator name -modseparator="MOD" - -# REQUIRED: mod_info_name=( MOD "modcommand" "Pretty Name" "URL" "filename" "modsubdirs" "LowercaseOn/Off" "/files/to/keep;" "/install/path" "ENGINES" "GAMES" "NOTGAMES" "AUTHOR_URL" "Short Description" ) -# Example 1) Well made mod: mod_info_name=( MOD "awesomemod" "This is an Awesome Mod" "https://awesomemod.com/latest.zip" "awesomemod.zip" "0" "LowercaseOff" "OVERWRITE" "${systemdir}/addons" "source;unity3d;" "GAMES" "NOTGAMES" "https://awesomemod.com/" "This mod knows that 42 is the answer" ) -# Example 2) Poorly made mod: mod_info_name=( MOD "stupidmod" "This is a stupid mod" "${crappymodurl}" "StupidMod.zip" "2" "LowercaseOn" "cfg;data/crappymod;" "${systemdir}" "source;" "GAMES" "Garry's mod;Counter-Strike: Source;" "This mod is dumber than dumb" ) -# None of those values can be empty -# index | Usage -# [0] | MOD: separator, all mods must begin with it -# [1] | "modcommand": the LGSM name and command to install the mod (must be unique and lowercase) -# [2] | "Pretty Name": the common name people use to call the mod that will be displayed to the user -# [3] | "URL": link to the mod archive file; can be a variable previously defined while scraping a URL -# [4] | "filename": the output filename -# [5] | "modsubdirs": in how many subdirectories is the mod (none is 0) (not used at release, but could be in the future) -# [6] | "LowercaseOn/Off": LowercaseOff or LowercaseOn: enable/disable converting extracted files and directories to lowercase (some games require it) -# [7] | "modinstalldir": the directory in which to install the mode (use LGSM dir variables such as ${systemdir}) -# [8] | "/files/to/keep;", files & directories that should not be overwritten upon update, separated and ended with a semicolon; you can also use "OVERWRITE" value to ignore the value or "NOUPDATE" to disallow updating; for files to keep upon uninstall, see fn_mod_tidy_files_list from mods_core.sh -# [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 -# [13] | "Short Description" a description showed to the user upon installation/removal - -# Source mods -mod_info_metamod=( MOD "metamod" "MetaMod" "${metamodurl}" "${metamodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/metaplugins.ini;" "source;" "GAMES" "NOTGAMES" "https://www.sourcemm.net" "Plugins Framework" ) -mod_info_sourcemod=( MOD "sourcemod" "SourceMod" "${sourcemodurl}" "${sourcemodlatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "GAMES" "NOTGAMES" "http://www.sourcemod.net" "Admin Features (requires MetaMod)" ) -mod_info_steamworks=( MOD "steamworks" "SteamWorks" "${steamworksurl}" "${steamworkslatestfile}" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/KyleSanderson/SteamWorks" "Exposing SteamWorks functions to SourcePawn" ) - -# CS:GO Mods -mod_info_gokz=( MOD "gokz" "GOKZ" "https://bitbucket.org/kztimerglobalteam/gokz/downloads/GOKZ-latest.zip" "gokz-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://bitbucket.org/kztimerglobalteam/gokz/src/master/" "Implements the KZ game mode (requires SourceMod and MetaMod)" ) -mod_info_ttt=( MOD "ttt" "Trouble in Terrorist Town" "https://csgottt.com/downloads/ttt-latest-dev-${sourcemodmversion}.zip" "ttt-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/Bara/TroubleinTerroristTown" "Implements the TTT game mode (requires SourceMod and MetaMod)" ) -mod_info_get5=( MOD "get5" "Get 5" "${get5url}" "${get5latestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/get5" "Plugin for competitive matches/scrims (requires SourceMod and MetaMod)" ) - -# Garry's Mod Addons -mod_info_ulib=( MOD "ulib" "ULib" "https://codeload.github.com/TeamUlysses/ulib/zip/master" "ulib-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "Complete Framework" ) -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_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" ) -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" ) -mod_info_wiremod=( MOD "wiremod" "Wiremod" "https://github.com/wiremod/wire/archive/master.zip" "wire-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/wiremod/wire" "Base Wiremod Addon") -mod_info_wiremodextras=( MOD "wiremod-extras" "Wiremod Extras" "https://github.com/wiremod/wire-extras/archive/master.zip" "wire-extras-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/wiremod/wire-extras/" "Addition to Wiremod, Extra Content") -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" ) - - -# Oxidemod -mod_info_rustoxide=( MOD "rustoxide" "Oxide for Rust" "${oxiderustlatestlink}" "Oxide.Rust-linux.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Rust;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-rust.1659/" "Allows for the use of plugins" ) -mod_info_hwoxide=( MOD "hwoxide" "Oxide for Hurtworld" "${oxidehurtworldlatestlink}" "Oxide.Hurtworld.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Hurtworld;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-hurtworld.1332/" "Allows for the use of plugins" ) -mod_info_sdtdoxide=( MOD "sdtdoxide" "Oxide for 7 Days To Die" "${oxidesdtdlatestlink}" "Oxide.SevenDaysToDie.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "7 Days To Die;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-7-days-to-die.813/" "Allows for the use of plugins" ) - -# REQUIRED: Set all mods info into the global array -mods_global_array=( "${mod_info_metamod[@]}" "${mod_info_sourcemod[@]}" "${mod_info_steamworks[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_get5[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" ) diff --git a/lgsm/functions/query_gamedig.sh b/lgsm/functions/query_gamedig.sh index 82939e917..285cf0805 100644 --- a/lgsm/functions/query_gamedig.sh +++ b/lgsm/functions/query_gamedig.sh @@ -22,6 +22,7 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; gamedigcmd=$(echo -e "gamedig --type \"${querytype}\" --host \"${ip}\" --port \"${queryport}\"|jq") gamedigraw=$(gamedig --type "${querytype}" --host "${ip}" --port "${queryport}") querystatus=$(echo "${gamedigraw}" | jq '.error|length') + fi # server name. @@ -31,12 +32,10 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; fi # numplayers. - if [ "${querytype}" == "minecraft" ]; then - gdplayers=$(echo "${gamedigraw}" | jq -re '.players | length') - fi + gdplayers=$(echo "${gamedigraw}" | jq -re '.raw.vanilla.raw.players.online') if [ "${gdplayers}" == "null" ]; then unset gdplayers - elif [ "${gdplayers}" == "[]" ] || [ "${gdplayers}" == "-1" ]; then + elif [ "${gdplayers}" == "[]" ]; then gdplayers=0 fi @@ -61,7 +60,7 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; fi # numbots. - gdbots=$(echo "${gamedigraw}" | jq -re '.bots | length') + gdbots=$(echo "${gamedigraw}" | jq -re '.raw.numbots') if [ "${gdbots}" == "null" ]||[ "${gdbots}" == "0" ]; then unset gdbots fi diff --git a/lgsm/functions/query_gsquery.py b/lgsm/functions/query_gsquery.py deleted file mode 100644 index 376f704b7..000000000 --- a/lgsm/functions/query_gsquery.py +++ /dev/null @@ -1,144 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding: utf-8 -*- -# query_gsquery.py -# Author: Anonymous & Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Allows querying of various game servers. - -import optparse -import socket -import sys - -class gsquery: - def __init__(self, options, arguments): - self.option = options - self.argument = arguments - # - self.server_response_timeout = 5 - self.default_buffer_length = 1024 - # - sourcequery=['protocol-valve','avalanche3.0','barotrauma','madness','quakelive','realvirtuality','refractor','source','goldsrc','spark','starbound','unity3d','unreal4','wurm'] - idtech2query=['protocol-quake3','idtech2','quake','iw2.0'] - idtech3query=['protocol-quake3','iw3.0','ioquake3','qfusion'] - minecraftquery=['minecraft','lwjgl2'] - minecraftbequery=['minecraftbe'] - jc2mpquery=['jc2mp'] - mumblequery=['mumbleping'] - soldatquery=['soldat'] - twquery=['teeworlds'] - unrealquery=['protocol-gamespy1','unreal'] - unreal2query=['protocol-unreal2','unreal2'] - unreal3query=['ut3','unreal3'] - if self.option.engine in sourcequery: - self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0' - elif self.option.engine in idtech2query: - self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00' - elif self.option.engine in idtech3query: - self.query_prompt_string = b'\xff\xff\xff\xffgetstatus' - elif self.option.engine in jc2mpquery: - self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40' - elif self.option.engine in minecraftquery: - self.query_prompt_string = b'\xFE\xFD\x09\x3d\x54\x1f\x93' - elif self.option.engine in 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' - elif self.option.engine in mumblequery: - self.query_prompt_string = b'\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08' - elif self.option.engine in soldatquery: - self.query_prompt_string = b'\x69\x00' - elif self.option.engine in twquery: - self.query_prompt_string = b"\x04\x00\x00\xff\xff\xff\xff\x05" + bytearray(511) - elif self.option.engine in unrealquery: - self.query_prompt_string = b'\x5C\x69\x6E\x66\x6F\x5C' - elif self.option.engine in unreal2query: - self.query_prompt_string = b'\x79\x00\x00\x00\x00' - elif self.option.engine in unreal3query: - self.query_prompt_string = b'\xFE\xFD\x09\x00\x00\x00\x00' - - self.connected = False - self.response = None - self.sanity_checks() - - def fatal_error(self, error_message, error_code=1): - sys.stderr.write('ERROR: ' + str(error_message) + '\n') - sys.exit(error_code) - - def exit_success(self, success_message=''): - sys.stdout.write('OK: ' + str(success_message) + '\n') - sys.exit(0) - - def responding(self): - # Connect. - connection = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - connection.settimeout(self.server_response_timeout) - try: - self.connected = connection.connect((self.option.address, int(self.option.port))) - except socket.timeout: - self.fatal_error('Request timed out', 1) - except: - 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) - connection.close() - # Response. - if self.response is None: - self.fatal_error('No response', 3) - if len(self.response) < 5: - sys.exit('Short response.', 3) - else: - self.exit_success(str(self.response)) - - def sanity_checks(self): - if not self.option.address: - self.fatal_error('No IPv4 address supplied.', 4) - if not self.option.port: - self.fatal_error('No port supplied.', 4) - -if __name__ == '__main__': - parser = optparse.OptionParser( - usage='usage: python3 %prog [options]', - version='%prog 0.0.1' - ) - parser.add_option( - '-a', '--address', - action='store', - dest='address', - default=False, - help='The IPv4 address of the server.' - ) - parser.add_option( - '-p', '--port', - action='store', - dest='port', - default=False, - help='The IPv4 port of the server.' - ) - parser.add_option( - '-e', '--engine', - action='store', - dest='engine', - default=False, - help='Engine type: protocol-valve protocol-quake3 protocol-quake3 protocol-gamespy1 protocol-unreal2 ut3 minecraft minecraftbe jc2mp mumbleping soldat teeworlds' - ) - parser.add_option( - '-v', '--verbose', - action='store_true', - dest='verbose', - default=False, - help='Display verbose output.' - ) - parser.add_option( - '-d', '--debug', - action='store_true', - dest='debug', - default=False, - help='Display debugging output.' - ) - options, arguments = parser.parse_args() - # - server = gsquery(options, arguments) - server.responding() diff --git a/lgsm/functions/update_factorio.sh b/lgsm/functions/update_factorio.sh deleted file mode 100644 index 5ff67c448..000000000 --- a/lgsm/functions/update_factorio.sh +++ /dev/null @@ -1,172 +0,0 @@ -#!/bin/bash -# LinuxGSM update_factorio.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Handles updating of Factorio servers. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_update_factorio_dl(){ - fn_fetch_file "https://factorio.com/get-download/${downloadbranch}/headless/${factorioarch}" "" "" "" "${tmpdir}" "factorio_headless_${factorioarch}-${remotebuild}.tar.xz" "" "norun" "noforce" "nomd5" - fn_dl_extract "${tmpdir}" "factorio_headless_${factorioarch}-${remotebuild}.tar.xz" "${tmpdir}" - echo -e "copying to ${serverfiles}...\c" - cp -R "${tmpdir}/factorio/"* "${serverfiles}" - local exitcode=$? - if [ "${exitcode}" == "0" ]; then - fn_print_ok_eol_nl - fn_script_log_pass "Copying to ${serverfiles}" - fn_clear_tmp - else - fn_print_fail_eol_nl - fn_script_log_fatal "Copying to ${serverfiles}" - core_exit.sh - fn_clear_tmp - fi -} - -fn_update_factorio_localbuild(){ - # Gets local build info. - fn_print_dots "Checking local build: ${remotelocation}" - # Uses executable to find local build. - cd "${executabledir}" || exit - if [ -f "${executable}" ]; then - localbuild=$(${executable} --version | grep "Version:" | awk '{print $2}') - fn_print_ok "Checking for update: ${remotelocation}: checking local build" - fn_script_log_pass "Checking local build" - else - localbuild="0" - fn_print_error "Checking for update: ${remotelocation}: checking local build" - fn_script_log_error "Checking local build" - fi -} - -fn_update_factorio_remotebuild(){ - # Gets remote build info. - remotebuild=$(curl -s "https://factorio.com/get-download/${downloadbranch}/headless/${factorioarch}" | grep -o '[0-9]\.[0-9]\{1,\}\.[0-9]\{1,\}' | head -1) - if [ "${installer}" != "1" ]; 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_fatal "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_fatal "Unable to get remote build" - core_exit.sh - fi - fi -} - -fn_update_factorio_compare(){ - fn_print_dots "Checking for update: ${remotelocation}" - # Removes dots so if statement can compare version numbers. - fn_print_dots "Checking for update: ${remotelocation}" - localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') - remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') - if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then - 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}${remotebuild} ${factorioarch}${default}" - if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" - fi - echo -en "\n" - fn_script_log_info "Update available" - fn_script_log_info "Local build: ${localbuild} ${factorioarch}" - fn_script_log_info "Remote build: ${remotebuild} ${factorioarch}" - if [ -v "${branch}" ]; then - fn_script_log_info "Branch: ${branch}" - fi - fn_script_log_info "${localbuild} > ${remotebuild}" - - unset updateonstart - check_status.sh - # If server stopped. - if [ "${status}" == "0" ]; then - exitbypass=1 - fn_update_factorio_dl - exitbypass=1 - command_start.sh - exitbypass=1 - command_stop.sh - # If server started. - else - fn_stop_warning - exitbypass=1 - command_stop.sh - exitbypass=1 - fn_update_factorio_dl - exitbypass=1 - command_start.sh - fi - date +%s > "${lockdir}/lastupdate.lock" - alert="update" - 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}${remotebuild} ${factorioarch}${default}" - if [ -v "${branch}" ]; then - echo -e "* Branch: ${branch}" - fi - echo -en "\n" - fn_script_log_info "No update available" - fn_script_log_info "Local build: ${localbuild} ${factorioarch}" - fn_script_log_info "Remote build: ${remotebuild} ${factorioarch}" - if [ -v "${branch}" ]; then - fn_script_log_info "Branch: ${branch}" - fi - fi -} - -fn_stop_warning(){ - fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" - fn_script_log_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" - totalseconds=3 - for seconds in {3..1}; do - fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update: ${totalseconds}" - totalseconds=$((totalseconds - 1)) - sleep 1 - if [ "${seconds}" == "0" ]; then - break - fi - done - fn_print_warn_nl "Updating server: SteamCMD: ${selfname} will be stopped during update" -} - -# The location where the builds are checked and downloaded. -remotelocation="factorio.com" - -# Game server architecture. -factorioarch="linux64" - -if [ "${branch}" == "stable" ]; then - downloadbranch="stable" -elif [ "${branch}" == "experimental" ]; then - downloadbranch="latest" -else - downloadbranch="${branch}" -fi - -if [ "${installer}" == "1" ]; then - fn_update_factorio_remotebuild - fn_update_factorio_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_factorio_localbuild - fn_update_factorio_remotebuild - fn_update_factorio_compare -fi diff --git a/lgsm/functions/update_minecraft.sh b/lgsm/functions/update_minecraft.sh deleted file mode 100644 index 556097bd6..000000000 --- a/lgsm/functions/update_minecraft.sh +++ /dev/null @@ -1,220 +0,0 @@ -#!/bin/bash -# LinuxGSM update_minecraft.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Handles updating of Minecraft servers. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_update_minecraft_dl(){ - if [ "${branch}" == "release" ]; then - latestmcreleaselink=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.latest.release as $latest | .versions[] | select(.id == $latest) | .url') - else - latestmcreleaselink=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.versions[0].url') - fi - - latestmcbuildurl=$(curl -s "${latestmcreleaselink}" | jq -r '.downloads.server.url') - fn_fetch_file "${latestmcbuildurl}" "" "" "" "${tmpdir}" "minecraft_server.${remotebuild}.jar" "" "norun" "noforce" "nomd5" - echo -e "copying to ${serverfiles}...\c" - cp "${tmpdir}/minecraft_server.${remotebuild}.jar" "${serverfiles}/minecraft_server.jar" - local exitcode=$? - if [ "${exitcode}" == "0" ]; then - fn_print_ok_eol_nl - fn_script_log_pass "Copying to ${serverfiles}" - chmod u+x "${serverfiles}/minecraft_server.jar" - fn_clear_tmp - else - fn_print_fail_eol_nl - fn_script_log_fatal "Copying to ${serverfiles}" - fn_clear_tmp - core_exit.sh - fi -} - -fn_update_minecraft_localbuild(){ - # Gets local build info. - fn_print_dots "Checking local build: ${remotelocation}" - # Uses log file to gather info. - # Gives time for log file to generate. - if [ ! -f "${serverfiles}/logs/latest.log" ]; then - fn_print_error "Checking local build: ${remotelocation}" - fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" - fn_print_info_nl "Checking local build: ${remotelocation}: forcing server restart" - fn_script_log_error "No log files containing version info" - fn_script_log_info "Forcing server restart" - exitbypass=1 - command_stop.sh - exitbypass=1 - command_start.sh - totalseconds=0 - # Check again, allow time to generate logs. - while [ ! -f "${serverfiles}/logs/latest.log" ]; do - sleep 1 - fn_print_info "Checking local build: ${remotelocation}: waiting for log file: ${totalseconds}" - if [ -v "${loopignore}" ]; then - loopignore=1 - fn_script_log_info "Waiting for log file to generate" - fi - - if [ "${totalseconds}" -gt "120" ]; then - localbuild="0" - fn_print_error "Checking local build: ${remotelocation}: waiting for log file: missing log file" - fn_script_log_error "Missing log file" - fn_script_log_error "Set localbuild to 0" - fi - - totalseconds=$((totalseconds + 1)) - done - fi - - if [ -z "${localbuild}" ]; then - localbuild=$(grep version "${serverfiles}/logs/latest.log" | grep -Eo '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}(-pre[0-9]+)?|([0-9]+w[0-9]+[a-z])') - fi - - if [ -z "${localbuild}" ]; then - # Gives time for var to generate. - totalseconds=0 - for seconds in {1..120}; do - fn_print_info "Checking local build: ${remotelocation}: waiting for local build: ${totalseconds}" - if [ -z "${loopignore}" ]; then - loopignore=1 - fn_script_log_info "Waiting for local build to generate" - fi - localbuild=$(cat "${serverfiles}/logs/latest.log" 2> /dev/null | grep version | grep -Eo '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}(-pre[0-9]+)?|([0-9]+w[0-9]+[a-z])') - if [ "${localbuild}" ]||[ "${seconds}" == "120" ]; then - break - fi - sleep 1 - totalseconds=$((totalseconds + 1)) - done - fi - - if [ -z "${localbuild}" ]; then - localbuild="0" - fn_print_error "Checking local build: ${remotelocation}: waiting for local build: missing local build info" - fn_script_log_error "Missing local build info" - fn_script_log_error "Set localbuild to 0" - else - fn_print_ok "Checking local build: ${remotelocation}" - fn_script_log_pass "Checking local build" - fi -} - -fn_update_minecraft_remotebuild(){ - # Gets remote build info. - if [ "${branch}" == "release" ]; then - remotebuild=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.latest.release') - else - remotebuild=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.versions[0].id') - fi - - if [ "${installer}" != "1" ]; 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_fatal "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_fatal "Unable to get remote build" - core_exit.sh - fi - fi -} - -fn_update_minecraft_compare(){ - # Removes dots so if statement can compare version numbers. - fn_print_dots "Checking for update: ${remotelocation}" - if [ "${localbuild}" != "${remotebuild}" ]||[ "${forceupdate}" == "1" ]; then - 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}${remotebuild}${default}" - echo -en "\n" - if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" - fi - fn_script_log_info "Update available" - fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" - fn_script_log_info "${localbuild} > ${remotebuild}" - - unset updateonstart - check_status.sh - # If server stopped. - if [ "${status}" == "0" ]; then - exitbypass=1 - fn_update_minecraft_dl - exitbypass=1 - command_start.sh - exitbypass=1 - command_stop.sh - # If server started. - else - fn_stop_warning - exitbypass=1 - command_stop.sh - exitbypass=1 - fn_update_minecraft_dl - exitbypass=1 - command_start.sh - fi - date +%s > "${lockdir}/lastupdate.lock" - alert="update" - 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}${remotebuild}${default}" - if [ -n "${branch}" ]; then - echo -e "* Branch: ${branch}" - fi - echo -en "\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 - fi -} - -fn_stop_warning(){ - fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" - fn_script_log_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" - totalseconds=3 - for seconds in {3..1}; do - fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update: ${totalseconds}" - totalseconds=$((totalseconds - 1)) - sleep 1 - if [ "${seconds}" == "0" ]; then - break - fi - done - fn_print_warn_nl "Updating server: SteamCMD: ${selfname} will be stopped during update" -} - -# The location where the builds are checked and downloaded. -remotelocation="mojang.com" - -if [ "${installer}" == "1" ]; then - fn_update_minecraft_remotebuild - fn_update_minecraft_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_minecraft_localbuild - fn_update_minecraft_remotebuild - fn_update_minecraft_compare -fi diff --git a/lgsm/functions/update_minecraft_bedrock.sh b/lgsm/functions/update_minecraft_bedrock.sh deleted file mode 100644 index 61cad6854..000000000 --- a/lgsm/functions/update_minecraft_bedrock.sh +++ /dev/null @@ -1,180 +0,0 @@ -#!/bin/bash -# LinuxGSM update_minecraft_bedrock.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Handles updating of Minecraft Bedrock servers. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_update_minecraft_dl(){ - latestmcbuildurl=$(curl -s "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*zip') - fn_fetch_file "${latestmcbuildurl}" "" "" "" "${tmpdir}" "bedrock_server.${remotebuild}.zip" - echo -e "Extracting to ${serverfiles}...\c" - if [ "${installer}" == "1" ]; then - unzip -oq "${tmpdir}/bedrock_server.${remotebuild}.zip" -x "server.properties" -d "${serverfiles}" - else - unzip -oq "${tmpdir}/bedrock_server.${remotebuild}.zip" -x "permissions.json" "server.properties" "whitelist.json" -d "${serverfiles}" - fi - local exitcode=$? - if [ "${exitcode}" == "0" ]; then - fn_print_ok_eol_nl - fn_script_log_pass "Extracting to ${serverfiles}" - chmod u+x "${serverfiles}/bedrock_server" - fn_clear_tmp - else - fn_print_fail_eol_nl - fn_script_log_fatal "Extracting to ${serverfiles}" - fn_clear_tmp - core_exit.sh - fi -} - -fn_update_minecraft_localbuild(){ - # Gets local build info. - fn_print_dots "Checking local build: ${remotelocation}" - # Uses log file to gather info. - # Log is generated and cleared on startup but filled on shutdown. - localbuild=$(grep Version "${consolelogdir}"/* 2>/dev/null | tail -1 | sed 's/.*Version //') - if [ -z "${localbuild}" ]; then - fn_print_error "Checking local build: ${remotelocation}" - fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" - fn_print_info_nl "Checking local build: ${remotelocation}: forcing server restart" - fn_script_log_error "No log files containing version info" - fn_script_log_info "Forcing server restart" - - check_status.sh - # If server stopped. - if [ "${status}" == "0" ]; then - exitbypass=1 - command_start.sh - sleep 3 - exitbypass=1 - command_stop.sh - # If server started. - else - exitbypass=1 - command_stop.sh - fi - fi - - if [ -z "${localbuild}" ]; then - localbuild=$(grep Version "$(ls -tr "${consolelogdir}"/* 2>/dev/null)" | tail -1 | sed 's/.*Version //') - fi - - if [ -z "${localbuild}" ]; then - localbuild="0" - fn_print_error "Checking local build: ${remotelocation}: waiting for local build: missing local build info" - fn_script_log_error "Missing local build info" - fn_script_log_error "Set localbuild to 0" - else - fn_print_ok "Checking local build: ${remotelocation}" - fn_script_log_pass "Checking local build" - fi -} - -fn_update_minecraft_remotebuild(){ - # Gets remote build info. - remotebuild=$(curl -s "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]") - if [ "${installer}" != "1" ]; 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_fatal "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_fatal "Unable to get remote build" - core_exit.sh - fi - fi -} - -fn_update_minecraft_compare(){ - # Removes dots so if statement can compare version numbers. - fn_print_dots "Checking for update: ${remotelocation}" - localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') - remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') - if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then - 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}${remotebuild}${default}" - echo -en "\n" - fn_script_log_info "Update available" - fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" - fn_script_log_info "${localbuild} > ${remotebuild}" - - unset updateonstart - check_status.sh - # If server stopped. - if [ "${status}" == "0" ]; then - exitbypass=1 - fn_update_minecraft_dl - exitbypass=1 - command_start.sh - exitbypass=1 - command_stop.sh - # If server started. - else - fn_stop_warning - exitbypass=1 - command_stop.sh - exitbypass=1 - fn_update_minecraft_dl - exitbypass=1 - command_start.sh - fi - date +%s > "${lockdir}/lastupdate.lock" - alert="update" - 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}${remotebuild}${default}" - echo -en "\n" - fn_script_log_info "No update available" - fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" - fi -} - -fn_stop_warning(){ - fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" - fn_script_log_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" - totalseconds=3 - for seconds in {3..1}; do - fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update: ${totalseconds}" - totalseconds=$((totalseconds - 1)) - sleep 1 - if [ "${seconds}" == "0" ]; then - break - fi - done - fn_print_warn_nl "Updating server: SteamCMD: ${selfname} will be stopped during update" -} - -# The location where the builds are checked and downloaded. -remotelocation="minecraft.net" - -if [ "${installer}" == "1" ]; then - fn_update_minecraft_remotebuild - fn_update_minecraft_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_minecraft_localbuild - fn_update_minecraft_remotebuild - fn_update_minecraft_compare -fi diff --git a/lgsm/functions/update_mta.sh b/lgsm/functions/update_mta.sh deleted file mode 100644 index 5aaecc122..000000000 --- a/lgsm/functions/update_mta.sh +++ /dev/null @@ -1,211 +0,0 @@ -#!/bin/bash -# LinuxGSM update_mta.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Handles updating of Multi Theft Auto servers. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_update_mta_dl(){ - fn_fetch_file "http://linux.mtasa.com/dl/multitheftauto_linux_x64.tar.gz" "" "" "" "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "" "norun" "noforce" "nomd5" - mkdir "${tmpdir}/multitheftauto_linux_x64" - fn_dl_extract "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "${tmpdir}/multitheftauto_linux_x64" - echo -e "copying to ${serverfiles}...\c" - cp -R "${tmpdir}/multitheftauto_linux_x64/multitheftauto_linux_x64/"* "${serverfiles}" - local exitcode=$? - fn_clear_tmp - if [ "${exitcode}" == "0" ]; then - fn_print_ok_eol_nl - fn_script_log_pass "Copying to ${serverfiles}" - chmod u+x "${serverfiles}/mta-server64" - else - fn_print_fail_eol_nl - fn_script_log_fatal "Copying to ${serverfiles}" - core_exit.sh - fi -} - -fn_update_mta_localbuild(){ - # Gets local build info. - fn_print_dots "Checking local build: ${remotelocation}" - # Uses log file to gather info. - # Gives time for log file to generate. - if [ ! -f "${serverfiles}/mods/deathmatch/logs/server.log" ]; then - fn_print_error "Checking local build: ${remotelocation}" - fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" - fn_print_info_nl "Checking local build: ${remotelocation}: forcing server restart" - fn_script_log_error "No log files containing version info" - fn_script_log_info "Forcing server restart" - exitbypass=1 - command_stop.sh - exitbypass=1 - command_start.sh - totalseconds=0 - # Check again, allow time to generate logs. - while [ ! -f "${serverfiles}/mods/deathmatch/logs/server.log" ]; do - sleep 1 - fn_print_info "Checking local build: ${remotelocation}: waiting for log file: ${totalseconds}" - if [ -v "${loopignore}" ]; then - loopignore=1 - fn_script_log_info "Waiting for log file to generate" - fi - - if [ "${totalseconds}" -gt "120" ]; then - localbuild="0" - fn_print_error "Checking local build: ${remotelocation}: waiting for log file: missing log file" - fn_script_log_error "Missing log file" - fn_script_log_error "Set localbuild to 0" - fi - - totalseconds=$((totalseconds + 1)) - done - fi - - if [ -z "${localbuild}" ]; then - localbuild=$(grep "= Multi Theft Auto: San Andreas v" "${serverfiles}/mods/deathmatch/logs/server.log" | awk '{ print $7 }' | sed -r 's/^.{1}//' | tail -1) - fi - - if [ -z "${localbuild}" ]; then - # Gives time for var to generate. - totalseconds=0 - for seconds in {1..120}; do - fn_print_info "Checking local build: ${remotelocation}: waiting for local build: ${totalseconds}" - if [ -z "${loopignore}" ]; then - loopignore=1 - fn_script_log_info "Waiting for local build to generate" - fi - localbuild=$(grep "= Multi Theft Auto: San Andreas v" "${serverfiles}/mods/deathmatch/logs/server.log" | awk '{ print $7 }' | sed -r 's/^.{1}//' | tail -1) - if [ "${localbuild}" ]; then - break - fi - sleep 1 - totalseconds=$((totalseconds + 1)) - done - fi - - if [ -z "${localbuild}" ]; then - localbuild="0" - fn_print_error "Checking local build: ${remotelocation}: waiting for local build: missing local build info" - fn_script_log_error "Missing local build info" - fn_script_log_error "Set localbuild to 0" - else - fn_print_ok "Checking local build: ${remotelocation}" - fn_script_log_pass "Checking local build" - fi -} - -fn_update_mta_remotebuild(){ - # Gets remote build info. - majorversion=$(curl -s https://raw.githubusercontent.com/multitheftauto/mtasa-blue/master/Server/version.h | grep "#define MTASA_VERSION_MAJOR" | awk '{ print $3 }' | sed 's/\r//g') - minorversion=$(curl -s https://raw.githubusercontent.com/multitheftauto/mtasa-blue/master/Server/version.h | grep "#define MTASA_VERSION_MINOR" | awk '{ print $3 }' | sed 's/\r//g') - maintenanceversion=$(curl -s https://raw.githubusercontent.com/multitheftauto/mtasa-blue/master/Server/version.h | grep "#define MTASA_VERSION_MAINTENANCE" | awk '{ print $3 }' | sed 's/\r//g') - remotebuild="${majorversion}.${minorversion}.${maintenanceversion}" - if [ "${installer}" != "1" ]; 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_fatal "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_fatal "Unable to get remote build" - core_exit.sh - fi - fi -} - -fn_update_mta_compare(){ - # Removes dots so if statement can compare version numbers. - fn_print_dots "Checking for update: ${remotelocation}" - localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') - remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') - if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then - fn_print_ok_nl "Checking for update: ${remotelocation}" - if [ "${forceupdate}" == "1" ]; then - # forceupdate bypasses checks, useful for small build changes - mtaupdatestatus="forced" - else - mtaupdatestatus="available" - fi - echo -en "\n" - echo -e "Update ${mtaupdatestatus}:" - echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuild}${default}" - echo -en "\n" - fn_script_log_info "Update available" - fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" - fn_script_log_info "${localbuild} > ${remotebuild}" - - unset updateonstart - check_status.sh - # If server stopped. - if [ "${status}" == "0" ]; then - exitbypass=1 - fn_update_mta_dl - exitbypass=1 - command_start.sh - exitbypass=1 - command_stop.sh - # If server started. - else - fn_stop_warning - exitbypass=1 - command_stop.sh - exitbypass=1 - fn_update_mta_dl - exitbypass=1 - command_start.sh - fi - date +%s > "${lockdir}/lastupdate.lock" - alert="update" - 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}${remotebuild}${default}" - echo -en "\n" - fn_script_log_info "No update available" - fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" - fi -} - -fn_stop_warning(){ - fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" - fn_script_log_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" - totalseconds=3 - for seconds in {3..1}; do - fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update: ${totalseconds}" - totalseconds=$((totalseconds - 1)) - sleep 1 - if [ "${seconds}" == "0" ]; then - break - fi - done - fn_print_warn_nl "Updating server: SteamCMD: ${selfname} will be stopped during update" -} - -# The location where the builds are checked and downloaded. -remotelocation="linux.mtasa.com" - -if [ "${installer}" == "1" ]; then - fn_update_mta_remotebuild - fn_update_mta_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_mta_localbuild - fn_update_mta_remotebuild - fn_update_mta_compare -fi diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh deleted file mode 100644 index ee6a2b0ad..000000000 --- a/lgsm/functions/update_mumble.sh +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/bash -# LinuxGSM update_mumble.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Handles updating of Mumble servers. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_update_mumble_dl(){ - fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${remotebuild}/murmur-static_${mumblearch}-${remotebuild}.tar.bz2" "" "" "" "${tmpdir}" "murmur-static_${mumblearch}-${remotebuild}.tar.bz2" "" "norun" "noforce" "nomd5" - fn_dl_extract "${tmpdir}" "murmur-static_${mumblearch}-${remotebuild}.tar.bz2" "${tmpdir}" - echo -e "copying to ${serverfiles}...\c" - cp -R "${tmpdir}/murmur-static_${mumblearch}-${remotebuild}/"* "${serverfiles}" - local exitcode=$? - if [ "${exitcode}" == "0" ]; then - fn_print_ok_eol_nl - fn_script_log_pass "Copying to ${serverfiles}" - fn_clear_tmp - else - fn_print_fail_eol_nl - fn_script_log_fatal "Copying to ${serverfiles}" - fn_clear_tmp - core_exit.sh - fi -} - -fn_update_mumble_localbuild(){ - # Gets local build info. - fn_print_dots "Checking local build: ${remotelocation}" - # Uses executable to find local build. - cd "${executabledir}" || exit - if [ -f "${executable}" ]; then - localbuild=$(${executable} -version 2>&1 >/dev/null | awk '{print $5}') - fn_print_ok "Checking local build: ${remotelocation}" - fn_script_log_pass "Checking local build" - else - localbuild="0" - fn_print_error "Checking local build: ${remotelocation}" - fn_script_log_error "Checking local build" - fi -} - -fn_update_mumble_remotebuild(){ - # Gets remote build info. - remotebuild=$(curl -s "https://api.github.com/repos/mumble-voip/mumble/releases/latest" | grep 'murmur-static_x86.*\.bz2"' | tail -1 | awk -F"/" '{ print $8 }') - if [ "${installer}" != "1" ]; 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_fatal "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_fatal "Unable to get remote build" - core_exit.sh - fi - fi -} - -fn_update_mumble_compare(){ - # Removes dots so if statement can compare version numbers. - fn_print_dots "Checking for update: ${remotelocation}" - localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') - remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') - if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then - fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild} ${mumblearch}${default}" - echo -e "* Remote build: ${green}${remotebuild} ${mumblearch}${default}" - echo -en "\n" - fn_script_log_info "Update available" - fn_script_log_info "Local build: ${localbuild} ${mumblearch}" - fn_script_log_info "Remote build: ${remotebuild} ${mumblearch}" - fn_script_log_info "${localbuild} > ${remotebuild}" - - unset updateonstart - check_status.sh - # If server stopped. - if [ "${status}" == "0" ]; then - exitbypass=1 - fn_update_mumble_dl - exitbypass=1 - command_start.sh - exitbypass=1 - command_stop.sh - # If server started. - else - fn_stop_warning - exitbypass=1 - command_stop.sh - exitbypass=1 - fn_update_mumble_dl - exitbypass=1 - command_start.sh - fi - date +%s > "${lockdir}/lastupdate.lock" - alert="update" - 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} ${mumblearch}${default}" - echo -e "* Remote build: ${green}${remotebuild} ${mumblearch}${default}" - echo -en "\n" - fn_script_log_info "No update available" - fn_script_log_info "Local build: ${localbuild} ${mumblearch}" - fn_script_log_info "Remote build: ${remotebuild} ${mumblearch}" - fi -} - -fn_stop_warning(){ - fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" - fn_script_log_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" - totalseconds=3 - for seconds in {3..1}; do - fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update: ${totalseconds}" - totalseconds=$((totalseconds - 1)) - sleep 1 - if [ "${seconds}" == "0" ]; then - break - fi - done - fn_print_warn_nl "Updating server: SteamCMD: ${selfname} will be stopped during update" -} - -# The location where the builds are checked and downloaded. -remotelocation="mumble.info" - -# Game server architecture. -mumblearch="x86" - -if [ "${installer}" == "1" ]; then - fn_update_mumble_remotebuild - fn_update_mumble_dl -else - fn_print_dots "Checking for update: ${remotelocation}" - fn_script_log_info "Checking for update: ${remotelocation}" - fn_update_mumble_localbuild - fn_update_mumble_remotebuild - fn_update_mumble_compare -fi diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh deleted file mode 100644 index 8a089c7f7..000000000 --- a/lgsm/functions/update_steamcmd.sh +++ /dev/null @@ -1,248 +0,0 @@ -#!/bin/bash -# LinuxGSM update_steamcmd.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Handles updating using SteamCMD. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_update_steamcmd_dl(){ - info_config.sh - # Detects if unbuffer command is available for 32 bit distributions only. - info_distro.sh - if [ "$(command -v stdbuf)" ]&&[ "${arch}" != "x86_64" ]; then - unbuffer="stdbuf -i0 -o0 -e0" - fi - if [ -d "${steamcmddir}" ]; then - cd "${steamcmddir}" || exit - fi - - # If GoldSrc (appid 90) servers. GoldSrc (appid 90) require extra commands. - if [ "${appid}" == "90" ]; then - # If using a specific branch. - if [ -n "${branch}" ]; then - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" +quit | tee -a "${lgsmlog}" - else - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" +quit | tee -a "${lgsmlog}" - fi - elif [ "${shortname}" == "ac" ]; then - ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" +quit - # All other servers. - else - if [ -n "${branch}" ]; then - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" +quit | tee -a "${lgsmlog}" - else - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" +quit | tee -a "${lgsmlog}" - fi - fi - fix.sh -} - -fn_update_steamcmd_localbuild(){ - # Gets local build info. - fn_print_dots "Checking local build: ${remotelocation}" - fn_appmanifest_check - # Uses appmanifest to find local build. - localbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) - - # Set branch for updateinfo. - IFS=' ' read -ra branchsplits <<< "${branch}" - if [ "${#branchsplits[@]}" -gt 1 ]; then - branchname="${branchsplits[1]}" - else - branchname="public" - fi - - # Checks if localbuild variable has been set. - if [ -z "${localbuild}" ]||[ "${localbuild}" == "null" ]; then - fn_print_fail "Checking local build: ${remotelocation}" - fn_script_log_fatal "Checking local build" - core_exit.sh - else - fn_print_ok "Checking local build: ${remotelocation}" - fn_script_log_pass "Checking local build" - fi -} - -fn_update_steamcmd_remotebuild(){ - # Gets remote build info. - if [ -d "${steamcmddir}" ]; then - cd "${steamcmddir}" || exit - fi - - # Removes appinfo.vdf as a fix for not always getting up to date version info from SteamCMD. - if [ "$(find "${HOME}" -type f -name "appinfo.vdf" | wc -l)" -ne "0" ]; then - find "${HOME}" -type f -name "appinfo.vdf" -exec rm -f {} \; - fi - - remotebuild=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed '1,/branches/d' | sed "1,/${branchname}/d" | grep -m 1 buildid | tr -cd '[:digit:]') - if [ "${installer}" != "1" ]; 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_fatal "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_fatal "Unable to get remote build" - core_exit.sh - fi - fi -} - -fn_update_steamcmd_compare(){ - fn_print_dots "Checking for update: ${remotelocation}" - if [ "${localbuild}" != "${remotebuild}" ]; then - 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}${remotebuild}${default}" - if [ -v "${branch}" ]; then - echo -e "* Branch: ${branch}" - fi - echo -e "https://steamdb.info/app/${appid}/" - echo -en "\n" - fn_script_log_info "Update available" - fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" - if [ -v "${branch}" ]; then - fn_script_log_info "Branch: ${branch}" - fi - fn_script_log_info "${localbuild} > ${remotebuild}" - - unset updateonstart - check_status.sh - # If server stopped. - if [ "${status}" == "0" ]; then - fn_update_steamcmd_dl - # If server started. - else - fn_stop_warning - exitbypass=1 - command_stop.sh - exitbypass=1 - fn_update_steamcmd_dl - exitbypass=1 - command_start.sh - fi - date +%s > "${lockdir}/lastupdate.lock" - alert="update" - 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}${remotebuild}${default}" - if [ -v "${branch}" ]; then - echo -e "* Branch: ${branch}" - fi - echo -e "https://steamdb.info/app/${appid}/" - echo -en "\n" - fn_script_log_info "No update available" - fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" - if [ -v "${branch}" ]; then - fn_script_log_info "Branch: ${branch}" - fi - fi -} - -fn_appmanifest_info(){ - appmanifestfile=$(find "${serverfiles}" -type f -name "appmanifest_${appid}.acf") - appmanifestfilewc=$(find "${serverfiles}" -type f -name "appmanifest_${appid}.acf" | wc -l) -} - -fn_appmanifest_check(){ - fn_appmanifest_info - # Multiple or no matching appmanifest files may sometimes be present. - # This error is corrected if required. - if [ "${appmanifestfilewc}" -ge "2" ]; then - fn_print_error "Multiple appmanifest_${appid}.acf files found" - fn_script_log_error "Multiple appmanifest_${appid}.acf files found" - fn_print_dots "Removing x${appmanifestfilewc} appmanifest_${appid}.acf files" - for appfile in ${appmanifestfile}; do - rm -f "${appfile:?}" - done - appmanifestfilewc1="${appmanifestfilewc}" - fn_appmanifest_info - # if error can not be resolved. - if [ "${appmanifestfilewc}" -ge "2" ]; then - fn_print_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" - fn_script_log_fatal "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" - echo -e "* Check user permissions" - for appfile in ${appmanifestfile}; do - echo -e " ${appfile}" - done - core_exit.sh - else - fn_print_ok "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files" - fn_script_log_pass "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files" - fn_print_info_nl "Forcing update to correct issue" - fn_script_log_info "Forcing update to correct issue" - fn_update_steamcmd_dl - fi - elif [ "${appmanifestfilewc}" -eq "0" ]; then - fn_print_error_nl "No appmanifest_${appid}.acf found" - fn_script_log_error "No appmanifest_${appid}.acf found" - fn_print_info_nl "Forcing update to correct issue" - fn_script_log_info "Forcing update to correct issue" - fn_update_steamcmd_dl - fn_appmanifest_info - if [ "${appmanifestfilewc}" -eq "0" ]; then - fn_print_fail_nl "Still no appmanifest_${appid}.acf found" - fn_script_log_fatal "Still no appmanifest_${appid}.acf found" - core_exit.sh - fi - fi -} - -fn_stop_warning(){ - fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" - fn_script_log_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" - totalseconds=3 - for seconds in {3..1}; do - fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update: ${totalseconds}" - totalseconds=$((totalseconds - 1)) - sleep 1 - if [ "${seconds}" == "0" ]; then - break - fi - done - fn_print_warn_nl "Updating server: SteamCMD: ${selfname} will be stopped during update" -} - -# The location where the builds are checked and downloaded. -remotelocation="SteamCMD" -check_steamcmd.sh - -if [ "${forceupdate}" == "1" ]; then - # forceupdate bypasses update checks. - check_status.sh - if [ "${status}" != "0" ]; then - fn_stop_warning - exitbypass=1 - command_stop.sh - fn_update_steamcmd_dl - date +%s > "${lockdir}/lastupdate.lock" - exitbypass=1 - command_start.sh - else - fn_update_steamcmd_dl - date +%s > "${lockdir}/lastupdate.lock" - fi -else - fn_print_dots "Checking for update" - fn_print_dots "Checking for update: ${remotelocation}" - fn_update_steamcmd_localbuild - fn_update_steamcmd_remotebuild - fn_update_steamcmd_compare -fi diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh deleted file mode 100644 index a5cc0dd60..000000000 --- a/lgsm/functions/update_ts3.sh +++ /dev/null @@ -1,221 +0,0 @@ -#!/bin/bash -# LinuxGSM command_ts3.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Handles updating of Teamspeak 3 servers. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_update_ts3_dl(){ - if [ "${ts3arch}" == "amd64" ]; then - remotebuildurl=$(curl -s 'https://www.teamspeak.com/versions/server.json' | jq -r '.linux.x86_64.mirrors."teamspeak.com"') - elif [ "${ts3arch}" == "x86" ]; then - remotebuildurl=$(curl -s 'https://www.teamspeak.com/versions/server.json' | jq -r '.linux.x86.mirrors."teamspeak.com"') - fi - fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${remotebuild}.tar.bz2" "" "norun" "noforce" "nomd5" - fn_dl_extract "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${remotebuild}.tar.bz2" "${tmpdir}" - echo -e "copying to ${serverfiles}...\c" - cp -R "${tmpdir}/teamspeak3-server_linux_${ts3arch}/"* "${serverfiles}" - local exitcode=$? - if [ "${exitcode}" == "0" ]; then - fn_print_ok_eol_nl - fn_script_log_pass "Copying to ${serverfiles}" - fn_clear_tmp - else - fn_print_fail_eol_nl - fn_script_log_fatal "Copying to ${serverfiles}" - fn_clear_tmp - core_exit.sh - fi -} - -fn_update_ts3_localbuild(){ - # Gets local build info. - fn_print_dots "Checking local build: ${remotelocation}" - # Uses log file to gather info. - # Gives time for log file to generate. - if [ ! -d "${serverfiles}/logs" ]||[ -z "$(find "${serverfiles}/logs/"* -name 'ts3server*_0.log' 2> /dev/null)" ]; then - fn_print_error "Checking local build: ${remotelocation}" - fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" - fn_print_info_nl "Checking local build: ${remotelocation}: forcing server restart" - fn_script_log_error "No log files containing version info" - fn_script_log_info "Forcing server restart" - exitbypass=1 - command_stop.sh - exitbypass=1 - command_start.sh - totalseconds=0 - # Check again, allow time to generate logs. - while [ ! -d "${serverfiles}/logs" ]||[ -z "$(find "${serverfiles}/logs/"* -name 'ts3server*_0.log' 2> /dev/null)" ]; do - sleep 1 - fn_print_info "Checking local build: ${remotelocation}: waiting for log file: ${totalseconds}" - if [ -v "${loopignore}" ]; then - loopignore=1 - fn_script_log_info "Waiting for log file to generate" - fi - - if [ "${totalseconds}" -gt "120" ]; then - localbuild="0" - fn_print_error "Checking local build: ${remotelocation}: waiting for log file: missing log file" - fn_script_log_error "Missing log file" - fn_script_log_error "Set localbuild to 0" - fi - - totalseconds=$((totalseconds + 1)) - done - fi - - if [ -z "${localbuild}" ]; then - localbuild=$(cat "$(find ./* -name "ts3server*_0.log" 2> /dev/null | sort | tail -1)" | grep -Eo "TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | grep -Eo "((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | tail -1) - fi - - if [ -z "${localbuild}" ]; then - # Gives time for var to generate. - totalseconds=0 - for seconds in {1..120}; do - fn_print_info "Checking local build: ${remotelocation}: waiting for local build: ${totalseconds}" - if [ -z "${loopignore}" ]; then - loopignore=1 - fn_script_log_info "Waiting for local build to generate" - fi - localbuild=$(cat "$(find ./* -name "ts3server*_0.log" 2> /dev/null | sort | tail -1)" | grep -Eo "TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | grep -Eo "((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | tail -1) - if [ "${localbuild}" ]||[ "${seconds}" == "120" ]; then - break - fi - sleep 1 - totalseconds=$((totalseconds + 1)) - done - fi - - if [ -z "${localbuild}" ]; then - localbuild="0" - fn_print_error "Checking local build: ${remotelocation}: waiting for local build: missing local build info" - fn_script_log_error "Missing local build info" - fn_script_log_error "Set localbuild to 0" - else - fn_print_ok "Checking local build: ${remotelocation}" - fn_script_log_pass "Checking local build" - fi -} - -fn_update_ts3_remotebuild(){ - # Gets remote build info. - if [ "${arch}" == "x86_64" ]; then - remotebuild=$(curl -s "https://www.teamspeak.com/versions/server.json" | jq -r '.linux.x86_64.version') - elif [ "${arch}" == "x86" ]; then - remotebuild=$(curl -s "https://www.teamspeak.com/versions/server.json" | jq -r '.linux.x86.version') - fi - if [ "${installer}" != "1" ]; 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_fatal "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_fatal "Unable to get remote build" - core_exit.sh - fi - fi -} - -fn_update_ts3_compare(){ - # Removes dots so if statement can compare version numbers. - fn_print_dots "Checking for update: ${remotelocation}" - localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') - remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') - if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then - 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}${remotebuild}${default}" - fn_script_log_info "Update available" - fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" - fn_script_log_info "${localbuild} > ${remotebuild}" - - unset updateonstart - check_status.sh - # If server stopped. - if [ "${status}" == "0" ]; then - exitbypass=1 - fn_update_ts3_dl - exitbypass=1 - command_start.sh - exitbypass=1 - command_stop.sh - # If server started. - else - fn_stop_warning - exitbypass=1 - command_stop.sh - exitbypass=1 - fn_update_ts3_dl - exitbypass=1 - command_start.sh - fi - date +%s > "${lockdir}/lastupdate.lock" - alert="update" - 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}${remotebuild}${default}" - echo -en "\n" - fn_script_log_info "No update available" - fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" - fi -} - -# Game server architecture. -info_distro.sh -if [ "${arch}" == "x86_64" ]; then - ts3arch="amd64" -elif [ "${arch}" == "i386" ]||[ "${arch}" == "i686" ]; then - ts3arch="x86" -else - fn_print_failure "Unknown or unsupported architecture: ${arch}" - fn_script_log_fatal "Unknown or unsupported architecture: ${arch}" - core_exit.sh -fi - -fn_stop_warning(){ - fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" - fn_script_log_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" - totalseconds=3 - for seconds in {3..1}; do - fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update: ${totalseconds}" - totalseconds=$((totalseconds - 1)) - sleep 1 - if [ "${seconds}" == "0" ]; then - break - fi - done - fn_print_warn_nl "Updating server: SteamCMD: ${selfname} will be stopped during update" -} - -# The location where the builds are checked and downloaded. -remotelocation="teamspeak.com" - -if [ "${installer}" == "1" ]; then - fn_update_ts3_remotebuild - fn_update_ts3_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_ts3_localbuild - fn_update_ts3_remotebuild - fn_update_ts3_compare -fi diff --git a/lgsm/modules/README.md b/lgsm/modules/README.md new file mode 100644 index 000000000..de008ecfa --- /dev/null +++ b/lgsm/modules/README.md @@ -0,0 +1,17 @@ +# LinuxGSM - Modules + +These modules are scripts that are called upon by the primary script linuxgsm.sh + +## Module Names + +Modules have been named to give an idea of what the function does. + +- 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 new file mode 100644 index 000000000..f2698e3b7 --- /dev/null +++ b/lgsm/modules/alert.sh @@ -0,0 +1,359 @@ +#!/bin/bash +# LinuxGSM alert.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Overall module for managing alerts. + +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 + fn_info_messages_server_resource + 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 +} + +fn_alert_test() { + fn_script_log_info "Sending alert: Testing LinuxGSM Alert. No action to be taken" + alertaction="Tested" + alertemoji="🚧" + alertsound="1" + alertmessage="Testing ${selfname} LinuxGSM Alert. No action to be taken." + # Green + alertcolourhex="#cdcd00" + alertcolourdec="13487360" +} + +# Running command manually +fn_alert_stopped() { + fn_script_log_info "Sending alert: ${selfname} has stopped" + alertaction="Stopped" + alertemoji="❌" + alertsound="1" + alertmessage="${selfname} has been stopped." + # Red + alertcolourhex="#cd0000" + alertcolourdec="13434880" +} + +fn_alert_started() { + fn_script_log_info "Sending alert: ${selfname} has started" + alertaction="Started" + alertemoji="✔️" + alertsound="1" + alertmessage="${selfname} has been started." + # Green + alertcolourhex="#00cd00" + alertcolourdec="52480" +} + +fn_alert_restarted() { + fn_script_log_info "Sending alert: ${selfname} has restarted" + alertaction="Restarted" + alertemoji="🗘" + alertsound="1" + alertmessage="${selfname} has been restarted." + # Green + alertcolourhex="#00cd00" + alertcolourdec="52480" +} + +# Failed monitor checks +fn_alert_monitor_session() { + fn_script_log_info "Sending alert: ${selfname} is not running. Game server has been restarted" + alertaction="Restarted" + alertemoji="🚨" + alertsound="2" + alertmessage="${selfname} is not running. Game server has been restarted." + # Red + alertcolourhex="#cd0000" + alertcolourdec="13434880" +} + +fn_alert_monitor_query() { + fn_script_log_info "Sending alert: Unable to query ${selfname}. Game server has been restarted" + alertaction="Restarted" + alertemoji="🚨" + alertsound="2" + alertmessage="Unable to query ${selfname}. Game server has been restarted." + # Red + alertcolourhex="#cd0000" + alertcolourdec="13434880" +} + +# Update alerts +fn_alert_update() { + fn_script_log_info "Sending alert: ${selfname} has received a game server update: ${localbuild}" + 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" + alertemoji="🎉" + alertsound="1" + alertmessage="${selfname} has requested an update and needs to be restarted." + # Blue + alertcolourhex="#1e90ff" + alertcolourdec="2003199" +} + +fn_alert_check_update() { + fn_script_log_info "Sending alert: ${gamename} update available: ${remotebuildversion}" + alertaction="Update available" + alertemoji="🎉" + alertsound="1" + alertmessage="${gamename} update available: ${remotebuildversion}" + # Blue + alertcolourhex="#1e90ff" + alertcolourdec="2003199" +} + +fn_alert_update_linuxgsm() { + fn_script_log_info "Sending alert: ${selfname} has received an LinuxGSM update" + alertaction="Updated" + alertemoji="🎉" + alertsound="1" + alertbody="${gamename} update available" + alertmessage="${selfname} has received an LinuxGSM update and been restarted." + # Green + alertcolourhex="#00cd00" + alertcolourdec="52480" +} + +fn_alert_backup() { + fn_script_log_info "Sending alert: ${selfname} has been backed up" + alertaction="Backed Up" + alertemoji="📂" + alertsound="1" + alertmessage="${selfname} has been backed up." + # Green + alertcolourhex="#00cd00" + alertcolourdec="52480" +} + +fn_alert_permissions() { + fn_script_log_info "Sending alert: ${selfname} has permissions issues" + alertaction="Checked Permissions" + alertemoji="❗" + alertsound="2" + alertmessage="${selfname} has permissions issues." + # Red + alertcolourhex="#cd0000" + alertcolourdec="13434880" +} + +fn_alert_config() { + fn_script_log_info "Sending alert: ${selfname} has received a new _default.cfg" + alertaction="Updated _default.cfg" + alertemoji="🎉" + alertsound="1" + alertmessage="${selfname} has received a new _default.cfg." + # Blue + alertcolourhex="#1e90ff" + alertcolourdec="2003199" +} + +fn_alert_wipe() { + fn_script_log_info "Sending alert: ${selfname} has been wiped" + alertaction="Wiped" + alertemoji="🧹" + alertsound="1" + alertmessage="${selfname} has been wiped." + # Green + alertcolourhex="#00cd00" + alertcolourdec="52480" +} + +fn_alert_info() { + fn_script_log_info "Sending alert: ${selfname} info" + alerttitle="LinuxGSM Alert - ${selfname} - Info" + alertaction="Queried" + alertemoji="📄" + alertsound="1" + alertmessage="${selfname} info." + # Blue + alertcolourhex="#1e90ff" + alertcolourdec="2003199" +} + +# Images +alerticon="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/gameicons/${shortname}-icon.png" + +if [ "${alert}" == "permissions" ]; then + fn_alert_permissions +elif [ "${alert}" == "monitor-session" ]; then + fn_alert_monitor_session +elif [ "${alert}" == "monitor-query" ]; then + fn_alert_monitor_query +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}" == "check-update" ]; then + fn_alert_check_update +elif [ "${alert}" == "config" ]; then + fn_alert_config +elif [ "${alert}" == "wipe" ]; then + fn_alert_wipe +elif [ "${alert}" == "info" ]; then + fn_alert_info +elif [ "${alert}" == "started" ]; then + fn_alert_started +elif [ "${alert}" == "stopped" ]; then + fn_alert_stopped +elif [ "${alert}" == "restarted" ]; then + fn_alert_restarted +elif [ "${alert}" == "update-linuxgsm" ]; then + fn_alert_update_linuxgsm +elif [ "${alert}" == "backup" ]; then + fn_alert_backup +else + fn_print_fail_nl "Missing alert type" + fn_script_log_fail "Missing alert type" + core_exit.sh +fi + +alerttitle="${alertemoji} ${alertaction} - ${servername} ${alertemoji}" + +# Generate alert log. +fn_alert_log + +# Generates the more info link. +if [ "${postalert}" == "on" ] && [ -n "${postalert}" ]; then + exitbypass=1 + command_postdetails.sh + fn_firstcommand_reset + unset exitbypass +elif [ "${postalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "More Info not enabled" + fn_script_log_warn "More Info alerts not enabled" +fi + +if [ "${discordalert}" == "on" ] && [ -n "${discordalert}" ]; then + alert_discord.sh +elif [ "${discordalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "Discord alerts not enabled" + fn_script_log_warn "Discord alerts not enabled" +elif [ -z "${discordtoken}" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Discord token not set" + echo -e "* https://docs.linuxgsm.com/alerts/discord" + fn_script_error "Discord token not set" +fi + +if [ "${emailalert}" == "on" ] && [ -n "${email}" ]; then + alert_email.sh +elif [ "${emailalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "Email alerts not enabled" + fn_script_log_warn "Email alerts not enabled" +elif [ -z "${email}" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Email not set" + fn_script_log_error "Email not set" +fi + +if [ "${gotifyalert}" == "on" ] && [ -n "${gotifyalert}" ]; then + alert_gotify.sh +elif [ "${gotifyalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "Gotify alerts not enabled" + fn_script_log_warn "Gotify alerts not enabled" +elif [ -z "${gotifytoken}" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Gotify token not set" + echo -e "* https://docs.linuxgsm.com/alerts/gotify" + fn_script_error "Gotify token not set" +elif [ -z "${gotifywebhook}" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Gotify webhook not set" + echo -e "* https://docs.linuxgsm.com/alerts/gotify" + fn_script_error "Gotify webhook not set" +fi + +if [ "${iftttalert}" == "on" ] && [ -n "${iftttalert}" ]; then + alert_ifttt.sh +elif [ "${iftttalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "IFTTT alerts not enabled" + fn_script_log_warn "IFTTT alerts not enabled" +elif [ -z "${ifttttoken}" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "IFTTT token not set" + echo -e "* https://docs.linuxgsm.com/alerts/ifttt" + fn_script_error "IFTTT token not set" +fi + +if [ "${pushbulletalert}" == "on" ] && [ -n "${pushbullettoken}" ]; then + alert_pushbullet.sh +elif [ "${pushbulletalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "Pushbullet alerts not enabled" + fn_script_log_warn "Pushbullet alerts not enabled" +elif [ -z "${pushbullettoken}" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Pushbullet token not set" + echo -e "* https://docs.linuxgsm.com/alerts/pushbullet" + fn_script_error "Pushbullet token not set" +fi + +if [ "${pushoveralert}" == "on" ] && [ -n "${pushoveralert}" ]; then + alert_pushover.sh +elif [ "${pushoveralert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "Pushover alerts not enabled" + fn_script_log_warn "Pushover alerts not enabled" +elif [ -z "${pushovertoken}" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Pushover token not set" + echo -e "* https://docs.linuxgsm.com/alerts/pushover" + fn_script_error "Pushover token not set" +fi + +if [ "${telegramalert}" == "on" ] && [ -n "${telegramtoken}" ]; then + alert_telegram.sh +elif [ "${telegramalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "Telegram Messages not enabled" + fn_script_log_warn "Telegram Messages not enabled" +elif [ -z "${telegramtoken}" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Telegram token not set." + echo -e "* https://docs.linuxgsm.com/alerts/telegram" + fn_script_error "Telegram token not set." +elif [ -z "${telegramchatid}" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Telegram chat id not set." + echo -e "* https://docs.linuxgsm.com/alerts/telegram" + fn_script_error "Telegram chat id not set." +fi + +if [ "${rocketchatalert}" == "on" ] && [ -n "${rocketchatalert}" ]; then + alert_rocketchat.sh +elif [ "${rocketchatalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "Rocketchat alerts not enabled" + fn_script_log_warn "Rocketchat alerts not enabled" +elif [ -z "${rocketchatwebhook}" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Rocketchat token not set" + #echo -e "* https://docs.linuxgsm.com/alerts/slack" + fn_script_error "Rocketchat token not set" +fi + +if [ "${slackalert}" == "on" ] && [ -n "${slackalert}" ]; then + alert_slack.sh +elif [ "${slackalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "Slack alerts not enabled" + fn_script_log_warn "Slack alerts not enabled" +elif [ -z "${slacktoken}" ] && [ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Slack token not set" + echo -e "* https://docs.linuxgsm.com/alerts/slack" + fn_script_error "Slack token not set" +fi diff --git a/lgsm/modules/alert_discord.sh b/lgsm/modules/alert_discord.sh new file mode 100644 index 000000000..93eda8d5b --- /dev/null +++ b/lgsm/modules/alert_discord.sh @@ -0,0 +1,153 @@ +#!/bin/bash +# LinuxGSM alert_discord.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends Discord alert. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +jsoninfo=$( + 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}", + "inline": true + }, + { + "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}", + "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 +) + +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 + fn_print_fail_nl "Sending Discord alert: ${discordsend}" + fn_script_log_fail "Sending Discord alert: ${discordsend}" +else + fn_print_ok_nl "Sending Discord alert" + fn_script_log_pass "Sending Discord alert" +fi diff --git a/lgsm/modules/alert_email.sh b/lgsm/modules/alert_email.sh new file mode 100644 index 000000000..aa13494d1 --- /dev/null +++ b/lgsm/modules/alert_email.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# LinuxGSM alert_email.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends email alert. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_print_dots "Sending Email alert: ${email}" + +if [ -n "${emailfrom}" ]; then + mail -s "${alerttitle}" -r "${emailfrom}" "${email}" < "${alertlog}" +else + mail -s "${alerttitle}" "${email}" < "${alertlog}" +fi +exitcode=$? +if [ "${exitcode}" -ne 0 ]; then + fn_print_ok_nl "Sending Email alert: ${email}" + fn_script_log_pass "Sending Email alert: ${email}" +else + fn_print_fail_nl "Sending Email alert: ${email}" + fn_script_log_fail "Sending Email alert: ${email}" +fi diff --git a/lgsm/modules/alert_gotify.sh b/lgsm/modules/alert_gotify.sh new file mode 100644 index 000000000..dcb438fb2 --- /dev/null +++ b/lgsm/modules/alert_gotify.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# LinuxGSM alert_gotify.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends Gotify alert. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +jsoninfo=$( + 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 +} +EOF +) + +jsonnoinfo=$( + 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)", + "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 .)") + +if [ -n "${gotifysend}" ]; then + fn_print_ok_nl "Sending Gotify alert" + fn_script_log_pass "Sending Gotify alert" +else + fn_print_fail_nl "Sending Gotify alert: ${gotifysend}" + fn_script_log_fail "Sending Gotify alert: ${gotifysend}" +fi diff --git a/lgsm/modules/alert_ifttt.sh b/lgsm/modules/alert_ifttt.sh new file mode 100644 index 000000000..ca1c005d0 --- /dev/null +++ b/lgsm/modules/alert_ifttt.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# LinuxGSM alert_ifttt.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends IFTTT alert. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +jsoninfo=$( + 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)" +} +EOF +) + +jsonnoinfo=$( + 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)" +} +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") + +if [ -n "${iftttsend}" ]; then + fn_print_fail_nl "Sending IFTTT alert: ${pushbulletsend}" + fn_script_log_fail "Sending IFTTT alert: ${pushbulletsend}" +else + fn_print_ok_nl "Sending IFTTT alert" + fn_script_log_pass "Sent IFTTT alert" +fi diff --git a/lgsm/modules/alert_pushbullet.sh b/lgsm/modules/alert_pushbullet.sh new file mode 100644 index 000000000..4b96a1f9f --- /dev/null +++ b/lgsm/modules/alert_pushbullet.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# LinuxGSM alert_pushbullet.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends Pushbullet Messenger alert. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +jsoninfo=$( + 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)" +} +EOF +) + +jsonnoinfo=$( + 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)" +} +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") + +if [ -n "${pushbulletsend}" ]; then + fn_print_fail_nl "Sending Pushbullet alert: ${pushbulletsend}" + fn_script_log_fail "Sending Pushbullet alert: ${pushbulletsend}" +else + fn_print_ok_nl "Sending Pushbullet alert" + fn_script_log_pass "Sent Pushbullet alert" +fi diff --git a/lgsm/modules/alert_pushover.sh b/lgsm/modules/alert_pushover.sh new file mode 100644 index 000000000..dc488026a --- /dev/null +++ b/lgsm/modules/alert_pushover.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# LinuxGSM alert_pushover.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends Pushover alert. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_print_dots "Sending Pushover alert" + +# Different alerts are given different priorities and notification sounds. +if [ "${alertsound}" == "1" ]; then + alertsound="" + alertpriority="0" +elif [ "${alertsound}" == "2" ]; then + # restarted. + alertsound="siren" + alertpriority="1" +else + alertsound="" + 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) +fi + +if [ -n "${pushoversend}" ]; then + fn_print_fail_nl "Sending Pushover alert: ${pushoversend}" + fn_script_log_fail "Sending Pushover alert: ${pushoversend}" +else + fn_print_ok_nl "Sending Pushover alert" + fn_script_log_pass "Sent Pushover alert" +fi diff --git a/lgsm/modules/alert_rocketchat.sh b/lgsm/modules/alert_rocketchat.sh new file mode 100644 index 000000000..bff2c6a0b --- /dev/null +++ b/lgsm/modules/alert_rocketchat.sh @@ -0,0 +1,134 @@ +#!/bin/bash +# LinuxGSM alert_rocketchat.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends Rocketchat alert. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +jsoninfo=$( + 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": "More info", + "value": "${alerturl}" + }, + { + "short": false, + "title": "Server Time", + "value": "$(date)" + } + ] + } + ] +} +EOF +) + +jsonnoinfo=$( + 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", + "value": "$(date)" + } + ] + } + ] +} +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}") + +if [ -n "${rocketchatsend}" ]; then + fn_print_ok_nl "Sending Rocketchat alert" + fn_script_log_pass "Sending Rocketchat alert" +else + fn_print_fail_nl "Sending Rocketchat alert: ${rocketchatsend}" + fn_script_log_fail "Sending Rocketchat alert: ${rocketchatsend}" +fi diff --git a/lgsm/modules/alert_slack.sh b/lgsm/modules/alert_slack.sh new file mode 100644 index 000000000..58dc54772 --- /dev/null +++ b/lgsm/modules/alert_slack.sh @@ -0,0 +1,193 @@ +#!/bin/bash +# LinuxGSM alert_slack.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends Slack alert. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +jsonnoinfo=$( + 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": "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 +) + +jsoninfo=$( + 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": [ + { + "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 [ -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}") + +if [ "${slacksend}" == "ok" ]; then + fn_print_ok_nl "Sending Slack alert" + fn_script_log_pass "Sending Slack alert" +else + fn_print_fail_nl "Sending Slack alert: ${slacksend}" + fn_script_log_fail "Sending Slack alert: ${slacksend}" +fi diff --git a/lgsm/modules/alert_telegram.sh b/lgsm/modules/alert_telegram.sh new file mode 100644 index 000000000..2e719dba7 --- /dev/null +++ b/lgsm/modules/alert_telegram.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# LinuxGSM alert_telegram.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends Telegram Messenger alert. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +jsoninfo=$( + 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" +} +EOF +) + +jsonnoinfo=$( + 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)", + "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") + +if [ -n "${telegramsend}" ]; then + fn_print_fail_nl "Sending Telegram alert: ${telegramsend}" + fn_script_log_fail "Sending Telegram alert: ${telegramsend}" +else + fn_print_ok_nl "Sending Telegram alert" + fn_script_log_pass "Sent Telegram alert" +fi diff --git a/lgsm/modules/check.sh b/lgsm/modules/check.sh new file mode 100644 index 000000000..7601898a9 --- /dev/null +++ b/lgsm/modules/check.sh @@ -0,0 +1,108 @@ +#!/bin/bash +# LinuxGSM check.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Overall module for managing checks. +# Runs checks that will either halt on or fix an issue. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Every command that requires checks just references check.sh. +# check.sh selects which checks to run by using arrays. + +if [ "${commandname}" != "INSTALL" ]; then + check_root.sh +fi + +if [ "${commandname}" != "UPDATE-LGSM" ]; then + check_version.sh +fi + +check_tmuxception.sh + +if [ "$(whoami)" != "root" ]; then + if [ "${commandname}" != "MONITOR" ]; then + check_permissions.sh + fi +fi + +if [ "${commandname}" != "INSTALL" ] && [ "${commandname}" != "UPDATE-LGSM" ] && [ "${commandname}" != "DETAILS" ] && [ "${commandname}" != "POST-DETAILS" ]; then + check_system_dir.sh +fi + +allowed_commands_array=(START DEBUG) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + check_executable.sh + fi +done + +if [ "$(whoami)" != "root" ]; then + allowed_commands_array=(DEBUG START INSTALL) + for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + check_glibc.sh + fi + done +fi + +allowed_commands_array=(BACKUP CONSOLE DEBUG DETAILS MAP-COMPRESSOR FASTDL MODS-INSTALL MODS-REMOVE MODS-UPDATE MONITOR POST-DETAILS RESTART START STOP TEST-ALERT CHANGE-PASSWORD UPDATE UPDATE-LGSM VALIDATE WIPE) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + check_logs.sh + fi +done + +allowed_commands_array=(BACKUP DEBUG START) +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) +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) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + if [ -z "${installflag}" ]; then + check_ip.sh + fi + fi +done + +allowed_commands_array=(DEBUG START UPDATE VALIDATE CHECK-UPDATE) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + if [ "${appid}" ]; then + check_steamcmd.sh + fi + fi +done + +allowed_commands_array=(CHANGE-PASSWORD DETAILS MONITOR 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) +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) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + check_gamedig.sh + fi +done diff --git a/lgsm/modules/check_config.sh b/lgsm/modules/check_config.sh new file mode 100644 index 000000000..24bc1c37f --- /dev/null +++ b/lgsm/modules/check_config.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# LinuxGSM check_config.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if the server config is missing and warns the user if needed. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ -n "${servercfgfullpath}" ] && [ ! -f "${servercfgfullpath}" ]; then + fn_print_warn_nl "Configuration file missing!" + echo -e "${servercfgfullpath}" + fn_script_log_warn "Configuration file missing!" + fn_script_log_warn "${servercfgfullpath}" + install_config.sh +fi + +if [ "${shortname}" == "rust" ] && [ -v rconpassword ] && [ -z "${rconpassword}" ]; then + fn_print_fail_nl "RCON password is not set" + fn_script_log_warn "RCON password is not set" +elif [ -v rconpassword ] && [ "${rconpassword}" == "CHANGE_ME" ]; then + fn_print_warn_nl "Default RCON password detected" + fn_script_log_warn "Default RCON password detected" +elif [ -v httppassword ] && [ "${httppassword}" == "CHANGE_ME" ]; then + fn_print_warn_nl "Default Web password detected" + fn_script_log_warn "Default Web password detected" +elif [ -v adminpassword ] && [ "${adminpassword}" == "CHANGE_ME" ]; then + fn_print_warn_nl "Default Admin password detected" + fn_script_log_warn "Default Admin password detected" + +fi + +if [ "${shortname}" == "vh" ] && [ -z "${serverpassword}" ]; then + fn_print_fail_nl "serverpassword is not set" + fn_script_log_fail "serverpassword is not set" +elif [ "${shortname}" == "vh" ] && [ "${#serverpassword}" -le "4" ]; then + fn_print_fail_nl "serverpassword is to short (min 5 chars)" + fn_script_log_fail "serverpassword is to short (min 5 chars)" +fi diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh new file mode 100644 index 000000000..95d4a6ad0 --- /dev/null +++ b/lgsm/modules/check_deps.sh @@ -0,0 +1,396 @@ +#!/bin/bash +# LinuxGSM check_deps.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks and installs missing dependencies. + +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 + 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 + fi +} + +fn_install_mono_repo() { + if [ "${autodepinstall}" == "0" ]; then + fn_print_information_nl "Automatically adding Mono repository." + fn_script_log_info "Automatically adding Mono repository." + echo -en ".\r" + fn_sleep_time_1 + echo -en "..\r" + fn_sleep_time_1 + echo -en "...\r" + fn_sleep_time_1 + echo -en " \r" + if [ "${distroid}" == "ubuntu" ]; then + if [ "${distroversion}" == "22.04" ]; then + cmd="sudo apt-get install gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-jammy main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + elif [ "${distroversion}" == "20.04" ]; then + cmd="sudo apt-get install gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-focal main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + elif [ "${distroversion}" == "18.04" ]; then + cmd="sudo apt-get install gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-bionic main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + elif [ "${distroversion}" == "16.04" ]; then + cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt install apt-transport-https ca-certificates;echo 'deb https://download.mono-project.com/repo/ubuntu stable-xenial main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + else + monoautoinstall="1" + fi + elif [ "${distroid}" == "debian" ]; then + if [ "${distroversion}" == "12" ]; then + cmd="sudo apt-get install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-bookworm main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + elif [ "${distroversion}" == "11" ]; then + cmd="sudo apt-get install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-bullseye main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + elif [ "${distroversion}" == "10" ]; then + cmd="sudo apt-get install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-buster main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + elif [ "${distroversion}" == "9" ]; then + cmd="sudo apt-get install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-stretch main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + else + monoautoinstall="1" + fi + elif [ "${distroid}" == "centos" ] || [ "${distroid}" == "almalinux" ] || [ "${distroid}" == "rocky" ]; then + if [ "${distroversion}" == "8" ]; then + cmd="sudo rpmkeys --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo'" + elif [ "${distroversion}" == "7" ]; then + cmd="sudo rpmkeys --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'" + else + monoautoinstall="1" + fi + elif [ "${distroid}" == "fedora" ]; then + if [ "${distroversion}" -ge "29" ]; then + cmd="sudo rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo';dnf update" + else + cmd="sudo rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo';dnf update" + fi + else + monoautoinstall="1" + fi + + # Run the mono repo install. + eval "${cmd}" + + # Did Mono repo install correctly? + if [ "${monoautoinstall}" != "1" ]; 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_success_nl "Installing Mono repository completed." + fn_script_log_pass "Installing Mono repository completed." + fi + fi + + # Mono can not be auto installed with this distro. + if [ "${monoautoinstall}" == "1" ]; then + fn_print_warning_nl "Mono auto install not available for ${distroname}." + echo -e "Follow instructions on Mono website to install." + echo -e "https://www.mono-project.com/download/stable/#download-lin" + fn_script_log_warn "Unable to install Mono repository. Mono auto install not available for ${distroname}." + fi + + else + fn_print_information_nl "Installing Mono repository." + fn_print_warning_nl "$(whoami) does not have sudo access." + echo -e "Follow instructions on Mono website to install." + echo -e "https://www.mono-project.com/download/stable/#download-lin" + fn_script_log_warn "Unable to install Mono repository. $(whoami) does not have sudo access." + fi +} + +fn_deps_email() { + # Adds postfix to required dependencies if email alert is enabled. + if [ "${emailalert}" == "on" ]; then + if [ -f /usr/bin/mailx ]; then + if [ -d /etc/exim4 ]; then + array_deps_required+=(exim4) + 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) + 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) + elif [ "$(command -v apt 2> /dev/null)" ]; then + array_deps_required+=(mailutils postfix) + fi + fi + fi +} + +fn_install_missing_deps() { + # If any dependencies are not installed. + if [ "${#array_deps_missing[*]}" != "0" ]; then + if [ "${commandname}" == "INSTALL" ]; then + fn_print_warning_nl "Missing dependencies: ${red}${array_deps_missing[*]}${default}" + fn_script_log_warn "Missing dependencies: ${array_deps_missing[*]}" + else + fn_print_dots "Missing dependencies" + fn_print_warn "Missing dependencies: ${red}${array_deps_missing[*]}${default}" + fn_script_log_warn "Missing dependencies: ${array_deps_missing[*]}" + fi + + # Attempt automatic dependency installation + if [ "${autoinstall}" == "1" ]; then + sudo -n true > /dev/null 2>&1 + else + sudo -v > /dev/null 2>&1 + fi + autodepinstall="$?" + + if [ "${monoinstalled}" == "false" ]; then + fn_install_mono_repo + fi + + if [ "${dotnetinstalled}" == "false" ]; then + fn_install_dotnet_repo + fi + + if [ "${commandname}" == "INSTALL" ]; then + if [ "${autodepinstall}" == "0" ]; then + fn_print_information_nl "$(whoami) has sudo access." + fn_script_log_info "$(whoami) has sudo access." + else + fn_print_warning_nl "$(whoami) does not have sudo access. Manually install dependencies or run ./${selfname} install as root." + fn_script_log_warn "$(whoami) does not have sudo access. Manually install dependencies or run ./${selfname} install as root." + fi + fi + + # Add sudo dpkg --add-architecture i386 if using i386 packages. + if [ "$(command -v apt 2> /dev/null)" ]; then + if printf '%s\n' "${array_deps_required[@]}" | grep -q -P 'i386'; then + i386installcommand="sudo dpkg --add-architecture i386; " + fi + fi + + # If automatic dependency install is available + if [ "${autodepinstall}" == "0" ]; then + fn_print_information_nl "Automatically installing missing dependencies." + fn_script_log_info "Automatically installing missing dependencies." + echo -en ".\r" + fn_sleep_time_1 + echo -en "..\r" + fn_sleep_time_1 + echo -en "...\r" + fn_sleep_time_1 + echo -en " \r" + if [ "$(command -v apt 2> /dev/null)" ]; then + cmd="echo steamcmd steam/question select \"I AGREE\" | sudo debconf-set-selections; echo steamcmd steam/license note '' | sudo debconf-set-selections; ${i386installcommand}sudo apt-get update; sudo apt-get -y install ${array_deps_missing[*]}" + eval "${cmd}" + elif [ "$(command -v dnf 2> /dev/null)" ]; then + cmd="sudo dnf -y install ${array_deps_missing[*]}" + eval "${cmd}" + elif [ "$(command -v yum 2> /dev/null)" ]; then + cmd="sudo yum -y install ${array_deps_missing[*]}" + eval "${cmd}" + fi + autodepinstall="$?" + + # If auto install passes, remove steamcmd install failure and set exit code to 0. + if [ "${autodepinstall}" == "0" ]; then + unset steamcmdfail + exitcode=0 + fi + fi + + # If automatic dependency install is unavailable. + if [ "${autodepinstall}" != "0" ]; then + if [ "$(command -v apt 2> /dev/null)" ]; then + echo -e " Run: '${green}${i386installcommand}sudo apt update; sudo apt install ${array_deps_missing[*]}${default}' as root to install missing dependencies." + elif [ "$(command -v dnf 2> /dev/null)" ]; then + echo -e " Run: '${green}sudo dnf install ${array_deps_missing[*]}${default}' as root to install missing dependencies." + elif [ "$(command -v yum 2> /dev/null)" ]; then + echo -e " Run: '${green}sudo yum install ${array_deps_missing[*]}${default}' as root to install missing dependencies." + fi + fi + + if [ "${steamcmdfail}" ]; then + if [ "${commandname}" == "INSTALL" ]; then + fn_print_failure_nl "Missing dependencies required to run SteamCMD." + fn_script_log_fail "Missing dependencies required to run SteamCMD." + core_exit.sh + else + fn_print_error_nl "Missing dependencies required to run SteamCMD." + fn_script_log_error "Missing dependencies required to run SteamCMD." + fi + fi + + else + if [ "${commandname}" == "INSTALL" ]; then + fn_print_skip2_nl "Required dependencies already installed." + fn_script_log_info "Required dependencies already installed." + fi + fi +} + +fn_check_loop() { + # Loop though required depenencies checking if they are installed. + for deptocheck in "${array_deps_required[@]}"; do + fn_deps_detector + done + + # user will be informed of any missing dependencies. + fn_install_missing_deps +} + +# Checks if dependency is installed or not. +fn_deps_detector() { + ## Check. + # 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. + if [ "${deptocheck}" == "libsdl2-2.0-0:i386" ] && [ -z "${appid}" ]; then + array_deps_required=("${array_deps_required[@]/libsdl2-2.0-0:i386/}") + steamcmdstatus=1 + elif [ "${deptocheck}" == "steamcmd" ] && [ -z "${appid}" ]; then + array_deps_required=("${array_deps_required[@]/steamcmd/}") + steamcmdstatus=1 + elif [ "${deptocheck}" == "steamcmd" ] && [ "${distroid}" == "debian" ] && ! grep -qE '[^deb]+non-free([^-]|$)' /etc/apt/sources.list; then + array_deps_required=("${array_deps_required[@]/steamcmd/}") + steamcmdstatus=1 + # Java: Added for users using Oracle JRE to bypass check. + elif [[ ${deptocheck} == "openjdk"* ]] || [[ ${deptocheck} == "java"* ]]; then + # Is java already installed? + if [ -n "${javaversion}" ]; then + # Added for users using Oracle JRE to bypass check. + depstatus=0 + deptocheck="${javaversion}" + else + depstatus=1 + fi + # Mono: A Mono repo needs to be installed. + elif [ "${deptocheck}" == "mono-complete" ]; then + if [ -n "${monoversion}" ] && [ "${monoversion}" -ge "5" ]; then + # Mono >= 5.0.0 already installed. + depstatus=0 + monoinstalled=true + else + # Mono not installed or installed Mono < 5.0.0. + depstatus=1 + monoinstalled=false + fi + # .NET Core: A .NET Core repo needs to be installed. + elif [ "${deptocheck}" == "aspnetcore-runtime-7.0" ]; then + # .NET is not installed. + if [ -n "${dotnetversion}" ]; then + depstatus=0 + dotnetinstalled=true + else + depstatus=1 + dotnetinstalled=false + fi + elif [ "$(command -v apt 2> /dev/null)" ]; then + dpkg-query -W -f='${Status}' "${deptocheck}" 2> /dev/null | grep -q -P '^install ok installed' + depstatus=$? + elif [ "$(command -v dnf 2> /dev/null)" ]; then + dnf list installed "${deptocheck}" > /dev/null 2>&1 + depstatus=$? + elif [ "$(command -v rpm 2> /dev/null)" ]; then + rpm -q "${deptocheck}" > /dev/null 2>&1 + depstatus=$? + fi + + # Outcome of Check. + if [ "${steamcmdstatus}" == "1" ]; then + # If SteamCMD is not available in repo dont check for it. + unset steamcmdstatus + elif [ "${depstatus}" == "0" ]; then + # If dependency is found. + missingdep=0 + if [ "${commandname}" == "INSTALL" ]; then + echo -e "${green}${deptocheck}${default}" + fn_sleep_time + fi + elif [ "${depstatus}" != "0" ]; then + # If dependency is not found. + missingdep=1 + if [ "${commandname}" == "INSTALL" ]; then + echo -e "${red}${deptocheck}${default}" + fn_sleep_time + fi + # If SteamCMD requirements are not met install will fail. + if [ -n "${appid}" ]; then + for steamcmddeptocheck in "${array_deps_required_steamcmd[@]}"; do + if [ "${deptocheck}" != "steamcmd" ] && [ "${deptocheck}" == "${steamcmddeptocheck}" ]; then + steamcmdfail=1 + fi + done + fi + fi + unset depstatus + + # Missing dependencies are added to array_deps_missing. + if [ "${missingdep}" == "1" ]; then + array_deps_missing+=("${deptocheck}") + fi +} + +if [ "${commandname}" == "INSTALL" ]; then + if [ "$(whoami)" == "root" ]; then + echo -e "" + echo -e "${bold}${lightyellow}Checking ${gamename} Dependencies as root${default}" + fn_messages_separator + fn_print_information_nl "Checking any missing dependencies for ${gamename} server only." + fn_print_information_nl "This will NOT install a ${gamename} server." + else + echo -e "" + echo -e "${bold}${lightyellow}Checking ${gamename} Dependencies${default}" + fn_messages_separator + fi +fi + +# Will warn user if their distro is no longer supported by the vendor. +if [ -n "${distrosupport}" ]; then + if [ "${distrosupport}" == "unsupported" ]; then + fn_print_warning_nl "${distroname} is no longer supported by the vendor or LinuxGSM. Upgrading is recommended." + fn_script_log_warn "${distroname} is no longer supported by the vendor or LinuxGSM. Upgrading is recommended." + fi +fi + +info_distro.sh + +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" + if [ -n "${checkflag}" ] && [ "${checkflag}" == "0" ]; then + fn_fetch_file_github "lgsm/data" "${distroid}-${distroversioncsv}.csv" "${datadir}" "chmodx" "norun" "noforce" "nohash" + fi +fi + +# If the file successfully downloaded run the dependency check. +if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then + depall=$(awk -F, '$1=="all" {$1=""; print $0}' "${datadir}/${distroid}-${distroversioncsv}.csv") + depsteamcmd=$(awk -F, '$1=="steamcmd" {$1=""; print $0}' "${datadir}/${distroid}-${distroversioncsv}.csv") + depshortname=$(awk -v shortname="${shortname}" -F, '$1==shortname {$1=""; print $0}' "${datadir}/${distroid}-${distroversioncsv}.csv") + + # Generate array of missing deps. + array_deps_missing=() + + array_deps_required=("${depall} ${depsteamcmd} ${depshortname}") + array_deps_required_steamcmd=("${depsteamcmd}") + fn_deps_email + # Unique sort dependency array. + IFS=" " read -r -a array_deps_required <<< "$(echo "${array_deps_required[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')" + + fn_check_loop +# Warn the user that dependency checking is unavailable for their distro. +elif [ "${commandname}" == "INSTALL" ] || [ -n "${checkflag}" ] && [ "${checkflag}" != "0" ]; then + fn_print_warning_nl "LinuxGSM dependency checking currently unavailable for ${distroname}." + # Prevent future dependency checking if unavailable for the distro. + echo "${version}" > "${tmpdir}/dependency-no-check.tmp" +elif [ -f "${tmpdir}/dependency-no-check.tmp" ]; then + # Allow LinuxGSM to try a dependency check if LinuxGSM has been recently updated. + nocheckversion=$(cat "${tmpdir}/dependency-no-check.tmp") + if [ "${version}" != "${nocheckversion}" ]; then + rm -f "${tmpdir:?}/dependency-no-check.tmp" + fi +fi diff --git a/lgsm/functions/check_executable.sh b/lgsm/modules/check_executable.sh similarity index 57% rename from lgsm/functions/check_executable.sh rename to lgsm/modules/check_executable.sh index 8623dc303..5959c61aa 100644 --- a/lgsm/functions/check_executable.sh +++ b/lgsm/modules/check_executable.sh @@ -1,17 +1,19 @@ #!/bin/bash -# LinuxGSM check_executable.sh function +# LinuxGSM check_executable.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Checks if server executable exists. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Check if executable exists +execname=$(basename "${executable}") if [ ! -f "${executabledir}/${execname}" ]; then fn_print_fail_nl "executable was not found" echo -e "* ${executabledir}/${execname}" if [ -d "${lgsmlogdir}" ]; then - fn_script_log_fatal "Executable was not found: ${executabledir}/${execname}" + fn_script_log_fail "Executable was not found: ${executabledir}/${execname}" fi unset exitbypass core_exit.sh diff --git a/lgsm/modules/check_gamedig.sh b/lgsm/modules/check_gamedig.sh new file mode 100644 index 000000000..0942ac42a --- /dev/null +++ b/lgsm/modules/check_gamedig.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# LinuxGSM check_gamedig.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# 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}" + fn_script_log_info "Installing Gamedig" + cd "${lgsmdir}" || exit + curl -L -o package.json "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/package.json" + npm install +elif [ "$(command -v node)" ] && [ "$(command -v npm)" ] && [ "$(node -v | cut -d 'v' -f 2 | cut -d '.' -f 1)" -ge 16 ]; then + cd "${lgsmdir}" || exit + curl -s -L -o package.json "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/package.json" + npm update > /dev/null 2>&1 +fi diff --git a/lgsm/modules/check_glibc.sh b/lgsm/modules/check_glibc.sh new file mode 100644 index 000000000..8b3d00658 --- /dev/null +++ b/lgsm/modules/check_glibc.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# LinuxGSM check_glibc.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if the server has the correct Glibc version. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +info_distro.sh + +if [ "${glibc}" == "null" ]; then + # Glibc is not required. + : +elif [ -z "${glibc}" ]; then + fn_print_dots "Checking glibc" + 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 + fn_print_dots "Checking glibc" + fn_print_error_nl "Checking glibc: requirements not met" + fn_script_log_error "Checking glibc: requirements not met" + echo -en "\n" + echo -e " * glibc required: ${glibc}" + echo -e " * glibc installed: ${red}${glibcversion}${default}" + echo -en "\n" + fn_print_information_nl "Distro upgrade is required" + fn_script_log_info "Distro upgrade is required" + fn_sleep_time_5 +fi diff --git a/lgsm/modules/check_ip.sh b/lgsm/modules/check_ip.sh new file mode 100644 index 000000000..8f943c568 --- /dev/null +++ b/lgsm/modules/check_ip.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# LinuxGSM check_ip.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Automatically identifies the server interface IP. +# If multiple interfaces are detected the user will need to manually set using ip="0.0.0.0". + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +info_game.sh + +ip_commands_array=("ip" "/bin/ip" "/usr/sbin/ip") +for ip_command in "${ip_commands_array[@]}"; do + if [ "$(command -v "${ip_command}" 2> /dev/null)" ]; then + ipcommand="${ip_command}" + break + fi +done + +ethtool_commands_array=("ethtool" "/bin/ethtool" "/usr/sbin/ethtool") +for ethtool_command in "${ethtool_commands_array[@]}"; do + if [ "$(command -v "${ethtool_command}" 2> /dev/null)" ]; then + ethtoolcommand="${ethtool_command}" + break + fi +done + +mapfile -t current_ips < <(${ipcommand} -o -4 addr | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -v 127.0.0) + +function fn_is_valid_ip() { + local ip="${1}" + # excluding 0.* ips also + grep -qEe '^[1-9]+[0-9]*\.[0-9]+\.[0-9]+\.[0-9]+$' <<< "${ip}" +} + +# Check if server has multiple IP addresses. + +# If the IP variable has been set by user. +if fn_is_valid_ip "${ip}"; then + queryips=("${ip}" "${publicip}") + httpip=("${ip}") + telnetip=("${ip}") +# If the game config has an IP set. +elif fn_is_valid_ip "${configip}"; then + queryips=("${configip}" "${publicip}") + ip="${configip}" + httpip=("${configip}") + telnetip=("${configip}") +# If there is only 1 server IP address. +# Some IP details can automatically use the one IP. +elif [ "${#current_ips[@]}" == "1" ]; then + queryips=("127.0.0.1" "${current_ips[@]}" "${publicip}") + ip="0.0.0.0" + httpip=("${current_ips[@]}") + telnetip=("${current_ips[@]}") +# If no ip is set by the user and server has more than one IP. +else + queryips=("127.0.0.1" "${current_ips[@]}" "${publicip}") + ip="0.0.0.0" + httpip=("${ip}") + telnetip=("${ip}") +fi diff --git a/lgsm/modules/check_last_update.sh b/lgsm/modules/check_last_update.sh new file mode 100644 index 000000000..2686c6507 --- /dev/null +++ b/lgsm/modules/check_last_update.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# LinuxGSM check_last_update.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks Lockfile to see when last update happened. +# Will reboot server if instance not rebooted since update. + +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 + +check_status.sh +if [ -f "${lockdir}/last-updated.lock" ] && [ "${status}" != "0" ]; then + if [ ! -f "${lockdir}/${selfname}-last-started.lock" ] || [ "${laststart}" -lt "${lastupdate}" ]; then + fn_print_info "${selfname} has not been restarted since last update" + fn_script_log_info "${selfname} has not been restarted since last update" + alert="update" + alert.sh + command_restart.sh + fn_firstcommand_reset + fi +fi diff --git a/lgsm/modules/check_logs.sh b/lgsm/modules/check_logs.sh new file mode 100644 index 000000000..36fb24036 --- /dev/null +++ b/lgsm/modules/check_logs.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# LinuxGSM check_logs.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if log files exist. + +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=true + install_logs.sh +} + +# Create directories for the script and console logs. +if [ ! -d "${lgsmlogdir}" ] || [ ! -d "${consolelogdir}" ]; then + fn_check_logs +fi + +# Create gamelogdir. +# If variable exists gamelogdir exists and log/server does not. +if [ "${gamelogdir}" ] && [ -d "${gamelogdir}" ] && [ ! -d "${logdir}/server" ]; then + fn_check_logs +fi + +# Create Steam log symlink if missing +if [ ! -d "${logdir}/steam" ] && [ -n "${appid}" ]; then + fn_check_logs +fi diff --git a/lgsm/functions/check_permissions.sh b/lgsm/modules/check_permissions.sh similarity index 55% rename from lgsm/functions/check_permissions.sh rename to lgsm/modules/check_permissions.sh index 7f95f5da7..9ed1bb65e 100644 --- a/lgsm/functions/check_permissions.sh +++ b/lgsm/modules/check_permissions.sh @@ -1,43 +1,48 @@ #!/bin/bash # LinuxGSM check_permissions.sh # Author: Daniel Gibbs -# Contributor: UltimateByte +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Checks ownership & permissions of scripts, files and directories. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_check_ownership(){ +fn_check_ownership() { if [ -f "${rootdir}/${selfname}" ]; then if [ "$(find "${rootdir}/${selfname}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then selfownissue=1 fi fi - if [ -d "${functionsdir}" ]; then - if [ "$(find "${functionsdir}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then + if [ -d "${lgsmdir}" ]; then + if [ "$(find "${lgsmdir}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then + lgsmownissue=1 + fi + fi + if [ -d "${modulesdir}" ]; then + if [ "$(find "${modulesdir}" -not -name '*.swp' -not -user "$(whoami)" | wc -l)" -ne "0" ]; then funcownissue=1 fi fi if [ -d "${serverfiles}" ]; then - if [ "$(find "${serverfiles}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then + if [ "$(find "${serverfiles}" -not -name '*.swp' -not -user "$(whoami)" | wc -l)" -ne "0" ]; then filesownissue=1 fi fi - if [ "${selfownissue}" == "1" ]||[ "${funcownissue}" == "1" ]||[ "${filesownissue}" == "1" ]; then + if [ "${selfownissue}" == "1" ] || [ "${lgsmownissue}" == "1" ] || [ "${filesownissue}" == "1" ]; then fn_print_fail_nl "Ownership issues found" - fn_script_log_fatal "Ownership issues found" + fn_script_log_fail "Ownership issues found" fn_print_information_nl "The current user ($(whoami)) does not have ownership of the following files:" fn_script_log_info "The current user ($(whoami)) does not have ownership of the following files:" { - echo -e "User\tGroup\tFile\n" + echo -en "User\tGroup\tFile:" if [ "${selfownissue}" == "1" ]; then - find "${rootdir}/${selfname}" -not -user "$(whoami)" -printf "%u\t\t%g\t%p\n" + find "${rootdir}/${selfname}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n" fi - if [ "${funcownissue}" == "1" ]; then - find "${functionsdir}" -not -user "$(whoami)" -printf "%u\t\t%g\t%p\n" + if [ "${lgsmownissue}" == "1" ]; then + find "${lgsmdir}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n" fi - if [ "${filesownissue}" == "1" ]; then - find "${serverfiles}" -not -user "$(whoami)" -printf "%u\t\t%g\t%p\n" + if [ "${filesownissue}" == "1" ]; then + find "${serverfiles}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n" fi } | column -s $'\t' -t | tee -a "${lgsmlog}" @@ -52,35 +57,54 @@ fn_check_ownership(){ fi } -fn_check_permissions(){ - if [ -d "${functionsdir}" ]; then - if [ "$(find "${functionsdir}" -type f -not -executable | wc -l)" -ne "0" ]; then +fn_check_permissions() { + # Check modules files are executable. + if [ -d "${modulesdir}" ]; then + 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_fatal "Permissions issues found" + fn_script_log_fail "Permissions issues found" fn_print_information_nl "The following files are not executable:" fn_script_log_info "The following files are not executable:" { - echo -e "File\n" - find "${functionsdir}" -type f -not -executable -printf "%p\n" + echo -en "File:" + echo -en "${findnotexecutable}" } | column -s $'\t' -t | tee -a "${lgsmlog}" - if [ "${monitorflag}" == 1 ]; then - alert="permissions" - alert.sh + + # Attempt to make the files executable + fn_print_information_nl "Attempting to fix permissions issues" + fn_script_log_info "Attempting to fix permissions issues" + echo "${findnotexecutable}" | xargs chmod +x + + # Re-check if there are still non-executable files + 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 "Failed to resolve permissions issues" + fn_script_log_fail "Failed to resolve permissions issues" + if [ "${monitorflag}" == 1 ]; then + alert="permissions" + alert.sh + fi + core_exit.sh + else + fn_print_ok_nl "Permissions issues resolved" + fn_script_log_pass "Permissions issues resolved" fi - core_exit.sh fi fi # Check rootdir permissions. - if [ "${rootdir}" ]; then - # Get permission numbers on directory under the form 775. + if [ -d "${rootdir}" ]; then + # Get permission numbers on directory should return 775. rootdirperm=$(stat -c %a "${rootdir}") # Grab the first and second digit for user and group permission. userrootdirperm="${rootdirperm:0:1}" grouprootdirperm="${rootdirperm:1:1}" - if [ "${userrootdirperm}" != "7" ]&&[ "${grouprootdirperm}" != "7" ]; then + if [ "${userrootdirperm}" != "7" ] && [ "${grouprootdirperm}" != "7" ]; then fn_print_fail_nl "Permissions issues found" - fn_script_log_fatal "Permissions issues found" + fn_script_log_fail "Permissions issues found" fn_print_information_nl "The following directory does not have the correct permissions:" fn_script_log_info "The following directory does not have the correct permissions:" fn_script_log_info "${rootdir}" @@ -92,6 +116,7 @@ fn_check_permissions(){ core_exit.sh fi fi + # Check if executable is executable and attempt to fix it. # First get executable name. execname=$(basename "${executable}") @@ -102,9 +127,9 @@ fn_check_permissions(){ userexecperm="${execperm:0:1}" groupexecperm="${execperm:1:1}" # Check for invalid user permission. - if [ "${userexecperm}" == "0" ]||[ "${userexecperm}" == "2" ]||[ "${userexecperm}" == "4" ]||[ "${userexecperm}" == "6" ]; then + if [ "${userexecperm}" == "0" ] || [ "${userexecperm}" == "2" ] || [ "${userexecperm}" == "4" ] || [ "${userexecperm}" == "6" ]; then # If user permission is invalid, then check for invalid group permissions. - if [ "${groupexecperm}" == "0" ]||[ "${groupexecperm}" == "2" ]||[ "${groupexecperm}" == "4" ]||[ "${groupexecperm}" == "6" ]; then + if [ "${groupexecperm}" == "0" ] || [ "${groupexecperm}" == "2" ] || [ "${groupexecperm}" == "4" ] || [ "${groupexecperm}" == "6" ]; then # If permission issues are found. fn_print_warn_nl "Permissions issue found" fn_script_log_warn "Permissions issue found" @@ -122,18 +147,18 @@ fn_check_permissions(){ # Grab the first and second digit for user and group permission. userexecperm="${execperm:0:1}" groupexecperm="${execperm:1:1}" - if [ "${userexecperm}" == "0" ]||[ "${userexecperm}" == "2" ]||[ "${userexecperm}" == "4" ]||[ "${userexecperm}" == "6" ]; then - if [ "${groupexecperm}" == "0" ]||[ "${groupexecperm}" == "2" ]||[ "${groupexecperm}" == "4" ]||[ "${groupexecperm}" == "6" ]; then - # If errors are still found. - fn_print_fail_nl "The following file could not be set executable:" - ls -l "${executabledir}/${execname}" - fn_script_log_warn "The following file could not be set executable:" - fn_script_log_info "${executabledir}/${execname}" - if [ "${monitorflag}" == "1" ]; then - alert="permissions" - alert.sh - fi - core_exit.sh + if [ "${userexecperm}" == "0" ] || [ "${userexecperm}" == "2" ] || [ "${userexecperm}" == "4" ] || [ "${userexecperm}" == "6" ]; then + if [ "${groupexecperm}" == "0" ] || [ "${groupexecperm}" == "2" ] || [ "${groupexecperm}" == "4" ] || [ "${groupexecperm}" == "6" ]; then + # If errors are still found. + fn_print_fail_nl "The following file could not be set executable:" + ls -l "${executabledir}/${execname}" + fn_script_log_warn "The following file could not be set executable:" + fn_script_log_info "${executabledir}/${execname}" + if [ "${monitorflag}" == "1" ]; then + alert="permissions" + alert.sh + fi + core_exit.sh fi fi fi @@ -141,29 +166,29 @@ fn_check_permissions(){ fi } -## The following fn_sys_perm_* functions checks for permission errors in /sys directory. +## The following fn_sys_perm_* function checks for permission errors in /sys directory. # Checks for permission errors in /sys directory. -fn_sys_perm_errors_detect(){ +fn_sys_perm_errors_detect() { # Reset test variables. sysdirpermerror="0" classdirpermerror="0" netdirpermerror="0" # Check permissions. # /sys, /sys/class and /sys/class/net should be readable & executable. - if [ ! -r "/sys" ]||[ ! -x "/sys" ]; then + if [ ! -r "/sys" ] || [ ! -x "/sys" ]; then sysdirpermerror="1" fi - if [ ! -r "/sys/class" ]||[ ! -x "/sys/class" ]; then + if [ ! -r "/sys/class" ] || [ ! -x "/sys/class" ]; then classdirpermerror="1" fi - if [ ! -r "/sys/class/net" ]||[ ! -x "/sys/class/net" ]; then + if [ ! -r "/sys/class/net" ] || [ ! -x "/sys/class/net" ]; then netdirpermerror="1" fi } # Display a message on how to fix the issue manually. -fn_sys_perm_fix_manually_msg(){ +fn_sys_perm_fix_manually_msg() { echo -e "" fn_print_information_nl "This error causes servers to fail starting properly" fn_script_log_info "This error causes servers to fail starting properly." @@ -171,7 +196,7 @@ fn_sys_perm_fix_manually_msg(){ fn_script_log_info "To fix this issue, run the following command as root:" echo -e " chmod a+rx /sys /sys/class /sys/class/net" fn_script_log "chmod a+rx /sys /sys/class /sys/class/net" - fn_sleep_time + fn_sleep_time_5 if [ "${monitorflag}" == 1 ]; then alert="permissions" alert.sh @@ -180,10 +205,10 @@ fn_sys_perm_fix_manually_msg(){ } # Attempt to fix /sys related permission errors if sudo is available, exits otherwise. -fn_sys_perm_errors_fix(){ +fn_sys_perm_errors_fix() { if sudo -n true > /dev/null 2>&1; then - fn_print_dots "Automatically fixing /sys permissions" - fn_script_log_info "Automatically fixing /sys permissions." + fn_print_dots "Fixing /sys permissions" + fn_script_log_info "Fixing /sys permissions." if [ "${sysdirpermerror}" == "1" ]; then sudo chmod a+rx "/sys" fi @@ -195,37 +220,36 @@ fn_sys_perm_errors_fix(){ fi # Run check again to see if it's fixed. fn_sys_perm_errors_detect - if [ "${sysdirpermerror}" == "1" ]||[ "${classdirpermerror}" == "1" ]||[ "${netdirpermerror}" == "1" ]; then + if [ "${sysdirpermerror}" == "1" ] || [ "${classdirpermerror}" == "1" ] || [ "${netdirpermerror}" == "1" ]; then fn_print_error "Could not fix /sys permissions" fn_script_log_error "Could not fix /sys permissions." - fn_sleep_time + # Show the user how to fix. fn_sys_perm_fix_manually_msg else - fn_print_ok_nl "Automatically fixing /sys permissions" + fn_print_ok_nl "Fixing /sys permissions" fn_script_log_pass "Permissions in /sys fixed" fi else - # Show the user how to fix. - fn_sys_perm_fix_manually_msg + # Show the user how to fix. + fn_sys_perm_fix_manually_msg fi } # Processes to the /sys related permission errors check & fix/info. -fn_sys_perm_error_process(){ +fn_sys_perm_error_process() { fn_sys_perm_errors_detect # If any error was found. - if [ "${sysdirpermerror}" == "1" ]||[ "${classdirpermerror}" == "1" ]||[ "${netdirpermerror}" == "1" ]; then - fn_print_error_nl "Permission error(s) found in /sys" - fn_script_log_error "Permission error(s) found in /sys" + if [ "${sysdirpermerror}" == "1" ] || [ "${classdirpermerror}" == "1" ] || [ "${netdirpermerror}" == "1" ]; then + fn_print_dots "Checking /sys permissions" + fn_print_error_nl "Checking /sys permissions" + fn_script_log_error "Checking /sys permissions" # Run the fix fn_sys_perm_errors_fix fi } -# Run perm error detect & fix/alert functions on /sys directories. - -## Run checks. +## Run permisions 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 new file mode 100644 index 000000000..47825ddc9 --- /dev/null +++ b/lgsm/modules/check_root.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# LinuxGSM check_root.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if the user tried to run the script as root. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ "$(whoami)" == "root" ]; then + if [ "${commandname}" != "INSTALL" ]; then + fn_print_fail_nl "Do NOT run as root!" + if [ -d "${lgsmlogdir}" ]; then + fn_script_log_fail "${selfname} attempted to run as root." + else + # Forces exit code is log does not yet exist. + exitcode=1 + fi + core_exit.sh + fi +fi diff --git a/lgsm/modules/check_status.sh b/lgsm/modules/check_status.sh new file mode 100644 index 000000000..e017b89ec --- /dev/null +++ b/lgsm/modules/check_status.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM check_status.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks the process status of the server. Either online or offline. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +status=$(tmux -L "${socketname}" list-sessions -F "#{session_name}" 2> /dev/null | grep -Ecx "^${sessionname}") diff --git a/lgsm/modules/check_steamcmd.sh b/lgsm/modules/check_steamcmd.sh new file mode 100644 index 000000000..0e7f5ce6c --- /dev/null +++ b/lgsm/modules/check_steamcmd.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# LinuxGSM check_steamcmd.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if SteamCMD is installed correctly. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# init steamcmd functions. +core_steamcmd.sh + +fn_check_steamcmd_clear +fn_check_steamcmd +if [ "${shortname}" == "ark" ]; then + fn_check_steamcmd_ark +fi +fn_check_steamcmd_dir +fn_check_steamcmd_dir_legacy +fn_check_steamcmd_steamapp +fn_check_steamcmd_user +fn_check_steamcmd_exec diff --git a/lgsm/modules/check_system_dir.sh b/lgsm/modules/check_system_dir.sh new file mode 100644 index 000000000..2b646835d --- /dev/null +++ b/lgsm/modules/check_system_dir.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# LinuxGSM check_system_dir.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if systemdir/serverfiles is accessible. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ ! -d "${serverfiles}" ]; then + fn_print_fail_nl "Cannot access ${serverfiles}: No such directory" + if [ -d "${lgsmlogdir}" ]; then + fn_script_log_fail "Cannot access ${serverfiles}: No such directory." + fi + core_exit.sh +fi + +if [ ! -d "${systemdir}" ] && [ -z "${CI}" ]; then + fn_print_fail_nl "Cannot access ${systemdir}: No such directory" + if [ -d "${lgsmlogdir}" ]; then + fn_script_log_fail "Cannot access ${systemdir}: No such directory." + fi + core_exit.sh +fi diff --git a/lgsm/modules/check_system_requirements.sh b/lgsm/modules/check_system_requirements.sh new file mode 100644 index 000000000..531695a6e --- /dev/null +++ b/lgsm/modules/check_system_requirements.sh @@ -0,0 +1,79 @@ +#!/bin/bash +# LinuxGSM check_system_requirements.sh +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks RAM requirements. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +info_distro.sh + +if [[ "${arch}" != "x86_64" && "${arch}" != "i386" && "${arch}" != "i686" ]]; then + echo -e "${red}Error: Only x86 type architectures are supported. Detected architecture: ${arch}${default}" + fn_script_log_error "Only x86 type architectures are supported. Detected architecture: ${arch}" + core_exit.sh +fi + +if [ "${shortname}" == "ark" ]; then + ramrequirementgb="7" +elif [ "${shortname}" == "arma3" ]; then + ramrequirementgb="2" +elif [ "${shortname}" == "armar" ]; then + ramrequirementgb="3" +elif [ "${shortname}" == "bt" ]; then + ramrequirementgb="1" +elif [ "${shortname}" == "cc" ]; then + ramrequirementgb="1" +elif [ "${shortname}" == "dayz" ]; then + ramrequirementgb="5" +elif [ "${shortname}" == "dodr" ]; then + ramrequirementgb="2" +elif [ "${shortname}" == "hw" ]; then + ramrequirementgb="3" +elif [ "${shortname}" == "mc" ]; then + ramrequirementgb="1" +elif [ "${shortname}" == "pmc" ]; then + ramrequirementgb="2" +elif [ "${shortname}" == "mh" ]; then + ramrequirementgb="4" +elif [ "${shortname}" == "ns2" ] || [ "${shortname}" == "ns2c" ]; then + ramrequirementgb="1" +elif [ "${shortname}" == "ps" ]; then + ramrequirementgb="2" +elif [ "${shortname}" == "pvr" ]; then + ramrequirementgb="1" +elif [ "${shortname}" == "pz" ]; then + ramrequirementgb="3" +elif [ "${shortname}" == "rust" ]; then + ramrequirementgb="9" +elif [ "${shortname}" == "sdtd" ]; then + ramrequirementgb="4" +elif [ "${shortname}" == "sf" ]; then + ramrequirementgb="12" +elif [ "${shortname}" == "squad" ]; then + ramrequirementgb="2" +elif [ "${shortname}" == "sm" ]; then + ramrequirementgb="10" +elif [ "${shortname}" == "st" ]; then + ramrequirementgb="1" +elif [ "${shortname}" == "stn" ]; then + ramrequirementgb="3" +elif [ "${shortname}" == "tu" ]; then + ramrequirementgb="2" +elif [ "${shortname}" == "vh" ]; then + ramrequirementgb="2" +else + ramrequirementgb="0.5" +fi + +# If the game or engine has a minimum RAM Requirement, compare it to system's available RAM. +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_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/functions/check_tmuxception.sh b/lgsm/modules/check_tmuxception.sh similarity index 64% rename from lgsm/functions/check_tmuxception.sh rename to lgsm/modules/check_tmuxception.sh index 4f5fd2e29..fa0748c8b 100644 --- a/lgsm/functions/check_tmuxception.sh +++ b/lgsm/modules/check_tmuxception.sh @@ -1,16 +1,16 @@ #!/bin/bash -# LinuxGSM check_config.sh function +# LinuxGSM check_config.sh module # Author: Daniel Gibbs -# Contributor: UltimateByte +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Checks if run from tmux or screen +# Description: Checks if run from tmux or screen. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_check_is_in_tmux(){ - if [ "${TMUX}" ]; then +fn_check_is_in_tmux() { + if [ "${TMUX}" ]; then fn_print_fail_nl "tmuxception error: Sorry Cobb you cannot start a tmux session inside of a tmux session." - fn_script_log_fatal "Tmuxception error: Attempted to start a tmux session inside of a tmux session." + fn_script_log_fail "Tmuxception error: Attempted to start a tmux session inside of a tmux session." fn_print_information_nl "LinuxGSM creates a tmux session when starting the server." echo -e "It is not possible to run a tmux session inside another tmux session" echo -e "https://docs.linuxgsm.com/requirements/tmux#tmuxception" @@ -18,10 +18,10 @@ fn_check_is_in_tmux(){ fi } -fn_check_is_in_screen(){ +fn_check_is_in_screen() { if [ "${STY}" ]; then fn_print_fail_nl "tmuxception error: Sorry Cobb you cannot start a tmux session inside of a screen session." - fn_script_log_fatal "Tmuxception error: Attempted to start a tmux session inside of a screen session." + fn_script_log_fail "Tmuxception error: Attempted to start a tmux session inside of a screen session." fn_print_information_nl "LinuxGSM creates a tmux session when starting the server." echo -e "It is not possible to run a tmux session inside screen session" echo -e "https://docs.linuxgsm.com/requirements/tmux#tmuxception" diff --git a/lgsm/functions/check_version.sh b/lgsm/modules/check_version.sh similarity index 65% rename from lgsm/functions/check_version.sh rename to lgsm/modules/check_version.sh index 6db78091d..b1e7f5584 100644 --- a/lgsm/functions/check_version.sh +++ b/lgsm/modules/check_version.sh @@ -1,11 +1,14 @@ #!/bin/bash -# LinuxGSM command_version.sh function +# LinuxGSM command_version.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Will run update-lgsm if gameserver.sh and modules version does not match # this will allow gameserver.sh to update - useful for multi instance servers. -if [ -n "${modulesversion}" ]&&[ -n "${version}" ]&&[ "${version}" != "${modulesversion}" ]; then +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ -n "${modulesversion}" ] && [ -n "${version}" ] && [ "${version}" != "${modulesversion}" ]; then exitbypass=1 echo -e "" fn_print_error_nl "LinuxGSM version mismatch" @@ -13,7 +16,8 @@ if [ -n "${modulesversion}" ]&&[ -n "${version}" ]&&[ "${version}" != "${modules echo -e "* ${selfname}: ${version}" echo -e "* modules: ${modulesversion}" echo -e "" - fn_sleep_time fn_script_log_error "LinuxGSM Version mismatch: ${selfname}: ${version}: modules: ${modulesversion}" + fn_sleep_time_1 command_update_linuxgsm.sh + fn_firstcommand_reset fi diff --git a/lgsm/functions/command_backup.sh b/lgsm/modules/command_backup.sh similarity index 59% rename from lgsm/functions/command_backup.sh rename to lgsm/modules/command_backup.sh index 537e86f1c..010c60577 100644 --- a/lgsm/functions/command_backup.sh +++ b/lgsm/modules/command_backup.sh @@ -1,18 +1,17 @@ #!/bin/bash -# LinuxGSM command_backup.sh function +# LinuxGSM command_backup.sh module # Author: Daniel Gibbs -# Contributor: UltimateByte +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Creates a .tar.gz file in the backup directory. commandname="BACKUP" -commandaction="Backing up" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -check.sh +commandaction="Backup" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set # Trap to remove lockfile on quit. -fn_backup_trap(){ +fn_backup_trap() { echo -e "" echo -en "backup ${backupname}.tar.gz..." fn_print_canceled_eol_nl @@ -21,32 +20,48 @@ fn_backup_trap(){ echo -en "backup ${backupname}.tar.gz..." fn_print_removed_eol_nl fn_script_log_info "Backup ${backupname}.tar.gz: REMOVED" - # Remove lock file. + # Remove backup lockfile. rm -f "${lockdir:?}/backup.lock" + fn_backup_start_server + unset exitbypass core_exit.sh } # Check if a backup is pending or has been aborted using backup.lock. -fn_backup_check_lockfile(){ +fn_backup_check_lockfile() { + # Remove stale lockfile. if [ -f "${lockdir}/backup.lock" ]; then - fn_print_info_nl "Lock file found: Backup is currently running" - fn_script_log_error "Lock file found: Backup is currently running: ${lockdir}/backup.lock" + if [ "$(find "${lockdir}/backup.lock" -mmin +60)" ]; then + fn_print_dots "Lockfile found: " + fn_print_checking_eol + fn_print_warn "Lockfile found: Removing stale lockfile: " + fn_print_warn_eol + fn_script_log_warn "Lockfile found: Removing stale lockfile" + rm -f "${lockdir:?}/backup.lock" + fi + fi + + if [ -f "${lockdir}/backup.lock" ]; then + fn_print_info_nl "Lockfile found: Backup is currently running" + fn_script_log_error "Lockfile found: Backup is currently running: ${lockdir}/backup.lock" core_exit.sh fi } # Initialisation. -fn_backup_init(){ +fn_backup_init() { # Backup file name with selfname and current date. backupname="${selfname}-$(date '+%Y-%m-%d-%H%M%S')" info_distro.sh - fn_print_dots "Backup starting" - fn_script_log_info "Backup starting" - fn_print_ok_nl "Backup starting" - if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then - fn_print_info_nl "There are no previous backups" + fn_print_dots "Starting backup" + fn_script_log_info "Starting backup" + if [ ! -d "${backupdir}" ] || [ "${backupcount}" == "0" ]; then + fn_print_info_nl "Starting backup: No previous backups found" + fn_script_log_info "No previous backups found" else + fn_print_info_nl "Starting backup: Previous backups found" + fn_script_log_info "Previous backups found" if [ "${lastbackupdaysago}" == "0" ]; then daysago="less than 1 day ago" elif [ "${lastbackupdaysago}" == "1" ]; then @@ -59,114 +74,87 @@ fn_backup_init(){ } # Check if server is started and whether to stop it. -fn_backup_stop_server(){ +fn_backup_stop_server() { check_status.sh - # Server is stopped. - if [ "${status}" == "0" ]; then - serverstopped="no" - # Server is running and stoponbackup=off. - elif [ "${stoponbackup}" == "off" ]; then - serverstopped="no" + # Server is running but will not be stopped. + if [ "${stoponbackup}" == "off" ]; then fn_print_warn_nl "${selfname} is currently running" echo -e "* Although unlikely; creating a backup while ${selfname} is running might corrupt the backup." fn_script_log_warn "${selfname} is currently running" fn_script_log_warn "Although unlikely; creating a backup while ${selfname} is running might corrupt the backup" # Server is running and will be stopped if stoponbackup=on or unset. - else - fn_stop_warning - serverstopped="yes" + # If server is started + elif [ "${status}" != "0" ]; then + fn_print_restart_warning + startserver="1" exitbypass=1 command_stop.sh + fn_firstcommand_reset fi } # Create required folders. -fn_backup_dir(){ +fn_backup_dir() { # Create backupdir if it doesn't exist. if [ ! -d "${backupdir}" ]; then mkdir -p "${backupdir}" fi } -# Migrate Backups from old dir before refactor -fn_backup_migrate_olddir(){ - # Check if old backup dir is there before the refactor and move the backups - if [ -d "${rootdir}/backups" ]; then - if [ "${rootdir}/backups" != "${backupdir}" ]; then - fn_print_dots "Backup directory is being migrated" - fn_script_log_info "Backup directory is being migrated" - fn_script_log_info "${rootdir}/backups > ${backupdir}" - mv "${rootdir}/backups/"* "${backupdir}" 2>/dev/null - exitcode=$? - if [ "${exitcode}" -eq 0 ]; then - rmdir "${rootdir}/backups" 2>/dev/null - exitcode=$? - fi - if [ "${exitcode}" -eq 0 ]; then - fn_print_ok_nl "Backup directory is being migrated" - fn_script_log_pass "Backup directory is being migrated" - else - fn_print_error_nl "Backup directory is being migrated" - fn_script_log_error "Backup directory is being migrated" - fi - fi - fi -} - -fn_backup_create_lockfile(){ +fn_backup_create_lockfile() { # Create lockfile. - date '+%s' > "${lockdir}/backup.lock" - fn_script_log_info "Lockfile generated" + date '+%s' > "${lockdir:?}/backup.lock" + fn_script_log_info "Backup lockfile generated" fn_script_log_info "${lockdir}/backup.lock" # trap to remove lockfile on quit. trap fn_backup_trap INT } # Compressing files. -fn_backup_compression(){ +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_print_dots "Backup (${rootdirduexbackup}) ${backupname}.tar.gz, in progress ..." + fn_script_log_info "Backup ${rootdirduexbackup} ${backupname}.tar.gz, in progress" excludedir=$(fn_backup_relpath) # Check that excludedir is a valid path. - if [ ! -d "${excludedir}" ] ; then + if [ ! -d "${excludedir}" ]; then fn_print_fail_nl "Problem identifying the previous backup directory for exclusion." - fn_script_log_fatal "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 -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}/backup.lock" ./. - local exitcode=$? - if [ ${exitcode} -ne 0 ]; then + tar --use-compress-program=pigz -cf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}" --exclude "${tmpdir}" ./. + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol - fn_script_log_fatal "Backup in progress: FAIL" + fn_script_log_fail "Backup in progress: FAIL" echo -e "${extractcmd}" | tee -a "${lgsmlog}" fn_print_fail_nl "Starting backup" - fn_script_log_fatal "Starting backup" + 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 fi - # Remove lock file - rm -f "${lockdir:?}/backup.lock" } # Clear old backups according to maxbackups and maxbackupdays variables. -fn_backup_prune(){ +fn_backup_prune() { # Clear if backup variables are set. - if [ "${maxbackups}" ]&&[ -n "${maxbackupdays}" ]; then + if [ "${maxbackups}" ] && [ -n "${maxbackupdays}" ]; then # How many backups there are. info_distro.sh # How many backups exceed maxbackups. - backupquotadiff=$((backupcount-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.gz" -mtime +"${maxbackupdays}" | wc -l) # If anything can be cleared. - if [ "${backupquotadiff}" -gt "0" ]||[ "${backupsoudatedcount}" -gt "0" ]; then + if [ "${backupquotadiff}" -gt "0" ] || [ "${backupsoudatedcount}" -gt "0" ]; then fn_print_dots "Pruning" fn_script_log_info "Backup pruning activated" fn_print_ok_nl "Pruning" @@ -175,7 +163,7 @@ fn_backup_prune(){ # Display how many backups will be cleared. echo -e "* Pruning: ${backupquotadiff} backup(s) has exceeded the ${maxbackups} backups limit" fn_script_log_info "Pruning: ${backupquotadiff} backup(s) has exceeded the ${maxbackups} backups limit" - fn_sleep_time + fn_sleep_time_1 fn_print_dots "Pruning: Clearing ${backupquotadiff} backup(s)" fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)" # Clear backups over quota. @@ -187,7 +175,7 @@ fn_backup_prune(){ # Display how many backups will be cleared. echo -e "* Pruning: ${backupsoudatedcount} backup(s) are older than ${maxbackupdays} days." fn_script_log_info "Pruning: ${backupsoudatedcount} backup(s) older than ${maxbackupdays} days." - fn_sleep_time + fn_sleep_time_1 fn_print_dots "Pruning: Clearing ${backupquotadiff} backup(s)." fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)" # Clear backups over quota @@ -202,82 +190,69 @@ 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_fatal "Problem assessing rootdir during relative path assessment: ${rootdir}" + fn_script_log_fail "Problem assessing rootdir during relative path assessment: ${rootdir}" core_exit.sh 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_fatal "Problem assessing backupdir during relative path assessment: ${rootdir}" + fn_script_log_fail "Problem assessing backupdir during relative path assessment: ${rootdir}" core_exit.sh fi # Compare the leading entries of each array. These common elements will be clipped off. # for the relative path output. - for ((base=0; base<${#rdirtoks[@]}; base++)) - do + for ((base = 0; base < ${#rdirtoks[@]}; base++)); do [[ "${rdirtoks[$base]}" != "${bdirtoks[$base]}" ]] && break done # Next, climb out of the remaining rootdir location with updir references. - for ((x=base;x<${#rdirtoks[@]};x++)) - do + for ((x = base; x < ${#rdirtoks[@]}; x++)); do echo -n "../" done # Climb down the remaining components of the backupdir location. - for ((x=base;x<$(( ${#bdirtoks[@]} - 1 ));x++)) - do - echo -n "${bdirtoks[$x]}/" + for ((x = base; x < $((${#bdirtoks[@]} - 1)); x++)); do + echo -n "${bdirtoks[$x]}/" done # In the event there were no directories left in the backupdir above to # traverse down, just add a newline. Otherwise at this point, there is # one remaining directory component in the backupdir to navigate. - if (( "$base" < "${#bdirtoks[@]}" )) ; then - echo -e "${bdirtoks[ $(( ${#bdirtoks[@]} - 1)) ]}" + if (("$base" < "${#bdirtoks[@]}")); then + echo -e "${bdirtoks[$((${#bdirtoks[@]} - 1))]}" else echo fi } -fn_stop_warning(){ - fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during backup" - fn_script_log_warn "Updating server: SteamCMD: ${selfname} will be stopped during backup" - totalseconds=3 - for seconds in {3..1}; do - fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during backup: ${totalseconds}" - totalseconds=$((totalseconds - 1)) - sleep 1 - if [ "${seconds}" == "0" ]; then - break - fi - done - fn_print_warn_nl "Updating server: SteamCMD: ${selfname} will be stopped during backup" -} - -# Restart the server if it was stopped for the backup. -fn_backup_start_server(){ - if [ "${serverstopped}" == "yes" ]; then +# Start the server if it was stopped for the backup. +fn_backup_start_server() { + if [ -n "${startserver}" ]; then exitbypass=1 command_start.sh + fn_firstcommand_reset fi } -# Run functions. +fn_print_dots "" +check.sh +core_logs.sh + fn_backup_check_lockfile -fn_backup_create_lockfile fn_backup_init fn_backup_stop_server fn_backup_dir -fn_backup_migrate_olddir +fn_backup_create_lockfile fn_backup_compression fn_backup_prune fn_backup_start_server +# Remove backup lockfile. +rm -f "${lockdir:?}/backup.lock" core_exit.sh diff --git a/lgsm/modules/command_check_update.sh b/lgsm/modules/command_check_update.sh new file mode 100644 index 000000000..ee4c8ccb3 --- /dev/null +++ b/lgsm/modules/command_check_update.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# LinuxGSM command_check_update.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of servers. + +commandname="CHECK-UPDATE" +commandaction="Check for Update" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_dots "" +check.sh +core_logs.sh + +if [ "${shortname}" == "ts3" ]; then + update_ts3.sh +elif [ "${shortname}" == "mc" ]; then + update_mc.sh +elif [ "${shortname}" == "mcb" ]; then + update_mcb.sh +elif [ "${shortname}" == "pmc" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then + update_pmc.sh +elif [ "${shortname}" == "fctr" ]; then + update_fctr.sh +elif [ "${shortname}" == "mta" ]; then + update_mta.sh +elif [ "${shortname}" == "jk2" ]; then + update_jk2.sh +elif [ "${shortname}" == "vints" ]; then + update_vints.sh +elif [ "${shortname}" == "ut99" ]; then + update_ut99.sh +else + update_steamcmd.sh +fi + +core_exit.sh diff --git a/lgsm/modules/command_console.sh b/lgsm/modules/command_console.sh new file mode 100644 index 000000000..6344088b3 --- /dev/null +++ b/lgsm/modules/command_console.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# LinuxGSM command_console.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Gives access to the server tmux console. + +commandname="CONSOLE" +commandaction="Access Console" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_header + +check.sh + +if [ "${consoleverbose}" == "yes" ]; then + echo -e "* Verbose output: ${lightgreen}yes${default}" +elif [ "${consoleverbose}" == "no" ]; then + echo -e "* Verbose output: ${red}no${default}" +else + echo -e "* Verbose output: ${red}unknown${default}" +fi + +if [ "${consoleinteract}" == "yes" ]; then + echo -e "* Interactive output: ${lightgreen}yes${default}" +elif [ "${consoleinteract}" == "no" ]; then + echo -e "* Interactive output: ${red}no${default}" +else + echo -e "* Interactive output: ${red}unknown${default}" +fi +echo "" +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 +fi +fn_print_dots "Accessing console" +check_status.sh +if [ "${status}" != "0" ]; then + fn_print_ok_nl "Accessing console" + fn_script_log_pass "Console accessed" + tmux -L "${socketname}" attach-session -t "${sessionname}" + fn_print_ok_nl "Closing console" + fn_script_log_pass "Console closed" +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 + fn_firstcommand_reset + fi +fi + +core_exit.sh diff --git a/lgsm/functions/command_debug.sh b/lgsm/modules/command_debug.sh similarity index 51% rename from lgsm/functions/command_debug.sh rename to lgsm/modules/command_debug.sh index 5aeb0d5e1..a5dae7615 100644 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/modules/command_debug.sh @@ -1,17 +1,19 @@ #!/bin/bash -# LinuxGSM command_debug.sh function +# LinuxGSM command_debug.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Runs the server without tmux and directly from the terminal. commandname="DEBUG" -commandaction="Debuging" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +commandaction="Debugging" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set # Trap to remove lockfile on quit. -fn_lockfile_trap(){ +fn_lockfile_trap() { # Remove lockfile. - rm -f "${lockdir:?}/${selfname}.lock" + rm -f "${lockdir:?}/${selfname}-started.lock" # resets terminal. Servers can sometimes mess up the terminal on exit. reset fn_print_dots "Stopping debug" @@ -22,25 +24,26 @@ fn_lockfile_trap(){ core_exit.sh } +fn_print_header + check.sh fix.sh info_distro.sh -info_config.sh -# NOTE: Check if works with server without parms. Could be intergrated in to info_parms.sh. -fn_parms -fn_print_header +info_game.sh + { echo -e "${lightblue}Distro:\t\t${default}${distroname}" - echo -e "${lightblue}Arch:\t\t${default}${arch}" + echo -e "${lightblue}Architecture:\t\t${default}${arch}" echo -e "${lightblue}Kernel:\t\t${default}${kernel}" echo -e "${lightblue}Hostname:\t\t${default}${HOSTNAME}" - echo -e "${lightblue}tmux:\t\t${default}${tmuxv}" + echo -e "${lightblue}tmux:\t\t${default}${tmuxversion}" echo -e "${lightblue}Avg Load:\t\t${default}${load}" echo -e "${lightblue}Free Memory:\t\t${default}${physmemfree}" echo -e "${lightblue}Free Disk:\t\t${default}${availspace}" } | column -s $'\t' -t + # glibc required. -if [ "${glibc}" ]; then +if [ -n "${glibc}" ]; then if [ "${glibc}" == "null" ]; then # Glibc is not required. : @@ -53,64 +56,84 @@ if [ "${glibc}" ]; then fi fi -# Server IP -if [ "${multiple_ip}" == "1" ]; then - echo -e "${lightblue}Server IP:\t${default}NOT SET" -else - echo -e "${lightblue}Server IP:\t${default}${ip}:${port}" -fi +# Server IP. +echo -e "${lightblue}Game Server IP:\t${default}${ip}:${port}" + # External server IP. -if [ "${extip}" ]; then - if [ "${ip}" != "${extip}" ]; then - echo -e "${lightblue}Internet IP:\t${default}${extip}:${port}" +if [ "${publicip}" ]; then + if [ "${ip}" != "${publicip}" ]; then + echo -e "${lightblue}Internet IP:\t${default}${publicip}:${port}" fi fi + # Server password. if [ "${serverpassword}" ]; then echo -e "${lightblue}Server password:\t${default}${serverpassword}" fi + +fn_reload_startparameters echo -e "${lightblue}Start parameters:${default}" -if [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then - echo -e "${executable} ${parms} -debug" +if [ "${engine}" == "source" ] || [ "${engine}" == "goldsrc" ]; then + echo -e "${executable} ${startparameters} -debug" +elif [ "${engine}" == "quake" ]; then + echo -e "${executable} ${startparameters} -condebug" else - echo -e "${executable} ${parms}" + echo -e "${preexecutable} ${executable} ${startparameters}" fi echo -e "" -echo -e "Use for identifying server issues only!" +echo -e "Use debug for identifying server issues only!" echo -e "Press CTRL+c to drop out of debug mode." fn_print_warning_nl "If ${selfname} is already running it will be stopped." -echo -e "" + if ! fn_prompt_yn "Continue?" Y; then - return + exitcode=0 + core_exit.sh fi fn_print_info_nl "Stopping any running servers" fn_script_log_info "Stopping any running servers" exitbypass=1 command_stop.sh +fn_firstcommand_reset unset exitbypass fn_print_dots "Starting debug" fn_script_log_info "Starting debug" fn_print_ok_nl "Starting debug" -# Create lockfile. -date '+%s' > "${lockdir}/${selfname}.lock" +# Create started lockfile. +date '+%s' > "${lockdir:?}/${selfname}-started.lock" +echo "${version}" >> "${lockdir}/${selfname}-started.lock" +echo "${port}" >> "${lockdir}/${selfname}-started.lock" fn_script_log_info "Lockfile generated" -fn_script_log_info "${lockdir}/${selfname}.lock" +fn_script_log_info "${lockdir}/${selfname}-started.lock" -cd "${executabledir}" || exit -# Note: do not add double quotes to ${executable} ${parms}. -if [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then - ${executable} ${parms} -debug -elif [ "${shortname}" == "arma3" ]; then - # Arma3 requires semicolons in the module list, which need to - # be escaped for regular (tmux) loading, but need to be - # stripped when loading straight from the console. - ${executable} ${parms//\\;/;} -elif [ "${engine}" == "quake" ]; then - ${executable} ${parms} -condebug +if [ "${shortname}" == "av" ]; then + cd "${systemdir}" || exit else - ${executable} ${parms} + cd "${executabledir}" || exit +fi + +# Note: do not add double quotes to ${executable} ${startparameters}. +if [ "${engine}" == "source" ] || [ "${engine}" == "goldsrc" ]; then + eval "${executable} ${startparameters} -debug" +elif [ "${engine}" == "quake" ]; then + eval "${executable} ${startparameters} -condebug" +else + # shellcheck disable=SC2086 + eval "${preexecutable} ${executable} ${startparameters}" +fi + +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 + fn_print_ok_nl "Server has stopped" + fn_script_log_pass "Server has stopped" + fn_print_ok_nl "Press ENTER to exit debug mode" + read -r fi fn_lockfile_trap diff --git a/lgsm/modules/command_details.sh b/lgsm/modules/command_details.sh new file mode 100644 index 000000000..8de2ddeb5 --- /dev/null +++ b/lgsm/modules/command_details.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# LinuxGSM command_details.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Displays server information. + +commandname="DETAILS" +commandaction="Display Details" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +# Run checks and gathers details to display. +check.sh +info_distro.sh +info_game.sh +info_messages.sh +if [ "${querymode}" == "2" ] || [ "${querymode}" == "3" ]; then + for queryip in "${queryips[@]}"; do + query_gamedig.sh + if [ "${querystatus}" == "0" ]; then + break + fi + done +fi +fn_info_messages_distro +fn_info_messages_server_resource +fn_info_messages_gameserver_resource +fn_info_messages_gameserver +fn_info_messages_script +fn_info_messages_backup +# Some game servers do not have parms. +if [ "${shortname}" != "jc2" ] && [ "${shortname}" != "dst" ] && [ "${shortname}" != "pz" ] && [ "${engine}" != "renderware" ]; then + fn_info_messages_commandlineparms +fi +fn_info_messages_ports_edit +fn_info_messages_ports +fn_info_messages_select_engine +fn_info_messages_statusbottom + +exitcode=0 +core_exit.sh diff --git a/lgsm/modules/command_dev_clear_modules.sh b/lgsm/modules/command_dev_clear_modules.sh new file mode 100644 index 000000000..d6196ba74 --- /dev/null +++ b/lgsm/modules/command_dev_clear_modules.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# LinuxGSM command_dev_clear_modules.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Deletes the contents of the modules dir. + +commandname="DEV-CLEAR-MODULES" +commandaction="Clear Modules" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +echo -e "" +echo -e "${bold}${lightyellow}Clear Modules${default}" +fn_messages_separator +echo -e "" +if fn_prompt_yn "Do you want to delete all modules?" Y; then + rm -rfv "${modulesdir:?}/"* + rm -rfv "${configdirdefault:?}/"* + fn_script_log_info "Cleared modules directory" + fn_script_log_info "Cleared default config directory" +fi + +core_exit.sh diff --git a/lgsm/functions/command_dev_debug.sh b/lgsm/modules/command_dev_debug.sh similarity index 60% rename from lgsm/functions/command_dev_debug.sh rename to lgsm/modules/command_dev_debug.sh index 962b01e7f..2b13b8c41 100644 --- a/lgsm/functions/command_dev_debug.sh +++ b/lgsm/modules/command_dev_debug.sh @@ -1,15 +1,21 @@ #!/bin/bash -# LinuxGSM command_dev_debug.sh function +# LinuxGSM command_dev_debug.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Dev only: Enables debugging log to be saved to dev-debug.log. commandname="DEV-DEBUG" -commandaction="Developer debug" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +commandaction="Developer Debug" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_reset + +fn_print_dots "" +check.sh +core_logs.sh if [ -f "${rootdir}/.dev-debug" ]; then - rm "${rootdir:?}/.dev-debug" + rm -f "${rootdir:?}/.dev-debug" fn_print_ok_nl "Disabled dev-debug" fn_script_log_info "Disabled dev-debug" else diff --git a/lgsm/functions/command_dev_detect_deps.sh b/lgsm/modules/command_dev_detect_deps.sh similarity index 76% rename from lgsm/functions/command_dev_detect_deps.sh rename to lgsm/modules/command_dev_detect_deps.sh index 04f37d696..fca15f075 100644 --- a/lgsm/functions/command_dev_detect_deps.sh +++ b/lgsm/modules/command_dev_detect_deps.sh @@ -1,38 +1,38 @@ #!/bin/bash -# LinuxGSM command_dev_detect_deps.sh function +# LinuxGSM command_dev_detect_deps.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Detects dependencies the server binary requires. commandname="DEV-DETECT-DEPS" -commandaction="Developer detect deps" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +commandaction="Dependency Checker" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set -echo -e "=================================" -echo -e "Dependencies Checker" -echo -e "=================================" +fn_print_header echo -e "Checking directory: " echo -e "${serverfiles}" -if [ "$(command -v eu-readelf 2>/dev/null)" ]; then +if [ "$(command -v eu-readelf 2> /dev/null)" ]; then readelf=eu-readelf -elif [ "$(command -v readelf 2>/dev/null)" ]; then +elif [ "$(command -v readelf 2> /dev/null)" ]; then readelf=readelf else echo -e "readelf/eu-readelf not installed" fi files=$(find "${serverfiles}" | wc -l) -find "${serverfiles}" -type f -print0 | -while IFS= read -r -d $'\0' line; do - if [ "${readelf}" == "eu-readelf" ]; then - ${readelf} -d "${line}" 2>/dev/null | grep NEEDED| awk '{ print $4 }' | sed 's/\[//g;s/\]//g' >> "${tmpdir}/.depdetect_readelf" - else - ${readelf} -d "${line}" 2>/dev/null | grep NEEDED | awk '{ print $5 }' | sed 's/\[//g;s/\]//g' >> "${tmpdir}/.depdetect_readelf" - fi - echo -n "${i} / ${files}" $'\r' - ((i++)) -done +find "${serverfiles}" -type f -print0 \ + | while IFS= read -r -d $'\0' line; do + if [ "${readelf}" == "eu-readelf" ]; then + ${readelf} -d "${line}" 2> /dev/null | grep NEEDED | awk '{ print $4 }' | sed 's/\[//g;s/\]//g' >> "${tmpdir}/.depdetect_readelf" + else + ${readelf} -d "${line}" 2> /dev/null | grep NEEDED | awk '{ print $5 }' | sed 's/\[//g;s/\]//g' >> "${tmpdir}/.depdetect_readelf" + fi + echo -n "${i} / ${files}" $'\r' + ((i++)) + done -sort "${tmpdir}/.depdetect_readelf" |uniq >"${tmpdir}/.depdetect_readelf_uniq" +sort "${tmpdir}/.depdetect_readelf" | uniq > "${tmpdir}/.depdetect_readelf_uniq" touch "${tmpdir}/.depdetect_centos_list" touch "${tmpdir}/.depdetect_ubuntu_list" @@ -40,9 +40,8 @@ touch "${tmpdir}/.depdetect_debian_list" while read -r lib; do echo -e "${lib}" - libs_array=( libm.so.6 libc.so.6 libtcmalloc_minimal.so.4 libpthread.so.0 libdl.so.2 libnsl.so.1 libgcc_s.so.1 librt.so.1 ld-linux.so.2 libdbus-glib-1.so.2 libgio-2.0.so.0 libglib-2.0.so.0 libGL.so.1 libgobject-2.0.so.0 libnm-glib.so.4 libnm-util.so.2 ) - for lib_file in "${libs_array[@]}" - do + libs_array=(libm.so.6 libc.so.6 libtcmalloc_minimal.so.4 libpthread.so.0 libdl.so.2 libnsl.so.1 libgcc_s.so.1 librt.so.1 ld-linux.so.2 libdbus-glib-1.so.2 libgio-2.0.so.0 libglib-2.0.so.0 libGL.so.1 libgobject-2.0.so.0 libnm-glib.so.4 libnm-util.so.2) + for lib_file in "${libs_array[@]}"; do if [ "${lib}" == "${lib_file}" ]; then echo -e "glibc.i686" >> "${tmpdir}/.depdetect_centos_list" echo -e "lib32gcc1" >> "${tmpdir}/.depdetect_ubuntu_list" @@ -51,9 +50,8 @@ while read -r lib; do fi done - libs_array=( libawt.so libjava.so libjli.so libjvm.so libnet.so libnio.so libverify.so ) - for lib_file in "${libs_array[@]}" - do + libs_array=(libawt.so libjava.so libjli.so libjvm.so libnet.so libnio.so libverify.so) + for lib_file in "${libs_array[@]}"; do if [ "${lib}" == "${lib_file}" ]; then echo -e "java-1.8.0-openjdk" >> "${tmpdir}/.depdetect_centos_list" echo -e "default-jre" >> "${tmpdir}/.depdetect_ubuntu_list" @@ -62,9 +60,8 @@ while read -r lib; do fi done - libs_array=( libtier0.so libtier0_srv.so libvstdlib_srv.so Core.so libvstdlib.so libtier0_s.so Editor.so Engine.so liblua.so libsteam_api.so ld-linux-x86-64.so.2 libPhysX3_x86.so libPhysX3Common_x86.so libPhysX3Cooking_x86.so) - for lib_file in "${libs_array[@]}" - do + libs_array=(libtier0.so libtier0_srv.so libvstdlib_srv.so Core.so libvstdlib.so libtier0_s.so Editor.so Engine.so liblua.so libsteam_api.so ld-linux-x86-64.so.2 libPhysX3_x86.so libPhysX3Common_x86.so libPhysX3Cooking_x86.so) + for lib_file in "${libs_array[@]}"; do # Known shared libs what dont requires dependencies. if [ "${lib}" == "${lib_file}" ]; then libdetected=1 @@ -86,12 +83,12 @@ while read -r lib; do echo -e "libcurl4-gnutls-dev:i386" >> "${tmpdir}/.depdetect_ubuntu_list" echo -e "libcurl4-gnutls-dev:i386" >> "${tmpdir}/.depdetect_debian_list" libdetected=1 - elif [ "${lib}" == "libspeex.so.1" ]||[ "${lib}" == "libspeexdsp.so.1" ]; then + elif [ "${lib}" == "libspeex.so.1" ] || [ "${lib}" == "libspeexdsp.so.1" ]; then echo -e "speex.i686" >> "${tmpdir}/.depdetect_centos_list" echo -e "speex:i386" >> "${tmpdir}/.depdetect_ubuntu_list" echo -e "speex:i386" >> "${tmpdir}/.depdetect_debian_list" libdetected=1 - elif [ "${lib}" == "./libSDL-1.2.so.0" ]||[ "${lib}" == "libSDL-1.2.so.0" ]; then + elif [ "${lib}" == "./libSDL-1.2.so.0" ] || [ "${lib}" == "libSDL-1.2.so.0" ]; then echo -e "SDL.i686" >> "${tmpdir}/.depdetect_centos_list" echo -e "libsdl1.2debian" >> "${tmpdir}/.depdetect_ubuntu_list" echo -e "libsdl1.2debian" >> "${tmpdir}/.depdetect_debian_list" @@ -157,6 +154,11 @@ while read -r lib; do echo -e "libfreetype6" >> "${tmpdir}/.depdetect_ubuntu_list" echo -e "libfreetype6" >> "${tmpdir}/.depdetect_debian_list" libdetected=1 + elif [ "${lib}" == "libc++.so.1" ]; then + echo -e "libcxx" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libc++1" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libc++1" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 fi if [ "${libdetected}" != "1" ]; then @@ -178,33 +180,33 @@ awk -vORS='' '{ print $1,$2 }' "${tmpdir}/.depdetect_ubuntu_list_uniq" > "${tmpd awk -vORS='' '{ print $1,$2 }' "${tmpdir}/.depdetect_debian_list_uniq" > "${tmpdir}/.depdetect_debian_line" echo -e "" echo -e "" -echo -e "Required Dependencies" -echo -e "=================================" +echo -e "${bold}Required Dependencies${default}" +fn_messages_separator echo -e "${executable}" echo -e "" -echo -e "CentOS" -echo -e "=================================" +echo -e "${bold}CentOS" +fn_messages_separator cat "${tmpdir}/.depdetect_centos_line" echo -e "" echo -e "" echo -e "Ubuntu" -echo -e "=================================" +fn_messages_separator cat "${tmpdir}/.depdetect_ubuntu_line" echo -e "" echo -e "" echo -e "Debian" -echo -e "=================================" +fn_messages_separator cat "${tmpdir}/.depdetect_debian_line" echo -e "" if [ "${unknownlib}" == "1" ]; then echo -e "" echo -e "Unknown shared Library" - echo -e "=================================" + fn_messages_separator cat "${tmpdir}/.depdetect_unknown" fi echo -e "" echo -e "Required Librarys" -echo -e "=================================" +fn_messages_separator sort "${tmpdir}/.depdetect_readelf" | uniq echo -en "\n" rm -f "${tmpdir:?}/.depdetect_centos_line" diff --git a/lgsm/functions/command_dev_detect_glibc.sh b/lgsm/modules/command_dev_detect_glibc.sh similarity index 59% rename from lgsm/functions/command_dev_detect_glibc.sh rename to lgsm/modules/command_dev_detect_glibc.sh index 2289bb818..20398bd47 100644 --- a/lgsm/functions/command_dev_detect_glibc.sh +++ b/lgsm/modules/command_dev_detect_glibc.sh @@ -1,21 +1,21 @@ #!/bin/bash -# LinuxGSM command_dev_detect_glibc.sh function +# LinuxGSM command_dev_detect_glibc.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Automatically detects the version of GLIBC that is required. # Can check a file or directory recursively. commandname="DEV-DETECT-GLIBC" -commandaction="Developer detect glibc" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +commandaction="Detect Glibc Requirements" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set -echo -e "=================================" -echo -e "glibc Requirements Checker" -echo -e "=================================" +fn_print_header -if [ ! "$(command -v objdump)" ]; then +if [ ! "$(command -v objdump 2> /dev/null)" ]; then fn_print_failure_nl "objdump is missing" - fn_script_log_fatal "objdump is missing" + fn_script_log_fail "objdump is missing" core_exit.sh fi @@ -32,10 +32,8 @@ elif [ -f "${serverfiles}" ]; then fi echo -e "" - -glibc_check_dir_array=( steamcmddir serverfiles ) -for glibc_check_var in "${glibc_check_dir_array[@]}" -do +glibc_check_dir_array=(steamcmddir serverfiles) +for glibc_check_var in "${glibc_check_dir_array[@]}"; do if [ "${glibc_check_var}" == "serverfiles" ]; then glibc_check_dir="${serverfiles}" glibc_check_name="${gamename}" @@ -46,23 +44,23 @@ do if [ -d "${glibc_check_dir}" ]; then 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) - 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" - echo -n "${i} / ${glibc_check_files}" $'\r' - ((i++)) - done - echo -e "" - echo -e "" - echo -e "${glibc_check_name} glibc Requirements" - echo -e "=================================" + 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 | 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[^ ]+" | sed 's/)$//' >> "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" + echo -n "${i} / ${glibc_check_files}" $'\r' + ((i++)) + done + echo -e "" + echo -e "" + 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" - cat "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" | sort | uniq | sort -r --version-sort | head -1 |tee -a "${tmpdir}/detect_glibc_highest.tmp" + 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" @@ -80,8 +78,8 @@ do fi done echo -e "" -echo -e "Final glibc Requirement" -echo -e "=================================" +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 rm -f "${tmpdir:?}/detect_glibc_highest.tmp" diff --git a/lgsm/modules/command_dev_detect_ldd.sh b/lgsm/modules/command_dev_detect_ldd.sh new file mode 100644 index 000000000..62db24da0 --- /dev/null +++ b/lgsm/modules/command_dev_detect_ldd.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# LinuxGSM command_dev_detect_ldd.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Automatically detects required deps using ldd. +# Can check a file or directory recursively. + +commandname="DEV-DETECT-LDD" +commandaction="Shared Object Dependencies Checker" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_header + +if [ -z "${serverfiles}" ]; then + dir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") +fi + +if [ -d "${serverfiles}" ]; then + echo -e "Checking directory: " + echo -e "${serverfiles}" +elif [ -f "${serverfiles}" ]; then + echo -e "Checking file: " + echo -e "${serverfiles}" +fi +echo -e "" +touch "${tmpdir}/detect_ldd.tmp" +touch "${tmpdir}/detect_ldd_not_found.tmp" + +files=$(find "${serverfiles}" | wc -l) +find "${serverfiles}" -type f -print0 \ + | while IFS= read -r -d $'\0' line; do + if ldd "${line}" 2> /dev/null | grep -v "not a dynamic executable"; then + echo -e "${line}" >> "${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"; then + 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" + fi + fi + echo -n "$i / $files" $'\r' + ((i++)) + done +echo -e "" +echo -e "" +fn_print_nl "${bold}${lightyellow}All${default}" +fn_messages_separator +cat "${tmpdir}/detect_ldd.tmp" + +echo -e "" +fn_print_nl "${bold}${lightyellow}Not Found${default}" +fn_messages_separator +cat "${tmpdir}/detect_ldd_not_found.tmp" + +rm -f "${tmpdir:?}/detect_ldd.tmp" +rm -f "${tmpdir:?}/detect_ldd_not_found.tmp" + +core_exit.sh diff --git a/lgsm/modules/command_dev_parse_distro_details.sh b/lgsm/modules/command_dev_parse_distro_details.sh new file mode 100644 index 000000000..dfb68ba2b --- /dev/null +++ b/lgsm/modules/command_dev_parse_distro_details.sh @@ -0,0 +1,121 @@ +#!/bin/bash +# LinuxGSM command_dev_parse_distro_details.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# 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 + +# Create an associative array of the server details. +declare -A server_details=( + ['.NET Version']="${dotnetversion}" + ['Arch']="${arch}" + ['Backup Count']="${backupcount}" + ['Backup Last Date']="${lastbackupdate}" + ['Backup Last Days Ago']="${lastbackupdaysago}" + ['Backup Last Size']="${lastbackupsize}" + ['Backup Last']="${lastbackup}" + ['CPU Average Load']="${load}" + ['CPU Cores']="${cpucores}" + ['CPU Frequency']="${cpufreqency}" + ['CPU Model']="${cpumodel}" + ['Distro Codename']="${distrocodename}" + ['Distro ID Like']="${distroidlike}" + ['Distro ID']="${distroid}" + ['Distro Kernel']="${kernel}" + ['Distro Name']="${distroname}" + ['Distro Version CSV']="${distroversioncsv}" + ['Distro Version RH']="${distroversionrh}" + ['Distro Version']="${distroversion}" + ['Distro-Info Support']="${distrosupport}" + ['File System']="${filesystem}" + ['Game Server PID']="${gameserverpid}" + ['Gameserver CPU Used MHz']="${cpuusedmhz}" + ['Gameserver CPU Used']="${cpuused}" + ['Gameserver Mem Used MB']="${memusedmb}" + ['Gameserver Mem Used Pct']="${memusedpct}" + ['GLIBC Version']="${glibcversion}" + ['GLIBC']="${glibc}" + ['HLDS Linux PID']="${hldslinuxpid}" + ['Java Version']="${javaversion}" + ['Mono Version']="${monoversion}" + ['Network Interface']="${netint}" + ['Network Link Speed']="${netlink}" + ['Old Free']="${oldfree}" + ['Phys Mem Available']="${physmemavailable}" + ['Phys Mem Buffers KB']="${physmembufferskb}" + ['Phys Mem Cached']="${physmemcached}" + ['Phys Mem Free']="${physmemfree}" + ['Phys Mem Reclaimable KB']="${physmemreclaimablekb}" + ['Phys Mem Total GB']="${physmemtotalgb}" + ['Phys Mem Used']="${physmemused}" + ['Size Backup Dir']="${backupdirdu}" + ['Size Root Dir ']="${rootdirdu}" + ['Size Root Dir Excl. Backup']="${rootdirduexbackup}" + ['Size Serverfiles']="${serverfilesdu}" + ['SRCDS Linux PID']="${srcdslinuxpid}" + ['Storage Available']="${availspace}" + ['Storage Total']="${totalspace}" + ['Storage Used']="${usedspace}" + ['Swap Free']="${swapfree}" + ['Swap Total']="${swaptotal}" + ['Swap Used']="${swapused}" + ['Tmux Version']="${tmuxversion}" + ['Uptime Days']="${days}" + ['Uptime Hours']="${hours}" + ['Uptime Minutes']="${minutes}" + ['Uptime Total Seconds']="${uptime}" + ['Virtual Environment']="${virtualenvironment}" + # ['Distro Info Array']="${distro_info_array}" + # ['Distros Unsupported Array']="${distrosunsupported_array}" + # ['Distros Unsupported']="${distrosunsupported}" + # ['Human Readable']="${humanreadable}" + # ['Phys Mem Actual Free KB']="${physmemactualfreekb}" + # ['Phys Mem Cached KB']="${physmemcachedkb}" + # ['Phys Mem Free KB']="${physmemfreekb}" + # ['Phys Mem Total KB']="${physmemtotalkb}" + # ['Phys Mem Total MB']="${physmemtotalmb}" + # ['SS Info']="${ssinfo}" +) + +# Initialize variables to keep track of available and missing distro details. +available_details="" +missing_details="" + +# Loop through the distro details and store them. +for key in "${!server_details[@]}"; do + value=${server_details[$key]} + if [ -n "$value" ]; then + available_details+="${lightblue}${key}: ${default}${value}\n" + else + missing_details+="${key}\n" + fi +done + +# Sort and output the available distro details. +if [ -n "$available_details" ]; then + echo -e "" + echo -e "${bold}${lightgreen}Available Distro Details${default}" + fn_messages_separator + echo -e "${available_details}" | sort +fi + +# Sort and output the missing distro details. +if [ -n "$missing_details" ]; then + echo -e "" + echo -e "${lightgreen}Missing or unsupported Distro Details${default}" + fn_messages_separator + echo -e "${missing_details}" | sort +fi + +core_exit.sh diff --git a/lgsm/modules/command_dev_parse_game_details.sh b/lgsm/modules/command_dev_parse_game_details.sh new file mode 100644 index 000000000..7c0767eea --- /dev/null +++ b/lgsm/modules/command_dev_parse_game_details.sh @@ -0,0 +1,164 @@ +#!/bin/bash +# LinuxGSM command_dev_parse_game_details.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# 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 +if [ -f "clusterconfig" ]; then + clustercfgfullpath="clusterconfig" +fi + +info_game.sh + +carriagereturn=$(file -b "${servercfgfullpath}" | grep -q CRLF && echo "${red}CRLF${default}" || echo "${lightgreen}LF${default}") + +echo -e "" +echo -e "${bold}${lightgreen}Server Details${default}" +fn_messages_separator + +echo -e "" +echo -e "${lightblue}Game: ${default}${gamename}" +echo -e "${lightblue}Config type: ${default}${configtype}" +echo -e "${lightblue}Config file: ${default}${servercfgfullpath}" +if [ -f "${clustercfgfullpath}" ]; then + echo -e "${lightblue}Cluster config file: ${default}${clustercfgfullpath}" +fi +echo -e "${lightblue}Carriage Return: ${default}${carriagereturn}" + +# Create an associative array of the server details. +declare -A server_details=( + ['Admin Password']="${adminpassword}" + ['Alert IP']="${alertip}" + ['API Port']="${apiport}" + ['App Port']="${appport}" + ['ASE']="${ase}" + ['Auth Token']="${authtoken}" + ['BattleEye Port']="${battleeyeport}" + ['Beacon Port']="${beaconport}" + ['Cave']="${cave}" + ['Client Port']="${clientport}" + ['Cluster']="${cluster}" + ['Config IP']="${configip}" + ['Creative Mode']="${creativemode}" + ['Custom Level URL']="${customlevelurl}" + ['DB Plugin']="${dbplugin}" + ['Default Map']="${defaultmap}" + ['Default Scenario']="${defaultscenario}" + ['Display Master Server']="${displaymasterserver}" + ['Epic Settings']="${epicsettings}" + ['File Port']="${fileport}" + ['Files Port']="${filesport}" + ['Game Mode']="${gamemode}" + ['Game Type']="${gametype}" + ['Home Kingdom']="${homekingdom}" + ['Home Server']="${homeserver}" + ['HTTP Enabled']="${httpenabled}" + ['HTTP IP']="${httpip}" + ['HTTP Password']="${httppassword}" + ['HTTP Port']="${httpport}" + ['HTTP User']="${httpuser}" + ['Internet IP']="${publicip}" + ['LAN Port']="${lanport}" + ['Login Server']="${loginserver}" + ['Master Port']="${masterport}" + ['Master Server']="${masterserver}" + ['Master']="${master}" + ['Max Players']="${maxplayers}" + ['Mod Server Port']="${modserverport}" + ['OldQueryPortNumber']="${oldqueryportnumber}" + ['Port 401']="${port401}" + ['Port IPv6']="${portipv6}" + ['Port']="${port}" + ['Query Enabled']="${queryenabled}" + ['Query HTTP Port']="${httpqueryport}" + ['Query HTTPS Port']="${httpsqueryport}" + ['Query Mode']="${querymode}" + ['Query Port GS']="${gamespyqueryport}" + ['Query Port']="${queryport}" + ['Query SSH Port']="${sshqueryport}" + ['Queue Enabled']="${queueenabled}" + ['Queue Port']="${queueport}" + ['Random Map']="${randommap}" + ['Raw Port']="${rawport}" + ['RCON Enabled']="${rconenabled}" + ['RCON Password']="${rconpassword}" + ['RCON Port']="${rconport}" + ['RCON Web']="${rconweb}" + ['Reserved Slots']="${reservedslots}" + ['RMI Port']="${rmiport}" + ['RMI Reg Port']="${rmiregport}" + ['Salt']="${salt}" + ['Save Game Interval']="${savegameinterval}" + ['Save Interval']="${saveinterval}" + ['Secondary Port']="${port3}" + ['Seed']="${seed}" + ['Server Description']="${serverdescription}" + ['Server IP']="${ip}" + ['Server Level']="${serverlevel}" + ['Server Name']="${servername}" + ['Server Password Enabled']="${serverpasswordenabled}" + ['Server Password']="${serverpassword}" + ['Server Version']="${serverversion}" + ['Shard']="${shard}" + ['Sharding']="${sharding}" + ['Shutdown Port']="${shutdownport}" + ['Stats Port']="${statsport}" + ['Steam Auth Port']="${steamauthport}" + ['Steam Port']="${steamport}" + ['Steamworks Port']="${steamworksport}" + ['Telnet Enabled']="${telnetenabled}" + ['Telnet IP']="${telnetip}" + ['Telnet Password']="${telnetpassword}" + ['Telnet Port']="${telnetport}" + ['Tickrate']="${tickrate}" + ['Unknown Port']="${unknownport}" + ['Version Count']="${versioncount}" + ['Voice Port']="${voiceport}" + ['Voice Unused Port']="${voiceunusedport}" + ['World Name']="${worldname}" + ['World Size']="${worldsize}" + ['World Type']="${worldtype}" +) + +# Initialize variables to keep track of available and missing server details. +available_details="" +missing_details="" + +# Loop through the server details and store them. +for key in "${!server_details[@]}"; do + value=${server_details[$key]} + if [ -n "$value" ]; then + available_details+="${lightblue}${key}: ${default}${value}\n" + else + missing_details+="${key}\n" + fi +done + +# Sort and output the available distro details. +if [ -n "$available_details" ]; then + echo -e "" + echo -e "${bold}${lightgreen}Available Gameserver Details${default}" + fn_messages_separator + echo -e "${available_details}" | sort +fi + +# Output the missing server details if there are any. +if [ -n "$missing_details" ]; then + echo -e "" + echo -e "${lightgreen}Missing or unsupported Gameserver Details${default}" + fn_messages_separator + echo -e "${missing_details}" | sort +fi + +core_exit.sh diff --git a/lgsm/modules/command_dev_query_raw.sh b/lgsm/modules/command_dev_query_raw.sh new file mode 100644 index 000000000..ea42599f9 --- /dev/null +++ b/lgsm/modules/command_dev_query_raw.sh @@ -0,0 +1,282 @@ +#!/bin/bash +# LinuxGSM command_dev_query_raw.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Raw gamedig output of the server. + +commandname="DEV-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 +info_messages.sh + +echo -e "" +echo -e "${lightgreen}IP Addresses Variables${default}" +fn_messages_separator +echo -e "" +echo -e "IP: ${ip}" +echo -e "HTTP IP: ${httpip}" +echo -e "Public IP: ${publicip}" +echo -e "Telnet IP: ${telnetip}" +echo -e "Display IP: ${displayip}" + +echo -e "" +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 "${bold}${lightyellow}Game Server Ports${default}" +fn_messages_separator +{ + echo -e "${lightblue}Port Name \tPort Number \tStatus \tTCP \tUDP${default}" + 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 [ -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:" + fi + fi + + if [ "${shortname}" == "mcb" ]; 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 [ -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 [ -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 [ -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 [ -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 [ -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 [ -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 [ -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 [ -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 [ -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 [ -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 [ -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 [ -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 [ -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 [ -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 [ -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 [ -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 [ -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 [ -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 [ -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 [ -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 [ -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 [ -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):" + fi + +} \ + | column -s $'\t' -t + +echo -e "" +echo -e "${bold}${lightyellow}SS Output${default}" +fn_messages_separator +fn_info_message_ports +eval "${portcommand}" + +echo -e "" +echo -e "${bold}${lightyellow}Query Port (${queryport}) - Gamedig Output${default}" +fn_messages_separator +echo -e "" +echo -e "PORT: ${port}" +echo -e "QUERY PORT: ${queryport}" +echo -e "" +echo -e "${lightgreen}Gamedig Raw Output${default}" +fn_messages_separator +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 +for queryip in "${queryips[@]}"; do + query_gamedig.sh + echo -e "${italic}${gamedigcmd}${default}" + echo"" + echo "${gamedigraw}" | jq +done + +echo -e "" +echo -e "${bold}${lightyellow}Query Port (${queryport}) - gsquery Output${default}" +fn_messages_separator +echo -e "" +for queryip in "${queryips[@]}"; do + 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 "${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 "" + timeout 3 bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}'' + querystatus="$?" + echo -e "" + if [ "${querystatus}" == "0" ]; then + echo -e "TCP query PASS" + else + echo -e "TCP query FAIL" + fi +done +echo -e "" +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 "${italic}bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}''${default}" + echo -e "" + timeout 3 bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}'' + querystatus="$?" + echo -e "" + if [ "${querystatus}" == "0" ]; then + echo -e "TCP query PASS" + else + echo -e "TCP query FAIL" + fi +done +echo -e "" +echo -e "${bold}${lightyellow}Steam Master Server Response${default}" +fn_messages_separator +echo -e "" +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 "" + +exitcode=0 +core_exit.sh 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/functions/command_fastdl.sh b/lgsm/modules/command_fastdl.sh similarity index 61% rename from lgsm/functions/command_fastdl.sh rename to lgsm/modules/command_fastdl.sh index f6a5897db..e3437bc1f 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/modules/command_fastdl.sh @@ -1,15 +1,14 @@ #!/bin/bash -# LinuxGSM command_fastdl.sh function +# LinuxGSM command_fastdl.sh module # Author: Daniel Gibbs -# Contributor: UltimateByte +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Creates a FastDL directory. +# Description: Creates a Fastdl directory. commandname="FASTDL" commandaction="Fastdl" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -check.sh +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set # Directories. if [ -z "${webdir}" ]; then @@ -23,26 +22,26 @@ luafastdlfile="lgsm_cl_force_fastdl.lua" luafastdlfullpath="${luasvautorundir}/${luafastdlfile}" # Check if bzip2 is installed. -if [ ! "$(command -v bzip2 2>/dev/null)" ]; then +if [ ! "$(command -v bzip2 2> /dev/null)" ]; then fn_print_fail "bzip2 is not installed" - fn_script_log_fatal "bzip2 is not installed" + fn_script_log_fail "bzip2 is not installed" core_exit.sh 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" -echo -e "=================================" +# 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,32 +62,32 @@ if [ "${shortname}" == "gmod" ]; then fi # Clears any fastdl directory content. -fn_clear_old_fastdl(){ - # Clearing old FastDL. +fn_clear_old_fastdl() { + # Clearing old Fastdl. if [ -d "${fastdldir}" ]; then - echo -en "clearing existing FastDL directory ${fastdldir}..." - rm -fR "${fastdldir:?}" + fn_print "clearing existing Fastdl directory ${fastdldir}" + rm -rf "${fastdldir:?}" exitcode=$? - if [ ${exitcode} -ne 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "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 } -fn_fastdl_dirs(){ +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} -ne 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Creating web directory ${webdir}" + fn_script_log_fail "Creating web directory ${webdir}" core_exit.sh else fn_print_ok_eol_nl @@ -96,12 +95,12 @@ 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} -ne 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Creating fastdl directory ${fastdldir}" + fn_script_log_fail "Creating fastdl directory ${fastdldir}" core_exit.sh else fn_print_ok_eol_nl @@ -111,7 +110,7 @@ fn_fastdl_dirs(){ } # Using this gist https://gist.github.com/agunnerson-ibm/efca449565a3e7356906 -fn_human_readable_file_size(){ +fn_human_readable_file_size() { local abbrevs=( $((1 << 60)):ZB $((1 << 50)):EB @@ -126,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%:*}" @@ -141,59 +140,62 @@ fn_human_readable_file_size(){ } # Provides info about the fastdl directory content and prompts for confirmation. -fn_fastdl_preview(){ +fn_fastdl_preview() { # Remove any file list. 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 cd "${systemdir}" || exit - allowed_extentions_array=( "*.ain" "*.bsp" "*.mdl" "*.mp3" "*.ogg" "*.otf" "*.pcf" "*.phy" "*.png" "*.svg" "*.vtf" "*.vmt" "*.vtx" "*.vvd" "*.ttf" "*.wav" ) + allowed_extentions_array=("*.ain" "*.bsp" "*.mdl" "*.mp3" "*.ogg" "*.otf" "*.pcf" "*.phy" "*.png" "*.svg" "*.vtf" "*.vmt" "*.vtx" "*.vvd" "*.ttf" "*.wav") for allowed_extention in "${allowed_extentions_array[@]}"; do fileswc=0 tput sc while read -r ext; do ((fileswc++)) - tput rc; tput el - echo -e "gathering ${allowed_extention} : ${fileswc}..." + tput rc + tput el + 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 else - fastdl_directories_array=( "maps" "materials" "models" "particles" "sound" "resources" ) + fastdl_directories_array=("maps" "materials" "models" "particles" "sound" "resources") for directory in "${fastdl_directories_array[@]}"; do if [ -d "${systemdir}/${directory}" ]; then if [ "${directory}" == "maps" ]; then - local allowed_extentions_array=( "*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt" ) + local allowed_extentions_array=("*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt") elif [ "${directory}" == "materials" ]; then - local allowed_extentions_array=( "*.vtf" "*.vmt" "*.vbf" "*.png" "*.svg" ) + local allowed_extentions_array=("*.vtf" "*.vmt" "*.vbf" "*.png" "*.svg") elif [ "${directory}" == "models" ]; then - local allowed_extentions_array=( "*.vtx" "*.vvd" "*.mdl" "*.phy" "*.jpg" "*.png" ) + local allowed_extentions_array=("*.vtx" "*.vvd" "*.mdl" "*.phy" "*.jpg" "*.png" "*.vmt" "*.vtf") elif [ "${directory}" == "particles" ]; then - local allowed_extentions_array=( "*.pcf" ) + local allowed_extentions_array=("*.pcf") elif [ "${directory}" == "sound" ]; then - local allowed_extentions_array=( "*.wav" "*.mp3" "*.ogg" ) + local allowed_extentions_array=("*.wav" "*.mp3" "*.ogg") fi for allowed_extention in "${allowed_extentions_array[@]}"; do fileswc=0 tput sc while read -r ext; do ((fileswc++)) - tput rc; tput el - echo -e "gathering ${directory} ${allowed_extention} : ${fileswc}..." + tput rc + tput el + 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}..." + tput rc + tput el + fn_print "gathering ${directory} ${allowed_extention} : ${fileswc}" if [ ${fileswc} != 0 ]; then fn_print_ok_eol_nl else @@ -204,27 +206,27 @@ fn_fastdl_preview(){ done fi if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then - echo -e "calculating total file size..." - fn_sleep_time + fn_print_nl "calculating total file size" + fn_sleep_time_1 totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt") # Calculates total file size. while read -r dufile; do filesize=$(stat -c %s "${dufile}") - filesizetotal=$(( filesizetotal+filesize )) + filesizetotal=$((filesizetotal + filesize)) exitcode=$? - if [ "${exitcode}" != 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Calculating total file size." + fn_script_log_fail "Calculating total file size" core_exit.sh fi - done <"${tmpdir}/fastdl_files_to_compress.txt" + done < "${tmpdir}/fastdl_files_to_compress.txt" else fn_print_fail_eol_nl "generating file list" - fn_script_log_fatal "Generating file list." + 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" @@ -233,21 +235,21 @@ fn_fastdl_preview(){ } # Builds Garry's Mod fastdl directory content. -fn_fastdl_gmod(){ +fn_fastdl_gmod() { cd "${systemdir}" || exit - for allowed_extention in "${allowed_extentions_array[@]}" - do + for allowed_extention in "${allowed_extentions_array[@]}"; do fileswc=0 tput sc while read -r fastdlfile; do ((fileswc++)) - tput rc; tput el - echo -e "copying ${allowed_extention} : ${fileswc}..." + tput rc + tput el + fn_print "copying ${allowed_extention} : ${fileswc}" cp --parents "${fastdlfile}" "${fastdldir}" exitcode=$? - if [ ${exitcode} -ne 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Copying ${fastdlfile} > ${fastdldir}" + fn_script_log_fail "Copying ${fastdlfile} > ${fastdldir}" core_exit.sh else fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}" @@ -257,27 +259,27 @@ 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} -ne 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Updating addons file structure" + fn_script_log_fail "Updating addons file structure" core_exit.sh else fn_print_ok_eol_nl fn_script_log_pass "Updating addons file structure" fi # Clear addons directory in fastdl. - echo -en "clearing addons dir from fastdl dir..." - fn_sleep_time - rm -fR "${fastdldir:?}/addons" + fn_print "clearing addons dir from fastdl dir..." + fn_sleep_time_1 + rm -rf "${fastdldir:?}/addons" exitcode=$? - if [ ${exitcode} -ne 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Clearing addons dir from fastdl dir" + fn_script_log_fail "Clearing addons dir from fastdl dir" core_exit.sh else fn_print_ok_eol_nl @@ -286,13 +288,13 @@ 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_sleep_time + fn_print "correcting DarkRP files..." + fn_sleep_time_1 cp -Rf "${fastdldir}/lua/"* "${fastdldir}" exitcode=$? - if [ ${exitcode} -ne 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Correcting DarkRP files" + fn_script_log_fail "Correcting DarkRP files" core_exit.sh else fn_print_ok_eol_nl @@ -305,33 +307,32 @@ fn_fastdl_gmod(){ while read -r dufile; do filesize=$(du -b "${dufile}" | awk '{ print $1 }') filesizetotal=$((filesizetotal + filesize)) - done <"${tmpdir}/fastdl_files_to_compress.txt" + done < "${tmpdir}/fastdl_files_to_compress.txt" fi } -fn_fastdl_source(){ - for directory in "${fastdl_directories_array[@]}" - do +fn_fastdl_source() { + for directory in "${fastdl_directories_array[@]}"; do if [ -d "${systemdir}/${directory}" ]; then if [ "${directory}" == "maps" ]; then - local allowed_extentions_array=( "*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt" ) + local allowed_extentions_array=("*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt") elif [ "${directory}" == "materials" ]; then - local allowed_extentions_array=( "*.vtf" "*.vmt" "*.vbf" "*.png" "*.svg" ) + local allowed_extentions_array=("*.vtf" "*.vmt" "*.vbf" "*.png" "*.svg") elif [ "${directory}" == "models" ]; then - local allowed_extentions_array=( "*.vtx" "*.vvd" "*.mdl" "*.phy" "*.jpg" "*.png" ) + local allowed_extentions_array=("*.vtx" "*.vvd" "*.mdl" "*.phy" "*.jpg" "*.png") elif [ "${directory}" == "particles" ]; then - local allowed_extentions_array=( "*.pcf" ) + local allowed_extentions_array=("*.pcf") elif [ "${directory}" == "sound" ]; then - local allowed_extentions_array=( "*.wav" "*.mp3" "*.ogg" ) + local allowed_extentions_array=("*.wav" "*.mp3" "*.ogg") fi - for allowed_extention in "${allowed_extentions_array[@]}" - do + for allowed_extention in "${allowed_extentions_array[@]}"; do fileswc=0 tput sc while read -r fastdlfile; do ((fileswc++)) - tput rc; tput el - echo -e "copying ${directory} ${allowed_extention} : ${fileswc}..." + tput rc + tput el + fn_print "copying ${directory} ${allowed_extention} : ${fileswc}" fn_sleep_time # get relative path of file in the dir tmprelfilepath="${fastdlfile#"${systemdir}/"}" @@ -342,9 +343,9 @@ fn_fastdl_source(){ fi cp "${fastdlfile}" "${fastdldir}/${copytodir}" exitcode=$? - if [ ${exitcode} -ne 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Copying ${fastdlfile} > ${fastdldir}/${copytodir}" + fn_script_log_fail "Copying ${fastdlfile} > ${fastdldir}/${copytodir}" core_exit.sh else fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}/${copytodir}" @@ -359,9 +360,9 @@ fn_fastdl_source(){ } # Builds the fastdl directory content. -fn_fastdl_build(){ - # Copy all needed files for FastDL. - echo -e "copying files to ${fastdldir}" +fn_fastdl_build() { + # 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 @@ -371,16 +372,16 @@ fn_fastdl_build(){ fi } -# Generate lua file that will force download any file into the FastDL directory. -fn_fastdl_gmod_dl_enforcer(){ +# 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} -ne 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Removing existing download enforcer ${luafastdlfullpath}" + fn_script_log_fail "Removing existing download enforcer ${luafastdlfullpath}" core_exit.sh else fn_print_ok_eol_nl @@ -389,16 +390,16 @@ 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} -ne 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Creating new download enforcer ${luafastdlfullpath}" + fn_script_log_fail "Creating new download enforcer ${luafastdlfullpath}" core_exit.sh else fn_print_ok_eol_nl @@ -407,23 +408,24 @@ fn_fastdl_gmod_dl_enforcer(){ fi } -# Compresses FastDL files using bzip2. -fn_fastdl_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} -ne 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Compressing ${filetocompress}" + 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 + done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \)) } +check.sh # Run functions. fn_fastdl_preview fn_clear_old_fastdl @@ -431,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/functions/command_install.sh b/lgsm/modules/command_install.sh similarity index 74% rename from lgsm/functions/command_install.sh rename to lgsm/modules/command_install.sh index 9a6b64e98..8dc9a77df 100644 --- a/lgsm/functions/command_install.sh +++ b/lgsm/modules/command_install.sh @@ -1,16 +1,17 @@ #!/bin/bash -# LinuxGSM command_install.sh function +# LinuxGSM command_install.sh module # Author: Daniel Gibbs -# Contributor: UltimateByte +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Overall function for the installer. +# Description: Overall module for the installer. commandname="INSTALL" commandaction="Installing" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set check.sh -if [ "$(whoami)" = "root" ]; then +if [ "$(whoami)" == "root" ]; then check_deps.sh else install_header.sh @@ -23,13 +24,15 @@ else install_server_files.sh install_ut2k4_key.sh elif [ -z "${appid}" ]; then - installer=1 install_server_files.sh elif [ "${appid}" ]; then install_steamcmd.sh install_server_files.sh fi + # Install gamedig + check_gamedig.sh + # Configuration. install_config.sh if [ -v gslt ]; then @@ -42,6 +45,7 @@ else install_ts3db.sh elif [ "${shortname}" == "mta" ]; then command_install_resources_mta.sh + fn_firstcommand_reset fi fix.sh diff --git a/lgsm/functions/command_install_resources_mta.sh b/lgsm/modules/command_install_resources_mta.sh similarity index 72% rename from lgsm/functions/command_install_resources_mta.sh rename to lgsm/modules/command_install_resources_mta.sh index 053982e0b..7eca4fb97 100644 --- a/lgsm/functions/command_install_resources_mta.sh +++ b/lgsm/modules/command_install_resources_mta.sh @@ -1,18 +1,20 @@ #!/bin/bash -# LinuxGSM command_install_resources_mta.sh function +# LinuxGSM command_install_resources_mta.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Installs the default resources for Multi Theft Auto. commandname="DEFAULT-RESOURCES" commandaction="Default Resources" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set -fn_install_resources(){ +fn_install_resources() { echo -e "" - echo -e "Installing Default Resources" - echo -e "=================================" - fn_fetch_file "http://mirror.mtasa.com/mtasa/resources/mtasa-resources-latest.zip" "" "" "" "${tmpdir}" "mtasa-resources-latest.zip" "nochmodx" "norun" "noforce" "nomd5" + 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}" echo -e "Default Resources Installed." } @@ -28,5 +30,3 @@ else fn_print_warning_nl "Default resources are not installed when using ./${selfname} auto-install." fn_print_information_nl "To install default resources use ./${selfname} install" fi - -core_exit.sh diff --git a/lgsm/functions/command_mods_install.sh b/lgsm/modules/command_mods_install.sh similarity index 73% rename from lgsm/functions/command_mods_install.sh rename to lgsm/modules/command_mods_install.sh index d3c517461..4401e2c56 100644 --- a/lgsm/functions/command_mods_install.sh +++ b/lgsm/modules/command_mods_install.sh @@ -1,13 +1,14 @@ #!/bin/bash -# LinuxGSM command_mods_install.sh function +# LinuxGSM command_mods_install.sh module # Author: Daniel Gibbs -# Contributor: UltimateByte +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: List and installs available mods along with mods_list.sh and mods_core.sh. commandname="MODS-INSTALL" -commandaction="Installing mods" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +commandaction="Installing Mods" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set check.sh mods_core.sh @@ -18,9 +19,9 @@ fn_print_header fn_mods_installed_list if [ "${installedmodscount}" -gt "0" ]; then echo -e "Installed addons/mods" - echo -e "=================================" + fn_messages_separator # Go through all available commands, get details and display them to the user. - for ((llindex=0; llindex < ${#installedmodslist[@]}; llindex++)); do + for ((llindex = 0; llindex < ${#installedmodslist[@]}; llindex++)); do # Current mod is the "llindex" value of the array we're going through. currentmod="${installedmodslist[llindex]}" fn_mod_get_info @@ -31,7 +32,7 @@ if [ "${installedmodscount}" -gt "0" ]; then fi echo -e "Available addons/mods" -echo -e "=================================" +fn_messages_separator # Display available mods from mods_list.sh. # Set and reset vars compatiblemodslistindex=0 @@ -39,9 +40,9 @@ compatiblemodslistindex=0 while [ "${compatiblemodslistindex}" -lt "${#compatiblemodslist[@]}" ]; do # Set values for convenience. displayedmodname="${compatiblemodslist[compatiblemodslistindex]}" - displayedmodcommand="${compatiblemodslist[compatiblemodslistindex+1]}" - displayedmodsite="${compatiblemodslist[compatiblemodslistindex+2]}" - displayedmoddescription="${compatiblemodslist[compatiblemodslistindex+3]}" + displayedmodcommand="${compatiblemodslist[compatiblemodslistindex + 1]}" + displayedmodsite="${compatiblemodslist[compatiblemodslistindex + 2]}" + displayedmoddescription="${compatiblemodslist[compatiblemodslistindex + 3]}" # Output mods to the user. echo -e "${displayedmodname} - ${displayedmoddescription} - ${displayedmodsite}" echo -e " * ${cyan}${displayedmodcommand}${default}" @@ -64,8 +65,8 @@ while [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; 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 + 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." @@ -77,7 +78,7 @@ fn_mod_get_info echo -e "" echo -e "Installing ${modprettyname}" -echo -e "=================================" +fn_messages_separator fn_script_log_info "${modprettyname} selected for install" # Check if the mod is already installed and warn the user. @@ -94,6 +95,18 @@ if [ -f "${modsinstalledlistfullpath}" ]; then fi ## Installation. +# If amxmodx check if metamod exists first +if [ "${modcommand}" == "amxmodx" ]; then + fn_mod_exist "metamod" +fi + +if [ "${modcommand}" == "amxmodxcs" ] \ + || [ "${modcommand}" == "amxmodxdod" ] \ + || [ "${modcommand}" == "amxmodxtfc" ] \ + || [ "${modcommand}" == "amxmodxns" ] \ + || [ "${modcommand}" == "amxmodxts" ]; then + fn_mod_exist "amxmodx" +fi fn_create_mods_dir fn_mods_clear_tmp_dir @@ -105,6 +118,17 @@ fn_mod_copy_destination fn_mod_add_list fn_mod_tidy_files_list fn_mods_clear_tmp_dir + +# Create/modify existing liblist.gam file for Metamod +if [ "${modcommand}" == "metamod" ]; then + fn_mod_install_liblist_gam_file +fi + +# Create/modify plugins.ini file for Metamod +if [ "${modcommand}" == "amxmodx" ]; then + fn_mod_install_amxmodx_file +fi + echo -e "${modprettyname} installed" fn_script_log_pass "${modprettyname} installed." diff --git a/lgsm/functions/command_mods_remove.sh b/lgsm/modules/command_mods_remove.sh similarity index 66% rename from lgsm/functions/command_mods_remove.sh rename to lgsm/modules/command_mods_remove.sh index 35fd41d5f..6dc52d95f 100644 --- a/lgsm/functions/command_mods_remove.sh +++ b/lgsm/modules/command_mods_remove.sh @@ -1,13 +1,14 @@ #!/bin/bash -# LinuxGSM command_mods_uninstall.sh function +# LinuxGSM command_mods_uninstall.sh module # Author: Daniel Gibbs -# Contributor: UltimateByte +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Uninstall mods along with mods_list.sh and mods_core.sh. commandname="MODS-REMOVE" -commandaction="Removing mods" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +commandaction="Removing Mods" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set check.sh mods_core.sh @@ -15,12 +16,12 @@ fn_mods_check_installed fn_print_header echo -e "Remove addons/mods" -echo -e "=================================" +fn_messages_separator # Displays list of installed mods. # Generates list to display to user. fn_mods_installed_list -for ((mlindex=0; mlindex < ${#installedmodslist[@]}; mlindex++)); do +for ((mlindex = 0; mlindex < ${#installedmodslist[@]}; mlindex++)); do # Current mod is the "mlindex" value of the array we are going through. currentmod="${installedmodslist[mlindex]}" # Get mod info. @@ -35,8 +36,8 @@ while [[ ! " ${installedmodslist[@]} " =~ " ${usermodselect} " ]]; 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 + 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." @@ -58,7 +59,7 @@ fn_script_log_info "Removing ${modsfilelistsize} files from ${modprettyname}" echo -e "removing ${modprettyname}" echo -e "* ${modsfilelistsize} files to be removed" echo -e "* location: ${modinstalldir}" -fn_sleep_time +fn_sleep_time_1 # Go through every file and remove it. modfileline="1" tput sc @@ -67,33 +68,42 @@ while [ "${modfileline}" -le "${modsfilelistsize}" ]; do currentfileremove=$(sed "${modfileline}q;d" "${modsdir}/${modcommand}-files.txt") # If file or directory exists, then remove it. - if [ -f "${modinstalldir}/${currentfileremove}" ]||[ -d "${modinstalldir}/${currentfileremove}" ]; then + if [ -f "${modinstalldir}/${currentfileremove}" ] || [ -d "${modinstalldir}/${currentfileremove}" ]; then rm -rf "${modinstalldir:?}/${currentfileremove:?}" - ((exitcode=$?)) - if [ ${exitcode} -ne 0 ]; then - fn_script_log_fatal "Removing ${modinstalldir}/${currentfileremove}" + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_script_log_fail "Removing ${modinstalldir}/${currentfileremove}" break else fn_script_log_pass "Removing ${modinstalldir}/${currentfileremove}" fi fi - tput rc; tput el + tput rc + tput el echo -e "removing ${modprettyname} ${modfileline} / ${modsfilelistsize} : ${currentfileremove}..." ((modfileline++)) done -if [ ${exitcode} -ne 0 ]; then - fn_print_fail_eol_nl - core_exit.sh + +# 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}" -ne 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi else fn_print_ok_eol_nl fi + # Remove file list. echo -en "removing ${modcommand}-files.txt..." -fn_sleep_time +fn_sleep_time_1 rm -rf "${modsdir:?}/${modcommand}-files.txt" -local exitcode=$? -if [ ${exitcode} -ne 0 ]; then - fn_script_log_fatal "Removing ${modsdir}/${modcommand}-files.txt" +exitcode=$? +if [ "${exitcode}" -ne 0 ]; then + fn_script_log_fail "Removing ${modsdir}/${modcommand}-files.txt" fn_print_fail_eol_nl core_exit.sh else @@ -103,12 +113,12 @@ fi # Remove mods from installed mods list. echo -en "removing ${modcommand} from ${modsinstalledlist}..." -fn_sleep_time +fn_sleep_time_1 sed -i "/^${modcommand}$/d" "${modsinstalledlistfullpath}" -local exitcode=$? -if [ ${exitcode} -ne 0 ]; then - fn_script_log_fatal "Removing ${modcommand} from ${modsinstalledlist}" +exitcode=$? +if [ "${exitcode}" -ne 0 ]; then + fn_script_log_fail "Removing ${modcommand} from ${modsinstalledlist}" fn_print_fail_eol_nl core_exit.sh else @@ -118,13 +128,25 @@ fi # Oxide fix # Oxide replaces server files, so a validate is required after uninstall. -if [ "${engine}" == "unity3d" ]&&[[ "${modprettyname}" == *"Oxide"* ]]; then +if [ "${engine}" == "unity3d" ] && [[ "${modprettyname}" == *"Oxide"* ]]; then fn_print_information_nl "Validating to restore original ${gamename} files replaced by Oxide" fn_script_log "Validating to restore original ${gamename} files replaced by Oxide" - exitbypass="1" + exitbypass=1 command_validate.sh + fn_firstcommand_reset unset exitbypass fi + +# Remove/modify existing liblist.gam file for Metamod +if [ "${modcommand}" == "metamod" ]; then + fn_mod_remove_liblist_gam_file +fi + +# Remove/modify plugins.ini file for AMX Mod X +if [ "${modcommand}" == "amxmodx" ]; then + fn_mod_remove_amxmodx_file +fi + echo -e "${modprettyname} removed" fn_script_log "${modprettyname} removed" diff --git a/lgsm/functions/command_mods_update.sh b/lgsm/modules/command_mods_update.sh similarity index 80% rename from lgsm/functions/command_mods_update.sh rename to lgsm/modules/command_mods_update.sh index 165b4ea98..10279b67b 100644 --- a/lgsm/functions/command_mods_update.sh +++ b/lgsm/modules/command_mods_update.sh @@ -1,38 +1,39 @@ #!/bin/bash -# LinuxGSM command_mods_update.sh function +# LinuxGSM command_mods_update.sh module # Author: Daniel Gibbs -# Contributor: UltimateByte +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Updates installed mods along with mods_list.sh and mods_core.sh. commandname="MODS-UPDATE" -commandaction="Updating mods" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +commandaction="Updating Mods" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set check.sh mods_core.sh # Prevents specific files being overwritten upon update (set by ${modkeepfiles}). # For that matter, remove cfg files after extraction before copying them to destination. -fn_remove_cfg_files(){ - if [ "${modkeepfiles}" != "OVERWRITE" ]&&[ "${modkeepfiles}" != "NOUPDATE" ]; then +fn_remove_cfg_files() { + if [ "${modkeepfiles}" != "OVERWRITE" ] && [ "${modkeepfiles}" != "NOUPDATE" ]; then echo -e "the following files/directories will be preserved:" - fn_sleep_time + fn_sleep_time_1 # Count how many files there are to remove. filestopreserve=$(echo -e "${modkeepfiles}" | awk -F ';' '{ print NF }') # Test all subvalues of "modkeepfiles" using the ";" separator. - for ((preservefilesindex=1; preservefilesindex < filestopreserve; preservefilesindex++)); do + for ((preservefilesindex = 1; preservefilesindex < filestopreserve; preservefilesindex++)); do # Put the current file we are looking for into a variable. - filetopreserve=$(echo -e "${modkeepfiles}" | awk -F ';' -v x=${preservefilesindex} '{ print $x }' ) + filetopreserve=$(echo -e "${modkeepfiles}" | awk -F ';' -v x=${preservefilesindex} '{ print $x }') echo -e " * serverfiles/${filetopreserve}" # If it matches an existing file that have been extracted delete the file. - if [ -f "${extractdir}/${filetopreserve}" ]||[ -d "${extractdir}/${filetopreserve}" ]; then - rm -r "${extractdir:?}/${filetopreserve}" + if [ -f "${extractdest}/${filetopreserve}" ] || [ -d "${extractdest}/${filetopreserve}" ]; then + rm -r "${extractdest:?}/${filetopreserve}" # Write the file path in a tmp file, to rebuild a full file list as it is rebuilt upon update. if [ ! -f "${modsdir}/.removedfiles.tmp" ]; then touch "${modsdir}/.removedfiles.tmp" fi - echo -e "${filetopreserve}" >> "${modsdir}/.removedfiles.tmp" + echo -e "${filetopreserve}" >> "${modsdir}/.removedfiles.tmp" fi done fi @@ -44,7 +45,7 @@ fn_print_info_nl "Update addons/mods: ${installedmodscount} addons/mods will be fn_script_log_info "${installedmodscount} mods or addons will be updated" fn_mods_installed_list # Go through all available commands, get details and display them to the user. -for ((ulindex=0; ulindex < ${#installedmodslist[@]}; ulindex++)); do +for ((ulindex = 0; ulindex < ${#installedmodslist[@]}; ulindex++)); do # Current mod is the "ulindex" value of the array we're going through. currentmod="${installedmodslist[ulindex]}" fn_mod_get_info @@ -96,7 +97,7 @@ while [ "${installedmodsline}" -le "${installedmodscount}" ]; do ((installedmodsline++)) else fn_print_fail "No mod was selected" - fn_script_log_fatal "No mod was selected" + fn_script_log_fail "No mod was selected" exitcode="1" core_exit.sh fi diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh new file mode 100644 index 000000000..6baa24a08 --- /dev/null +++ b/lgsm/modules/command_monitor.sh @@ -0,0 +1,420 @@ +#!/bin/bash +# LinuxGSM command_monitor.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Monitors server by checking for running processes +# then passes to gamedig and gsquery. + +commandname="MONITOR" +commandaction="Monitoring" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_monitor_check_monitoring() { + if [ -f "${lockdir}/${selfname}.lock" ]; then + # Part of migration to v23.5.0. #4296 + rm -f "${lockdir:?}/${selfname}.lock" + 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_checking_eol + fn_script_log_info "Checking lockfile: CHECKING" + 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." + core_exit.sh + fi +} + +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_checking_eol + fn_script_log_info "Checking installer: CHECKING" + 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 + fi +} + +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_checking_eol + 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 + fi +} + +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_checking_eol + 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 + fi +} + +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_checking_eol + 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" + fi + 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_checking_eol + 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 + fi +} + +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_checking_eol + 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" + fi + 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_checking_eol + 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 + fi +} + +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_checking_eol + 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" + fi + 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_checking_eol + 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 + fi +} + +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_checking_eol + 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" + fi + 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_checking_eol + 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 + fi +} + +# Source engine games may display a messages to indicate the server needs restarting. +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_checking_eol + 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" + alert.sh + command_update.sh + core_exit.sh + fi + fi +} + +fn_monitor_check_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. + sessionwidth="80" + 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_eol_nl + fn_script_log_error "Checking session: ERROR" + fn_script_log_error "Checking session: There are PIDS with identical tmux sessions running" + fn_script_log_error "Checking session: Killing all tmux sessions with the socketname name ${socketname} and session name ${sessionname}" + pkill -f "tmux -L ${socketname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}" + command_restart.sh + 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_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" + fn_script_log_error "Checking session: Killing session with the socketname name ${sessionname} and session name ${sessionname}" + pkill -f "tmux -L ${sessionname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}" + command_restart.sh + 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_eol_nl + fn_script_log_error "Checking session: ERROR" + fn_script_log_error "Checking session: PIDS with old type tmux session are running" + fn_script_log_error "Checking session: Killing session with the session name ${sessionname}" + pkill -f "tmux new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}" + command_restart.sh + core_exit.sh + elif [ "${status}" != "0" ]; then + fn_print_ok "Checking session" + fn_print_ok_eol_nl + fn_script_log_pass "Checking session: OK" + # send LinuxGSM stats if monitor is OK. + if [ "${stats}" == "on" ] || [ "${stats}" == "y" ] && [ "${querymode}" == "1" ]; then + info_stats.sh + fi + else + fn_print_error "Checking session" + fn_print_fail_eol_nl + fn_script_log_fail "Checking session: FAIL" + alert="monitor-session" + alert.sh + fn_script_log_info "Checking session: Monitor is restarting ${selfname}" + command_restart.sh + core_exit.sh + fi +} + +# 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_checking_eol + fn_script_log_info "Checking port: CHECKING" + if [ -n "${rconenabled}" ] && [ "${rconenabled}" != "true" ] && [ "${shortname}" == "av" ]; then + fn_print_warn "Checking port: Unable to query, rcon is not enabled" + fn_script_log_warn "Checking port: Unable to query, rcon is not enabled" + else + fn_print_error "Checking port: Unable to query, queryport is not set" + fn_script_log_error "Checking port: Unable to query, queryport is not set" + fi + core_exit.sh + fi +} + +fn_query_gsquery() { + 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}" > /dev/null 2>&1 + querystatus="$?" +} + +fn_query_tcp() { + bash -c "exec 3<> /dev/tcp/'${queryip}'/'${queryport}'" > /dev/null 2>&1 + querystatus="$?" +} + +fn_monitor_query() { + # Will loop and query up to 5 times every 15 seconds. + # Query will wait up to 60 seconds to confirm server is down as server can become non-responsive during map changes. + 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_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_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" + fn_script_log_info "Server started: $(date -d "@$(head -n 1 "${lockdir}/${selfname}-started.lock")")" + fn_script_log_info "Current time: $(date)" + monitorpass=1 + core_exit.sh + # will use query method selected in fn_monitor_loop + # gamedig + elif [ "${querymethod}" == "gamedig" ]; then + query_gamedig.sh + # gsquery + elif [ "${querymethod}" == "gsquery" ]; then + fn_query_gsquery + #tcp query + elif [ "${querymethod}" == "tcp" ]; then + fn_query_tcp + fi + + if [ "${querystatus}" == "0" ]; then + # Server query OK. + 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 + if [ "${querystatus}" == "0" ]; then + # Add query data to log. + if [ "${gdname}" ]; then + fn_script_log_info "Server name: ${gdname}" + fi + if [ "${gdplayers}" ]; then + fn_script_log_info "Players: ${gdplayers}/${gdmaxplayers}" + fi + if [ "${gdbots}" ]; then + fn_script_log_info "Bots: ${gdbots}" + fi + if [ "${gdmap}" ]; then + fn_script_log_info "Map: ${gdmap}" + fi + if [ "${gdgamemode}" ]; then + fn_script_log_info "Game Mode: ${gdgamemode}" + fi + + # send LinuxGSM stats if monitor is OK. + if [ "${stats}" == "on" ] || [ "${stats}" == "y" ]; then + info_stats.sh + fi + fi + core_exit.sh + else + # Server query FAIL. + 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_eol_nl + fn_script_log_warn "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : FAIL" + # Send alert if enabled. + alert="monitor-query" + alert.sh + command_restart.sh + fn_firstcommand_reset + core_exit.sh + fi + fi + 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}" + fn_print_wait_eol + fn_sleep_time_1 + totalseconds=$((totalseconds + 1)) + if [ "${seconds}" == "15" ]; then + break + fi + done + done +} + +fn_monitor_loop() { + # loop though query methods selected by querymode. + totalseconds=0 + if [ "${querymode}" == "2" ]; then + local query_methods_array=(gamedig gsquery) + elif [ "${querymode}" == "3" ]; then + local query_methods_array=(gamedig) + elif [ "${querymode}" == "4" ]; then + local query_methods_array=(gsquery) + elif [ "${querymode}" == "5" ]; then + local query_methods_array=(tcp) + fi + for querymethod in "${query_methods_array[@]}"; do + # Will check if gamedig is installed and bypass if not. + if [ "${querymethod}" == "gamedig" ]; then + if [ "$(command -v gamedig 2> /dev/null)" ] || [ -f "${lgsmdir}/node_modules/gamedig/bin/gamedig.js" ] && [ "$(command -v jq 2> /dev/null)" ]; then + if [ -z "${monitorpass}" ]; then + fn_monitor_query + fi + else + fn_script_log_info "gamedig is not installed" + fn_script_log_info "https://docs.linuxgsm.com/requirements/gamedig" + fi + else + # will not query if query already passed. + if [ -z "${monitorpass}" ]; then + fn_monitor_query + fi + fi + done +} + +fn_print_dots "" +monitorflag=1 +# Dont do any monitoring or checks if installer is running. +fn_monitor_check_install +check.sh +core_logs.sh +info_game.sh + +# query pre-checks +fn_monitor_check_details +fn_monitor_check_backup +fn_monitor_check_debug +fn_monitor_check_update_source +fn_monitor_check_update +fn_monitor_check_monitoring +fn_monitor_check_starting +fn_monitor_check_stopping +fn_monitor_check_session + +# Monitor will not continue if session only check. +if [ "${querymode}" != "1" ]; then + fn_monitor_check_queryport + + # Add a querydelay of 1 min if var missing. + if [ -z "${querydelay}" ]; then + querydelay="1" + fi + + fn_monitor_loop +fi +core_exit.sh diff --git a/lgsm/modules/command_postdetails.sh b/lgsm/modules/command_postdetails.sh new file mode 100644 index 000000000..61d537440 --- /dev/null +++ b/lgsm/modules/command_postdetails.sh @@ -0,0 +1,76 @@ +#!/bin/bash +# LinuxGSM command_postdetails.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Strips sensitive information out of Details output. + +commandname="POST-DETAILS" +commandaction="Post Details" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_bad_postdetailslog() { + fn_print_fail_nl "Unable to create temporary file ${postdetailslog}." + core_exit.sh +} + +# 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:?}" +fi + +# Rather than a one-pass sed parser, default to using a temporary directory. +if [ "${exitbypass}" ]; then + postdetailslog="${alertlog}" +else + # Run checks and gathers details to display. + check.sh + info_game.sh + info_distro.sh + info_messages.sh + for queryip in "${queryips[@]}"; do + query_gamedig.sh + if [ "${querystatus}" == "0" ]; then + break + fi + done + touch "${postdetailslog}" || fn_bad_postdetailslog + { + fn_info_messages_distro + fn_info_messages_server_resource + fn_info_messages_gameserver_resource + fn_info_messages_gameserver + fn_info_messages_script + fn_info_messages_backup + # Some game servers do not have parms. + if [ "${shortname}" != "jc2" ] && [ "${shortname}" != "jc3" ] && [ "${shortname}" != "dst" ] && [ "${shortname}" != "pz" ] && [ "${engine}" != "renderware" ]; then + fn_info_messages_commandlineparms + fi + fn_info_messages_ports_edit + fn_info_messages_ports + fn_info_messages_select_engine + fn_info_messages_statusbottom + } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | tee -a "${postdetailslog}" > /dev/null 2>&1 +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}" + +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}" + +if [ -z "${exitbypass}" ]; then + core_exit.sh +fi diff --git a/lgsm/modules/command_restart.sh b/lgsm/modules/command_restart.sh new file mode 100644 index 000000000..0a7f9b5f0 --- /dev/null +++ b/lgsm/modules/command_restart.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LinuxGSM command_restart.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Restarts the server. + +commandname="RESTART" +commandaction="Restarting" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +info_game.sh +exitbypass=1 +command_stop.sh +command_start.sh +fn_firstcommand_reset +core_exit.sh diff --git a/lgsm/modules/command_send.sh b/lgsm/modules/command_send.sh new file mode 100644 index 000000000..de021599d --- /dev/null +++ b/lgsm/modules/command_send.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# LinuxGSM command_send.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Send command to the server tmux console. + +commandname="SEND" +commandaction="Send" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +if [ -z "${userinput2}" ]; then + fn_print_header + fn_print_information_nl "Send a command to the console." +fi + +check_status.sh +if [ "${status}" != "0" ]; then + if [ -n "${userinput2}" ]; then + commandtosend="${userinput2}" + else + echo "" + commandtosend=$(fn_prompt_message "send: ") + fi + echo "" + fn_print_dots "Sending command to console: \"${commandtosend}\"" + 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" + 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 +fi + +core_exit.sh diff --git a/lgsm/modules/command_skeleton.sh b/lgsm/modules/command_skeleton.sh new file mode 100644 index 000000000..b9f51205a --- /dev/null +++ b/lgsm/modules/command_skeleton.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# LinuxGSM command_skeleton.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Creates an copy of a game servers directorys. + +commandname="SKELETON" +commandaction="Skeleton" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_dots "Creating skeleton directory" +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}" -ne 0 ]; then + fn_print_fail_nl "Creating skeleton directory" + fn_script_log_fail "Creating skeleton directory" +else + fn_print_ok_nl "Creating skeleton directory: ./skel" + fn_script_log_pass "Creating skeleton directory: ./skel" +fi +core_exit.sh diff --git a/lgsm/functions/command_donate.sh b/lgsm/modules/command_sponsor.sh old mode 100644 new mode 100755 similarity index 51% rename from lgsm/functions/command_donate.sh rename to lgsm/modules/command_sponsor.sh index 9bb7f2faf..1915aa328 --- a/lgsm/functions/command_donate.sh +++ b/lgsm/modules/command_sponsor.sh @@ -1,22 +1,24 @@ #!/bin/bash -# LinuxGSM command_donate.sh function +# LinuxGSM command_sponsor.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Shows ways to donate. +# Description: Shows ways to sponsor. -commandname="DONATE" -commandaction="Donate" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +commandname="SPONSOR" +commandaction="Sponsor" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set fn_print_ascii_logo -echo -e "${lightyellow}Support LinuxGSM${default}" -echo -e "=================================" +echo -e "${bold}${lightyellow}Support LinuxGSM${default}" +fn_messages_separator echo -e "" echo -e "Been using LinuxGSM?" -echo -e "Consider donating to support development." +echo -e "Consider sponsoring to support development." echo -e "" -echo -e "* ${lightblue}Patreon:${default} https://linuxgsm.com/patreon" echo -e "* ${lightblue}GitHub:${default} https://github.com/sponsors/dgibbs64" +echo -e "* ${lightblue}Patreon:${default} https://linuxgsm.com/patreon" echo -e "* ${lightblue}PayPal:${default} https://linuxgsm.com/paypal" echo -e "" echo -e "LinuxGSM est. 2012" diff --git a/lgsm/modules/command_start.sh b/lgsm/modules/command_start.sh new file mode 100644 index 000000000..a4e07b44b --- /dev/null +++ b/lgsm/modules/command_start.sh @@ -0,0 +1,209 @@ +#!/bin/bash +# LinuxGSM command_start.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Starts the server. + +commandname="START" +commandaction="Starting" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +addtimestamp="gawk '{ print strftime(\\\"[$logtimestampformat]\\\"), \\\$0 }'" +fn_firstcommand_set + +# This will allow the Jedi Knight 2 version to be printed in console on start. +# Used to allow update to detect JK2MV server version. +fn_start_jk2() { + fn_start_tmux + tmux -L "${socketname}" end -t "${sessionname}" version ENTER > /dev/null 2>&1 +} + +fn_start_tmux() { + # check for tmux size variables. + if [[ "${servercfgtmuxwidth}" =~ ^[0-9]+$ ]]; then + sessionwidth="${servercfgtmuxwidth}" + else + sessionwidth="80" + fi + if [[ "${servercfgtmuxheight}" =~ ^[0-9]+$ ]]; then + sessionheight="${servercfgtmuxheight}" + else + sessionheight="23" + fi + + # Log rotation. + fn_script_log_info "Rotating log files" + if [ "${engine}" == "unreal2" ] && [ -f "${gamelog}" ]; then + mv "${gamelog}" "${gamelogdate}" + fi + if [ -f "${lgsmlog}" ]; then + mv "${lgsmlog}" "${lgsmlogdate}" + fi + if [ -f "${consolelog}" ]; then + mv "${consolelog}" "${consolelogdate}" + fi + + # Create a starting lockfile that only exists while the start command is running. + date '+%s' > "${lockdir:?}/${selfname}-starting.lock" + + fn_reload_startparameters + + # Create uid to ensure unique tmux socket name. + if [ ! -f "${datadir}/${selfname}.uid" ]; then + check_status.sh + if [ "${status}" != "0" ]; then + # stop running server (if running) to prevent lingering tmux sessions. + exitbypass=1 + command_stop.sh + fi + uid=$(date '+%s' | sha1sum | head -c 8) + echo "${uid}" > "${datadir}/${selfname}.uid" + socketname="${sessionname}-$(cat "${datadir}/${selfname}.uid")" + fi + + if [ "${shortname}" == "av" ]; then + cd "${systemdir}" || exit + else + cd "${executabledir}" || exit + fi + + tmux -L "${socketname}" new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${preexecutable} ${executable} ${startparameters}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" + + # Create logfile. + touch "${consolelog}" + + # tmux compiled from source will return "master", therefore ignore it. + if [ "${tmuxversion}" == "master" ]; then + fn_script_log "tmux version: master (user compiled)" + echo -e "tmux version: master (user compiled)" >> "${consolelog}" + fi + + # Enable console logging. + if [ "${consolelogging}" == "on" ] || [ -z "${consolelogging}" ]; then + # timestamp will break mcb update check. + if [ "${logtimestamp}" == "on" ] && [ "${shortname}" != "mcb" ]; then + tmux -L "${socketname}" pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'" + else + tmux -L "${socketname}" pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" + fi + else + echo -e "Console logging disabled in settings" >> "${consolelog}" + fn_script_log_info "Console logging disabled in settings" + fi + + fn_sleep_time_1 + + # If the server fails to start. + check_status.sh + if [ "${status}" == "0" ]; then + fn_print_fail_nl "Unable to start ${servername}" + fn_script_log_fail "Unable to start ${servername}" + if [ -s "${lgsmlogdir}/.${selfname}-tmux-error.tmp" ]; then + fn_print_fail_nl "Unable to start ${servername}: tmux error:" + fn_script_log_fail "Unable to start ${servername}: tmux error" + echo -e "" + echo -e "Command" + fn_messages_separator + echo -e "tmux -L \"${sessionname}\" new-session -d -s \"${sessionname}\" \"${preexecutable} ${executable} ${startparameters}\"" | tee -a "${lgsmlog}" + echo -e "" + echo -e "Error" + fn_messages_separator + tee -a "${lgsmlog}" < "${lgsmlogdir}/.${selfname}-tmux-error.tmp" + + # Detected error https://linuxgsm.com/support + if grep -c "Operation not permitted" "${lgsmlogdir}/.${selfname}-tmux-error.tmp"; then + echo -e "" + echo -e "Fix" + fn_messages_separator + if ! grep "tty:" /etc/group | grep "$(whoami)"; then + echo -e "$(whoami) is not part of the tty group." + fn_script_log_info "$(whoami) is not part of the tty group." + group=$(grep tty /etc/group) + echo -e "" + echo -e " ${group}" + fn_script_log_info "${group}" + echo -e "" + echo -e "Run the following command with root privileges." + echo -e "" + echo -e " usermod -G tty $(whoami)" + echo -e "" + 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 "${italic}https://linuxgsm.com/support" + fn_script_log_info "https://linuxgsm.com/support" + fi + fi + fi + # Remove starting lockfile when command ends. + rm -f "${lockdir:?}/${selfname}-starting.lock" + core_exit.sh + else + # Create start lockfile that exists only when the server is running. + date '+%s' > "${lockdir:?}/${selfname}-started.lock" + echo "${version}" >> "${lockdir}/${selfname}-started.lock" + echo "${port}" >> "${lockdir}/${selfname}-started.lock" + fn_print_ok "${servername}" + fn_script_log_pass "Started ${servername}" + + # Create last started Lockfile. + date +%s > "${lockdir}/${selfname}-last-started.lock" + + fn_print_ok "${servername}" + fn_script_log_pass "Started ${servername}" + if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "START" ]; then + alert="started" + alert.sh + elif [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "RESTART" ]; then + alert="restarted" + alert.sh + fi + fi + rm -f "${lgsmlogdir:?}/.${selfname}-tmux-error.tmp" 2> /dev/null + echo -en "\n" +} + +# If user ran the start command monitor will become enabled. +if [ "${firstcommandname}" == "START" ] || [ "${firstcommandname}" == "RESTART" ]; then + date '+%s' > "${lockdir:?}/${selfname}-monitoring.lock" +fi + +fn_print_dots "" +check.sh + +# If the server already started dont start again. +if [ "${status}" != "0" ]; then + fn_print_dots "${servername}" + 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. + rm -f "${lockdir:?}/${selfname}-starting.lock" + core_exit.sh + fi +fi + +fix.sh +info_game.sh +core_logs.sh + +# Will check for updates if updateonstart is yes. +if [ "${updateonstart}" == "yes" ] || [ "${updateonstart}" == "1" ] || [ "${updateonstart}" == "on" ]; then + exitbypass=1 + unset updateonstart + command_update.sh + fn_firstcommand_reset +fi + +fn_print_dots "${servername}" +if [ "${shortname}" == "jk2" ]; then + fn_start_jk2 +else + fn_start_tmux +fi + +# Remove starting lockfile when command ends. +rm -f "${lockdir:?}/${selfname}-starting.lock" +core_exit.sh diff --git a/lgsm/functions/command_stop.sh b/lgsm/modules/command_stop.sh similarity index 50% rename from lgsm/functions/command_stop.sh rename to lgsm/modules/command_stop.sh index 6ea4f4d7a..f1edc3544 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/modules/command_stop.sh @@ -1,30 +1,35 @@ #!/bin/bash -# LinuxGSM command_stop.sh function +# LinuxGSM command_stop.sh module # Author: Daniel Gibbs -# Contributors: UltimateByte +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Stops the server. commandname="STOP" commandaction="Stopping" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set # Attempts graceful shutdown by sending 'CTRL+c'. -fn_stop_graceful_ctrlc(){ +fn_stop_graceful_ctrlc() { fn_print_dots "Graceful: CTRL+c" fn_script_log_info "Graceful: CTRL+c" - # Sends quit. - tmux send-keys -t "${sessionname}" C-c > /dev/null 2>&1 + # 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. 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 + alert="stopped" + alert.sh + fi break fi - sleep 1 + fn_sleep_time_1 fn_print_dots "Graceful: CTRL+c: ${seconds}" done check_status.sh @@ -38,21 +43,25 @@ fn_stop_graceful_ctrlc(){ # Attempts graceful shutdown by sending a specified command. # Usage: fn_stop_graceful_cmd "console_command" "timeout_in_seconds" # e.g.: fn_stop_graceful_cmd "quit" "30" -fn_stop_graceful_cmd(){ +fn_stop_graceful_cmd() { fn_print_dots "Graceful: sending \"${1}\"" fn_script_log_info "Graceful: sending \"${1}\"" # Sends specific stop command. - tmux send -t "${sessionname}" "${1}" ENTER > /dev/null 2>&1 + tmux -L "${socketname}" send -t "${sessionname}" ENTER "${1}" ENTER > /dev/null 2>&1 # Waits up to ${seconds} seconds giving the server time to shutdown gracefully. - for ((seconds=1; seconds<=${2}; seconds++)); do + 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 + alert="stopped" + alert.sh + fi break fi - sleep 1 + fn_sleep_time_1 fn_print_dots "Graceful: sending \"${1}\": ${seconds}" done check_status.sh @@ -66,25 +75,29 @@ fn_stop_graceful_cmd(){ # Attempts graceful shutdown of goldsrc using rcon 'quit' command. # There is only a 3 second delay before a forced a tmux shutdown # as GoldSrc servers 'quit' command does a restart rather than shutdown. -fn_stop_graceful_goldsrc(){ +fn_stop_graceful_goldsrc() { fn_print_dots "Graceful: sending \"quit\"" fn_script_log_info "Graceful: sending \"quit\"" # sends quit - tmux send -t "${sessionname}" quit ENTER > /dev/null 2>&1 + tmux -L "${socketname}" send -t "${sessionname}" quit ENTER > /dev/null 2>&1 # Waits 3 seconds as goldsrc servers restart with the quit command. for seconds in {1..3}; do - sleep 1 + 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 + alert="stopped" + alert.sh + fi } # telnet command for sdtd graceful shutdown. -fn_stop_graceful_sdtd_telnet(){ - if [ -z "${telnetpass}" ]||[ "${telnetpass}" == "NOT SET" ]; then - sdtd_telnet_shutdown=$( expect -c ' +fn_stop_graceful_sdtd_telnet() { + if [ -z "${telnetpassword}" ] || [ "${telnetpassword}" == "NOT SET" ]; then + sdtdtelnetshutdown=$(expect -c ' proc abort {} { puts "Timeout or EOF\n" exit 1 @@ -98,14 +111,14 @@ fn_stop_graceful_sdtd_telnet(){ puts "Completed.\n" ') else - sdtd_telnet_shutdown=$( expect -c ' + sdtdtelnetshutdown=$(expect -c ' proc abort {} { puts "Timeout or EOF\n" exit 1 } spawn telnet '"${telnetip}"' '"${telnetport}"' expect { - "password:" { send "'"${telnetpass}"'\r" } + "password:" { send "'"${telnetpassword}"'\r" } default abort } expect { @@ -119,19 +132,19 @@ fn_stop_graceful_sdtd_telnet(){ } # Attempts graceful shutdown of 7 Days To Die using telnet. -fn_stop_graceful_sdtd(){ +fn_stop_graceful_sdtd() { fn_print_dots "Graceful: telnet" fn_script_log_info "Graceful: telnet" if [ "${telnetenabled}" == "false" ]; then fn_print_info_nl "Graceful: telnet: DISABLED: Enable in ${servercfg}" - elif [ "$(command -v expect 2>/dev/null)" ]; then + elif [ "$(command -v expect 2> /dev/null)" ]; then # Tries to shutdown with both localhost and server IP. for telnetip in 127.0.0.1 ${ip}; do fn_print_dots "Graceful: telnet: ${telnetip}:${telnetport}" fn_script_log_info "Graceful: telnet: ${telnetip}:${telnetport}" fn_stop_graceful_sdtd_telnet - completed=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Completed.") - refused=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Timeout or EOF") + completed=$(echo -en "\n ${sdtdtelnetshutdown}" | grep "Completed.") + refused=$(echo -en "\n ${sdtdtelnetshutdown}" | grep "Timeout or EOF") if [ "${refused}" ]; then fn_print_error "Graceful: telnet: ${telnetip}:${telnetport} : " fn_print_fail_eol_nl @@ -146,14 +159,18 @@ fn_stop_graceful_sdtd(){ if [ "${completed}" ]; then for seconds in {1..30}; do fn_stop_graceful_sdtd_telnet - refused=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Timeout or EOF") + refused=$(echo -en "\n ${sdtdtelnetshutdown}" | grep "Timeout or EOF") if [ "${refused}" ]; then fn_print_ok "Graceful: telnet: ${telnetip}:${telnetport} : " fn_print_ok_eol_nl fn_script_log_pass "Graceful: telnet: ${telnetip}:${telnetport} : ${seconds} seconds" + if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then + alert="stopped" + alert.sh + fi break fi - sleep 1 + fn_sleep_time_1 fn_print_dots "Graceful: telnet: ${seconds}" done # If telnet shutdown fails tmux shutdown will be used, this risks loss of world save. @@ -168,7 +185,7 @@ fn_stop_graceful_sdtd(){ fi echo -en "\n" | tee -a "${lgsmlog}" echo -en "Telnet output:" | tee -a "${lgsmlog}" - echo -en "\n ${sdtd_telnet_shutdown}" | tee -a "${lgsmlog}" + echo -en "\n ${sdtdtelnetshutdown}" | tee -a "${lgsmlog}" echo -en "\n\n" | tee -a "${lgsmlog}" fi else @@ -178,25 +195,118 @@ fn_stop_graceful_sdtd(){ fi } +# Attempts graceful shutdown of Soulmask using telnet. +fn_stop_graceful_sm() { + fn_print_dots "Graceful: telnet" + fn_script_log_info "Graceful: telnet" + if [ "${telnetenabled}" == "false" ]; then + fn_print_info_nl "Graceful: telnet: DISABLED: Enable in ${servercfg}" + elif [ "$(command -v expect 2> /dev/null)" ]; then + # Tries to shutdown with both localhost and server IP. + for telnetip in 127.0.0.1 ${ip}; do + fn_print_dots "Graceful: telnet: ${telnetip}:${telnetport}" + fn_script_log_info "Graceful: telnet: ${telnetip}:${telnetport}" + fn_stop_graceful_sm_telnet + completed=$(echo -en "\n ${smtelnetshutdown}" | grep "Completed.") + refused=$(echo -en "\n ${smtelnetshutdown}" | grep "Timeout or EOF") + if [ "${refused}" ]; then + fn_print_error "Graceful: telnet: ${telnetip}:${telnetport} : " + fn_print_fail_eol_nl + fn_script_log_error "Graceful: telnet: ${telnetip}:${telnetport} : FAIL" + elif [ "${completed}" ]; then + break + fi + done + + # If telnet shutdown was successful will use telnet again to check + # the connection has closed, confirming that the tmux session can now be killed. + if [ "${completed}" ]; then + for seconds in {1..30}; do + fn_stop_graceful_sm_telnet + refused=$(echo -en "\n ${smtelnetshutdown}" | grep "Timeout or EOF") + if [ "${refused}" ]; then + fn_print_ok "Graceful: telnet: ${telnetip}:${telnetport} : " + fn_print_ok_eol_nl + fn_script_log_pass "Graceful: telnet: ${telnetip}:${telnetport} : ${seconds} seconds" + if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then + alert="stopped" + alert.sh + fi + break + fi + fn_sleep_time_1 + fn_print_dots "Graceful: telnet: ${seconds}" + done + # If telnet shutdown fails, show it and stop + else + if [ "${refused}" ]; then + fn_print_error "Graceful: telnet: " + fn_print_fail_eol_nl + fn_script_log_error "Graceful: telnet: ${telnetip}:${telnetport} : FAIL" + else + fn_print_error_nl "Graceful: telnet: Unknown error" + fn_script_log_error "Graceful: telnet: Unknown error" + fi + echo -en "\n" | tee -a "${lgsmlog}" + echo -en "Telnet output:" | tee -a "${lgsmlog}" + echo -en "\n ${smtelnetshutdown}" | tee -a "${lgsmlog}" + echo -en "\n\n" | tee -a "${lgsmlog}" + fi + else + fn_print_warn "Graceful: telnet: expect not installed: " + fn_print_fail_eol_nl + fn_script_log_warn "Graceful: telnet: expect not installed: FAIL" + fi +} + +# telnet command for soulmask graceful shutdown. +fn_stop_graceful_sm_telnet() { + smtelnetshutdown=$(expect -c ' + proc abort {} { + puts "Timeout or EOF\n" + exit 1 + } + spawn telnet '"${telnetip}"' '"${telnetport}"' + expect { + "Hello:" { send "saveworld 1\r" } + default abort + } + expect { + "the world is saved." { send "quit 1\r" } + default abort + } + expect { + "World is closing..." {} + default abort + } + expect { eof } + puts "Completed.\n" + ') +} + # Attempts graceful shutdown by sending /save /stop. -fn_stop_graceful_avorion(){ +fn_stop_graceful_avorion() { fn_print_dots "Graceful: /save /stop" fn_script_log_info "Graceful: /save /stop" # Sends /save. - tmux send-keys -t "${sessionname}" /save ENTER > /dev/null 2>&1 - sleep 5 + tmux -L "${socketname}" send-keys -t "${sessionname}" /save ENTER > /dev/null 2>&1 + fn_sleep_time_5 # Sends /quit. - tmux send-keys -t "${sessionname}" /stop ENTER > /dev/null 2>&1 + 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. 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 + alert="stopped" + alert.sh + fi break fi - sleep 1 + fn_sleep_time_1 fn_print_dots "Graceful: /save /stop: ${seconds}" done check_status.sh @@ -207,7 +317,7 @@ fn_stop_graceful_avorion(){ fi } -fn_stop_graceful_select(){ +fn_stop_graceful_select() { if [ "${stopmode}" == "1" ]; then fn_stop_tmux elif [ "${stopmode}" == "2" ]; then @@ -228,51 +338,73 @@ fn_stop_graceful_select(){ fn_stop_graceful_goldsrc elif [ "${stopmode}" == "10" ]; then fn_stop_graceful_avorion + elif [ "${stopmode}" == "11" ]; then + fn_stop_graceful_cmd "end" 30 + elif [ "${stopmode}" == "12" ]; then + fn_stop_graceful_cmd "shutdown" 30 + elif [ "${stopmode}" == "13" ]; then + fn_stop_graceful_sm fi } -fn_stop_tmux(){ +fn_stop_tmux() { fn_print_dots "${servername}" fn_script_log_info "tmux kill-session: ${sessionname}: ${servername}" # Kill tmux session. - tmux kill-session -t "${sessionname}" > /dev/null 2>&1 - sleep 0.5 + tmux -L "${socketname}" kill-session -t "${sessionname}" > /dev/null 2>&1 + fn_sleep_time_1 check_status.sh if [ "${status}" == "0" ]; then fn_print_ok_nl "${servername}" fn_script_log_pass "Stopped ${servername}" + if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then + alert="stopped" + alert.sh + fi else fn_print_fail_nl "Unable to stop ${servername}" - fn_script_log_fatal "Unable to stop ${servername}" + fn_script_log_fail "Unable to stop ${servername}" fi } # Checks if the server is already stopped. -fn_stop_pre_check(){ +fn_stop_pre_check() { if [ "${status}" == "0" ]; then - fn_print_info_nl "${servername} is already stopped" - fn_script_log_error "${servername} is already stopped" + fn_print_skip_nl "${servername} is already stopped" + fn_script_log_info "${servername} is already stopped" else # Select graceful shutdown. fn_stop_graceful_select - fi - # Check status again, a kill tmux session if graceful shutdown failed. - check_status.sh - if [ "${status}" != "0" ]; then - fn_stop_tmux + # Check status again, a kill tmux session if graceful shutdown failed. + check_status.sh + if [ "${status}" != "0" ]; then + fn_stop_tmux + fi fi } +fn_print_dots "" check.sh + +# Create a stopping lockfile that only exists while the stop command is running. +date '+%s' > "${lockdir:?}/${selfname}-stopping.lock" + fn_print_dots "${servername}" -info_config.sh +info_game.sh fn_stop_pre_check -# Remove lockfile. -if [ -f "${lockdir}/${selfname}.lock" ]; then - rm -f "${lockdir:?}/${selfname}.lock" + +# Remove started lockfile. +rm -f "${lockdir:?}/${selfname}-started.lock" + +# If user ran the stop command monitor will become disabled. +if [ "${firstcommandname}" == "STOP" ]; then + rm -f "${lockdir:?}/${selfname}-monitoring.lock" fi +# Remove stopping lockfile. +rm -f "${lockdir:?}/${selfname}-stopping.lock" + if [ -z "${exitbypass}" ]; then core_exit.sh fi diff --git a/lgsm/functions/command_test_alert.sh b/lgsm/modules/command_test_alert.sh similarity index 55% rename from lgsm/functions/command_test_alert.sh rename to lgsm/modules/command_test_alert.sh index 5d1c11885..becb365a3 100644 --- a/lgsm/functions/command_test_alert.sh +++ b/lgsm/modules/command_test_alert.sh @@ -1,16 +1,18 @@ #!/bin/bash -# LinuxGSM command_test_alert.sh function +# LinuxGSM command_test_alert.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Sends a test alert. commandname="TEST-ALERT" commandaction="Sending Alert" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set fn_print_dots "${servername}" check.sh -info_config.sh +info_game.sh alert="test" alert.sh diff --git a/lgsm/functions/command_ts3_server_pass.sh b/lgsm/modules/command_ts3_server_pass.sh similarity index 72% rename from lgsm/functions/command_ts3_server_pass.sh rename to lgsm/modules/command_ts3_server_pass.sh index 8ff799e6e..f5fad684e 100644 --- a/lgsm/functions/command_ts3_server_pass.sh +++ b/lgsm/modules/command_ts3_server_pass.sh @@ -1,21 +1,23 @@ #!/bin/bash -# LinuxGSM command_ts3_server_pass.sh function +# LinuxGSM command_ts3_server_pass.sh module # Author: Daniel Gibbs -# Contributor : UltimateByte +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Changes TS3 serveradmin password. commandname="CHANGE-PASSWORD" -commandaction="Changing password" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +commandaction="Changing Password" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set -fn_serveradmin_password_prompt(){ +fn_serveradmin_password_prompt() { fn_print_header fn_print_information_nl "You are about to change the ${gamename} ServerAdmin password." fn_print_warning_nl "${gamename} will restart during this process." echo -e "" if ! fn_prompt_yn "Continue?" Y; then - echo Exiting; exit + exitcode=0 + core_exit.sh fi fn_script_log_info "Initiating ${gamename} ServerAdmin password change" read -rp "Enter new password: " newpassword @@ -23,11 +25,12 @@ fn_serveradmin_password_prompt(){ fn_script_log_info "Changing password" } -fn_serveradmin_password_set(){ +fn_serveradmin_password_set() { # Start server in "new password mode". ts3serverpass="1" - exitbypass="1" + exitbypass=1 command_start.sh + fn_firstcommand_reset fn_print_ok_nl "New password applied" fn_script_log_pass "New ServerAdmin password applied" } @@ -37,15 +40,18 @@ check.sh fn_serveradmin_password_prompt if [ "${status}" != "0" ]; then # Stop any running server. - exitbypass="1" + exitbypass=1 command_stop.sh + fn_firstcommand_reset fn_serveradmin_password_set parms="serveradmin_password=\"${newpassword}\" inifile=\"${servercfgfullpath}\" > /dev/null 2>&1" ts3serverpass="0" command_restart.sh + fn_firstcommand_reset else fn_serveradmin_password_set command_stop.sh + fn_firstcommand_reset fi core_exit.sh diff --git a/lgsm/modules/command_update.sh b/lgsm/modules/command_update.sh new file mode 100644 index 000000000..6bb30a4c8 --- /dev/null +++ b/lgsm/modules/command_update.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# LinuxGSM command_update.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of servers. + +commandname="UPDATE" +commandaction="Updating" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_dots "" +check.sh +core_logs.sh +check_last_update.sh + +if [ "${shortname}" == "ts3" ]; then + update_ts3.sh +elif [ "${shortname}" == "mc" ]; then + update_mc.sh +elif [ "${shortname}" == "mcb" ]; then + update_mcb.sh +elif [ "${shortname}" == "pmc" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then + update_pmc.sh +elif [ "${shortname}" == "fctr" ]; then + update_fctr.sh +elif [ "${shortname}" == "mta" ]; then + update_mta.sh +elif [ "${shortname}" == "jk2" ]; then + update_jk2.sh +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 + +# remove update lockfile. +rm -f "${lockdir:?}/update.lock" + +core_exit.sh diff --git a/lgsm/modules/command_update_linuxgsm.sh b/lgsm/modules/command_update_linuxgsm.sh new file mode 100644 index 000000000..3299be509 --- /dev/null +++ b/lgsm/modules/command_update_linuxgsm.sh @@ -0,0 +1,251 @@ +#!/bin/bash +# LinuxGSM command_update_linuxgsm.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Deletes the modules dir to allow re-downloading of modules from GitHub. + +commandname="UPDATE-LGSM" +commandaction="Updating LinuxGSM" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_dots "" +check.sh +info_distro.sh +info_game.sh + +# Prevent github from using a cached version of the file if dev-debug is enabled. +if [ -f "${rootdir}/.dev-debug" ]; then + nocache="-H \"Cache-Control: no-cache\" -H \"Pragma: no-cache\"" +fi + +fn_script_log_info "Updating LinuxGSM" + +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 +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 + else + remotereponame="Bitbucket" + fn_print_ok_nl "Selecting repo: ${remotereponame}" + fi +else + remotereponame="GitHub" + fn_print_ok_nl "Selecting repo: ${remotereponame}" +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 +else + 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 + fn_print_fail_eol_nl + fn_script_log_fail "Checking ${remotereponame} linuxgsm.sh" + fn_script_log_fail "Curl returned error: ${exitcode}" + core_exit.sh +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")) +else + 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 + fn_print_update_eol_nl + 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_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 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 "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" + 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 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}" + fn_script_log_info "Copying ${selfname}" + cp "${tmpdir}/linuxgsm.sh" "${rootdir}/${selfname}" + sed -i "s+shortname=\"core\"+shortname=\"${shortname}\"+g" "${rootdir}/${selfname}" + sed -i "s+gameservername=\"core\"+gameservername=\"${gameservername}\"+g" "${rootdir}/${selfname}" + sed -i "s+gamename=\"core\"+gamename=\"${gamename}\"+g" "${rootdir}/${selfname}" + sed -i "s+githubuser=\"GameServerManagers\"+githubuser=\"${githubuser}\"+g" "${rootdir}/${selfname}" + sed -i "s+githubrepo=\"LinuxGSM\"+githubrepo=\"${githubrepo}\"+g" "${rootdir}/${selfname}" + sed -i "s+githubbranch=\"master\"+githubbranch=\"${githubbranch}\"+g" "${rootdir}/${selfname}" + + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fail "copying ${selfname}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "copying ${selfname}" + fi +else + fn_print_skip_eol_nl + fn_script_log_info "Checking ${selfname}" +fi + +# Check _default.cfg. +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 +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: ${exitcode}" + core_exit.sh +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")) +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")) +fi + +if [ "${config_file_diff}" != "" ]; then + fn_print_update_eol_nl + 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_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 [ ${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 + 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: ${exitcode}" + core_exit.sh + 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")) + 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")) + fi + + if [ "${config_file_diff}" != "" ]; then + fn_print_update_eol_nl + 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_skip_eol_nl + fn_script_log_pass "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" + fi +fi +# Check and update modules. +if [ -n "${modulesdir}" ]; then + if [ -d "${modulesdir}" ]; then + ( + cd "${modulesdir}" || exit + for modulefile in *; do + # check if module exists in the repo and remove if missing. + # commonly used if module names change. + echo -en "checking ${remotereponame} module [ ${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 + 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" + if ! rm -f "${modulefile:?}"; then + fn_print_fail_eol_nl + fn_script_log_fail "Removing module ${modulefile}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Removing module ${modulefile}" + fi + 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}")) + 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}")) + fi + + # results + if [ "${module_file_diff}" != "" ]; then + fn_print_update_eol_nl + fn_script_log "Checking ${remotereponame} module ${modulefile}" + rm -rf "${modulesdir:?}/${modulefile}" + fn_update_module + else + fn_print_skip_eol_nl + fn_script_log_pass "Checking ${remotereponame} module ${modulefile}" + fi + fi + done + ) + fi +fi + +fn_print_ok_nl "Updating modules" +fn_script_log_pass "Updating modules" + +core_exit.sh diff --git a/lgsm/modules/command_validate.sh b/lgsm/modules/command_validate.sh new file mode 100644 index 000000000..30c20e96e --- /dev/null +++ b/lgsm/modules/command_validate.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# LinuxGSM command_validate.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Runs a server validation. + +commandname="VALIDATE" +commandaction="Validating" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_validate() { + 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 ": 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 ": SteamCMD: Validate might overwrite some customised files" + date '+%s' > "${lockdir:?}/update.lock" + fn_dl_steamcmd +} + +fn_print_dots "" +check.sh +core_logs.sh + +fn_print_dots "SteamCMD" + +if [ "${status}" != "0" ]; then + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fn_validate + exitbypass=1 + command_start.sh + fn_firstcommand_reset +else + fn_validate +fi + +# remove update lockfile +rm -f "${lockdir:?}/update.lock" + +core_exit.sh diff --git a/lgsm/modules/command_wipe.sh b/lgsm/modules/command_wipe.sh new file mode 100644 index 000000000..21023d17d --- /dev/null +++ b/lgsm/modules/command_wipe.sh @@ -0,0 +1,186 @@ +#!/bin/bash +# LinuxGSM command_backup.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Wipes server data, useful after updates for some games like Rust. + +commandname="WIPE" +commandaction="Wiping" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +# Provides an exit code upon error. +fn_wipe_exit_code() { + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi +} + +# Removes files to wipe server. +fn_wipe_files() { + fn_print_start_nl "${wipetype}" + fn_script_log_info "${wipetype}" + + # Remove Map files + if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then + if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ]; then + 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 + fn_print_nl "no .map file(s) to remove" + fn_sleep_time + fn_script_log_pass "no .map file(s) to remove" + fi + fi + # Remove Save files. + if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then + if [ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ]; then + 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 + fn_print_nl "no .sav file(s) to remove" + fn_script_log_pass "no .sav file(s) to remove" + fn_sleep_time + fi + fi + # Remove db files for full wipe. + # Excluding player.tokens.db for Rust+. + if [ -n "${serverwipe}" ]; then + if [ -n "$(find "${serveridentitydir}" -type f ! -name 'player.tokens.db' -name "*.db")" ]; then + 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 + fn_print_nl "no .db file(s) to remove" + fn_sleep_time + fn_script_log_pass "no .db file(s) to remove" + fi + fi +} + +fn_map_wipe_warning() { + fn_print_warn "Map wipe will reset the map data and keep blueprint data" + fn_script_log_warn "Map wipe will reset the map data and keep blueprint data" + totalseconds=3 + for seconds in {3..1}; do + fn_print_warn "map wipe will reset the map data and keep blueprint data: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + fn_sleep_time_1 + if [ "${seconds}" == "0" ]; then + break + fi + done + fn_print_warn_nl "Map wipe will reset the map data and keep blueprint data" +} + +fn_full_wipe_warning() { + fn_print_warn "Server wipe will reset the map data and remove blueprint data" + fn_script_log_warn "Server wipe will reset the map data and remove blueprint data" + totalseconds=3 + for seconds in {3..1}; do + fn_print_warn "server wipe will reset the map data and remove blueprint data: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + fn_sleep_time_1 + if [ "${seconds}" == "0" ]; then + break + fi + done + fn_print_warn_nl "Server wipe will reset the map data and remove blueprint data" +} + +# 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 + 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 + fi +} + +# A summary of what wipe is going to do. +fn_wipe_details() { + fn_print_information_nl "Wipe does not remove Rust+ data." + fn_print "* Wipe map data " + if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then + fn_print_yes_eol_nl + else + fn_print_no_eol_nl + fi + + fn_print "* Wipe blueprint data " + if [ -n "${serverwipe}" ]; then + fn_print_yes_eol_nl + else + fn_print_no_eol_nl + fi + + fn_print "* Change Procedural Map seed " + if [ -n "${randomseed}" ]; then + fn_print_yes_eol_nl + else + fn_print_no_eol_nl + fi +} + +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 + wipetype="Full wipe" + fn_full_wipe_warning + fn_wipe_details + elif [ -n "${mapwipe}" ]; then + wipetype="Map wipe" + fn_map_wipe_warning + fn_wipe_details + fi + check_status.sh + if [ "${status}" != "0" ]; then + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fn_wipe_files + fn_wipe_random_seed + fn_print_success_nl "${wipetype}" + fn_script_log_pass "${wipetype}" + alert="wipe" + alert.sh + exitbypass=1 + command_start.sh + fn_firstcommand_reset + else + fn_wipe_files + fn_wipe_random_seed + fn_print_success_nl "${wipetype}" + fn_script_log_pass "${wipetype}" + alert="wipe" + alert.sh + fi +else + fn_print_ok_nl "Wipe not required" + fn_script_log_pass "Wipe not required" +fi +core_exit.sh diff --git a/lgsm/functions/compress_unreal2_maps.sh b/lgsm/modules/compress_unreal2_maps.sh similarity index 73% rename from lgsm/functions/compress_unreal2_maps.sh rename to lgsm/modules/compress_unreal2_maps.sh index 3580c20c9..58824cbc7 100644 --- a/lgsm/functions/compress_unreal2_maps.sh +++ b/lgsm/modules/compress_unreal2_maps.sh @@ -1,12 +1,14 @@ #!/bin/bash -# LinuxGSM compress_unreal2_maps.sh function +# 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" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +commandaction="Compressing Maps" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set check.sh fn_print_header @@ -19,7 +21,8 @@ echo -e "" echo -e "${compressedmapsdir}" echo -e "" if ! fn_prompt_yn "Start compression?" Y; then - return + exitcode=0 + core_exit.sh fi mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 rm -rfv "${serverfiles:?}/Maps/"*.ut2.uz2 diff --git a/lgsm/functions/compress_ut99_maps.sh b/lgsm/modules/compress_ut99_maps.sh similarity index 73% rename from lgsm/functions/compress_ut99_maps.sh rename to lgsm/modules/compress_ut99_maps.sh index 677f5aaa2..885c32d9a 100644 --- a/lgsm/functions/compress_ut99_maps.sh +++ b/lgsm/modules/compress_ut99_maps.sh @@ -1,12 +1,14 @@ #!/bin/bash -# LinuxGSM compress_ut99_maps.sh function +# 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" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +commandaction="Compressing Maps" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set check.sh fn_print_header @@ -19,7 +21,8 @@ echo -e "" echo -e "${compressedmapsdir}" echo -e "" if ! fn_prompt_yn "Start compression?" Y; then - return + exitcode=0 + core_exit.sh fi mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 rm -rfv "${serverfiles:?}/Maps/"*.unr.uz diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh new file mode 100644 index 000000000..3b9ec9945 --- /dev/null +++ b/lgsm/modules/core_dl.sh @@ -0,0 +1,638 @@ +#!/bin/bash +# LinuxGSM core_dl.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Deals with all downloads for LinuxGSM. + +# remote_fileurl: The URL of the file: http://example.com/dl/File.tar.bz2 +# local_filedir: location the file is to be saved: /home/server/lgsm/tmp +# local_filename: name of file (this can be different from the url name): file.tar.bz2 +# chmodx: Optional, set to "chmodx" to make file executable using chmod +x +# run: Optional, set run to execute the file after download +# forcedl: Optional, force re-download of file even if exists +# hash: Optional, set an hash sum and will compare it against the file. +# +# Downloads can be defined in code like so: +# fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}" +# fn_fetch_file "http://example.com/file.tar.bz2" "http://example.com/file2.tar.bz2" "file.tar.bz2" "file2.tar.bz2" "/some/dir" "file.tar.bz2" "chmodx" "run" "forcedl" "10cd7353aa9d758a075c600a6dd193fd" + +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 + echo -e "Branch: ${branch}" + fn_script_log_info "Branch: ${branch}" + fi + if [ -n "${betapassword}" ]; then + echo -e "Branch password: ${betapassword}" + fn_script_log_info "Branch password: ${betapassword}" + fi + if [ -d "${steamcmddir}" ]; then + cd "${steamcmddir}" || exit + fi + + # Unbuffer will allow the output of steamcmd not buffer allowing a smooth output. + # unbuffer us part of the expect package. + if [ "$(command -v unbuffer 2> /dev/null)" ]; then + unbuffer="unbuffer" + fi + + # Validate will be added as a parameter if required. + if [ "${commandname}" == "VALIDATE" ] || [ "${commandname}" == "INSTALL" ]; then + validate="validate" + fi + + # To do error checking for SteamCMD the output of steamcmd will be saved to a log. + steamcmdlog="${lgsmlogdir}/${selfname}-steamcmd.log" + + # clear previous steamcmd log + if [ -f "${steamcmdlog}" ]; then + rm -f "${steamcmdlog:?}" + fi + counter=0 + 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. + 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}" + 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}" + 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}" + 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}" + 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}" + else + ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" ${validate} +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}" + 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}" + else + ${unbuffer} ${steamcmdcommand} +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + fi + fi + + # Error checking for SteamCMD. Some errors will loop to try again and some will just exit. + # Check also if we have more errors than retries to be sure that we do not loop to many times and error out. + exitcode=$? + if [ -n "$(grep -i "Error!" "${steamcmdlog}" | tail -1)" ] && [ "$(grep -ic "Error!" "${steamcmdlog}")" -ge "${counter}" ]; then + # Not enough space. + if [ -n "$(grep "0x202" "${steamcmdlog}" | tail -1)" ]; then + 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 + # Not enough space. + elif [ -n "$(grep "0x212" "${steamcmdlog}" | tail -1)" ]; then + 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 + # 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" + fn_script_log_fail "${commandaction} ${selfname}: ${remotelocation}: Steam account does not have a license for the required game" + core_exit.sh + # Two-factor authentication failure + elif [ -n "$(grep "Two-factor code mismatch" "${steamcmdlog}" | tail -1)" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Two-factor authentication failure" + fn_script_log_fail "${commandaction} ${selfname}: ${remotelocation}: Two-factor authentication failure" + core_exit.sh + # Incorrect Branch password + elif [ -n "$(grep "Password check for AppId" "${steamcmdlog}" | tail -1)" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: betapassword is incorrect" + fn_script_log_fail "${commandaction} ${selfname}: ${remotelocation}: betapassword is incorrect" + core_exit.sh + # Update did not finish. + elif [ -n "$(grep "0x402" "${steamcmdlog}" | tail -1)" ] || [ -n "$(grep "0x602" "${steamcmdlog}" | tail -1)" ]; then + fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Update required but not completed - check network" + fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Update required but not completed - check network" + # Disk write failure. + elif [ -n "$(grep "0x606" "${steamcmdlog}" | tail -1)" ] || [ -n "$(grep "0x602" "${steamcmdlog}" | tail -1)" ]; then + fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Disk write failure" + fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Disk write failure" + # Missing update files. + 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" + fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured" + fi + 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_success_nl "${commandaction} ${selfname}: ${remotelocation}" + fn_script_log_pass "${commandaction} ${selfname}: ${remotelocation}" + fi + + if [ "${counter}" -gt "10" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Did not complete the download, too many retrys" + fn_script_log_fail "${commandaction} ${selfname}: ${remotelocation}: Did not complete the download, too many retrys" + core_exit.sh + fi + done +} + +# Emptys contents of the LinuxGSM tmpdir. +fn_clear_tmp() { + echo -en "clearing tmp directory [ ${italic}${tmpdir}${default} ]" + if [ -d "${tmpdir}" ]; then + rm -rf "${tmpdir:?}/"* + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_print_error_eol_nl + fn_script_log_error "clearing tmp directory ${tmpdir}" + else + fn_print_ok_eol_nl + fn_script_log_pass "clearing tmp directory ${tmpdir}" + fi + fi +} + +fn_dl_hash() { + # Runs Hash Check if available. + if [ "${hash}" != "0" ] && [ "${hash}" != "nohash" ] && [ "${hash}" != "nomd5" ]; then + # MD5 + if [ "${#hash}" == "32" ]; then + hashbin="md5sum" + hashtype="MD5" + # SHA1 + elif [ "${#hash}" == "40" ]; then + hashbin="sha1sum" + hashtype="SHA1" + # SHA256 + elif [ "${#hash}" == "64" ]; then + hashbin="sha256sum" + hashtype="SHA256" + # SHA512 + elif [ "${#hash}" == "128" ]; then + 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" + core_exit.sh + fi + echo -en "verifying ${local_filename} with ${hashtype}..." + fn_sleep_time + hashsumcmd=$(${hashbin} "${local_filedir}/${local_filename}" | awk '{print $1}') + if [ "${hashsumcmd}" != "${hash}" ]; then + fn_print_fail_eol_nl + echo -e "${local_filename} returned ${hashtype} checksum: ${hashsumcmd}" + echo -e "expected ${hashtype} checksum: ${hash}" + fn_script_log_fail "Verifying ${local_filename} with ${hashtype}" + fn_script_log_info "${local_filename} returned ${hashtype} checksum: ${hashsumcmd}" + fn_script_log_info "Expected ${hashtype} checksum: ${hash}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Verifying ${local_filename} with ${hashtype}" + fn_script_log_info "${local_filename} returned ${hashtype} checksum: ${hashsumcmd}" + fn_script_log_info "Expected ${hashtype} checksum: ${hash}" + fi + fi +} + +# Extracts bzip2, gzip or zip files. +# Extracts can be defined in code like so: +# fn_dl_extract "${local_filedir}" "${local_filename}" "${extractdest}" "${extractsrc}" +# fn_dl_extract "/home/gameserver/lgsm/tmp" "file.tar.bz2" "/home/gamserver/serverfiles" +fn_dl_extract() { + local_filedir="${1}" + local_filename="${2}" + extractdest="${3}" + extractsrc="${4}" + # Extracts archives. + echo -en "extracting ${local_filename}..." + + if [ ! -d "${extractdest}" ]; then + mkdir "${extractdest}" + fi + if [ ! -f "${local_filedir}/${local_filename}" ]; then + fn_print_fail_eol_nl + echo -en "file ${local_filedir}/${local_filename} not found" + fn_script_log_fail "Extracting ${local_filename}" + fn_script_log_fail "File ${local_filedir}/${local_filename} not found" + core_exit.sh + fi + mime=$(file -b --mime-type "${local_filedir}/${local_filename}") + if [ "${mime}" == "application/gzip" ] || [ "${mime}" == "application/x-gzip" ]; then + if [ -n "${extractsrc}" ]; then + extractcmd=$(tar -zxf "${local_filedir}/${local_filename}" -C "${extractdest}" --strip-components=1 "${extractsrc}") + else + extractcmd=$(tar -zxf "${local_filedir}/${local_filename}" -C "${extractdest}") + fi + elif [ "${mime}" == "application/x-bzip2" ]; then + if [ -n "${extractsrc}" ]; then + extractcmd=$(tar -jxf "${local_filedir}/${local_filename}" -C "${extractdest}" --strip-components=1 "${extractsrc}") + else + extractcmd=$(tar -jxf "${local_filedir}/${local_filename}" -C "${extractdest}") + fi + elif [ "${mime}" == "application/x-xz" ]; then + if [ -n "${extractsrc}" ]; then + extractcmd=$(tar -Jxf "${local_filedir}/${local_filename}" -C "${extractdest}" --strip-components=1 "${extractsrc}") + else + extractcmd=$(tar -Jxf "${local_filedir}/${local_filename}" -C "${extractdest}") + fi + elif [ "${mime}" == "application/zip" ]; then + if [ -n "${extractsrc}" ]; then + temp_extractdir="${tmpdir}/Xonotic" + extractcmd=$(unzip -qo "${local_filedir}/${local_filename}" "${extractsrc}/*" -d "${temp_extractdir}") + find "${temp_extractdir}/${extractsrc}" -mindepth 1 -maxdepth 1 -exec mv -t "${extractdest}" {} + + rm -rf "${temp_extractdir}" + else + extractcmd=$(unzip -qo -d "${extractdest}" "${local_filedir}/${local_filename}") + fi + fi + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fail "Extracting ${local_filename}" + if [ -f "${lgsmlog}" ]; then + echo -e "${extractcmd}" >> "${lgsmlog}" + fi + echo -e "${extractcmd}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Extracting ${local_filename}" + fi +} + +# Trap to remove file download if canceled before completed. +fn_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 +} + +# Will check a file exists and download it. Will not exit if fails to download. +fn_check_file() { + remote_fileurl="${1}" + remote_fileurl_backup="${2}" + remote_fileurl_name="${3}" + remote_fileurl_backup_name="${4}" + remote_filename="${5}" + # If backup fileurl exists include it. + if [ -n "${remote_fileurl_backup}" ]; then + # counter set to 0 to allow second try + counter=0 + remote_fileurls_array=(remote_fileurl remote_fileurl_backup) + else + # counter set to 1 to not allow second try + 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}" + fileurl_name="${remote_fileurl_name}" + elif [ "${remote_fileurl_array}" == "remote_fileurl_backup" ]; then + fileurl="${remote_fileurl_backup}" + fileurl_name="${remote_fileurl_backup_name}" + fi + counter=$((counter + 1)) + echo -e "checking ${fileurl_name} ${remote_filename}\c" + curlcmd=$(curl --output /dev/null --silent --head --fail "${fileurl}" 2>&1) + exitcode=$? + + # On first try will error. On second try will fail. + if [ "${exitcode}" -ne 0 ]; then + if [ ${counter} -ge 2 ]; then + fn_print_fail_eol_nl + if [ -f "${lgsmlog}" ]; then + fn_script_log_fail "Checking ${remote_filename}" + fn_script_log_fail "${fileurl}" + checkflag=1 + fi + else + fn_print_error_eol_nl + if [ -f "${lgsmlog}" ]; then + fn_script_log_error "Checking ${remote_filename}" + fn_script_log_error "${fileurl}" + checkflag=2 + fi + fi + else + fn_print_ok_eol + echo -en "\033[2K\\r" + if [ -f "${lgsmlog}" ]; then + fn_script_log_pass "Checking ${remote_filename}" + checkflag=0 + fi + break + fi + done + + if [ -f "${local_filedir}/${local_filename}" ]; then + fn_dl_hash + # Execute file if run is set. + if [ "${run}" == "run" ]; then + # shellcheck source=/dev/null + source "${local_filedir}/${local_filename}" + fi + fi +} + +fn_fetch_file() { + remote_fileurl="${1}" + remote_fileurl_backup="${2}" + remote_fileurl_name="${3}" + remote_fileurl_backup_name="${4}" + local_filedir="${5}" + local_filename="${6}" + chmodx="${7:-0}" + run="${8:-0}" + forcedl="${9:-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. + if [ -n "${remote_fileurl_backup}" ]; then + # counter set to 0 to allow second try + counter=0 + remote_fileurls_array=(remote_fileurl remote_fileurl_backup) + else + # counter set to 1 to not allow second try + 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}" + fileurl_name="${remote_fileurl_name}" + elif [ "${remote_fileurl_array}" == "remote_fileurl_backup" ]; then + fileurl="${remote_fileurl_backup}" + fileurl_name="${remote_fileurl_backup_name}" + fi + counter=$((counter + 1)) + if [ ! -d "${local_filedir}" ]; then + mkdir -p "${local_filedir}" + fi + # Trap will remove part downloaded files if canceled. + trap fn_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 [ ${italic}${local_filename}${default} ]" + fn_sleep_time + "${curlcmd[@]}" --progress-bar "${fileurl}" 2>&1 + exitcode=$? + echo -en "downloading file [ ${italic}${local_filename}${default} ]" + else + echo -en "fetching ${fileurl_name} [ ${italic}${local_filename}${default} ]\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 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}" -ne 0 ]; then + if [ ${counter} -ge 2 ]; then + fn_print_fail_eol_nl + if [ -f "${lgsmlog}" ]; then + fn_script_log_fail "Downloading ${local_filename}..." + fn_script_log_fail "${fileurl}" + fi + core_exit.sh + else + fn_print_error_eol_nl + if [ -f "${lgsmlog}" ]; then + fn_script_log_error "Downloading ${local_filename}..." + fn_script_log_error "${fileurl}" + fi + fi + else + fn_print_ok_eol_nl + if [ -f "${lgsmlog}" ]; then + fn_script_log_pass "Downloading ${local_filename}..." + fi + + # Make file executable if chmodx is set. + if [ "${chmodx}" == "chmodx" ]; then + chmod +x "${local_filedir}/${local_filename}" + fi + + # Remove trap. + trap - INT + + break + fi + done + fi + + if [ -f "${local_filedir}/${local_filename}" ]; then + fn_dl_hash + # Execute file if run is set. + if [ "${run}" == "run" ]; then + # shellcheck source=/dev/null + source "${local_filedir}/${local_filename}" + fi + fi +} + +# GitHub file download modules. +# Used to simplify downloading specific files from GitHub. + +# github_file_url_dir: the directory of the file in the GitHub: lgsm/modules +# github_file_url_name: the filename of the file to download from GitHub: core_messages.sh +# github_file_url_dir: the directory of the file in the GitHub: lgsm/modules +# github_file_url_name: the filename of the file to download from GitHub: core_messages.sh +# githuburl: the full GitHub url + +# remote_fileurl: The URL of the file: http://example.com/dl/File.tar.bz2 +# local_filedir: location the file is to be saved: /home/server/lgsm/tmp +# local_filename: name of file (this can be different from the url name): file.tar.bz2 +# chmodx: Optional, set to "chmodx" to make file executable using chmod +x +# run: Optional, set run to execute the file after download +# forcedl: Optional, force re-download of file even if exists +# hash: Optional, set an hash sum and will compare it against the file. + +# Fetches files from the Git repo. +fn_fetch_file_github() { + github_file_url_dir="${1}" + github_file_url_name="${2}" + # 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="${3}" + local_filename="${github_file_url_name}" + chmodx="${4:-0}" + run="${5:-0}" + forcedl="${6:-0}" + hash="${7:-0}" + # 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_check_file_github() { + github_file_url_dir="${1}" + github_file_url_name="${2}" + 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" + fn_check_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${github_file_url_name}" +} + +# Fetches config files from the Git repo. +fn_fetch_config() { + github_file_url_dir="${1}" + github_file_url_name="${2}" + # 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="${3}" + local_filename="${4}" + chmodx="nochmodx" + run="norun" + 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}" +} + +# Fetches modules from the Git repo during first download. +fn_fetch_module() { + github_file_url_dir="lgsm/modules" + github_file_url_name="${modulefile}" + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "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}" +} + +# Fetches modules from the Git repo during update-lgsm. +fn_update_module() { + github_file_url_dir="lgsm/modules" + github_file_url_name="${modulefile}" + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "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="norun" + 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}" + +} + +# Function to download latest github release. +# $1 GitHub user / organisation. +# $2 Repo name. +# $3 Destination for download. +# $4 Search string in releases (needed if there are more files that can be downloaded from the release pages). +fn_dl_latest_release_github() { + local githubreleaseuser="${1}" + local githubreleaserepo="${2}" + local githubreleasedownloadpath="${3}" + local githubreleasesearch="${4}" + local githublatestreleaseurl="https://api.github.com/repos/${githubreleaseuser}/${githubreleaserepo}/releases/latest" + + # Get last github release. + # If no search for the release filename is set, just get the first file from the latest release. + if [ -z "${githubreleasesearch}" ]; then + githubreleaseassets=$(curl -s "${githublatestreleaseurl}" | jq '[ .assets[] ]') + else + githubreleaseassets=$(curl -s "${githublatestreleaseurl}" | jq "[ .assets[]|select(.browser_download_url | contains(\"${githubreleasesearch}\")) ]") + fi + + # Check how many releases we got from the api and exit if we have more then one. + if [ "$(echo -e "${githubreleaseassets}" | jq '. | length')" -gt 1 ]; then + fn_print_fatal_nl "Found more than one release to download - Please report this to the LinuxGSM issue tracker" + fn_script_log_fail "Found more than one release to download - Please report this to the LinuxGSM issue tracker" + else + # Set variables for download via fn_fetch_file. + githubreleasefilename=$(echo -e "${githubreleaseassets}" | jq -r '.[]name') + githubreleasedownloadlink=$(echo -e "${githubreleaseassets}" | jq -r '.[]browser_download_url') + + # Error if no version is there. + if [ -z "${githubreleasefilename}" ]; then + fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fail "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + else + # Fetch file from the remote location from the existing module to the ${tmpdir} for now. + fn_fetch_file "${githubreleasedownloadlink}" "" "${githubreleasefilename}" "" "${githubreleasedownloadpath}" "${githubreleasefilename}" + fi + fi +} diff --git a/lgsm/modules/core_exit.sh b/lgsm/modules/core_exit.sh new file mode 100644 index 000000000..5f55dfcd1 --- /dev/null +++ b/lgsm/modules/core_exit.sh @@ -0,0 +1,65 @@ +#!/bin/bash +# LinuxGSM core_exit.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles exiting of LinuxGSM by running and reporting an exit code. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_exit_dev_debug() { + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "" + 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" + fi + fi +} + +# If running dependency check as root will remove any files that belong to root user. +if [ "$(whoami)" == "root" ]; then + find "${lgsmdir}"/ -group root -prune -exec rm -rf {} + > /dev/null 2>&1 + find "${logdir}"/ -group root -prune -exec rm -rf {} + > /dev/null 2>&1 +fi + +if [ "${exitbypass}" ]; then + unset exitbypass +elif [ "${exitcode}" -ne 0 ]; then + # List LinuxGSM version in logs + fn_script_log_info "LinuxGSM version: ${version}" + if [ "${exitcode}" -eq 1 ]; then + fn_script_log_fail "${moduleselfname} exiting with code: ${exitcode}" + elif [ "${exitcode}" -eq 2 ]; then + fn_script_log_error "${moduleselfname} exiting with code: ${exitcode}" + elif [ "${exitcode}" -eq 3 ]; then + fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}" + else + # if exit code is not set assume error. + fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}" + exitcode=4 + fi + fn_exit_dev_debug + # remove trap. + trap - INT + exit "${exitcode}" +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}" + fn_exit_dev_debug + # remove trap. + trap - INT + exit "${exitcode}" +else + # List LinuxGSM version in logs + fn_script_log_info "LinuxGSM version: ${version}" + fn_print_error "No exit code set" + fn_script_log_pass "${moduleselfname} exiting with code: NOT SET" + fn_exit_dev_debug + # remove trap. + trap - INT + exit "${exitcode}" +fi diff --git a/lgsm/modules/core_getopt.sh b/lgsm/modules/core_getopt.sh new file mode 100644 index 000000000..9a5704663 --- /dev/null +++ b/lgsm/modules/core_getopt.sh @@ -0,0 +1,218 @@ +#!/bin/bash +# LinuxGSM core_getopt.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: getopt arguments. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +### Define all commands here. +## User commands | Trigger commands | Description +# Standard commands. +cmd_install=("i;install" "command_install.sh" "Install the server.") +cmd_auto_install=("ai;auto-install" "fn_autoinstall" "Install the server without prompts.") +cmd_start=("st;start" "command_start.sh" "Start the server.") +cmd_stop=("sp;stop" "command_stop.sh" "Stop the server.") +cmd_restart=("r;restart" "command_restart.sh" "Restart the server.") +cmd_details=("dt;details" "command_details.sh" "Display server information.") +cmd_postdetails=("pd;postdetails" "command_postdetails.sh" "Post details to termbin.com (removing passwords).") +cmd_backup=("b;backup" "command_backup.sh" "Create backup archives of the server.") +cmd_update_linuxgsm=("ul;update-lgsm;uf;update-modules" "command_update_linuxgsm.sh" "Check and apply any LinuxGSM updates.") +cmd_test_alert=("ta;test-alert" "command_test_alert.sh" "Send a test alert.") +cmd_monitor=("m;monitor" "command_monitor.sh" "Check server status and restart if crashed.") +cmd_skeleton=("sk;skeleton" "command_skeleton.sh" "Create a skeleton directory.") +cmd_sponsor=("s;sponsor" "command_sponsor.sh" "Sponsorship options.") +cmd_send=("sd;send" "command_send.sh" "Send command to game server console.") +# Console servers only. +cmd_console=("c;console" "command_console.sh" "Access server console.") +cmd_debug=("d;debug" "command_debug.sh" "Start server directly in your terminal.") +# Update servers only. +cmd_update=("u;update" "command_update.sh" "Check and apply any server updates.") +cmd_check_update=("cu;check-update" "command_check_update.sh" "Check if a gameserver update is available") +cmd_force_update=("fu;force-update;update-restart;ur" "forceupdate=1; command_update.sh" "Apply server updates bypassing check.") +# SteamCMD servers only. +cmd_validate=("v;validate" "command_validate.sh" "Validate server files with SteamCMD.") +# Server with mods-install. +cmd_mods_install=("mi;mods-install" "command_mods_install.sh" "View and install available mods/addons.") +cmd_mods_remove=("mr;mods-remove" "command_mods_remove.sh" "View and remove an installed mod/addon.") +cmd_mods_update=("mu;mods-update" "command_mods_update.sh" "Update installed mods/addons.") +# Server specific. +cmd_change_password=("pw;change-password" "command_ts3_server_pass.sh" "Change TS3 serveradmin password.") +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_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.") +cmd_fastdl=("fd;fastdl" "command_fastdl.sh" "Build a FastDL directory.") +# Dev commands. +cmd_dev_debug=("dev;developer" "command_dev_debug.sh" "Enable developer Mode.") +cmd_dev_parse_game_details=("pgd;parse-game-details" "command_dev_parse_game_details.sh" "Display parsed gameserver details.") +cmd_dev_parse_distro_details=("pdd;parse-distro-details" "command_dev_parse_distro_details.sh" "Display parsed distro details.") +cmd_dev_detect_deps=("dd;detect-deps" "command_dev_detect_deps.sh" "Detect required dependencies.") +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. + +currentopt=("${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monitor[@]}" "${cmd_test_alert[@]}" "${cmd_details[@]}" "${cmd_postdetails[@]}" "${cmd_skeleton[@]}") + +# Update LinuxGSM. +currentopt+=("${cmd_update_linuxgsm[@]}") + +# Exclude noupdate games here. +if [ "${shortname}" == "jk2" ] || [ "${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. + if [ "${appid}" ] || [ "${shortname}" == "mta" ]; then + currentopt+=("${cmd_force_update[@]}") + fi + fi +fi + +# Validate and check-update command. +if [ "${appid}" ]; then + currentopt+=("${cmd_validate[@]}") +fi + +# Backup. +currentopt+=("${cmd_backup[@]}") + +# Console & Debug. +currentopt+=("${cmd_console[@]}" "${cmd_debug[@]}") + +# Console send. +if [ "${consoleinteract}" == "yes" ]; then + currentopt+=("${cmd_send[@]}") +fi + +## Game server exclusive commands. + +# FastDL command. +if [ "${engine}" == "source" ]; then + currentopt+=("${cmd_fastdl[@]}") +fi + +# TeamSpeak exclusive. +if [ "${shortname}" == "ts3" ]; then + currentopt+=("${cmd_change_password[@]}") +fi + +# Rust exclusive. +if [ "${shortname}" == "rust" ]; then + currentopt+=("${cmd_fullwipe[@]}" "${cmd_mapwipe[@]}") +fi + +# Unreal exclusive. +if [ "${engine}" == "unreal2" ]; then + if [ "${shortname}" == "ut2k4" ]; then + currentopt+=("${cmd_install_cdkey[@]}" "${cmd_map_compressor_u2[@]}") + else + currentopt+=("${cmd_map_compressor_u2[@]}") + fi +fi +if [ "${engine}" == "unreal" ]; then + currentopt+=("${cmd_map_compressor_u99[@]}") +fi + +# DST exclusive. +if [ "${shortname}" == "dst" ]; then + currentopt+=("${cmd_install_dst_token[@]}") +fi + +# MTA exclusive. +if [ "${shortname}" == "mta" ]; then + currentopt+=("${cmd_install_default_resources[@]}") +fi + +# Squad license exclusive. +if [ "${shortname}" == "squad" ]; then + currentopt+=("${cmd_install_squad_license[@]}") +fi + +## Mods commands. +if [ "${engine}" == "source" ] || [ "${shortname}" == "rust" ] || [ "${shortname}" == "hq" ] || [ "${shortname}" == "sdtd" ] || [ "${shortname}" == "cs" ] || [ "${shortname}" == "dod" ] || [ "${shortname}" == "tfc" ] || [ "${shortname}" == "ns" ] || [ "${shortname}" == "ts" ] || [ "${shortname}" == "hldm" ] || [ "${shortname}" == "vh" ]; then + currentopt+=("${cmd_mods_install[@]}" "${cmd_mods_remove[@]}" "${cmd_mods_update[@]}") +fi + +## Installer. +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_ui[@]}" "${cmd_dev_clear_modules[@]}") +fi + +## Sponsor. +currentopt+=("${cmd_sponsor[@]}") + +### Build list of available commands. +optcommands=() +index="0" +for ((index = "0"; index < ${#currentopt[@]}; index += 3)); do + cmdamount=$(echo -e "${currentopt[index]}" | awk -F ';' '{ print NF }') + for ((cmdindex = 1; cmdindex <= cmdamount; cmdindex++)); do + optcommands+=("$(echo -e "${currentopt[index]}" | awk -F ';' -v x=${cmdindex} '{ print $x }')") + done +done + +# Shows LinuxGSM usage. +fn_opt_usage() { + 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 + 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 + fn_script_log_pass "Display commands" + core_exit.sh +} + +# Check if command exists and run corresponding scripts, or display script usage. +if [ -z "${getopt}" ]; then + fn_opt_usage +fi +# If command exists. +for i in "${optcommands[@]}"; do + if [ "${i}" == "${getopt}" ]; then + # Seek and run command. + index="0" + for ((index = "0"; index < ${#currentopt[@]}; index += 3)); do + currcmdamount=$(echo -e "${currentopt[index]}" | awk -F ';' '{ print NF }') + for ((currcmdindex = 1; currcmdindex <= currcmdamount; currcmdindex++)); do + if [ "$(echo -e "${currentopt[index]}" | awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then + # Run command. + eval "${currentopt[index + 1]}" + # Exit should occur in modules. Should this not happen print an error + fn_print_error2_nl "Command did not exit correctly: ${getopt}" + fn_script_log_error "Command did not exit correctly: ${getopt}" + core_exit.sh + fi + done + done + fi +done + +# If we're executing this, it means command was not found. +fn_print_error2_nl "Unknown command: $0 ${getopt}" +fn_script_log_error "Unknown command: $0 ${getopt}" +fn_opt_usage +core_exit.sh diff --git a/lgsm/modules/core_github.sh b/lgsm/modules/core_github.sh new file mode 100644 index 000000000..3b3a96c0f --- /dev/null +++ b/lgsm/modules/core_github.sh @@ -0,0 +1,114 @@ +#!/bin/bash +# LinuxGSM core_github.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: core module file for updates via github + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +github_api="https://api.github.com" + +fn_githublocalversionfile() { + local githubreleaseuser="${1}" + local githubreleaserepo="${2}" + + githublocalversionfile="${datadir}/github-${githubreleaseuser}-${githubreleaserepo}-version" +} + +# $1 githubuser/group +# $2 github repo name +fn_github_get_latest_release_version() { + local githubreleaseuser="${1}" + local githubreleaserepo="${2}" + local githublatestreleaseurl="${github_api}/repos/${githubreleaseuser}/${githubreleaserepo}/releases/latest" + + githubreleaseversion=$(curl -s --connect-timeout 3 "${githublatestreleaseurl}" | jq '.tag_name') + + # error if no version is there + if [ -z "${githubreleaseversion}" ]; then + fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fail "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + fi +} + +# $1 githubuser/group +# $2 github repo name +fn_github_set_latest_release_version() { + local githubreleaseuser="${1}" + local githubreleaserepo="${2}" + + fn_githublocalversionfile "${githubreleaseuser}" "${githubreleaserepo}" + + local githublatestreleaseurl="${github_api}/repos/${githubreleaseuser}/${githubreleaserepo}/releases/latest" + githubreleaseversion=$(curl -s "${githublatestreleaseurl}" | jq -r '.tag_name') + + # error if no version is there + if [ -z "${githubreleaseversion}" ]; then + fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fail "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + else + echo "${githubreleaseversion}" > "${githublocalversionfile}" + fi +} + +# $1 githubuser/group +# $2 github repo name +fn_github_get_installed_version() { + local githubreleaseuser="${1}" + local githubreleaserepo="${2}" + + fn_githublocalversionfile "${githubreleaseuser}" "${githubreleaserepo}" + + githublocalversion=$(cat "${githublocalversionfile}") +} + +# $1 githubuser/group +# $2 github repo name +# if a update needs to be downloaded - updateneeded is set to 1 +fn_github_compare_version() { + local githubreleaseuser="${1}" + local githubreleaserepo="${2}" + exitcode=0 + updateneeded=0 + + fn_githublocalversionfile "${githubreleaseuser}" "${githubreleaserepo}" + local githublatestreleaseurl="${github_api}/repos/${githubreleaseuser}/${githubreleaserepo}/releases/latest" + + githublocalversion=$(cat "${githublocalversionfile}") + githubreleaseversion=$(curl -s "${githublatestreleaseurl}" | jq '.tag_name') + + # error if no version is there + if [ -z "${githubreleaseversion}" ]; then + fn_print_fail_nl "Can not get version from Github Api for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fail "Can not get version from Github Api for ${githubreleaseuser}/${githubreleaserepo}" + else + if [ "${githublocalversion}" == "${githubreleaseversion}" ]; then + echo -en "\n" + echo -e "No update from github.com/${githubreleaseuser}/${githubreleaserepo}/ available:" + echo -e "* Local build: ${red}${githublocalversion}${default}" + echo -e "* Remote build: ${green}${githubreleaseversion}${default}" + echo -en "\n" + else + # check if version that is installed is higher than the remote version to not override it + last_version=$(echo -e "${githublocalversion}\n${githubreleaseversion}" | sort -V | head -n1) + if [ "${githubreleaseversion}" == "${last_version}" ]; then + echo -en "\n" + echo -e "Update from github.com/${githubreleaseuser}/${githubreleaserepo}/ available:" + echo -e "* Local build: ${red}${githublocalversion}${default}" + echo -e "* Remote build: ${green}${githubreleaseversion}${default}" + echo -en "\n" + updateneeded=1 + else + # local version is higher than the remote version output this to the user + # strange case but could be possible, as a release could be removed from github + echo -en "\n" + echo -e "Local version is newer than the remote version" + echo -e "* Local version: ${green}${githublocalversion}${default}" + echo -e "* Remote version: ${green}${githubreleaseversion}${default}" + echo -en "\n" + exitcode=1 + fi + fi + fi +} diff --git a/lgsm/modules/core_legacy.sh b/lgsm/modules/core_legacy.sh new file mode 100644 index 000000000..4c9a55c39 --- /dev/null +++ b/lgsm/modules/core_legacy.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# LinuxGSM core_legacy.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Code for backwards compatability with older versions of LinuxGSM. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ -z "${socketname}" ]; then + socketname="${sessionname}" +fi + +if [ -n "${webadminuser}" ]; then + httpuser="${webadminuser}" +fi + +if [ -n "${webadminpass}" ]; then + httppassword="${webadminpass}" +fi + +if [ -n "${webadminport}" ]; then + httpport="${webadminport}" +fi + +if [ -n "${webadminip}" ]; then + httpip="${webadminip}" +fi + +if [ -n "${gameworld}" ]; then + worldname="${gameworld}" +fi + +if [ -n "${autosaveinterval}" ]; then + saveinterval="${autosaveinterval}" +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" +if [ -d "${lgsmdir}/functions" ]; then + if [ "$(find "${lgsmdir}/modules"/ -type f -mtime +"14" | wc -l)" -ne "0" ]; then + rm -rf "${lgsmdir:?}/functions" + fi +fi + +fn_parms() { + fn_reload_startparameters + parms="${startparameters}" +} diff --git a/lgsm/functions/core_logs.sh b/lgsm/modules/core_logs.sh similarity index 90% rename from lgsm/functions/core_logs.sh rename to lgsm/modules/core_logs.sh index 00c4d0662..7b435b563 100644 --- a/lgsm/functions/core_logs.sh +++ b/lgsm/modules/core_logs.sh @@ -1,11 +1,11 @@ #!/bin/bash -# LinuxGSM core_logs.sh function +# LinuxGSM core_logs.sh module # Author: Daniel Gibbs -# Contributor: UltimateByte +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Acts as a log rotator, removing old logs. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Check if logfile variable and file exist, create logfile if it doesn't exist. if [ "${consolelog}" ]; then @@ -16,7 +16,7 @@ fi # For games not displaying a console, and having logs into their game directory. check_status.sh -if [ "${status}" != "0" ]&&[ "${commandname}" == "START" ]&&[ -n "${gamelogfile}" ]; then +if [ "${status}" != "0" ] && [ "${commandname}" == "START" ] && [ -n "${gamelogfile}" ]; then if [ "$(find "${systemdir}" -name "gamelog*.log")" ]; then fn_print_info "Moving game logs to ${gamelogdir}" fn_script_log_info "Moving game logs to ${gamelogdir}" @@ -38,8 +38,14 @@ if [ "$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l)" -ne "0" ]; darkrplogdir="${systemdir}/data/darkrp_logs" legacyserverlogdir="${logdir}/server" # Setting up counting variables - scriptcount="0" ; consolecount="0" ; gamecount="0" ; srcdscount="0" ; smcount="0" ; ulxcount="0" ; darkrpcount="0" ; legacycount="0" - fn_sleep_time + scriptcount="0" + consolecount="0" + gamecount="0" + srcdscount="0" + smcount="0" + ulxcount="0" + darkrpcount="0" + legacycount="0" fn_print_info "Removing logs older than ${logdays} days" fn_script_log_info "Removing logs older than ${logdays} days" # Logging logfiles to be removed according to "${logdays}", counting and removing them. @@ -48,7 +54,7 @@ if [ "$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l)" -ne "0" ]; scriptcount=$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l) find "${lgsmlogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; # SRCDS and unreal logfiles. - if [ "${engine}" == "unreal2" ]||[ "${engine}" == "source" ]; then + if [ "${engine}" == "unreal2" ] || [ "${engine}" == "source" ]; then find "${gamelogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" gamecount=$(find "${gamelogdir}"/ -type f -mtime +"${logdays}" | wc -l) find "${gamelogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; diff --git a/lgsm/modules/core_messages.sh b/lgsm/modules/core_messages.sh new file mode 100644 index 000000000..37c2e98b5 --- /dev/null +++ b/lgsm/modules/core_messages.sh @@ -0,0 +1,577 @@ +#!/bin/bash +# LinuxGSM core_messages.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Defines on-screen messages such as [ OK ] and how script logs look. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# nl: new line: message is following by a new line. +# eol: end of line: message is placed at the end of the current line. +fn_ansi_loader() { + # carriage return. + creeol="\r" + if [ "${ansi}" != "off" ]; then + # echo colors + default="\e[0m" + black="\e[30m" + red="\e[31m" + lightred="\e[91m" + green="\e[32m" + lightgreen="\e[92m" + yellow="\e[33m" + lightyellow="\e[93m" + blue="\e[34m" + lightblue="\e[94m" + magenta="\e[35m" + lightmagenta="\e[95m" + cyan="\e[36m" + lightcyan="\e[96m" + darkgrey="\e[90m" + lightgrey="\e[37m" + white="\e[97m" + # 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() { + sleep "0.1" +} + +fn_sleep_time_05() { + sleep "0.5" +} + +fn_sleep_time_1() { + sleep "1" +} + +fn_sleep_time_5() { + sleep "5" +} + +fn_sleep_time_10() { + sleep "10" +} + +# Log display +######################## +## Feb 28 14:56:58 ut99-server: Monitor: +fn_script_log() { + if [ -d "${lgsmlogdir}" ]; then + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: ${1}" >> "${lgsmlog}" + else + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${1}" >> "${lgsmlog}" + fi + fi +} + +## Feb 28 14:56:58 ut99-server: Monitor: PASS: +fn_script_log_pass() { + fn_script_log "PASS: ${1}" + exitcode=0 +} + +## Feb 28 14:56:58 ut99-server: Monitor: FATAL: +fn_script_log_fail() { + fn_script_log "FAIL: ${1}" + exitcode=1 +} + +## Feb 28 14:56:58 ut99-server: Monitor: ERROR: +fn_script_log_error() { + fn_script_log "ERROR: ${1}" + exitcode=2 +} + +## Feb 28 14:56:58 ut99-server: Monitor: WARN: +fn_script_log_warn() { + fn_script_log "WARN: ${1}" + exitcode=3 +} + +## Feb 28 14:56:58 ut99-server: Monitor: INFO: +fn_script_log_info() { + fn_script_log "INFO: ${1}" +} + +# On-Screen - Automated functions +################################## + +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 "${bold}${creeol}[${color} ${type} ${default}]${default} ${commandaction} ${selfname}: ${message}${default}" + else + echo -en "${bold}${cree}[${color} ${type} ${default}]${default} ${message}${default}" + fi + fn_sleep_time +} + +fn_print_message_nl() { + local type="$1" + local color="$2" + local message="$3" + if [ "${commandaction}" ]; then + echo -e "${bold}${creeol}[${color} ${type} ${default}]${default} ${commandaction} ${selfname}: ${message}${default}" + else + 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 +} + +# [ OK ] +fn_print_ok() { + fn_print_message " OK " "${green}" "$*" +} + +fn_print_ok_nl() { + fn_print_message_nl " OK " "${green}" "$*" +} + +# [ FAIL ] +fn_print_fail() { + fn_print_message "FAIL" "${red}" "$*" +} + +fn_print_fail_nl() { + fn_print_message_nl "FAIL" "${red}" "$*" +} + +# [ ERROR ] +fn_print_error() { + fn_print_message "ERROR" "${red}" "$*" +} + +fn_print_error_nl() { + fn_print_message_nl "ERROR" "${red}" "$*" +} + +# [ WARN ] +fn_print_warn() { + fn_print_message "WARN" "${lightyellow}" "$*" +} + +fn_print_warn_nl() { + fn_print_message_nl "WARN" "${lightyellow}" "$*" +} + +# [ INFO ] +fn_print_info() { + fn_print_message "INFO" "${cyan}" "$*" +} + +fn_print_info_nl() { + 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() { + fn_print_message "START" "${lightgreen}" "$*" +} + +fn_print_start_nl() { + fn_print_message_nl "START" "${lightgreen}" "$*" +} + +# On-Screen - Interactive messages +################################## + +# Separator is different for details. +fn_messages_separator() { + if [ "${commandname}" == "DETAILS" ]; then + printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = + else + echo -e "${bold}=================================${default}" + fn_sleep_time + fi +} + +# No More Room in Hell Debug +# ================================= +fn_print_header() { + echo -e "" + echo -e "${bold}${lightyellow}${gamename} ${commandaction}${default}" + fn_messages_separator +} + +# Success! +fn_print_success() { + echo -en "${green}Success!${default} $*${default}" + fn_sleep_time +} + +fn_print_success_nl() { + echo -e "${green}Success!${default} $*${default}" + fn_sleep_time +} + +# Failure! +fn_print_failure() { + echo -en "${red}Failure!${default} $*${default}" + fn_sleep_time +} + +fn_print_failure_nl() { + echo -e "${red}Failure!${default} $*${default}" + fn_sleep_time +} + +# Error! +fn_print_error2() { + echo -en "${red}Error!${default} $*${default}" + fn_sleep_time +} + +fn_print_error2_nl() { + echo -e "${red}Error!${default} $*${default}" + fn_sleep_time +} + +# Warning! +fn_print_warning() { + echo -en "${lightyellow}Warning!${default} $*${default}" + fn_sleep_time +} + +fn_print_warning_nl() { + echo -e "${lightyellow}Warning!${default} $*${default}" + fn_sleep_time +} + +# Information! +fn_print_information() { + echo -en "${cyan}Information!${default} $*${default}" + fn_sleep_time +} + +fn_print_information_nl() { + 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" + + if [ "${initial}" == "Y" ]; then + prompt+=" [Y/n] " + elif [ "${initial}" == "N" ]; then + prompt+=" [y/N] " + else + prompt+=" [y/n] " + fi + + while true; do + read -e -i "${initial}" -p "${prompt}" -r yn + case "${yn}" in + [Yy] | [Yy][Ee][Ss]) return 0 ;; + [Nn] | [Nn][Oo]) return 1 ;; + *) echo -e "Please answer yes or no." ;; + esac + done +} + +# Prompt for message +fn_prompt_message() { + while true; do + unset prompt + local prompt="$1" + read -e -p "${prompt}" -r answer + if fn_prompt_yn "Continue" Y; then + break + fi + done + echo "${answer}" +} + +# On-Screen End of Line +################################## + +# YES +fn_print_yes_eol() { + echo -en " ... ${cyan}YES${default}" + fn_sleep_time +} + +fn_print_yes_eol_nl() { + echo -e " ... ${cyan}YES${default}" + fn_sleep_time +} + +# NO +fn_print_no_eol() { + echo -en " ... ${red}NO${default}" + fn_sleep_time +} + +fn_print_no_eol_nl() { + echo -e " ... ${red}NO${default}" + fn_sleep_time +} + +# OK +fn_print_ok_eol() { + echo -en " ... ${green}OK${default}" + fn_sleep_time +} + +fn_print_ok_eol_nl() { + echo -e " ... ${green}OK${default}" + fn_sleep_time +} + +# FAIL +fn_print_fail_eol() { + echo -en " ... ${red}FAIL${default}" + fn_sleep_time +} + +fn_print_fail_eol_nl() { + echo -e " ... ${red}FAIL${default}" + fn_sleep_time +} + +# ERROR +fn_print_error_eol() { + echo -en " ... ${red}ERROR${default}" + fn_sleep_time +} + +fn_print_error_eol_nl() { + echo -e " ... ${red}ERROR${default}" + fn_sleep_time +} + +# WAIT +fn_print_wait_eol() { + echo -en " ... ${cyan}WAIT${default}" + fn_sleep_time +} + +fn_print_wait_eol_nl() { + echo -e " ... ${cyan}WAIT${default}" + fn_sleep_time +} + +# WARN +fn_print_warn_eol() { + echo -en " ... ${lightyellow}WARN${default}" + fn_sleep_time +} + +fn_print_warn_eol_nl() { + echo -e " ... ${lightyellow}WARN${default}" + fn_sleep_time +} + +# INFO +fn_print_info_eol() { + echo -en " ... ${cyan}INFO${default}" + fn_sleep_time +} + +fn_print_info_eol_nl() { + echo -e " ... ${cyan}INFO${default}" + fn_sleep_time +} + +# QUERYING +fn_print_querying_eol() { + echo -en " ... ${cyan}QUERYING${default}" + fn_sleep_time_1 +} + +fn_print_querying_eol_nl() { + echo -e " ... ${cyan}QUERYING${default}" + fn_sleep_time_1 +} + +# CHECKING +fn_print_checking_eol() { + echo -en " ... ${cyan}CHECKING${default}" + fn_sleep_time_1 +} + +fn_print_checking_eol_nl() { + echo -e " ... ${cyan}CHECKING${default}" + fn_sleep_time_1 +} + +# DELAY +fn_print_delay_eol() { + echo -en " ... ${green}DELAY${default}" + fn_sleep_time_1 +} + +fn_print_delay_eol_nl() { + echo -e " ... ${green}DELAY${default}" + fn_sleep_time_1 +} + +# CANCELED +fn_print_canceled_eol() { + echo -en " ... ${lightyellow}CANCELED${default}" + fn_sleep_time_1 +} + +fn_print_canceled_eol_nl() { + echo -e " ... ${lightyellow}CANCELED${default}" + fn_sleep_time_1 +} + +# REMOVED +fn_print_removed_eol() { + echo -en " ... ${red}REMOVED${default}" + fn_sleep_time_1 +} + +fn_print_removed_eol_nl() { + echo -e " ... ${red}REMOVED${default}" + fn_sleep_time_1 +} + +# UPDATE +fn_print_update_eol() { + echo -en " ... ${lightblue}UPDATE${default}" + fn_sleep_time +} + +fn_print_update_eol_nl() { + 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 +} + +fn_print_ascii_logo() { + echo -e "" + echo -e " mdMMMMbm" + echo -e " mMMMMMMMMMMm" + echo -e " mMMMMMMMMMMMMm" + echo -e " mMMMMMMMMMMMMMMm" + echo -e " hMMMV^VMMV^VMMMh" + echo -e " MMMMM MM MMMMM" + echo -e " hMMs vv sMMh" + echo -e " hMMM: :MMMh" + echo -e " .hMMMh hMMMh." + echo -e " -dMMMh ${lightgrey}__${default} hMMMd-" + echo -e " :mMMMs ${lightgrey}||${default} sMMMm:" + echo -e " :MMMM+ ${lightgrey}||${default} ${red}_${default} +NMMN:" + echo -e " .mMMM+ ${lightgrey}========${default} +MMMm." + echo -e " yMMMy ${darkgrey}##############${default} yMMMy" + echo -e " mMMM: ${darkgrey}##############${default} :MMMm" + echo -e " mMM ${lightyellow}nn${default} ${lightyellow}nn${default} ${lightyellow}nn${default} ${lightyellow}nn${default} MMm" + echo -e " o ${lightyellow}nNNNNNNNn${default} ${lightyellow}nNNNNNNNn${default} o" + echo -e " ${lightyellow}nNNNNNNNNNn${default} ${lightyellow}nNNNNNNNNNn${default}" + echo -e " ${lightyellow}nNNNNNNNNNNN${default} ${lightyellow}NNNNNNNNNNNn${default}" + echo -e " ${lightyellow}+NNNNNNNNN:${default} ${lightyellow}:NNNNNNNNN+${default}" + echo -e " ${lightyellow}nNNNNNNN${default} /\ ${lightyellow}NNNNNNNn${default}" + echo -e " ${lightyellow}nnnnn${default} db ${lightyellow}nnnnn${default}" + echo -e "" + echo -e "${lightyellow}888${default} ${lightyellow}d8b${default} ${default}.d8888b. .d8888b. 888b d888" + echo -e "${lightyellow}888 Y8P ${default}d88P Y88b d88P Y88b 8888b d8888" + echo -e "${lightyellow}888${default} ${default}888${default} 888 Y88b. 88888b.d88888" + echo -e "${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}88888b.${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} 888 Y888b. 888Y88888P888" + echo -e "${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}88b${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}Y8bd8P${default} 888 88888 Y88b. 888 Y888P 888" + echo -e "${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}X88K${default} 888 888 888 888 Y8P 888" + echo -e "${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}Y88b${default} ${lightyellow}88Y${default} ${lightyellow}.d8pq8b.${default} Y88b d88P Y88b d88P 888 * 888" + echo -e "${lightyellow}LinuxGSM${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}Y8888Y${default} ${lightyellow}888${default} ${lightyellow}888${default} Y2012P88 Y8888P 888 888" + echo -e "" +} + +fn_print_restart_warning() { + fn_print_warn "${selfname} will be restarted" + fn_script_log_warn "${selfname} will be restarted" + totalseconds=3 + for seconds in {3..1}; do + fn_print_warn "${selfname} will be restarted: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + fn_sleep_time_1 + if [ "${seconds}" == "0" ]; then + break + fi + done + fn_print_warn_nl "${selfname} will be restarted" +} + +# 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 + +# Used to remember the command that ran first. +fn_firstcommand_set() { + if [ -z "${firstcommandname}" ]; then + firstcommandname="${commandname}" + firstcommandaction="${commandaction}" + fi +} + +# Used to reset commandname variables to the command the script ran first. +fn_firstcommand_reset() { + commandname="${firstcommandname}" + commandaction="${firstcommandaction}" +} diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh new file mode 100644 index 000000000..9907f6857 --- /dev/null +++ b/lgsm/modules/core_modules.sh @@ -0,0 +1,861 @@ +#!/bin/bash +# LinuxGSM core_modules.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Defines all modules to allow download and execution of modules using fn_fetch_module. +# This module is called first before any other module. Without this file other modules will not load. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +modulesversion="v24.3.3" + +# Core + +core_dl.sh() { + modulefile="${FUNCNAME[0]}" + if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + fn_fetch_core_dl "lgsm/modules" "core_dl.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + else + fn_bootstrap_fetch_file_github "lgsm/modules" "core_dl.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + fi +} + +core_messages.sh() { + modulefile="${FUNCNAME[0]}" + if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + fn_fetch_core_dl "lgsm/modules" "core_messages.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + else + fn_bootstrap_fetch_file_github "lgsm/modules" "core_messages.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + fi +} + +core_legacy.sh() { + modulefile="${FUNCNAME[0]}" + if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + fn_fetch_core_dl "lgsm/modules" "core_legacy.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + else + fn_bootstrap_fetch_file_github "lgsm/modules" "core_legacy.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + fi +} + +core_exit.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module + 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() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +core_trap.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +core_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +core_github.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Commands + +command_backup.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_console.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_debug.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_details.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_sponsor.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_postdetails.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_test_alert.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_monitor.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_start.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_stop.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_validate.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_install.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_install_resources_mta.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_squad_license.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_mods_install.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_mods_update.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_mods_remove.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_fastdl.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_ts3_server_pass.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_restart.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_skeleton.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_wipe.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_send.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Checks + +check.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_config.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_deps.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_executable.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_glibc.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_ip.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_last_update.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_logs.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_permissions.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_root.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_status.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_system_dir.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_system_requirements.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_tmuxception.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_version.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Compress + +compress_unreal2_maps.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +compress_ut99_maps.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Mods + +mods_list.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +mods_core.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Dev + +command_dev_clear_modules.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_debug.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_parse_game_details.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_parse_distro_details.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_detect_deps.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_detect_glibc.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_detect_ldd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_ui.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_query_raw.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Fix + +fix.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ark.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_av.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_arma3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_armar.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_bt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_bo.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_cmw.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_csgo.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_dst.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_hw.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ins.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_kf.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_kf2.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_mcb.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_mta.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_nmrih.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_onset.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_pvr.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ro.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_rust.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_rw.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_sfc.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_sm.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_st.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_terraria.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_tf2.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ut3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_rust.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_samp.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_sdtd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_sof2.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_squad.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ts3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ut2k4.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ut.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_unt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_vh.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_wurm.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_xnt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_zmr.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Info + +info_distro.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +info_game.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +info_messages.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +info_stats.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Alert + +alert.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_discord.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_email.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_ifttt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_pushbullet.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_pushover.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_gotify.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_telegram.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_rocketchat.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_slack.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} +# Logs + +core_logs.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Query + +query_gamedig.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Update + +command_update_modules.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_update_linuxgsm.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_update.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_check_update.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_ts3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_mc.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_mcb.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_pmc.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_mta.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_fctr.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_jk2.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_vints.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_ut99.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_xnt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fn_update_modules.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# +## Installer modules +# + +fn_autoinstall() { + autoinstall=1 + command_install.sh +} + +install_complete.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_config.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_factorio_save.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_gamedig.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_dst_token.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_eula.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_gsquery.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_gslt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_header.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_logs.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_retry.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_server_dir.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} +install_server_files.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_stats.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_ts3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_ts3db.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_ut2k4.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_dl_ut2k4.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_ut2k4_key.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Calls code required for legacy servers +core_legacy.sh + +# Creates tmp dir if missing +if [ ! -d "${tmpdir}" ]; then + mkdir -p "${tmpdir}" +fi + +# Creates lock dir if missing +if [ ! -d "${lockdir}" ]; then + mkdir -p "${lockdir}" +fi + +# Creates data dir if missing +if [ ! -d "${datadir}" ]; then + mkdir -p "${datadir}" +fi + +# if $USER id missing set to whoami +if [ -z "${USER}" ]; then + USER="$(whoami)" +fi + +# Calls on-screen messages (bootstrap) +core_messages.sh + +#Calls file downloader (bootstrap) +core_dl.sh + +# Calls the global Ctrl-C trap +core_trap.sh diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh new file mode 100644 index 000000000..dad98a1e2 --- /dev/null +++ b/lgsm/modules/core_steamcmd.sh @@ -0,0 +1,430 @@ +#!/bin/bash +# LinuxGSM core_steamcmd.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Core modules for SteamCMD + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_install_steamcmd() { + if [ "${shortname}" == "ark" ] && [ "${installsteamcmd}" == "1" ]; then + steamcmddir="${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" + fi + if [ ! -d "${steamcmddir}" ]; then + mkdir -p "${steamcmddir}" + fi + fn_fetch_file "http://media.steampowered.com/client/steamcmd_linux.tar.gz" "" "" "" "${tmpdir}" "steamcmd_linux.tar.gz" "nochmodx" "norun" "noforce" "nohash" + fn_dl_extract "${tmpdir}" "steamcmd_linux.tar.gz" "${steamcmddir}" + chmod +x "${steamcmddir}/steamcmd.sh" +} + +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}" + 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 + core_exit.sh + fi + # Anonymous user is set if steamuser is missing. + if [ -z "${steamuser}" ]; then + if [ -d "${lgsmlogdir}" ]; then + fn_script_log_info "Using anonymous Steam login" + fi + steamuser="anonymous" + steampass='' + fi +} + +fn_check_steamcmd() { + # Checks if SteamCMD exists when starting or updating a server. + # 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 not installed" + fn_script_log_warn "SteamCMD is not installed" + fn_install_steamcmd + fi + elif [ "${commandname}" == "INSTALL" ]; then + fn_print "install SteamCMD" + fn_print_skip_eol_nl + fi +} + +fn_check_steamcmd_dir() { + # Worksround that pre-installs the correct steam directories to ensure all packages use the correct Standard. + # https://github.com/ValveSoftware/steam-for-linux/issues/6976#issuecomment-610446347 + + # Create Steam installation directory. + if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then + mkdir -p "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" + fi + + # Create common Steam directory. + if [ ! -d "${HOME}/.steam" ]; then + mkdir -p "${HOME}/.steam" + fi + + # Symbolic links to Steam installation directory. + if [ ! -L "${HOME}/.steam/root" ]; then + if [ -d "${HOME}/.steam/root" ]; then + rm -f "${HOME:?}/.steam/root" + fi + ln -s "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" "${HOME}/.steam/root" + fi + + if [ ! -L "${HOME}/.steam/steam" ]; then + if [ -d "${HOME}/.steam/steam" ]; then + rm -rf "${HOME}/.steam/steam" + fi + ln -s "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" "${HOME}/.steam/steam" + fi +} + +fn_check_steamcmd_dir_legacy() { + # Remove old Steam installation directories ~/Steam and ${rootdir}/steamcmd + if [ -d "${rootdir}/steamcmd" ] && [ "${steamcmddir}" == "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then + rm -rf "${rootdir:?}/steamcmd" + fi + + if [ -d "${HOME}/Steam" ] && [ "${steamcmddir}" == "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then + rm -rf "${HOME}/Steam" + fi +} + +fn_check_steamcmd_steamapp() { + # Check that steamapp directory fixes issue #3481 + if [ ! -d "${serverfiles}/steamapps" ]; then + mkdir -p "${serverfiles}/steamapps" + fi +} + +fn_check_steamcmd_ark() { + # Checks if SteamCMD exists in + # Engine/Binaries/ThirdParty/SteamCMD/Linux + # to allow ark mods to work + if [ ! -f "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamcmd.sh" ]; then + installsteamcmd=1 + if [ "${commandname}" == "INSTALL" ]; then + fn_install_steamcmd + else + fn_print_warn_nl "ARK mods SteamCMD is missing" + fn_script_log_warn "ARK mods SteamCMD is missing" + fn_install_steamcmd + fi + elif [ "${commandname}" == "INSTALL" ]; then + fn_print_information "ARK mods SteamCMD is already installed..." + fn_print_ok_eol_nl + fi +} + +fn_check_steamcmd_clear() { + # Will remove steamcmd dir if steamcmd package is installed. + if [ "$(command -v steamcmd 2> /dev/null)" ] && [ -d "${rootdir}/steamcmd" ]; then + rm -rf "${steamcmddir:?}" + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_script_log_fail "Removing ${rootdir}/steamcmd" + else + fn_script_log_pass "Removing ${rootdir}/steamcmd" + fi + fi +} + +fn_check_steamcmd_exec() { + if [ "$(command -v steamcmd 2> /dev/null)" ]; then + steamcmdcommand="steamcmd" + else + steamcmdcommand="./steamcmd.sh" + fi +} + +fn_update_steamcmd_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + fn_check_steamcmd_appmanifest + # Uses appmanifest to find local build. + localbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) + + # Checks if localbuild variable has been set. + if [ -z "${localbuild}" ]; then + fn_print_fail "Checking local build: ${remotelocation}: missing local build info" + fn_script_log_fail "Missing local build info" + core_exit.sh + else + fn_print_ok "Checking local build: ${remotelocation}" + fn_script_log_pass "Checking local build" + fi +} + +fn_update_steamcmd_remotebuild() { + # Get remote build info. + if [ -d "${steamcmddir}" ]; then + cd "${steamcmddir}" || exit + fi + + # Removes appinfo.vdf as a fix for not always getting up to date version info from SteamCMD. + if [ "$(find "${HOME}" -type f -name "appinfo.vdf" 2> /dev/null | wc -l)" -ne "0" ]; then + find "${HOME}" -type f -name "appinfo.vdf" -exec rm -f {} \; 2> /dev/null + fi + + # Set branch to public if no custom branch. + if [ -z "${branch}" ]; then + branch="public" + fi + + # added as was failing GitHub Actions test. Running SteamCMD twice seems to fix it. + 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_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 + 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 "${remotebuildversion}" ] || [ "${remotebuildversion}" == "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_steamcmd_compare() { + fn_print_dots "Checking for update: ${remotelocation}" + # Update has been found or force update. + if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${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}" + if [ -n "${branch}" ]; then + fn_print_nl "* Branch: ${branch}" + fi + if [ -n "${betapassword}" ]; then + fn_print_nl "* Branch password: ${betapassword}" + fi + 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}" + 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}" + + if [ "${commandname}" == "UPDATE" ]; then + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + fn_dl_steamcmd + # If server started. + else + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + fn_dl_steamcmd + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi + unset exitbypass + date +%s > "${lockdir:?}/last-updated.lock" + 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}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + fn_print_nl "* Branch: ${branch}" + fi + if [ -n "${betapassword}" ]; then + fn_print_nl "* Branch password: ${betapassword}" + fi + 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}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + if [ -n "${betapassword}" ]; then + fn_script_log_info "Branch password: ${betapassword}" + fi + fi +} + +fn_appmanifest_info() { + appmanifestfile=$(find -L "${serverfiles}/steamapps" -type f -name "appmanifest_${appid}.acf") + appmanifestfilewc=$(find -L "${serverfiles}/steamapps" -type f -name "appmanifest_${appid}.acf" | wc -l) +} + +fn_check_steamcmd_appmanifest() { + fn_appmanifest_info + # Multiple or no matching appmanifest files may sometimes be present. + if [ "${appmanifestfilewc}" -ge "2" ]; then + fn_print_error "Multiple appmanifest_${appid}.acf files found" + fn_script_log_error "Multiple appmanifest_${appid}.acf files found" + fn_print_dots "Removing x${appmanifestfilewc} appmanifest_${appid}.acf files" + for appfile in ${appmanifestfile}; do + rm -f "${appfile:?}" + done + appmanifestfilewc1="${appmanifestfilewc}" + fn_appmanifest_info + # if error can not be resolved. + 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" + fn_print_nl "* Check user permissions" + for appfile in ${appmanifestfile}; do + fn_print_nl " ${appfile}" + done + core_exit.sh + else + fn_print_ok "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files" + fn_script_log_pass "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files" + fn_print_info_nl "Forcing update to correct issue" + fn_script_log_info "Forcing update to correct issue" + fn_dl_steamcmd + fi + elif [ "${appmanifestfilewc}" -eq "0" ]; then + fn_print_error_nl "No appmanifest_${appid}.acf found" + fn_script_log_error "No appmanifest_${appid}.acf found" + fn_print_info_nl "Forcing update to correct issue" + fn_script_log_info "Forcing update to correct issue" + fn_dl_steamcmd + fn_appmanifest_info + if [ "${appmanifestfilewc}" -eq "0" ]; then + fn_print_fail_nl "Still no appmanifest_${appid}.acf found" + fn_script_log_fail "Still no appmanifest_${appid}.acf found" + core_exit.sh + fi + fi + + # Checking for half completed updates. + bytesdownloaded=$(grep BytesDownloaded "${appmanifestfile}" | tr -cd '[:digit:]') + bytestodownload=$(grep BytesToDownload "${appmanifestfile}" | tr -cd '[:digit:]') + if [ "${bytesdownloaded}" != "${bytestodownload}" ]; then + fn_print_error_nl "BytesDownloaded and BytesToDownload do not match" + fn_script_log_error "BytesDownloaded and BytesToDownload do not match" + fn_print_info_nl "Forcing update to correct issue" + fn_script_log_info "Forcing update to correct issue" + fn_dl_steamcmd + fi + + bytesstaged=$(grep BytesStaged "${appmanifestfile}" | tr -cd '[:digit:]') + bytestostage=$(grep BytesToStage "${appmanifestfile}" | tr -cd '[:digit:]') + if [ "${bytesstaged}" != "${bytestostage}" ]; then + fn_print_error_nl "BytesStaged and BytesToStage do not match" + fn_script_log_error "BytesStaged and BytesToStage do not match" + fn_print_info_nl "Forcing update to correct issue" + fn_script_log_info "Forcing update to correct issue" + fn_dl_steamcmd + fi + + # if engine is GoldSrc check SharedDepots exists in appmanifest_90.acf + if [ "${engine}" == "goldsrc" ]; then + shareddepotsexists=$(grep -c SharedDepots "${serverfiles}/steamapps/appmanifest_90.acf") + if [ ! -f "${serverfiles}/steamapps/appmanifest_90.acf" ] || [ "${shareddepotsexists}" == "0" ]; then + fn_print_error_nl "SharedDepots missing from appmanifest_90.acf" + fn_script_log_error "SharedDepots missing from appmanifest_90.acf" + fn_print_info_nl "Forcing update to correct issue" + fn_script_log_info "Forcing update to correct issue" + if [ "${shortname}" == "ahl" ]; then + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "bb" ]; then + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "cscz" ]; then + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_80.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "css" ]; then + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "dmc" ]; then + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_40.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "dod" ]; then + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_30.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "hldm" ]; then + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "ns" ]; then + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "opfor" ]; then + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_50.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "ricochet" ]; then + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_60.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "tfc" ]; then + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_20.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "ts" ]; then + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "vs" ]; then + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fi + fn_dl_steamcmd + fi + fi +} diff --git a/lgsm/modules/core_trap.sh b/lgsm/modules/core_trap.sh new file mode 100644 index 000000000..4b66b3937 --- /dev/null +++ b/lgsm/modules/core_trap.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# LinuxGSM core_trap.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles CTRL-C trap to give an exit code. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_exit_trap() { + if [ -z "${exitcode}" ]; then + exitcode=$? + fi + echo -e "" + if [ -z "${exitcode}" ]; then + exitcode=0 + fi + core_exit.sh +} + +# trap to give an exit code. +trap fn_exit_trap INT diff --git a/lgsm/modules/fix.sh b/lgsm/modules/fix.sh new file mode 100644 index 000000000..f31030779 --- /dev/null +++ b/lgsm/modules/fix.sh @@ -0,0 +1,88 @@ +#!/bin/bash +# LinuxGSM fix.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Overall module for managing fixes. +# Runs modules that will fix an issue. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Messages that are displayed for some fixes. +fn_fix_msg_start() { + fn_print_dots "Applying ${fixname} fix: ${gamename}" + fn_print_info "Applying ${fixname} fix: ${gamename}" + fn_script_log_info "Applying ${fixname} fix: ${gamename}" +} + +fn_fix_msg_start_nl() { + fn_print_dots "Applying ${fixname} fix: ${gamename}" + fn_print_info_nl "Applying ${fixname} fix: ${gamename}" + fn_script_log_info "Applying ${fixname} fix: ${gamename}" +} + +fn_fix_msg_end() { + exirtcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_print_error_nl "Applying ${fixname} fix: ${gamename}" + fn_script_log_error "Applying ${fixname} fix: ${gamename}" + else + fn_print_ok_nl "Applying ${fixname} fix: ${gamename}" + fn_script_log_pass "Applying ${fixname} fix: ${gamename}" + fi +} + +fn_exists_fix() { + local short="${1:?}" + + if [ "$(type -t "fix_${short}.sh")" == 'function' ]; then + return 0 + else + return 1 + fi +} + +fn_apply_fix() { + local phase_message="${1:?}" + local short="${2:?}" + + if fn_exists_fix "${short}"; then + "fix_${short}.sh" + else + fn_print_error_nl "${shortname} is marked to apply pre start fix but there is no fix registered" + fi +} + +apply_pre_start_fix=(arma3 armar ark av bt bo csgo cmw dst hw ins kf nmrih onset pvr ro rust rw samp sdtd sfc sm sof2 squad st tf2 terraria ts3 mcb mta unt vh wurm xnt zmr) +apply_post_install_fix=(av kf kf2 ro ut2k4 ut ut3) + +# validate registered fixes for safe development +for fix in "${apply_pre_start_fix[@]}" "${apply_post_install_fix[@]}"; do + if ! fn_exists_fix "${fix}"; then + fn_print_fail_nl "fix_${fix}.sh is registered but doesn't exist. Typo or did you miss to modify core_modules.sh?" + exitcode=1 + core_exit.sh + fi +done + +# Fixes that are run on start. +if [ "${commandname}" != "INSTALL" ] && [ -z "${fixbypass}" ]; then + if [ "${appid}" ]; then + fix_steamcmd.sh + fi + + if grep -qEe "(^|\s)${shortname}(\s|$)" <<< "${apply_pre_start_fix[@]}"; then + fn_apply_fix "pre start" "${shortname}" + fi +fi + +# Fixes that are run on install only. +if [ "${commandname}" == "INSTALL" ]; then + if grep -qEe "(^|\s)${shortname}(\s|$)" <<< "${apply_post_install_fix[@]}"; then + echo -e "" + echo -e "${bold}${lightyellow}Applying Post-Install Fixes${default}" + fn_messages_separator + postinstall=1 + fn_apply_fix "post install" "${shortname}" + fi +fi diff --git a/lgsm/functions/fix_ark.sh b/lgsm/modules/fix_ark.sh similarity index 72% rename from lgsm/functions/fix_ark.sh rename to lgsm/modules/fix_ark.sh index 3c1355b1e..366d137dd 100644 --- a/lgsm/functions/fix_ark.sh +++ b/lgsm/modules/fix_ark.sh @@ -1,24 +1,29 @@ #!/bin/bash -# LinuxGSM fix_ark.sh function +# LinuxGSM fix_ark.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with ARK: Survival Evolved. +# Description: Resolves issues with ARK: Survival Evolved. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # removes mulitple appworkshop_346110.acf if found. -steamappsfilewc=$(find ${HOME} -name appworkshop_346110.acf | wc -l) +steamappsfilewc="$(find "${HOME}" -name appworkshop_346110.acf | wc -l)" if [ "${steamappsfilewc}" -gt "1" ]; then fixname="multiple appworkshop acf files" fn_fix_msg_start - find ${HOME} -name appworkshop_346110.acf -exec rm -f {} \; + find "${HOME}" -name appworkshop_346110.acf -exec rm -f {} \; fn_fix_msg_end elif [ "${steamappsfilewc}" -eq "1" ]; then # Steam mods directory selecter # 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}") - steamappspath=$(cd "${steamappsdir}"|| return; cd ../;pwd) + steamappspath=$( + cd "${steamappsdir}" || return + cd ../ + pwd + ) # removes the symlink if exists. # fixes issue with older versions of LinuxGSM linking to /home/arkserver/steamcmd @@ -40,7 +45,7 @@ elif [ "${steamappsfilewc}" -eq "1" ]; then fi # if the steamapps symlink is incorrect unlink it. - if [ -d "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" ]&&[ -L "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ]&&[ "$(readlink ${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps)" != "${steamappspath}" ]; then + if [ -d "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" ] && [ -L "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ] && [ "$(readlink "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps")" != "${steamappspath}" ]; then fixname="incorrect steamapps symlink" fn_fix_msg_start unlink "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" diff --git a/lgsm/modules/fix_arma3.sh b/lgsm/modules/fix_arma3.sh new file mode 100644 index 000000000..66f5ebe5d --- /dev/null +++ b/lgsm/modules/fix_arma3.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# LinuxGSM fix_arma3.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with ARMA3. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: 20150 Segmentation fault (core dumped) error. +if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3" ] || [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3 - Other Profiles" ]; then + fixname="20150 Segmentation fault (core dumped)" + fn_fix_msg_start + mkdir -p "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3 - Other Profiles" + fn_fix_msg_end +fi diff --git a/lgsm/modules/fix_armar.sh b/lgsm/modules/fix_armar.sh new file mode 100755 index 000000000..c2bb8fbdb --- /dev/null +++ b/lgsm/modules/fix_armar.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# LinuxGSM fix_armar.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Arma Reforger. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: Profile directory doesn't exist. +# Issue Link: https://feedback.bistudio.com/T164845 +if [ ! -d "${serverprofilefullpath}" ]; then + fixname="Profile directory doesn't exist" + fn_fix_msg_start + mkdir -p "${serverprofilefullpath}" + fn_fix_msg_end +fi diff --git a/lgsm/modules/fix_av.sh b/lgsm/modules/fix_av.sh new file mode 100644 index 000000000..ea225810c --- /dev/null +++ b/lgsm/modules/fix_av.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# LinuxGSM fix_av.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Avorion. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" + +# Generates the server config if it doesn't exist. +if [ ! -f "${servercfgfullpath}" ]; then + startparameters="--datapath ${avdatapath} --galaxy-name ${selfname} --init-folders-only" + fn_print_information "starting ${gamename} server to generate configs." + cd "${systemdir}" || exit + eval "${executable} ${startparameters}" +fi diff --git a/lgsm/modules/fix_bo.sh b/lgsm/modules/fix_bo.sh new file mode 100644 index 000000000..5d74f27de --- /dev/null +++ b/lgsm/modules/fix_bo.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_hw.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Ballistic Overkill. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/BODS_Data/Plugins/x86_64" diff --git a/lgsm/modules/fix_bt.sh b/lgsm/modules/fix_bt.sh new file mode 100755 index 000000000..107c84458 --- /dev/null +++ b/lgsm/modules/fix_bt.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# LinuxGSM fix_bt.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Barotrauma. + +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 + fixname="Missing user data directory error." + fn_fix_msg_start + mkdir -p "${XDG_DATA_HOME:="${HOME}/.local/share"}/Daedalic Entertainment GmbH/Barotrauma" + fn_fix_msg_end +fi + +# check if startscript is with windows line endings and reformat it +if file -b "${serverfiles}${executable:1}" | grep -q CRLF; then + fixname="Convert ${executable:2} to unix file format" + fn_fix_msg_start + dos2unix -q "${serverfiles}${executable:1}" + fn_fix_msg_end +fi diff --git a/lgsm/modules/fix_cmw.sh b/lgsm/modules/fix_cmw.sh new file mode 100644 index 000000000..413bfbc33 --- /dev/null +++ b/lgsm/modules/fix_cmw.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# LinuxGSM fix_cmw.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Chivalry: Medieval Warfare. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ ! -f "${executabledir}/steam_appid.txt" ]; then + fixname="steam_appid.txt" + fn_fix_msg_start + echo 219640 > "${executabledir}/steam_appid.txt" + fn_fix_msg_end +fi + +if [ ! -f "${servercfgfullpath}" ]; then + fn_fix_msg_start + fixname="copy config" + if [ ! -d "${servercfgdir}" ]; then + mkdir -p "${servercfgdir}" + fi + cp "${systemdir}/UDKGame/Config/"*.ini "${servercfgdir}" + fn_fix_msg_end +fi diff --git a/lgsm/functions/fix_csgo.sh b/lgsm/modules/fix_csgo.sh similarity index 65% rename from lgsm/functions/fix_csgo.sh rename to lgsm/modules/fix_csgo.sh index 6b213d388..8f5550ab5 100644 --- a/lgsm/functions/fix_csgo.sh +++ b/lgsm/modules/fix_csgo.sh @@ -1,10 +1,11 @@ #!/bin/bash -# LinuxGSM fix_csgo.sh function +# LinuxGSM fix_csgo.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with CS:GO. +# Description: Resolves issues with Counter-Strike: Global Offensive. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: server not always creating steam_appid.txt file. if [ ! -f "${serverfiles}/steam_appid.txt" ]; then @@ -30,3 +31,12 @@ if [ -f "${servercfgdir}/valve.rc" ] && grep -E '^\s*exec\s*(default|joystick)\. sed -i 's/^\s*exec\s*joystick.cfg/\/\/exec joystick.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1 fn_fix_msg_end fi + +# Fixes: Detected engine 11 but could not load: /home/csgo/serverfiles/bin/libgcc_s.so.1: version `GCC_7.0.0' not found (required by /lib/i386-linux-gnu/libstdc++.so.6) +libgccc_so="${serverfiles}/bin/libgcc_s.so.1" +if [ -f "${libgccc_so}" ]; then + fixname="libgcc_s.so.1 move away" + fn_fix_msg_start + mv "${libgccc_so}" "${libgccc_so}.bak" + fn_fix_msg_end +fi diff --git a/lgsm/functions/fix_dst.sh b/lgsm/modules/fix_dst.sh similarity index 61% rename from lgsm/functions/fix_dst.sh rename to lgsm/modules/fix_dst.sh index b203e1cd8..2848fa5bb 100644 --- a/lgsm/functions/fix_dst.sh +++ b/lgsm/modules/fix_dst.sh @@ -1,14 +1,15 @@ #!/bin/bash -# LinuxGSM fix_dst.sh function +# LinuxGSM fix_dst.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Don't Starve Together. +# Description: Resolves issues with Don't Starve Together. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: ./dontstarve_dedicated_server_nullrenderer: ./lib32/libcurl-gnutls.so.4: no version information available (required by ./dontstarve_dedicated_server_nullrenderer). # Issue only occures on CentOS as libcurl-gnutls.so.4 is called libcurl.so.4 on CentOS. -if [ -f "/etc/redhat-release" ]&&[ ! -f "${serverfiles}/bin/lib32/libcurl-gnutls.so.4" ]; then +if [ -f "/etc/redhat-release" ] && [ ! -f "${serverfiles}/bin/lib32/libcurl-gnutls.so.4" ]; then fixname="libcurl-gnutls.so.4" fn_fix_msg_start ln -s "/usr/lib/libcurl.so.4" "${serverfiles}/bin/lib32/libcurl-gnutls.so.4" diff --git a/lgsm/modules/fix_hw.sh b/lgsm/modules/fix_hw.sh new file mode 100644 index 000000000..c7d209bb6 --- /dev/null +++ b/lgsm/modules/fix_hw.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_hw.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Hurtworld. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/Hurtworld_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_ins.sh b/lgsm/modules/fix_ins.sh similarity index 70% rename from lgsm/functions/fix_ins.sh rename to lgsm/modules/fix_ins.sh index f41dffbd4..1d1423c6b 100644 --- a/lgsm/functions/fix_ins.sh +++ b/lgsm/modules/fix_ins.sh @@ -1,10 +1,11 @@ #!/bin/bash -# LinuxGSM fix_ins.sh function +# LinuxGSM fix_ins.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Insurgency. +# Description: Resolves issues with Insurgency. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: ./srcds_linux: error while loading shared libraries: libtier0.so: cannot open shared object file: No such file or directory. diff --git a/lgsm/modules/fix_kf.sh b/lgsm/modules/fix_kf.sh new file mode 100644 index 000000000..00b99e06c --- /dev/null +++ b/lgsm/modules/fix_kf.sh @@ -0,0 +1,117 @@ +#!/bin/bash +# LinuxGSM fix_kf.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Killing Floor. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# echo -e "applying WebAdmin ROOst.css fix." +# echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" +sed -i 's/none}/none;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" +sed -i 's/underline}/underline;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" +# echo -e "applying WebAdmin CharSet fix." +# echo -e "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" +sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/UWeb.int" + +# get md5sum of steamclient.so +if [ -f "${serverfiles}/System/steamclient.so" ]; then + steamclientmd5=$(md5sum "${serverfiles}/System/steamclient.so" | awk '{print $1;}') +fi +#get md5sum of libtier0_s.so +if [ -f "${serverfiles}/System/libtier0_s.so" ]; then + libtier0_smd5=$(md5sum "${serverfiles}/System/libtier0_s.so" | awk '{print $1;}') +fi +#get md5sum of libvstdlib_s.so +if [ -f "${serverfiles}/System/libvstdlib_s.so" ]; then + libvstdlib_smd5=$(md5sum "${serverfiles}/System/libvstdlib_s.so" | awk '{print $1;}') +fi + +# get md5sum of steamclient.so from steamcmd +if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then + steamcmdsteamclientmd5=$(md5sum "${HOME}/.steam/steamcmd/linux32/steamclient.so" | awk '{print $1;}') +elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then + steamcmdsteamclientmd5=$(md5sum "${steamcmddir}/linux32/steamclient.so" | awk '{print $1;}') +elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" ]; then + steamcmdsteamclientmd5=$(md5sum "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" | awk '{print $1;}') +fi + +# get md5sum of libtier0_s.so from steamcmd +if [ -f "${HOME}/.steam/steamcmd/linux32/libtier0_s.so" ]; then + steamcmdlibtier0_smd5=$(md5sum "${HOME}/.steam/steamcmd/linux32/libtier0_s.so" | awk '{print $1;}') +elif [ -f "${steamcmddir}/linux32/libtier0_s.so" ]; then + steamcmdlibtier0_smd5=$(md5sum "${steamcmddir}/linux32/libtier0_s.so" | awk '{print $1;}') +elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/libtier0_s.so" ]; then + steamcmdlibtier0_smd5=$(md5sum "${HOME}/.local/share/Steam/steamcmd/linux32/libtier0_s.so" | awk '{print $1;}') +fi + +# get md5sum of libvstdlib_s.so from steamcmd +if [ -f "${HOME}/.steam/steamcmd/linux32/libvstdlib_s.so" ]; then + steamcmdlibvstdlib_smd5=$(md5sum "${HOME}/.steam/steamcmd/linux32/libvstdlib_s.so" | awk '{print $1;}') +elif [ -f "${steamcmddir}/linux32/libvstdlib_s.so" ]; then + steamcmdlibvstdlib_smd5=$(md5sum "${steamcmddir}/linux32/libvstdlib_s.so" | awk '{print $1;}') +elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/libvstdlib_s.so" ]; then + steamcmdlibvstdlib_smd5=$(md5sum "${HOME}/.local/share/Steam/steamcmd/linux32/libvstdlib_s.so" | awk '{print $1;}') +fi + +if [ ! -f "${serverfiles}/System/steamclient.so" ] || [ "${steamcmdsteamclientmd5}" != "${steamclientmd5}" ]; then + fixname="steamclient.so x86" + fn_fix_msg_start + if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then + cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/System/steamclient.so" + elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then + cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/System/steamclient.so" + elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" ]; then + cp "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" "${serverfiles}/System/steamclient.so" + fi + fn_fix_msg_end +fi + +if [ ! -f "${serverfiles}/System/libtier0_s.so" ] || [ "${steamcmdlibtier0_smd5}" != "${libtier0_smd5}" ]; then + fixname="libtier0_s.so" + fn_fix_msg_start + if [ -f "${HOME}/.steam/steamcmd/linux32/libtier0_s.so" ]; then + cp "${HOME}/.steam/steamcmd/linux32/libtier0_s.so" "${serverfiles}/System/libtier0_s.so" + elif [ -f "${steamcmddir}/linux32/libtier0_s.so" ]; then + cp "${steamcmddir}/linux32/libtier0_s.so" "${serverfiles}/System/libtier0_s.so" + elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/libtier0_s.so" ]; then + cp "${HOME}/.local/share/Steam/steamcmd/linux32/libtier0_s.so" "${serverfiles}/System/libtier0_s.so" + fi + fn_fix_msg_end +fi + +if [ ! -f "${serverfiles}/System/libvstdlib_s.so" ] || [ "${steamcmdlibvstdlib_smd5}" != "${libvstdlib_smd5}" ]; then + fixname="libvstdlib_s.so" + fn_fix_msg_start + if [ -f "${HOME}/.steam/steamcmd/linux32/libvstdlib_s.so" ]; then + cp "${HOME}/.steam/steamcmd/linux32/libvstdlib_s.so" "${serverfiles}/System/libvstdlib_s.so" + elif [ -f "${steamcmddir}/linux32/libvstdlib_s.so" ]; then + cp "${steamcmddir}/linux32/libvstdlib_s.so" "${serverfiles}/System/libvstdlib_s.so" + elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/libvstdlib_s.so" ]; then + cp "${HOME}/.local/share/Steam/steamcmd/linux32/libvstdlib_s.so" "${serverfiles}/System/libvstdlib_s.so" + fi + fn_fix_msg_end +fi + +# if running install command +if [ "${commandname}" == "INSTALL" ]; then + echo -e "applying server name fix." + fn_sleep_time + echo -e "forcing server restart..." + fn_sleep_time + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fn_sleep_time_5 + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fn_sleep_time_5 + exitbypass=1 + command_stop.sh + fn_firstcommand_reset +fi diff --git a/lgsm/modules/fix_kf2.sh b/lgsm/modules/fix_kf2.sh new file mode 100644 index 000000000..495e9d70e --- /dev/null +++ b/lgsm/modules/fix_kf2.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LinuxGSM fix_kf2.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Killing Floor 2. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +startparameters="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\"" + +fn_print_information "starting ${gamename} server to generate configs." +exitbypass=1 +command_start.sh +fn_firstcommand_reset +fn_sleep_time_10 +exitbypass=1 +command_stop.sh +fn_firstcommand_reset diff --git a/lgsm/functions/fix_mcb.sh b/lgsm/modules/fix_mcb.sh similarity index 52% rename from lgsm/functions/fix_mcb.sh rename to lgsm/modules/fix_mcb.sh index 691647fb7..bc84d84e1 100644 --- a/lgsm/functions/fix_mcb.sh +++ b/lgsm/modules/fix_mcb.sh @@ -1,10 +1,11 @@ #!/bin/bash -# LinuxGSM fix_mcb.sh function +# LinuxGSM fix_mcb.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves possible startup issue with Minecraft Bedrock. +# Description: Resolves various issues with Minecraft Bedrock. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # official docs state that the server should be started with: LD_LIBRARY_PATH=. ./bedrock_server export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" diff --git a/lgsm/functions/fix_mta.sh b/lgsm/modules/fix_mta.sh similarity index 63% rename from lgsm/functions/fix_mta.sh rename to lgsm/modules/fix_mta.sh index 549101a68..2fff69691 100644 --- a/lgsm/functions/fix_mta.sh +++ b/lgsm/modules/fix_mta.sh @@ -1,16 +1,15 @@ #!/bin/bash -# LinuxGSM fix_mta.sh function +# LinuxGSM fix_mta.sh module # Author: Daniel Gibbs -# Contributor: ChaosMTA +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Installs the libmysqlclient for database functions on the server. +# Description: Resolves various issues with Multi Theft Auto. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -f "${lgsmdir}/lib/libmysqlclient.so.16" ]; then fixname="libmysqlclient16" fn_fix_msg_start_nl - fn_sleep_time fn_fetch_file "https://nightly.mtasa.com/files/modules/64/libmysqlclient.so.16" "" "" "" "${lgsmdir}/lib" "libmysqlclient.so.16" "chmodx" "norun" "noforce" "6c188e0f8fb5d7a29f4bc413b9fed6c2" fn_fix_msg_end fi diff --git a/lgsm/modules/fix_nmrih.sh b/lgsm/modules/fix_nmrih.sh new file mode 100644 index 000000000..4eb76c24e --- /dev/null +++ b/lgsm/modules/fix_nmrih.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# LinuxGSM fix_nmrih.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Create symlinks for renamed No More Room In Hell serverfiles. +# Solution from Steam Community post: https://steamcommunity.com/app/224260/discussions/2/1732089092441769414/ + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ ! -f "${serverfiles}/bin/vphysics.so" ]; then + ln -s "${serverfiles}/bin/vphysics_srv.so" "${serverfiles}/bin/vphysics.so" +fi +if [ ! -f "${serverfiles}/bin/studiorender.so" ]; then + ln -s "${serverfiles}/bin/studiorender_srv.so" "${serverfiles}/bin/studiorender.so" +fi +if [ ! -f "${serverfiles}/bin/soundemittersystem.so" ]; then + ln -s "${serverfiles}/bin/soundemittersystem_srv.so" "${serverfiles}/bin/soundemittersystem.so" +fi +if [ ! -f "${serverfiles}/bin/shaderapiempty.so" ]; then + ln -s "${serverfiles}/bin/shaderapiempty_srv.so" "${serverfiles}/bin/shaderapiempty.so" +fi +if [ ! -f "${serverfiles}/bin/scenefilecache.so" ]; then + ln -s "${serverfiles}/bin/scenefilecache_srv.so" "${serverfiles}/bin/scenefilecache.so" +fi +if [ ! -f "${serverfiles}/bin/replay.so" ]; then + ln -s "${serverfiles}/bin/replay_srv.so" "${serverfiles}/bin/replay.so" +fi +if [ ! -f "${serverfiles}/bin/materialsystem.so" ]; then + ln -s "${serverfiles}/bin/materialsystem_srv.so" "${serverfiles}/bin/materialsystem.so" +fi diff --git a/lgsm/functions/fix_onset.sh b/lgsm/modules/fix_onset.sh similarity index 63% rename from lgsm/functions/fix_onset.sh rename to lgsm/modules/fix_onset.sh index 630245844..6430e5d6b 100644 --- a/lgsm/functions/fix_onset.sh +++ b/lgsm/modules/fix_onset.sh @@ -1,16 +1,17 @@ #!/bin/bash -# LinuxGSM fix_onset.sh function -# Author: Frédéric C. +# LinuxGSM fix_onset.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Resolves various issues with Onset. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" # 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. -if [ -f "/etc/redhat-release" ]&&[ ! -f "${serverfiles}/libmariadbclient.so.18" ]&&[ -f "/usr/lib64/libmariadb.so.3" ]; then +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 ln -s "/usr/lib64/libmariadb.so.3" "${serverfiles}/libmariadbclient.so.18" diff --git a/lgsm/modules/fix_pvr.sh b/lgsm/modules/fix_pvr.sh new file mode 100644 index 000000000..e4409bc37 --- /dev/null +++ b/lgsm/modules/fix_pvr.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# LinuxGSM fix_pvr.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Pavlov VR. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ ! -f "${serverfiles}/linux64/libc++.so" ] && [ -f "/usr/lib/x86_64-linux-gnu/libc++.so.1" ]; then + cp "/usr/lib/x86_64-linux-gnu/libc++.so.1" "${serverfiles}/linux64/libc++.so" +fi + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" diff --git a/lgsm/modules/fix_ro.sh b/lgsm/modules/fix_ro.sh new file mode 100644 index 000000000..8b9bee442 --- /dev/null +++ b/lgsm/modules/fix_ro.sh @@ -0,0 +1,117 @@ +#!/bin/bash +# LinuxGSM fix_ro.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Red Orchestra: Ostfront 41-45. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# echo -e "applying WebAdmin ROOst.css fix." +# echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" +sed -i 's/none}/none;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" +sed -i 's/underline}/underline;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" +# echo -e "applying WebAdmin CharSet fix." +# echo -e "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" +sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/uweb.int" + +# get md5sum of steamclient.so +if [ -f "${serverfiles}/system/steamclient.so" ]; then + steamclientmd5=$(md5sum "${serverfiles}/system/steamclient.so" | awk '{print $1;}') +fi +#get md5sum of libtier0_s.so +if [ -f "${serverfiles}/system/libtier0_s.so" ]; then + libtier0_smd5=$(md5sum "${serverfiles}/system/libtier0_s.so" | awk '{print $1;}') +fi +#get md5sum of libvstdlib_s.so +if [ -f "${serverfiles}/system/libvstdlib_s.so" ]; then + libvstdlib_smd5=$(md5sum "${serverfiles}/system/libvstdlib_s.so" | awk '{print $1;}') +fi + +# get md5sum of steamclient.so from steamcmd +if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then + steamcmdsteamclientmd5=$(md5sum "${HOME}/.steam/steamcmd/linux32/steamclient.so" | awk '{print $1;}') +elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then + steamcmdsteamclientmd5=$(md5sum "${steamcmddir}/linux32/steamclient.so" | awk '{print $1;}') +elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" ]; then + steamcmdsteamclientmd5=$(md5sum "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" | awk '{print $1;}') +fi + +# get md5sum of libtier0_s.so from steamcmd +if [ -f "${HOME}/.steam/steamcmd/linux32/libtier0_s.so" ]; then + steamcmdlibtier0_smd5=$(md5sum "${HOME}/.steam/steamcmd/linux32/libtier0_s.so" | awk '{print $1;}') +elif [ -f "${steamcmddir}/linux32/libtier0_s.so" ]; then + steamcmdlibtier0_smd5=$(md5sum "${steamcmddir}/linux32/libtier0_s.so" | awk '{print $1;}') +elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/libtier0_s.so" ]; then + steamcmdlibtier0_smd5=$(md5sum "${HOME}/.local/share/Steam/steamcmd/linux32/libtier0_s.so" | awk '{print $1;}') +fi + +# get md5sum of libvstdlib_s.so from steamcmd +if [ -f "${HOME}/.steam/steamcmd/linux32/libvstdlib_s.so" ]; then + steamcmdlibvstdlib_smd5=$(md5sum "${HOME}/.steam/steamcmd/linux32/libvstdlib_s.so" | awk '{print $1;}') +elif [ -f "${steamcmddir}/linux32/libvstdlib_s.so" ]; then + steamcmdlibvstdlib_smd5=$(md5sum "${steamcmddir}/linux32/libvstdlib_s.so" | awk '{print $1;}') +elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/libvstdlib_s.so" ]; then + steamcmdlibvstdlib_smd5=$(md5sum "${HOME}/.local/share/Steam/steamcmd/linux32/libvstdlib_s.so" | awk '{print $1;}') +fi + +if [ ! -f "${serverfiles}/system/steamclient.so" ] || [ "${steamcmdsteamclientmd5}" != "${steamclientmd5}" ]; then + fixname="steamclient.so x86" + fn_fix_msg_start + if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then + cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/system/steamclient.so" + elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then + cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/system/steamclient.so" + elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" ]; then + cp "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" "${serverfiles}/system/steamclient.so" + fi + fn_fix_msg_end +fi + +if [ ! -f "${serverfiles}/system/libtier0_s.so" ] || [ "${steamcmdlibtier0_smd5}" != "${libtier0_smd5}" ]; then + fixname="libtier0_s.so" + fn_fix_msg_start + if [ -f "${HOME}/.steam/steamcmd/linux32/libtier0_s.so" ]; then + cp "${HOME}/.steam/steamcmd/linux32/libtier0_s.so" "${serverfiles}/system/libtier0_s.so" + elif [ -f "${steamcmddir}/linux32/libtier0_s.so" ]; then + cp "${steamcmddir}/linux32/libtier0_s.so" "${serverfiles}/system/libtier0_s.so" + elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/libtier0_s.so" ]; then + cp "${HOME}/.local/share/Steam/steamcmd/linux32/libtier0_s.so" "${serverfiles}/system/libtier0_s.so" + fi + fn_fix_msg_end +fi + +if [ ! -f "${serverfiles}/system/libvstdlib_s.so" ] || [ "${steamcmdlibvstdlib_smd5}" != "${libvstdlib_smd5}" ]; then + fixname="libvstdlib_s.so" + fn_fix_msg_start + if [ -f "${HOME}/.steam/steamcmd/linux32/libvstdlib_s.so" ]; then + cp "${HOME}/.steam/steamcmd/linux32/libvstdlib_s.so" "${serverfiles}/system/libvstdlib_s.so" + elif [ -f "${steamcmddir}/linux32/libvstdlib_s.so" ]; then + cp "${steamcmddir}/linux32/libvstdlib_s.so" "${serverfiles}/system/libvstdlib_s.so" + elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/libvstdlib_s.so" ]; then + cp "${HOME}/.local/share/Steam/steamcmd/linux32/libvstdlib_s.so" "${serverfiles}/system/libvstdlib_s.so" + fi + fn_fix_msg_end +fi + +# if running install command +if [ "${commandname}" == "INSTALL" ]; then + echo -e "applying server name fix." + fn_sleep_time + echo -e "forcing server restart..." + fn_sleep_time + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fn_sleep_time_5 + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fn_sleep_time_5 + exitbypass=1 + command_stop.sh + fn_firstcommand_reset +fi diff --git a/lgsm/modules/fix_rust.sh b/lgsm/modules/fix_rust.sh new file mode 100644 index 000000000..80c790a59 --- /dev/null +++ b/lgsm/modules/fix_rust.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# LinuxGSM fix_rust.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Rust. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: [Raknet] Server Shutting Down (Shutting Down). +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/RustDedicated_Data/Plugins/x86_64" + +# Part of random seed feature. +# 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" + seed="$(cat "${datadir}/${selfname}-seed.txt")" + fn_print_info_nl "Generating new random seed (${cyan}${seed}${default})" + fn_script_log_pass "Generating new random seed (${cyan}${seed}${default})" + fi + seed="$(cat "${datadir}/${selfname}-seed.txt")" + randomseed=1 +fi + +# If Carbon mod is installed, run enviroment.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" + # shellcheck source=/dev/null + source "${serverfiles}/carbon/tools/environment.sh" +fi + +# fix for #4268 +# insert set -g default-terminal "screen-256color" into ~/.tmux.conf +if [ -f "${serverfiles}/RustDedicated_Data/Managed/Oxide.Rust.dll" ]; then + # tmux version is 3.3 or higher + tmuxvdigit="$(tmux -V | sed "s/tmux //" | sed -n '1 p' | tr -cd '[:digit:]')" + if [ "${tmuxvdigit}" -ge "33" ]; then + if [ ! -f "${HOME}/.tmux.conf" ]; then + touch "${HOME}/.tmux.conf" + fi + if ! grep -q "set -g default-terminal \"screen-256color\"" "${HOME}/.tmux.conf"; then + fixname="tmux screen-256color" + fn_fix_msg_start + echo "set -g default-terminal \"screen-256color\"" >> "${HOME}/.tmux.conf" + fn_fix_msg_end + fi + fi +fi diff --git a/lgsm/modules/fix_rw.sh b/lgsm/modules/fix_rw.sh new file mode 100644 index 000000000..dee15dedb --- /dev/null +++ b/lgsm/modules/fix_rw.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_rw.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Rising World. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" diff --git a/lgsm/modules/fix_samp.sh b/lgsm/modules/fix_samp.sh new file mode 100644 index 000000000..e193485d7 --- /dev/null +++ b/lgsm/modules/fix_samp.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# LinuxGSM fix_sfc.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issue that the default rcon password is not changed. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ -f "${servercfgfullpath}" ]; then + # check if default password is set "changeme" + currentpass=$(grep -E "^rcon_password" "${servercfgfullpath}" | sed 's/^rcon_password //') + defaultpass="changeme" + # check if default password is set + if [ "${currentpass}" == "${defaultpass}" ]; then + fixname="change default rcon password" + fn_fix_msg_start + fn_script_log_info "Changing rcon/admin password." + randomstring=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2> /dev/null | head -c 8 | xargs) + rconpass="admin${randomstring}" + sed -i "s/rcon_password changeme/rcon_password ${rconpass}/g" "${servercfgfullpath}" + fn_fix_msg_end + fi + # check if the hostname is the default name + currenthostname=$(grep -E "^hostname" "${servercfgfullpath}" | sed 's/^hostname //') + defaulthostname="SA-MP 0.3 Server" + if [ "${currenthostname}" == "${defaulthostname}" ]; then + fixname="change default hostname" + fn_fix_msg_start + fn_script_log_info "Changing default hostname to LinuxGSM" + sed -i "s/hostname ${defaulthostname}/hostname LinuxGSM/g" "${servercfgfullpath}" + fn_fix_msg_end + fi +fi diff --git a/lgsm/modules/fix_sdtd.sh b/lgsm/modules/fix_sdtd.sh new file mode 100644 index 000000000..2b4620687 --- /dev/null +++ b/lgsm/modules/fix_sdtd.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_sdtd.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with 7 Days to Die. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}/7DaysToDieServer_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_sfc.sh b/lgsm/modules/fix_sfc.sh similarity index 88% rename from lgsm/functions/fix_sfc.sh rename to lgsm/modules/fix_sfc.sh index 874d6eca7..70e5d0484 100644 --- a/lgsm/functions/fix_sfc.sh +++ b/lgsm/modules/fix_sfc.sh @@ -1,10 +1,11 @@ #!/bin/bash -# LinuxGSM fix_sfc.sh function +# LinuxGSM fix_sfc.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Source Forts Classic. +# Description: Resolves issues with Source Forts Classic. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -f "${serverfiles}/bin/datacache.so" ]; then ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so" diff --git a/lgsm/modules/fix_sm.sh b/lgsm/modules/fix_sm.sh new file mode 100644 index 000000000..d75ca8c78 --- /dev/null +++ b/lgsm/modules/fix_sm.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_sm.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Unturned. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" diff --git a/lgsm/modules/fix_sof2.sh b/lgsm/modules/fix_sof2.sh new file mode 100644 index 000000000..45e3b299c --- /dev/null +++ b/lgsm/modules/fix_sof2.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# LinuxGSM fix_rust.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Soldier of Fortune 2. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: error while loading shared libraries: libcxa.so.1 +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" diff --git a/lgsm/modules/fix_squad.sh b/lgsm/modules/fix_squad.sh new file mode 100644 index 000000000..b9ee76a8d --- /dev/null +++ b/lgsm/modules/fix_squad.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# LinuxGSM fix_squad.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Squad. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# As the server base dir changed for the game, we need to migrate the default config from the old to the new location +oldservercfg="${serverfiles}/Squad/ServerConfig/${servercfg}" +if [ -f "${oldservercfg}" ] && [ -f "${servercfgfullpath}" ]; then + # diff old and new config - if it is different move the old config over the new one + if [ "$(diff -c "${oldservercfg}" "${servercfgfullpath}" | wc -l)" -gt 0 ]; then + fixname="Migrate server config to new Game folder" + fn_fix_msg_start + mv -v "${oldservercfg}" "${servercfgfullpath}" + fn_fix_msg_end + else + fixname="remove the same config from old configdir" + fn_fix_msg_start + rm -f "${oldservercfg}" + fn_fix_msg_end + + fi +fi diff --git a/lgsm/modules/fix_st.sh b/lgsm/modules/fix_st.sh new file mode 100644 index 000000000..bbd9890bd --- /dev/null +++ b/lgsm/modules/fix_st.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# LinuxGSM fix_rust.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Stationeers. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: [Raknet] Server Shutting Down (Shutting Down). +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/rocketstation_DedicatedServer_Data/Plugins/x86_64" diff --git a/lgsm/modules/fix_steamcmd.sh b/lgsm/modules/fix_steamcmd.sh new file mode 100644 index 000000000..0ba5c85b2 --- /dev/null +++ b/lgsm/modules/fix_steamcmd.sh @@ -0,0 +1,141 @@ +#!/bin/bash +# LinuxGSM fix_steamcmd.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with SteamCMD. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# function to simplify the steamclient.so fix +# example +# fn_fix_steamclient_so 32|64 (bit) "${serverfiles}/linux32/" +fn_fix_steamclient_so() { + # $1 type of fix 32 or 64 as possible values + # $2 as destination where the lib will be copied to + if [ "$1" == "32" ]; then + # steamclient.so x86 fix. + if [ ! -f "${2}/steamclient.so" ]; then + fixname="steamclient.so x86" + fn_fix_msg_start + if [ ! -d "${2}" ]; then + mkdir -p "${2}" + fi + if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then + cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${2}/steamclient.so" + elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then + cp "${steamcmddir}/linux32/steamclient.so" "${2}/steamclient.so" + elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" ]; then + cp "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" "${2}/steamclient.so" + fi + fn_fix_msg_end + fi + elif [ "$1" == "64" ]; then + # steamclient.so x86_64 fix. + if [ ! -f "${2}/steamclient.so" ]; then + fixname="steamclient.so x86_64" + fn_fix_msg_start + if [ ! -d "${2}" ]; then + mkdir -p "${2}" + fi + if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then + cp "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${2}/steamclient.so" + elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then + cp "${steamcmddir}/linux64/steamclient.so" "${2}/steamclient.so" + elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux64/steamclient.so" ]; then + cp "${HOME}/.local/share/Steam/steamcmd/linux64/steamclient.so" "${2}/steamclient.so" + fi + fn_fix_msg_end + fi + fi +} + +# Helps fix: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so. +steamsdk64="${HOME}/.steam/sdk64" +steamclientsdk64="${steamsdk64}/steamclient.so" +# remove any old unlinked versions of steamclient.so +if [ -f "${steamclientsdk64}" ]; then + if [ "$(stat -c '%h' "${steamclientsdk64}")" -eq 1 ]; then + fixname="steamclient.so sdk64 - remove old file" + fn_fix_msg_start + rm -f "${steamclientsdk64}" + fn_fix_msg_end + fi +fi + +# place new hardlink for the file to the disk +if [ ! -f "${steamclientsdk64}" ]; then + fixname="steamclient.so sdk64 hardlink" + fn_fix_msg_start + if [ ! -d "${steamsdk64}" ]; then + mkdir -p "${steamsdk64}" + fi + if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then + ln "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${steamclientsdk64}" + elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then + ln "${steamcmddir}/linux64/steamclient.so" "${steamclientsdk64}" + elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux64/steamclient.so" ]; then + ln "${HOME}/.local/share/Steam/steamcmd/linux64/steamclient.so" "${steamclientsdk64}" + else + fn_print_fail_nl "Could not copy any steamclient.so 64bit for the gameserver" + fi + fn_fix_msg_end +fi + +# Helps fix: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so. +steamsdk32="${HOME}/.steam/sdk32" +steamclientsdk32="${HOME}/.steam/sdk32/steamclient.so" +if [ -f "${steamclientsdk32}" ]; then + if [ " $(stat -c '%h' "${steamclientsdk32}")" -eq 1 ]; then + fixname="steamclient.so sdk32 - remove old file" + fn_fix_msg_start + rm -f "${steamclientsdk32}" + fn_fix_msg_end + fi +fi + +# place new hardlink for the file to the disk +if [ ! -f "${steamclientsdk32}" ]; then + fixname="steamclient.so sdk32 link" + fn_fix_msg_start + if [ ! -d "${steamsdk32}" ]; then + mkdir -p "${steamsdk32}" + fi + if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then + ln "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${steamclientsdk32}" + elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then + ln "${steamcmddir}/linux32/steamclient.so" "${steamclientsdk32}" + elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" ]; then + ln "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" "${steamclientsdk32}" + else + fn_print_fail_nl "Could not copy any steamclient.so 32bit for the gameserver" + fi + fn_fix_msg_end +fi + +# steamclient.so fixes +if [ "${shortname}" == "bo" ]; then + fn_fix_steamclient_so "32" "${serverfiles}/BODS_Data/Plugins/x86" + fn_fix_steamclient_so "64" "${serverfiles}/BODS_Data/Plugins/x86_64" +elif [ "${shortname}" == "cmw" ]; then + fn_fix_steamclient_so "32" "${executabledir}/lib" +elif [ "${shortname}" == "cs" ]; then + fn_fix_steamclient_so "32" "${serverfiles}" +elif [ "${shortname}" == "col" ]; then + fn_fix_steamclient_so "64" "${serverfiles}" +elif [ "${shortname}" == "ins" ]; then + fn_fix_steamclient_so "32" "${serverfiles}/bin" +elif [ "${shortname}" == "pz" ]; then + fn_fix_steamclient_so "32" "${serverfiles}/linux32" + fn_fix_steamclient_so "64" "${serverfiles}/linux64" +elif [ "${shortname}" == "pvr" ]; then + fn_fix_steamclient_so "64" "${executabledir}" +elif [ "${shortname}" == "ss3" ]; then + fn_fix_steamclient_so "32" "${serverfiles}/Bin" +elif [ "${shortname}" == "tu" ]; then + fn_fix_steamclient_so "64" "${executabledir}" +elif [ "${shortname}" == "unt" ]; then + fn_fix_steamclient_so "64" "${serverfiles}" +elif [ "${shortname}" == "wurm" ]; then + fn_fix_steamclient_so "64" "${serverfiles}/nativelibs" +fi diff --git a/lgsm/modules/fix_terraria.sh b/lgsm/modules/fix_terraria.sh new file mode 100644 index 000000000..0d45e257f --- /dev/null +++ b/lgsm/modules/fix_terraria.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_terraria.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Terraria. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export TERM=xterm diff --git a/lgsm/modules/fix_tf2.sh b/lgsm/modules/fix_tf2.sh new file mode 100644 index 000000000..105026488 --- /dev/null +++ b/lgsm/modules/fix_tf2.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# LinuxGSM fix_tf2.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Team Fortress 2. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: Team Fortress 2 Segmentation fault for Red-Hat Distros #2062. +if [ -f "/etc/redhat-release" ] && [ ! -f "${serverfiles}/bin/libcurl-gnutls.so.4" ]; then + fixname="libcurl-gnutls.so.4" + fn_fix_msg_start + ln -s "/usr/lib/libcurl.so.4" "${serverfiles}/bin/libcurl-gnutls.so.4" + fn_fix_msg_end +fi diff --git a/lgsm/modules/fix_ts3.sh b/lgsm/modules/fix_ts3.sh new file mode 100644 index 000000000..0f081cb37 --- /dev/null +++ b/lgsm/modules/fix_ts3.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# LinuxGSM fix_ts3.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Teamspeak 3. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Creates a blank ts3server.ini if it does not exist. +if [ ! -f "${servercfgfullpath}" ]; then + fixname="create blank ${servercfg}" + fn_fix_msg_start + touch "${servercfgfullpath}" + fn_fix_msg_end +fi + +# Accept license. +if [ ! -f "${executabledir}/.ts3server_license_accepted" ]; then + install_eula.sh +fi + +# Fixes: makes libmariadb2 available #1924. +if [ ! -f "${serverfiles}/libmariadb.so.2" ]; then + fixname="libmariadb.so.2" + fn_fix_msg_start + cp "${serverfiles}/redist/libmariadb.so.2" "${serverfiles}/libmariadb.so.2" + fn_fix_msg_end +fi + +# Fixes: failed to register local accounting service: No such file or directory. +accountingfile="/dev/shm/7gbhujb54g8z9hu43jre8" +if [ -f "${accountingfile}" ] && [ "${status}" == "0" ]; then + # Check permissions for the file if the current user owns it, if not exit. + if [ "$(stat -c %U ${accountingfile})" == "$(whoami)" ]; then + fixname="Delete file ${accountingfile}" + fn_fix_msg_start + rm -f "${accountingfile}" + fn_fix_msg_end + # file is not owned by the current user and needs to be deleted manually. + else + fn_print_error_nl "File ${accountingfile} is not owned by $(whoami) and needs to be deleted manually" + fn_script_log_fail "File ${accountingfile} is not owned by $(whoami) and needs to be deleted manually" + core_exit.sh + fi +fi diff --git a/lgsm/modules/fix_unt.sh b/lgsm/modules/fix_unt.sh new file mode 100644 index 000000000..dbe64ffd6 --- /dev/null +++ b/lgsm/modules/fix_unt.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_rust.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Unturned. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/Unturned_Headless_Data/Plugins/x86_64" diff --git a/lgsm/modules/fix_ut.sh b/lgsm/modules/fix_ut.sh new file mode 100644 index 000000000..3da5c068c --- /dev/null +++ b/lgsm/modules/fix_ut.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# LinuxGSM fix_ut.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Unreal Tournament. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +#Set Binary Executable +echo -e "chmod +x ${executabledir}/${executable}" +chmod +x "${executabledir}/${executable}" +fn_sleep_time diff --git a/lgsm/functions/fix_ut2k4.sh b/lgsm/modules/fix_ut2k4.sh similarity index 70% rename from lgsm/functions/fix_ut2k4.sh rename to lgsm/modules/fix_ut2k4.sh index fa2d29bf5..4b9d35011 100644 --- a/lgsm/functions/fix_ut2k4.sh +++ b/lgsm/modules/fix_ut2k4.sh @@ -1,10 +1,11 @@ #!/bin/bash -# LinuxGSM fix_ut2k4.sh function +# LinuxGSM fix_ut2k4.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Unreal Tournament 2004. +# Description: Resolves issues with Unreal Tournament 2004. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "applying WebAdmin ut2003.css fix." echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" @@ -21,11 +22,15 @@ echo -e "forcing server restart." fn_sleep_time exitbypass=1 command_start.sh -sleep 5 +fn_firstcommand_reset +fn_sleep_time_5 exitbypass=1 command_stop.sh +fn_firstcommand_reset exitbypass=1 command_start.sh -sleep 5 +fn_firstcommand_reset +fn_sleep_time_5 exitbypass=1 command_stop.sh +fn_firstcommand_reset diff --git a/lgsm/modules/fix_ut3.sh b/lgsm/modules/fix_ut3.sh new file mode 100644 index 000000000..aa5c5e464 --- /dev/null +++ b/lgsm/modules/fix_ut3.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LinuxGSM fix_ut2.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Unreal Tournament 3. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +startparameters="server VCTF-Suspense?Game=UTGameContent.UTVehicleCTFGame_Content?bIsDedicated=true?bIsLanMatch=false?bUsesStats=false?bShouldAdvertise=false?PureServer=1?bAllowJoinInProgress=true?ConfigSubDir=${selfname} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}" + +fn_print_information "starting ${gamename} server to generate configs." +exitbypass=1 +command_start.sh +fn_firstcommand_reset +fn_sleep_time_10 +exitbypass=1 +command_stop.sh +fn_firstcommand_reset diff --git a/lgsm/modules/fix_vh.sh b/lgsm/modules/fix_vh.sh new file mode 100644 index 000000000..7c1455443 --- /dev/null +++ b/lgsm/modules/fix_vh.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# LinuxGSM fix_rust.sh module +# Author: Alasdair Haig +# Website: https://linuxgsm.com +# Description: Resolves issues with Valheim. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH + +modsdir="${lgsmdir}/mods" +modsinstalledlistfullpath="${modsdir}/installed-mods.txt" +if [ -f "${modsinstalledlistfullpath}" ]; then + # special check if Valheim Plus is installed + if grep -qE "^valheimplus" "${modsinstalledlistfullpath}"; then + if ! grep -qE "^executable=\"./start_server_bepinex.sh\"" "${configdirserver}/${selfname}.cfg"; then + echo 'executable="./start_server_bepinex.sh"' >> "${configdirserver}/${selfname}.cfg" + executable="./start_server_bepinex.sh" + fi + if [ -d "${serverfiles}/unstripped_corlib" ]; 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" + fi + # special exports for BepInEx if installed + if grep -qE "^bepinexvh" "${modsinstalledlistfullpath}"; then + fn_print_info_nl "BepInEx install detected, applying start exports" + fn_script_log_info "BepInEx install detected, applying start exports" + # exports for BepInEx framework from script start_server_bepinex.sh + export DOORSTOP_ENABLE=TRUE + export DOORSTOP_INVOKE_DLL_PATH=./BepInEx/core/BepInEx.Preloader.dll + export DOORSTOP_CORLIB_OVERRIDE_PATH=./unstripped_corlib + + export LD_LIBRARY_PATH="./doorstop_libs:${LD_LIBRARY_PATH}" + export LD_PRELOAD="libdoorstop_x64.so:${LD_PRELOAD}" + + export SteamAppId=892970 + fi +fi diff --git a/lgsm/modules/fix_wurm.sh b/lgsm/modules/fix_wurm.sh new file mode 100644 index 000000000..6f17ccd76 --- /dev/null +++ b/lgsm/modules/fix_wurm.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# LinuxGSM fix_wurm.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issues with Wurm Unlimited. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# First run requires start with no parms. +# After first run new dirs are created. +if [ ! -d "${serverfiles}/Creative" ]; then + fixname="Copy Creative directory" + fn_fix_msg_start + cp -R "${serverfiles}/dist/Creative" "${serverfiles}/Creative" + fn_fix_msg_end +fi + +if [ ! -d "${serverfiles}/Adventure" ]; then + fixname="Copy Adventure directory" + fn_fix_msg_start + cp -R "${serverfiles}/dist/Adventure" "${serverfiles}/Adventure" + fn_fix_msg_end +fi diff --git a/lgsm/modules/fix_xnt.sh b/lgsm/modules/fix_xnt.sh new file mode 100644 index 000000000..44b51c5de --- /dev/null +++ b/lgsm/modules/fix_xnt.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# LinuxGSM fix_xnt.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Install Xonotic Default Config + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Create the directory if it doesn't exist +if [ ! -d "${systemdir}/${selfname}/data" ]; then + mkdir -p "${systemdir}/${selfname}/data" +fi diff --git a/lgsm/functions/fix_zmr.sh b/lgsm/modules/fix_zmr.sh similarity index 88% rename from lgsm/functions/fix_zmr.sh rename to lgsm/modules/fix_zmr.sh index 1825fa327..5b42eeccf 100644 --- a/lgsm/functions/fix_zmr.sh +++ b/lgsm/modules/fix_zmr.sh @@ -1,10 +1,11 @@ #!/bin/bash -# LinuxGSM fix_sfc.sh function +# LinuxGSM fix_sfc.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Zombie Master: Reborn. +# Description: Resolves issues with Zombie Master: Reborn. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -f "${serverfiles}/bin/datacache.so" ]; then ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so" diff --git a/lgsm/modules/info_distro.sh b/lgsm/modules/info_distro.sh new file mode 100644 index 000000000..67a9fd5df --- /dev/null +++ b/lgsm/modules/info_distro.sh @@ -0,0 +1,281 @@ +#!/bin/bash +# LinuxGSM info_distro.sh module +# 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. +# 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. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +### Game Server pid +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}')" + elif [ "${engine}" == "goldsrc" ]; then + hldslinuxpid="$(ps -ef | grep -v grep | grep "${gameserverpid}" | grep hlds_linux | awk '{print $2}')" + fi +fi +### Distro information + +## Distro +# Returns architecture, kernel and distro/os. +arch="$(uname -m)" # Architecture e.g. x86_64 +kernel="$(uname -r)" # Kernel e.g. 2.6.32-042stab120.16 + +# Gathers distro info from various sources filling in missing gaps. +distro_info_array=(os-release lsb_release hostnamectl debian_version redhat-release) +for distro_info in "${distro_info_array[@]}"; do + if [ -f "/etc/os-release" ] && [ "${distro_info}" == "os-release" ]; then + distroname="$(grep "PRETTY_NAME" /etc/os-release | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. Ubuntu 22.04.3 LTS + distroversion="$(grep "VERSION_ID" /etc/os-release | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. 22.04 + distroid="$(grep "ID=" /etc/os-release | grep -v _ID | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. ubuntu + distroidlike="$(grep "ID_LIKE=" /etc/os-release | grep -v _ID | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. debian + distrocodename="$(grep "VERSION_CODENAME" /etc/os-release | awk -F= '{gsub(/"/,"",$2);print $2}')" # e.g. jammy + # Special var for rhel like distros to remove point in number e.g 8.4 to just 8. + if [[ "${distroidlike}" == *"rhel"* ]] || [ "${distroid}" == "rhel" ]; then + distroversionrh="$(sed -nr 's/^VERSION_ID="([0-9]*).+?"/\1/p' /etc/os-release)" # e.g. 8 + fi + elif [ "$(command -v lsb_release 2> /dev/null)" ] && [ "${distro_info}" == "lsb_release" ]; then + if [ -z "${distroname}" ]; then + distroname="$(lsb_release -sd)" # e.g. Ubuntu 22.04.3 LTS + elif [ -z "${distroversion}" ]; then + distroversion="$(lsb_release -sr)" # e.g. 22.04 + elif [ -z "${distroid}" ]; then + distroid="$(lsb_release -si)" # e.g. Ubuntu + elif [ -z "${distrocodename}" ]; then + distrocodename="$(lsb_release -sc)" # e.g. jammy + fi + elif [ "$(command -v hostnamectl 2> /dev/null)" ] && [ "${distro_info}" == "hostnamectl" ]; then + if [ -z "${distroname}" ]; then + distroname="$(hostnamectl | grep "Operating System" | sed 's/Operating System: //g')" # e.g. Ubuntu 22.04.3 LTS + fi + elif [ -f "/etc/debian_version" ] && [ "${distro_info}" == "debian_version" ]; then + if [ -z "${distroname}" ]; then + distroname="Debian $(cat /etc/debian_version)" # e.g. Debian bookworm/sid + elif [ -z "${distroversion}" ]; then + distroversion="$(cat /etc/debian_version)" # e.g. bookworm/sid + elif [ -z "${distroid}" ]; then + distroid="debian" + fi + elif [ -f "/etc/redhat-release" ] && [ "${distro_info}" == "redhat-release" ]; then + if [ -z "${distroname}" ]; then + distroname="$(cat /etc/redhat-release)" # e.g. Rocky Linux release 9.2 (Blue Onyx) + elif [ -z "${distroversion}" ]; then + distroversion="$(rpm -qa \*-release | grep -Ei "oracle|redhat|centos|fedora|rocky|alma" | cut -d"-" -f3)" # e.g. 9.2 + elif [ -z "${distroid}" ]; then + distroid="$(awk '{print $1}' /etc/redhat-release)" # e.g. Rocky + fi + fi +done + +# Get virtual environment type. +if [ "$(command -v systemd-detect-virt 2> /dev/null)" ]; then + virtualenvironment="$(systemd-detect-virt)" # e.g. kvm +fi + +# distroversioncsv is used for selecting the correct distro csv in data directory +if [ -n "${distroversionrh}" ]; then + distroversioncsv="${distroversionrh}" # e.g. 8 +else + distroversioncsv="${distroversion}" # e.g. 22.04 +fi + +# Check if distro supported by distro vendor. +# distro-info available in debian based distros. +if [ "$(command -v distro-info 2> /dev/null)" ]; then + distrosunsupported="$(distro-info --unsupported)" + distrosunsupported_array=("${distrosunsupported}") + for distrounsupported in "${distrosunsupported_array[@]}"; do + if [ "${distrounsupported}" == "${distrocodename}" ]; then + distrosupport="unsupported" + break + else + distrosupport="supported" + fi + done +elif [[ "${distroidlike}" == *"rhel"* ]] || [ "${distroid}" == "rhel" ]; then + # RHEL/CentOS 7 EOL 2024-06-30. Will be unsupported after this date. + if [ "${distroversionrh}" -lt "8" ] && [ "$(date +%s)" -lt "1719705600" ]; then + distrosupport="unsupported" + else + distrosupport="supported" + fi +fi + +## Glibc version +glibcversion="$(ldd --version | sed -n '1s/.* //p')" # e.g: 2.17 + +## tmux version +if [ "$(command -V tmux 2> /dev/null)" ]; then + tmuxversion="$(tmux -V | awk '{print $2}')" # e.g: tmux 3.3 +fi + +if [ "$(command -V java 2> /dev/null)" ]; then + javaversion="$(java -version 2>&1 | grep "version")" # e.g: openjdk version "17.0.8.1" 2023-08-24 +fi + +if [ "$(command -v mono 2> /dev/null)" ]; then + monoversion="$(mono --version 2>&1 | grep -Po '(?<=version )\d')" # e.g: 6 +fi + +if [ "$(command -v dotnet 2> /dev/null)" ]; then + dotnetversion="$(dotnet --list-runtimes | grep -E 'Microsoft\.NETCore\.App' | awk '{print $2}')" # e.g: 6.0.0 +fi + +## Uptime +uptime="$(< /proc/uptime)" +uptime=${uptime/[. ]*/} +minutes="$((uptime / 60 % 60))" +hours="$((uptime / 60 / 60 % 24))" +days="$((uptime / 60 / 60 / 24))" + +### Performance information + +## Average server load +load="$(uptime | awk -F 'load average: ' '{ print $2 }')" # e.g 0.01, 0.05, 0.11 + +## CPU information +cpumodel="$(awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')" # e.g Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz +cpucores="$(awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo)" +cpufreqency="$(awk -F: '/cpu MHz/ {freq=$2} END {print freq}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')" # e.g 2394.503 +# CPU usage of the game server pid +if [ -n "${gameserverpid}" ]; then + cpuused="$(ps --forest -o pcpu -g "${gameserverpid}" | awk '{s+=$1} END {print s}')" # integer + cpuusedmhz="$(echo "${cpufreqency} * ${cpuused} / 100" | bc)" # integer +fi + +## Memory information +# Available RAM and swap. + +# Newer distros can use numfmt to give more accurate results. +if [ "$(command -v numfmt 2> /dev/null)" ]; then + # Issue #2005 - Kernel 3.14+ contains MemAvailable which should be used. All others will be calculated. + + # get the raw KB values of these fields. + physmemtotalkb="$(grep MemTotal /proc/meminfo | awk '{print $2}')" # integer + physmemfreekb="$(grep ^MemFree /proc/meminfo | awk '{print $2}')" # integer + physmembufferskb="$(grep ^Buffers /proc/meminfo | awk '{print $2}')" # integer + physmemcachedkb="$(grep ^Cached /proc/meminfo | awk '{print $2}')" # integer + physmemreclaimablekb="$(grep ^SReclaimable /proc/meminfo | awk '{print $2}')" # integer + + # check if MemAvailable Exists. + if grep -q ^MemAvailable /proc/meminfo; then + physmemactualfreekb="$(grep ^MemAvailable /proc/meminfo | awk '{print $2}')" # integer + else + physmemactualfreekb="$((physmemfreekb + physmembufferskb + physmemcachedkb))" # integer + fi + + # Available RAM and swap. + physmemtotalmb="$(((physmemtotalkb + 512) / 1024))" # integer # integer + physmemtotalgb="$(((physmemtotalmb + 512) / 1024))" # integer # integer + physmemtotal="$(numfmt --to=iec --from=iec --suffix=B "${physmemtotalkb}K")" # string + physmemfree="$(numfmt --to=iec --from=iec --suffix=B "${physmemactualfreekb}K")" # string + physmemused="$(numfmt --to=iec --from=iec --suffix=B "$((physmemtotalkb - physmemfreekb - physmembufferskb - physmemcachedkb - physmemreclaimablekb))K")" # string + physmemavailable="$(numfmt --to=iec --from=iec --suffix=B "${physmemactualfreekb}K")" # string + physmemcached="$(numfmt --to=iec --from=iec --suffix=B "$((physmemcachedkb + physmemreclaimablekb))K")" # string + + swaptotal="$(numfmt --to=iec --from=iec --suffix=B "$(grep ^SwapTotal /proc/meminfo | awk '{print $2}')K")" # string + swapfree="$(numfmt --to=iec --from=iec --suffix=B "$(grep ^SwapFree /proc/meminfo | awk '{print $2}')K")" # string + swapused="$(numfmt --to=iec --from=iec --suffix=B "$(($(grep ^SwapTotal /proc/meminfo | awk '{print $2}') - $(grep ^SwapFree /proc/meminfo | awk '{print $2}')))K")" # string + # RAM usage of the game server pid + if [ "${gameserverpid}" ]; then + memusedmb="$(ps --forest -o rss -g "${gameserverpid}" | awk '{s+=$1} END {print s}' | awk '{$1/=1024;printf "%.0f",$1}{print $2}')" # integer + memusedpct="$(ps --forest -o %mem -g "${gameserverpid}" | awk '{s+=$1} END {print s}')" # integer + fi +else + # Older distros will need to use free. + # Older versions of free do not support -h option. + 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 + physmemtotal="$(free ${humanreadable} | awk '/Mem:/ {print $2}')" # string + physmemfree="$(free ${humanreadable} | awk '/Mem:/ {print $4}')" # string + physmemused="$(free ${humanreadable} | awk '/Mem:/ {print $3}')" # string + + oldfree="$(free ${humanreadable} | awk '/cache:/')" + if [ "${oldfree}" ]; then + physmemavailable="n/a" # string + physmemcached="n/a" # string + else + physmemavailable="$(free ${humanreadable} | awk '/Mem:/ {print $7}')" # string + physmemcached="$(free ${humanreadable} | awk '/Mem:/ {print $6}')" # string + fi + + swaptotal="$(free ${humanreadable} | awk '/Swap:/ {print $2}')" # string + swapused="$(free ${humanreadable} | awk '/Swap:/ {print $3}')" # string + swapfree="$(free ${humanreadable} | awk '/Swap:/ {print $4}')" # string +fi + +### Disk information + +## Available disk space on the partition. +filesystem="$(LC_ALL=C df -hP "${rootdir}" | tail -n 1 | awk '{print $1}')" # string e.g /dev/sda +totalspace="$(LC_ALL=C df -hP "${rootdir}" | tail -n 1 | awk '{print $2}')" # string e.g 20G +usedspace="$(LC_ALL=C df -hP "${rootdir}" | tail -n 1 | awk '{print $3}')" # string e.g 15G +availspace="$(LC_ALL=C df -hP "${rootdir}" | tail -n 1 | awk '{print $4}')" # string e.g 5G + +## LinuxGSM used space total. +rootdirdu="$(du -sh "${rootdir}" 2> /dev/null | awk '{print $1}')" +if [ -z "${rootdirdu}" ]; then + rootdirdu="0M" +fi + +## LinuxGSM used space in serverfiles dir. +serverfilesdu="$(du -sh "${serverfiles}" 2> /dev/null | awk '{print $1}')" +if [ -z "${serverfilesdu}" ]; then + serverfilesdu="0M" +fi + +## LinuxGSM used space total minus backup dir. +rootdirduexbackup="$(du -sh --exclude="${backupdir}" "${serverfiles}" 2> /dev/null | awk '{print $1}')" +if [ -z "${rootdirduexbackup}" ]; then + rootdirduexbackup="0M" +fi + +## Backup info +if [ -d "${backupdir}" ]; then + # Used space in backups dir. + backupdirdu="$(du -sh "${backupdir}" | awk '{print $1}')" + # If no backup dir, size is 0M. + if [ -z "${backupdirdu}" ]; then + backupdirdu="0M" + fi + + # number of backups set to 0 by default. + backupcount=0 + + # If there are backups in backup dir. + if [ "$(find "${backupdir}" -name "*.tar.gz" | wc -l)" -ne "0" ]; then + # number of backups. + backupcount="$(find "${backupdir}"/*.tar.gz | wc -l)" # integer + # most recent backup. + lastbackup="$(ls -1t "${backupdir}"/*.tar.gz | head -1)" # string + # date of most recent backup. + lastbackupdate="$(date -r "${lastbackup}")" # string + # no of days since last backup. + lastbackupdaysago="$((($(date +'%s') - $(date -r "${lastbackup}" +'%s')) / 60 / 60 / 24))" # integer + # size of most recent backup. + lastbackupsize="$(du -h "${lastbackup}" | awk '{print $1}')" # string + fi +fi + +# Network Interface name +netint=$(${ipcommand} -o addr | grep "${ip}" | awk '{print $2}') # e.g eth0 +netlink=$(${ethtoolcommand} "${netint}" 2> /dev/null | grep Speed | awk '{print $2}') # e.g 1000Mb/s + +# 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 + glibc="2.14" + fi +fi + +# Gather Port Info using ss. +ssinfo="$(ss -tuplwn)" diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh new file mode 100644 index 000000000..4e1d5dedd --- /dev/null +++ b/lgsm/modules/info_game.sh @@ -0,0 +1,2603 @@ +#!/bin/bash +# LinuxGSM info_game.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Gathers various game server information. +# !Note: When adding variables to this script, ensure that they are also added to the command_dev_parse_game_details.sh script. + +# shellcheck disable=SC2317 +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Config Type: ini +# Comment: ; or # +# Note: this ini filter does not filter by section. Can cause issues with some games that have multiple sections with the same variable name. +fn_info_game_ini() { + # sed is used to process the file. + # -n: Suppresses automatic printing of pattern space. + # /^\<'"${2}"'\>/: Matches lines starting with the word provided as the second argument ($2), considering it as a whole word. + # { s/.*= *"\?\([^"]*\)"\?/\1/p;q }: Command block executed for lines that match the pattern. + # - s/.*= *"\?\([^"]*\)"\?/\1/: Matches and captures the value after an equals sign (=), possibly surrounded by optional double quotes. + # - .*: Matches any characters before the equals sign. + # - = *"\?: Matches the equals sign and any optional spaces before an optional double quote. + # - \([^"]*\): Captures any characters that are not double quotes. + # - "\?: Matches an optional double quote. + # - /1: Replaces the entire matched pattern with the captured value. + # - p: Prints the modified line. + # - q: Quits processing after modifying and printing the line. + + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.*= *\"\?\([^"]*\)\"\?/\1/p;q }' "${servercfgparse}" | tr -d '\r')\"" + configtype="ini" +} + +# Config Type: Key Value Pairs (Equals Delimited) +# Comment: ; or # +fn_info_game_keyvalue_pairs_equals() { + # sed is used to process the file. + # -n: Suppresses automatic printing of pattern space. + # /^\<'"${2}"'\>/: Matches lines starting with the word provided as the second argument ($2), considering it as a whole word. + # { s/.*= *"\?\([^"]*\)"\?/\1/p;q }: Command block executed for lines that match the pattern. + # - s/.*= *"\?\([^"]*\)"\?/\1/: Matches and captures the value after an equals sign (=), possibly surrounded by optional double quotes. + # - .*: Matches any characters before the equals sign. + # - = *"\?: Matches the equals sign and any optional spaces before an optional double quote. + # - \([^"]*\): Captures any characters that are not double quotes. + # - "\?: Matches an optional double quote. + # - /1: Replaces the entire matched pattern with the captured value. + # - p: Prints the modified line. + # - q: Quits processing after modifying and printing the line. + + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.*= *\"\?\([^"]*\)\"\?/\1/p;q }' "${servercfgparse}" | tr -d '\r')\"" + configtype="keyvalue_pairs" +} + +# Config Type: Key Value Pairs (Space Delimited) +# Comment: ; or # +fn_info_game_keyvalue_pairs_space() { + # sed is used to process the file. + # -n: Suppresses automatic printing of pattern space. + # /^\<'"${2}"'\>/: Matches lines starting with the word provided as the second argument ($2), considering it as a whole word. + # { s/.* *"\?\([^"]*\)"\?/\1/p;q }: Command block executed for lines that match the pattern. + # - s/.* *"\?\([^"]*\)"\?/\1/: Matches and captures the value after an space ( ), possibly surrounded by optional double quotes. + # - .*: Matches any characters before the space. + # - = *"\?: Matches the space and any optional spaces before an optional double quote. + # - \([^"]*\): Captures any characters that are not double quotes. + # - "\?: Matches an optional double quote. + # - /1: Replaces the entire matched pattern with the captured value. + # - p: Prints the modified line. + # - q: Quits processing after modifying and printing the line. + + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.* *\"\?\([^"]*\)\"\?/\1/p;q }' "${servercfgparse}" | tr -d '\r')\"" + configtype="keyvalue_pairs" +} + +# Config Type: QuakeC +# Comment: // or /* */ +fn_info_game_quakec() { + # -n: Suppresses automatic printing of pattern space. + # /^[[:space:]]*\<'"${2}"'\>/: Matches lines starting with optional leading whitespace and the word provided as the second argument ($2), considering it as a whole word. + # { s/.* *"\?\([^"]*\)"\?/\1/p;q }: Command block executed for lines that match the pattern. + # - s/.* *"\?\([^"]*\)"\?/\1/: Matches and captures the value after any number of spaces, possibly surrounded by optional double quotes. + # - .*: Matches any characters before the spaces. + # - *: Matches any number of spaces. + # - "\?: Matches an optional double quote. + # - \([^"]*\): Captures any characters that are not double quotes. + # - "\?: Matches an optional double quote. + # - /1: Replaces the entire matched pattern with the captured value. + # - p: Prints the modified line. + # - q: Quits processing after modifying and printing the line. + + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(sed -n '/[[:space:]]\<'"${2}"'\>/ { s/.* *\"\?\([^"]*\)\"\?/\1/p;q }' "${servercfgparse}" | tr -d '\r')\"" + configtype="quakec" +} + +# Config Type: json +# Comment: // or /* */ +fn_info_game_json() { + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(jq -r "${2}" "${servercfgparse}")\"" + configtype="json" +} + +# Config Type: SQF +# Comment: // or /* */ +fn_info_game_sqf() { + # sed is the command itself, indicating that we want to use the sed utility. + # -n: Suppresses automatic printing of pattern space. + # /^\<'"${2}"'\>/: Matches lines starting with the word provided as the second argument ($2), considering it as a whole word. + # { s/.*= *"\?\([^"]*\)"\?/\1/;s/;$//p;q }: Command block executed for lines that match the pattern. + # - s/.*= *"\?\([^"]*\)"\?/\1/: Matches and captures the value after an equals sign (=), possibly surrounded by optional double quotes. + # - .*: Matches any characters before the equals sign. + # - = *"\?: Matches the equals sign and any optional spaces before an optional double quote. + # - \([^"]*\): Captures any characters that are not double quotes. + # - "\?: Matches an optional double quote. + # - /1: Replaces the entire matched pattern with the captured value. + # - s/;$//: Removes a semicolon (;) at the end of the line, if present. + # - p: Prints the modified line. + # - q: Quits processing after modifying and printing the line. + + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.*= *"\?\([^"]*\)"\?/\1/;s/;$//p;q }' "${servercfgparse}" | tr -d '\r')\"" + configtype="sqf" +} + +# Config Type: XML +# Comment: +fn_info_game_xml() { + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(xmllint --xpath "string(${2})" "${servercfgparse}")\"" + configtype="xml" +} + +# Config Type: Valve KeyValues +# Comment: // +fn_info_game_valve_keyvalues() { + # sed is used to process the file. + # -n: Suppresses automatic printing of pattern space. + # /^[[:space:]]*\<'"${2}"'\>/: Matches lines starting with optional leading whitespace and the word provided as the second argument ($2), considering it as a whole word. + # { s/.* *"\?\([^"]*\)"\?/\1/p;q }: Command block executed for lines that match the pattern. + # - s/.* *"\?\([^"]*\)"\?/\1/: Matches and captures the value after any number of spaces, possibly surrounded by optional double quotes. + # - .*: Matches any characters before the spaces. + # - *: Matches any number of spaces. + # - "\?: Matches an optional double quote. + # - \([^"]*\): Captures any characters that are not double quotes. + # - "\?: Matches an optional double quote. + # - /1: Replaces the entire matched pattern with the captured value. + # - p: Prints the modified line. + # - q: Quits processing after modifying and printing the line. + + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.* *"\([^"]*\)".*/\1/p;q }' "${servercfgparse}" | tr -d '\r')\"" + configtype="valve_keyvalues" +} + +# Config Type: Java properties +# Comment: # or ! +fn_info_game_java_properties() { + # sed is used to process the file. + # -n: Suppresses automatic printing of pattern space. + # /^\<'"${2}"'\>/: Matches lines starting with the word provided as the second argument ($2), considering it as a whole word. + # { s/.*= *"\?\([^"]*\)"\?/\1/p;q }: Command block executed for lines that match the pattern. + # - s/.*= *"\?\([^"]*\)"\?/\1/: Matches and captures the value after an equals sign (=), possibly surrounded by optional double quotes. + # - .*: Matches any characters before the equals sign. + # - = *"\?: Matches the equals sign and any optional spaces before an optional double quote. + # - \([^"]*\): Captures any characters that are not double quotes. + # - "\?: Matches an optional double quote. + # - /1: Replaces the entire matched pattern with the captured value. + # - p: Prints the modified line. + # - q: Quits processing after modifying and printing the line. + + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.*= *\"\?\([^"]*\)\"\?/\1/p;q }' "${servercfgparse}" | tr -d '\r')\"" + configtype="java" +} + +# Config Type: ini +# Comment: ; or # +# Note: this ini filter does not filter by section. Can cause issues with some games that have multiple sections with the same variable name. +fn_info_game_lua() { + # - The '-n' option suppresses automatic printing of pattern space. + # - The pattern '/^[[:space:]]*\<'"${2}"'\>/' matches lines that begin with optional whitespace characters, + # followed by the exact word specified by the second argument. + # - If the pattern matches, the following actions are performed within the curly braces: + # - 's/.*= *"\?\([^"]*\)"\?/\1/' extracts the value within double quotes after an equal sign (if present), + # removing any leading or trailing spaces. + # - 's#,.*##' removes everything after the first comma encountered. + # - 'p' prints the modified pattern space. + # - 'q' quits processing after printing the modified pattern space. + + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(sed -n '/^[[:space:]]*\<'"${2}"'\>/ { s/.*= *"\?\([^"]*\)"\?/\1/;s#,.*##;p;q }' "${servercfgparse}" | tr -d '\r')\"" + configtype="lua" +} + +# Config Type: custom (Project Cars) +# Comment: // +fn_info_game_pc_config() { + # sed is used to process the file. + # -n: Suppresses automatic printing of pattern space. + # /^\<'"${2}"'\>/: Matches lines starting with the word provided as the second argument ($2), considering it as a whole word. + # { s/.*: *"\?\([^"]*\)"\?/\1/p;q }: Command block executed for lines that match the pattern. + # - s/.*: *"\?\([^"]*\)"\?/\1/: Matches and captures the value after an equals sign (=), possibly surrounded by optional double quotes. + # - .*: Matches any characters before the equals sign. + # - : *"\?: Matches the : sign and any optional spaces before an optional double quote. + # - \([^"]*\): Captures any characters that are not double quotes. + # - "\?: Matches an optional double quote. + # - /1: Replaces the entire matched pattern with the captured value. + # - p: Prints the modified line. + # - q: Quits processing after modifying and printing the line. + + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.*: *\"\?\([^"]*\)\"\?/\1/p;q }' "${servercfgparse}" | tr -d '\r')\"" + configtype="pc_config" +} + +# Config Type: ini +# Parameters: false +# Comment: ; or # +# Example: NAME=SERVERNAME +# Filetype: ini +fn_info_game_ac() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "ADMIN_PASSWORD" + fn_info_game_ini "httpport" "HTTP_PORT" + fn_info_game_ini "port" "TCP_PORT" + fn_info_game_ini "servername" "NAME" + fn_info_game_ini "serverpassword" "PASSWORD" + fi + adminpassword="${adminpassword:-NOT SET}" + httpport="${httpport:-0}" + port="${port:-0}" + queryport="${httpport:-0}" + servername="${servername:-NOT SET}" + serverpassword="${serverpassword:-NOT SET}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: SessionName=SERVERNAME +# Filetype: ini +fn_info_game_ark() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "ServerAdminPassword" + fn_info_game_ini "maxplayers" "MaxPlayers" + fn_info_game_ini "rconport" "RCONPort" + fn_info_game_ini "servername" "SessionName" + fn_info_game_ini "serverpassword" "ServerPassword" + fi + adminpassword="${adminpassword:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + rawport="$((port + 1))" + rconport="${rconport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: SQF +# Parameters: true +# Comment: // or /* */ +# Example: serverName = "SERVERNAME"; +# Filetype: cfg +fn_info_game_arma3() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_sqf "adminpassword" "passwordAdmin" + fn_info_game_sqf "maxplayers" "maxPlayers" + fn_info_game_sqf "servername" "hostname" + fn_info_game_sqf "serverpassword" "password" + fi + adminpassword="${adminpassword:-"NOT SET"}" + battleeyeport="$((port + 4))" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="$((port + 1))" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + steamport="$((port + 2))" + voiceport="${port:-"0"}" + voiceunusedport="$((port + 3))" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: serverName=SERVERNAME +# Filetype: ini +fn_info_game_av() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "maxplayers" "maxPlayers" + fn_info_game_ini "port" "port" + fn_info_game_ini "rconport" "rconPort" + fn_info_game_ini "servername" "name" + fn_info_game_ini "serverpassword" "password" + fn_info_game_ini "rconpassword" "rconPassword" + if [ -n "${rconpassword}" ]; then + rconenabled="true" + fi + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + + rconenabled="${rconenabled:-"false"}" + rconpassword="${rconpassword:-"NOT SET"}" + rconport="${rconport:-"0"}" + # queryport doesnt respond to any queries, using session only. + queryport=""$((port + 3))"" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + steamport="$((port + 21))" + steamworksport="$((port + 20))" +} + +# Config Type: ini unknown (Source?) +# Parameters: true +# Comment: # or // +# Example: ServerName=SERVERNAME +# Filetype: txt +fn_info_game_bo() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "maxplayers" "MaxPlayers" + fn_info_game_ini "port" "ServerPort" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "Password" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="$((port + 1))" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_btl() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "AdminPassword" + fn_info_game_ini "servername" "ServerName" + fi + adminpassword="${adminpassword:-"NOT SET"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + rconport="$((port + 2))" + servername="${servername:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_cmw() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "maxplayers" "MaxPlayers" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "GamePassword" + fn_info_game_ini "rconport" "RConPort" "${servercfgdir}/DefaultGame.ini" + fi + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + rconport="${rconport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: iMaxClanMembers=1024 +# Filetype: ini +fn_info_game_dodr() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "maxplayers" "iMaxPlayers" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: cluster_name = SERVERNAME +# Filetype: ini +fn_info_game_dst() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "port" "server_port" + fn_info_game_ini "steamauthport" "authentication_port" + fn_info_game_ini "steamport" "master_server_port" + fi + if [ -f "${clustercfgfullpath}" ]; then + fn_info_game_ini "maxplayers" "max_players" "${clustercfgfullpath}" + fn_info_game_ini "servername" "cluster_name" "${clustercfgfullpath}" + fn_info_game_ini "serverpassword" "cluster_password" "${clustercfgfullpath}" + fn_info_game_ini "tickrate" "tick_rate" "${clustercfgfullpath}" + fn_info_game_ini "masterport" "master_port" "${clustercfgfullpath}" + fn_info_game_ini "gamemode" "game_mode" "${clustercfgfullpath}" + fn_info_game_ini "configip" "bind_ip" "${clustercfgfullpath}" + fi + + cave="${cave:-"NOT SET"}" + cluster="${cluster:-"NOT SET"}" + configip="${configip:-"0.0.0.0"}" + gamemode="${gamemode:-"NOT SET"}" + master="${master:-"NOT SET"}" + masterport="${masterport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + shard="${shard:-"NOT SET"}" + sharding="${sharding:-"NOT SET"}" + steamauthport="${steamauthport:-"0"}" + steamport="${steamport:-"0"}" + tickrate="${tickrate:-"0"}" +} + +# Config Type: parameters +# Parameters: true +# Comment: ; or # +# Example: SessionName=SERVERNAME +# Filetype: ini +fn_info_game_hcu() { + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_kf() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "AdminPassword" + fn_info_game_ini "httpenabled" "bEnabled" + fn_info_game_ini "httppassword" "AdminPassword" + fn_info_game_ini "httpport" "ListenPort" + fn_info_game_ini "httpuser" "AdminName" + fn_info_game_ini "lanport" "LANServerPort" + fn_info_game_ini "maxplayers" "MaxPlayers" + fn_info_game_ini "port" "Port" + fn_info_game_ini "gamespyqueryport" "OldQueryPortNumber" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "GamePassword" + fi + adminpassword="${adminpassword:-"NOT SET"}" + defaultmap="${defaultmap:-"NOT SET"}" + gamespyqueryport="${gamespyqueryport:-"0"}" # Gamespy Query Port + httpenabled="${httpenabled:-"NOT SET"}" + httppassword="${adminpassword}" + httpport="${httpport:-"0"}" + httpuser="${httpuser:-"NOT SET"}" + lanport="${lanport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport=$((28902 + (port - 7757))) # Valve Query Port + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + steamport="20610" + unreal2queryport="$((port + 1))" # Unreal2 Query Port +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_kf2() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "AdminPassword" + fn_info_game_ini "httpport" "ListenPort" "${servercfgdir}/KFWeb.ini" + fn_info_game_ini "port" "Port" "${servercfgdir}/LinuxServer-KFEngine.ini" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "GamePassword" + fn_info_game_ini "httpenabled" "bEnabled" "${servercfgdir}/KFWeb.ini" + fn_info_game_ini "httppassword" "AdminPassword" + fi + adminpassword="${adminpassword:-"NOT SET"}" + defaultmap="${defaultmap:-"NOT SET"}" + httpport="${httpport:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + httpenabled="${httpenabled:-"NOT SET"}" + httppassword="${httppassword:-"NOT SET"}" + httpuser="Admin" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_mh() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "ServerPassword" + fn_info_game_ini "rconpassword" "AdminPassword" + fn_info_game_ini "maxplayers" "MaxSlots" + fi + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + rconpassword="${rconpassword:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + beaconport="${beaconport:-"0"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName="SERVERNAME" +# Filetype: cfg +fn_info_game_ps() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "maxplayers" "MaxPlayers" + fn_info_game_ini "reservedslots" "NumReservedSlots" + fn_info_game_ini "serverpassword" "ServerPassword" + fi + if [ -f "${servercfgdir}/Rcon.cfg" ]; then + fn_info_game_ini "rconpassword" "Password" "${servercfgdir}/Rcon.cfg" + fn_info_game_ini "rconport" "Port" "${servercfgdir}/Rcon.cfg" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + if [ -z "${queryport}" ]; then + queryport="${port:-"0"}" + fi + randommap="${randommap:-"NOT SET"}" + if [ -z "${rconpassword}" ] || [ "${#rconpassword}" == 1 ]; then + rconpassword="NOT SET" + fi + rconport="${rconport:-"0"}" + reservedslots="${reservedslots:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + tickrate="${tickrate:-"0"}" +} + +# Config Type: ini +# Parameters: false +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: cfg +fn_info_game_pvr() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "maxplayers" "MaxPlayers" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + port401="$((port + 400))" + queryport="${port:-"0"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: false +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: cfg +fn_info_game_pw() { + servername="${servername:-"NOT SET"}" + port="${port:-"0"}" + queryport="${port:-"0"}" + steamport="${steamport:-"0"}" + unknownport="1985" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: PublicName=SERVERNAME +# Filetype: ini +fn_info_game_pz() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "maxplayers" "MaxPlayers" + fn_info_game_ini "port" "DefaultPort" + fn_info_game_ini "rconpassword" "RCONPassword" + fn_info_game_ini "servername" "PublicName" + fn_info_game_ini "serverpassword" "Password" + fn_info_game_ini "worldname" "Map" + + fi + adminpassword="${adminpassword:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + worldname="${worldname:-"NOT SET"}" +} + +# Config Type: xml +# Comment: +# Example: SERVERNAME +# Filetype: xml +fn_info_game_st() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_xml "adminpassword" "/SettingData/AdminPassword" + fn_info_game_xml "maxplayers" "/SettingData/ServerMaxPlayers" + fn_info_game_xml "port" "/SettingData/GamePort" + fn_info_game_xml "queryport" "/SettingData/UpdatePort" + fn_info_game_xml "saveinterval" "/SettingData/SaveInterval" + fn_info_game_xml "servername" "/SettingData/ServerName" + fn_info_game_xml "serverpassword" "/SettingData/ServerPassword" + fi + adminpassword="${adminpassword:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + saveinterval="${saveinterval:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + worldname="${worldname:-"NOT SET"}" + worldtype="${worldtype:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_stn() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "configip" "ServerIP" + fn_info_game_ini "port" "ServerPort" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "ServerPassword" + fi + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="$((port + 1))" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: parameters +# Parameters: true +# Comment: +# Example: -ServerName="SERVERNAME" +# Filetype: parameters +fn_info_game_tf() { + beaconport="${beaconport:-"0"}" + gamemode="${gamemode:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + saveinterval="${saveinterval:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + shutdownport="${shutdownport:-"0"}" + +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=ServerName +# Filetype: ini +fn_info_game_ti() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "maxplayers" "MaxPlayerCount" + fn_info_game_ini "queueenabled" "bQueueEnabled" + fn_info_game_ini "queueport" "QueuePort" + fn_info_game_ini "rconenabled" "bRconEnabled" + fn_info_game_ini "rconpassword" "RconPassword" + fn_info_game_ini "rconport" "RconPort" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "ServerPassword" + fn_info_game_ini "serverpasswordenabled" "bServerPassword" + fi + maxplayers="${maxplayers:-"0"}" + queueenabled="${queueenabled:-"NOT SET"}" + queueport="${queueport:-"0"}" + rconenabled="${rconenabled:-"NOT SET"}" + rconpassword="${rconpassword:-"NOT SET"}" + rconport="${rconport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + serverpasswordenabled="${serverpasswordenabled:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: false +# Comment: ; or # +# Example: default_voice_port=9987 +# Filetype: ini +fn_info_game_ts3() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "configip" "voice_ip" + fn_info_game_ini "dbplugin" "dbplugin" + fn_info_game_ini "fileport" "filetransfer_port" + fn_info_game_ini "port" "default_voice_port" + fn_info_game_ini "httpqueryport" "query_http_port" + fn_info_game_ini "httpsqueryport" "query_https_port" + fn_info_game_ini "queryport" "query_port" + fn_info_game_ini "sshqueryport" "query_ssh_port" + fi + configip="${configip:-"0.0.0.0"}" + dbplugin="${dbplugin:-"NOT SET"}" + fileport="${fileport:-"0"}" + port="${port:-"0"}" + httpqueryport="${httpqueryport:-"0"}" + httpsqueryport="${httpsqueryport:-"0"}" + queryport="${queryport:-"0"}" + sshqueryport="${sshqueryport:-"0"}" + telnetport="${queryport}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerTitle=SERVERNAME +# Filetype: ini +fn_info_game_tu() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "maxplayers" "MaxPlayers" + fn_info_game_ini "servername" "ServerTitle" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" + steamport="$((port + 1))" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_ut99() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "AdminPassword" + fn_info_game_ini "beaconport" "ServerBeaconPort" + fn_info_game_ini "port" "Port" + fn_info_game_ini "gamespyqueryport" "OldQueryPortNumber" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "GamePassword" + fn_info_game_ini "httpenabled" "bEnabled" + fn_info_game_ini "httppassword" "AdminPassword" + fn_info_game_ini "httpport" "ListenPort" + fn_info_game_ini "httpuser" "AdminUserName" + fi + adminpassword="${adminpassword:-"NOT SET"}" + beaconport="${beaconport:-"0"}" + defaultmap="${defaultmap:-"NOT SET"}" + httpport="${httpport:-"0"}" + port="${port:-"0"}" + queryport="$((port + 1))" + gamespyqueryport="${gamespyqueryport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + httpenabled="${httpenabled:-"0"}" + httppassword="${httppassword:-"NOT SET"}" + httpuser="${httpuser:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_ut3() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "AdminPassword" + fn_info_game_ini "maxplayers" "MaxPlayers" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "GamePassword" + fn_info_game_ini "httpenabled" "bEnabled" + fn_info_game_ini "httppassword" "AdminPassword" + fn_info_game_ini "httpport" "ListenPort" + fi + adminpassword="${adminpassword:-"NOT SET"}" + defaultmap="${defaultmap:-"NOT SET"}" + httpport="${httpport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + httpenabled="${httpenabled:-"0"}" + httppassword="${httppassword:-"NOT SET"}" + httpuser="Admin" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_unreal2() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "AdminPassword" + fn_info_game_ini "httpport" "ListenPort" + fn_info_game_ini "port" "Port" + fn_info_game_ini "gamespyqueryport" "OldQueryPortNumber" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "GamePassword" + fn_info_game_ini "httpenabled" "bEnabled" + fn_info_game_ini "httpuser" "AdminName" + fi + adminpassword="${adminpassword:-"NOT SET"}" + defaultmap="${defaultmap:-"NOT SET"}" + httpport="${httpport:-"0"}" + port="${port:-"0"}" + queryport="$((port + 1))" + gamespyqueryport="${gamespyqueryport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + httpenabled="${httpenabled:-"0"}" + httppassword="${adminpassword:-"NOT SET"}" + httpuser="${httpuser:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName="SERVERNAME" +# Filetype: ini +fn_info_game_ut() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "servername" "ServerName" + fi + defaultmap="${defaultmap:-"NOT SET"}" + gametype="${gametype:-"NOT SET"}" + port="${port:-"0"}" + queryport="$((port + 1))" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_ut2k4() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "AdminPassword" + fn_info_game_ini "httpport" "ListenPort" + fn_info_game_ini "lanport" "LANServerPort" + fn_info_game_ini "port" "Port" + fn_info_game_ini "gamespyqueryport" "OldQueryPortNumber" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "GamePassword" + fn_info_game_ini "httpenabled" "bEnabled" + fn_info_game_ini "httpuser" "AdminName" + fi + adminpassword="${adminpassword:-"NOT SET"}" + defaultmap="${defaultmap:-"NOT SET"}" + httpport="${httpport:-"0"}" + lanport="${lanport:-"0"}" + port="${port:-"0"}" + queryport="$((port + 1))" + gamespyqueryport="${gamespyqueryport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + httpenabled="${httpenabled:-"0"}" + httppassword="${adminpassword}" + httpuser="${httpuser:-"NOT SET"}" +} + +# Config Type: json +# Parameters: true +# Comment: // or /* */ +# Example: "name": "SERVERNAME", +# Filetype: json +fn_info_game_armar() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "adminpassword" ".game.passwordAdmin" + fn_info_game_json "configip" ".bindAddress" + fn_info_game_json "maxplayers" ".game.maxPlayers" + fn_info_game_json "port" ".bindPort" + 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))" + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: con +# Parameters: true +# Comment: # or // +# Example: game.serverName "SERVERNAME" +# Filetype: con +fn_info_game_bf1942() { + if [ -f "${servercfgfullpath}" ]; then + 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 "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" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: con +# Parameters: true +# Comment: # or // +# Example: game.serverName "SERVERNAME" +# Filetype: con +fn_info_game_bfv() { + if [ -f "${servercfgfullpath}" ]; then + 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 "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" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: XML +# Parameters: false +# Comment: +# Example: +# Filetype: xml +fn_info_game_bt() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_xml "maxplayers" "/serversettings/@MaxPlayers" + fn_info_game_xml "port" "/serversettings/@port" + fn_info_game_xml "queryport" "/serversettings/@queryport" + fn_info_game_xml "servername" "/serversettings/@name" + fn_info_game_xml "serverpassword" "/serversettings/@password" + fn_info_game_xml "tickrate" "/serversettings/@TickRate" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + tickrate="${tickrate:-"0"}" +} + +# Config Type: json +# Parameters: false +# Comment: // or /* */ +# Example: "game_title":"SERVERNAME" +# Filetype: json +fn_info_game_cd() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "maxplayers" ".player_count" + fn_info_game_json "port" ".game_port" + fn_info_game_json "rconenabled" ".rcon" + fn_info_game_json "rconpassword" ".rcon_password" + fn_info_game_json "rconport" ".rcon_port" + fn_info_game_json "servername" ".game_title" + fn_info_game_json "steamport" ".steam_port_messages" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + rconenabled="${rconenabled:-"NOT SET"}" + rconpassword="${rconpassword:-"NOT SET"}" + rconport="${rconport:-"0"}" + servername="${servername:-"NOT SET"}" + steamport="${steamport:-"0"}" +} + +# Config Type: json +# Parameters: true +# Comment: // or /* */ +# Example: "worldName":"SERVERNAME" +# Filetype: json +fn_info_game_ck() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "servername" ".worldName" + fn_info_game_json "maxplayers" ".maxNumberPlayers" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="$((port + 1))" + servername="${servername:-"NOT SET"}" +} + +# Config Type: QuakeC +# Parameters: true +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_cod() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "rconpassword" "rconpassword" + fn_info_game_quakec "servername" "sv_hostname" + fi + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: QuakeC +# Parameters: true +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_coduo() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "rconpassword" "rconpassword" + fn_info_game_quakec "servername" "sv_hostname" + fi + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: QuakeC +# Parameters: true +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_cod2() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "rconpassword" "rconpassword" + fn_info_game_quakec "servername" "sv_hostname" + fi + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: QuakeC +# Parameters: true +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_cod4() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "rconpassword" "rcon_password" + fn_info_game_quakec "servername" "sv_hostname" + fi + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: QuakeC +# Parameters: true +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_codwaw() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "rconpassword" "rcon_password" + fn_info_game_quakec "servername" "sv_hostname" + fi + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: json +# Parameters: false +# Comment: // or /* */ +# Example: "ServerName": "SERVERNAME" +# Filetype: json +fn_info_game_col() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "configip" ".ServerSettings.ServerIP" + fn_info_game_json "maxplayers" ".ServerSettings.MaxPlayerCount" + fn_info_game_json "port" ".ServerSettings.ServerGamePort" + fn_info_game_json "rconpassword" ".ServerSettings.RCONPassword" + fn_info_game_json "servername" ".ServerSettings.ServerName" + fn_info_game_json "serverpassword" ".ServerSettings.ServerPassword" + fn_info_game_json "steamport" ".ServerSettings.ServerSteamPort" + fi + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + steamport="${steamport:-"0"}" +} + +# Config Type: Valve KeyValues +# Comment: // +# Example: hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_cs2() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_valve_keyvalues "servername" "hostname" + fn_info_game_valve_keyvalues "defaultmap" "map" + fn_info_game_valve_keyvalues "serverpassword" "sv_password" + fi + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + serverpassword="${serverpassword:-"NOT SET"}" + port="${port:-"0"}" + queryport="${port:-"0"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_ct() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "configip" "bindAddress" + fn_info_game_ini "gamemode" "gameMode" + fn_info_game_ini "maxplayers" "maxPlayerNumber" + fn_info_game_ini "port" "port" + fn_info_game_ini "saveinterval" "autoSaveSec" + fn_info_game_ini "servername" "name" + fn_info_game_ini "serverpassword" "serverPassword" + fn_info_game_ini "serverpasswordenabled" "usePassword" + fi + configip="${configip:-"0.0.0.0"}" + gamemode="${gamemode:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + saveinterval="${saveinterval:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + serverpasswordenabled="${serverpasswordenabled:-"NOT SET"}" +} + +# Config Type: SQF +# Parameters: true +# Comment: // or /* */ +# Example: serverName = "SERVERNAME"; +# Filetype: cfg +fn_info_game_dayz() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_sqf "adminpassword" "passwordAdmin" + fn_info_game_sqf "maxplayers" "maxPlayers" + fn_info_game_sqf "queryport" "steamQueryPort" + fn_info_game_sqf "servername" "hostname" + fn_info_game_sqf "serverpassword" "password" + fi + adminpassword="${adminpassword:-"NOT SET"}" + battleeyeport="$((port + 4))" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + steamport="$((port + 2))" +} + +# Config Type: json +# Parameters: false +# Comment: // or /* */ +# Example: "Description": "SERVERNAME" +# Filetype: json +fn_info_game_eco() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "configip" ".IPAddress" + fn_info_game_json "httpport" ".WebServerPort" + fn_info_game_json "maxplayers" ".MaxConnections" + fn_info_game_json "port" ".GameServerPort" + fn_info_game_json "rconport" ".RconServerPort" + fn_info_game_json "servername" ".Description" + fn_info_game_json "serverpassword" ".Password" + fn_info_game_json "tickrate" ".Rate" + fi + configip="${configip:-"0.0.0.0"}" + httpport="${httpport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port:-"0"}" + rconport="${rconport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + tickrate="${tickrate:-"0"}" +} + +# Config Type: QuakeC +# Parameters: true +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_etl() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "configip" "net_ip" + fn_info_game_quakec "maxplayers" "sv_maxclients" + fn_info_game_quakec "port" "net_port" + fn_info_game_quakec "rconpassword" "rconpassword" + fn_info_game_quakec "servername" "sv_hostname" + fn_info_game_quakec "serverpassword" "g_password" + fi + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: json +# Parameters: true +# Comment: // or /* */ +# Example: "name": "SERVERNAME" +# Filetype: json +fn_info_game_fctr() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "authtoken" ".token" + fn_info_game_json "maxplayers" ".max_players" + fn_info_game_json "savegameinterval" ".autosave_interval" + fn_info_game_json "servername" ".name" + fn_info_game_json "serverpassword" ".game_password" + fn_info_game_json "versioncount" ".autosave_slots" + fi + authtoken="${authtoken:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" + rconport="${rconport:-"0"}" + savegameinterval="${savegameinterval:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + versioncount="${versioncount:-"0"}" + + # get server version if installed. + local factoriobin="${executabledir}${executable:1}" + if [ -f "${factoriobin}" ]; then + serverversion="$(${factoriobin} --version | grep -m 1 "Version:" | awk '{print $2}')" + fi +} + +# Config Type: parameters (json possibly supported) +# Parameters: true +# Comment: +# Example: -serverName="SERVERNAME" +# Filetype: parameters +fn_info_game_hw() { + servername="${servername:-"NOT SET"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + maxplayers="${maxplayers:-"0"}" + # #4189 option setting can be blank + # defaultmap="${defaultmap:-"NOT SET"}" + creativemode="${creativemode:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_hz() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "AdminPassword" + fn_info_game_ini "servername" "ServerName" + fi + adminpass="${adminpassword:-"NOT SET"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + rconport="$((port + 2))" + servername="${servername:-"NOT SET"}" +} + +# Config Type: parameters +# Parameters: true +# Comment: +# Example: -hostname='SERVERNAME' +# Filetype: parameters +fn_info_game_inss() { + port="${port:-"0"}" + queryport="${queryport:-"0"}" + rconport="${rconport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + defaultmap="${defaultmap:-"NOT SET"}" + defaultscenario="${defaultscenario:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" +} + +# Config Type: lua (Custom) +# Parameters: false +# Comment: -- +# Example: Name = "SERVERNAME", +# Filetype: lua +fn_info_game_jc2() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_lua "configip" "BindIP" + fn_info_game_lua "maxplayers" "MaxPlayers" + fn_info_game_lua "port" "BindPort" + fn_info_game_lua "serverdescription" "Description" + fn_info_game_lua "servername" "Name" + fn_info_game_lua "serverpassword" "Password" + fi + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + queryport="${port}" + queryport="${queryport:-"0"}" + serverdescription="${serverdescription:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: json +# Parameters: false +# Comment: // or /* */ +# Example: "name": "SERVERNAME" +# Filetype: json +fn_info_game_jc3() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "configip" ".host" + fn_info_game_json "httpport" ".httpPort" + fn_info_game_json "maxplayers" ".maxPlayers" + fn_info_game_json "port" ".port" + fn_info_game_json "queryport" ".queryPort" + fn_info_game_json "serverdescription" ".description" + fn_info_game_json "servername" ".name" + fn_info_game_json "serverpassword" ".password" + fn_info_game_json "steamport" ".steamPort" + fn_info_game_json "tickrate" ".maxTickRate" + fi + configip="${configip:-"0.0.0.0"}" + httpport="${httpport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + serverdescription="${serverdescription:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + steamport="${steamport:-"0"}" + tickrate="${tickrate:-"0"}" +} + +# Config Type: QuakeC +# Parameters: true +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_jk2() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "maxplayers" "sv_maxclients" + fn_info_game_quakec "rconpassword" "rconpassword" + fn_info_game_quakec "servername" "sv_hostname" + fn_info_game_quakec "serverpassword" "g_password" + fn_info_game_quakec "serverversion" "mv_serverversion" + fi + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + serverversion="${serverversion:-"NOT SET"}" +} + +# Config Type: Java properties +# Comment: # or ! +# Example: motd=SERVERNAME +# Filetype: properties +fn_info_game_mc() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_java_properties "configip" "server-ip" + fn_info_game_java_properties "gamemode" "gamemode" + fn_info_game_java_properties "maxplayers" "max-players" + fn_info_game_java_properties "port" "server-port" + fn_info_game_java_properties "queryenabled" "enable-query" + fn_info_game_java_properties "queryport" "query.port" + fn_info_game_java_properties "rconpassword" "rcon.password" + fn_info_game_java_properties "rconport" "rcon.port" + fn_info_game_java_properties "servername" "motd" + fn_info_game_java_properties "worldname" "level-name" + fi + configip="${configip:-"0.0.0.0"}" + gamemode="${gamemode:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryenabled="${queryenabled:-"NOT SET"}" + if [ -z "${queryport}" ]; then + queryport="${port}" + fi + rconpassword="${rconpassword:-"NOT SET"}" + rconport="${rconport:-"0"}" + servername="${servername:-"NOT SET"}" + worldname="${worldname:-"NOT SET"}" +} + +# Config Type: Java properties +# Comment: # or ! +# Example: server-name=SERVERNAME +# Filetype: properties +fn_info_game_mcb() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_java_properties "gamemode" "gamemode" + fn_info_game_java_properties "maxplayers" "max-players" + fn_info_game_java_properties "port" "server-port" + fn_info_game_java_properties "portv6" "server-portv6" + fn_info_game_java_properties "servername" "server-name" + fn_info_game_java_properties "worldname" "level-name" + fi + gamemode="${gamemode:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + portipv6="${portipv6:-"NOT SET"}" + queryport="${port}" + servername="${servername:-"NOT SET"}" + worldname="${worldname:-"NOT SET"}" +} + +# Config Type: QuakeC +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_mohaa() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "maxplayers" "sv_maxclients" + fn_info_game_quakec "rconpassword" "rconPassword" + fn_info_game_quakec "servername" "sv_hostname" + fn_info_game_quakec "serverpassword" "g_password" + fi + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: xml +# Comment: +# Example: Default MTA Server +# Filetype: conf +fn_info_game_mta() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_xml "port" "/config/serverport" + fn_info_game_xml "httpport" "/config/httpport" + fn_info_game_xml "servername" "/config/servername" + fn_info_game_xml "maxplayers" "/config/maxplayers" + fn_info_game_xml "ase" "/config/ase" + fi + if [ "${ase}" == "1" ]; then + ase="Enabled" + else + ase="Disabled" + fi + port="${port:-"0"}" + queryport="$((port + 123))" + httpport="${httpport:-"0"}" + ase="${ase:-"Disabled"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" +} + +# Config Type: custom +# Comment: // +# Example: port = 14159, +# Filetype: cfg +fn_info_game_nec() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_lua "maxplayers" "slots" + fn_info_game_lua "port" "port" + fn_info_game_lua "serverpassword" "password" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + servername="Necesse Port ${port}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_ohd() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini rconenabled "bEnabled" + fn_info_game_ini rconport "ListenPort" + fn_info_game_ini rconpassword "Password" + fi + rconenabled="${rconenabled:-"false"}" + rconport="${rconport:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" +} + +# Config Type: json +# Parameters: false +# Comment: // or /* */ +fn_info_game_onset() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "maxplayers" ".maxplayers" + fn_info_game_json "port" ".port" + fn_info_game_json "servername" ".servername_short" + fn_info_game_json "serverpassword" ".password" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + httpport="$((port - 2))" + queryport="$((port - 1))" + servername="${servername:-"NOT SET"}" +} + +# Config Type: custom +# Parameters: false +# Comment: // +# Filetype: cfg +fn_info_game_pc() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_pc_config "apiport" "httpApiPort" + fn_info_game_pc_config "httpenabled" "enableHttpApi" + fn_info_game_pc_config "httpport" "httpApiPort" + fn_info_game_pc_config "maxplayers" "maxPlayerCount" + fn_info_game_pc_config "port" "hostPort" + fn_info_game_pc_config "queryport" "queryPort" + fn_info_game_pc_config "servername" "name" + fn_info_game_pc_config "serverpassword" "password" + fn_info_game_pc_config "steamport" "steamPort" + fi + apiport="${apiport:-"0"}" + httpenabled="${httpenabled:-"0"}" + httpport="${httpport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + steamport="${steamport:-"0"}" +} + +fn_info_game_pc2() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_pc_config "apiport" "httpApiPort" + fn_info_game_pc_config "httpenabled" "enableHttpApi" + fn_info_game_pc_config "httpport" "httpApiPort" + fn_info_game_pc_config "maxplayers" "maxPlayerCount" + fn_info_game_pc_config "port" "hostPort" + fn_info_game_pc_config "queryport" "queryPort" + fn_info_game_pc_config "servername" "name" + fn_info_game_pc_config "serverpassword" "password" + fn_info_game_pc_config "steamport" "steamPort" + fi + apiport="${apiport:-"0"}" + httpenabled="${httpenabled:-"0"}" + httpport="${httpport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + steamport="${steamport:-"0"}" +} + +# Config Type: SiiNunit +# Comment: // +# Example: lobby_name: "SERVERNAME" +# Filetype: ssi +fn_info_game_prism3d() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + maxplayers="${unavailable}" + port="${zero}" + queryport="${zero}" + servername="${unavailable}" + serverpassword="${unavailable}" + else + maxplayers=$(sed -nr 's/^\s*max_players\s*:\s*([0-9]+)/\1/p' "${servercfgfullpath}") + port=$(sed -nr 's/^\s*connection_dedicated_port\s*:\s*([0-9]+)/\1/p' "${servercfgfullpath}") + queryport=$(sed -nr 's/^\s*query_dedicated_port\s*:\s*([0-9]+)/\1/p' "${servercfgfullpath}") + servername=$(sed -nr 's/^\s*lobby_name\s*:\s*"?([^"\r\n]+)"?/\1/p' "${servercfgfullpath}") + serverpassword=$(sed -nr 's/^\s*password\s*:\s*"(.*)"/\1/p' "${servercfgfullpath}") + + # Not set + maxplayers="${maxplayers:-"0"}" + port="${port:-"27015"}" + queryport="${queryport:-"27016"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + fi +} + +# Config Type: QuakeC +# Comment: // or /* */ +# Example: set hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_q2() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "maxplayers" "maxclients" + fn_info_game_quakec "rconpassword" "rcon_password" + fn_info_game_quakec "servername" "hostname" + fi + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: QuakeC +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_q3() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "maxplayers" "sv_maxclients" + fn_info_game_quakec "rconpassword" "rconpassword" + fn_info_game_quakec "servername" "sv_hostname" + fi + maxplayers="${maxplayers:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + port="${port:-"0"}" + queryport="${port}" + defaultmap="${defaultmap:-"NOT SET"}" +} + +# Config Type: QuakeC +# Comment: // or /* */ +# fn_info_game_quakec "SERVERNAME" +# Filetype: cfg +fn_info_game_q4() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "maxplayers" "sv_maxclients" + fn_info_game_quakec "rconpassword" "net_serverRemoteConsolePassword" + fn_info_game_quakec "servername" "si_name" + fn_info_game_quakec "serverpassword" "g_password" + fi + maxplayers="${maxplayers:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + port="${port:-"0"}" + queryport="${port}" + defaultmap="${defaultmap:-"NOT SET"}" +} + +# Config Type: QuakeC +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_ql() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "configip" "net_ip" + fn_info_game_quakec "maxplayers" "sv_maxClients" + fn_info_game_quakec "port" "net_port" + fn_info_game_quakec "rconpassword" "zmq_rcon_password" + fn_info_game_quakec "rconport" "zmq_rcon_port" + fn_info_game_quakec "servername" "sv_hostname" + fn_info_game_quakec "serverpassword" "g_password" + fn_info_game_quakec "statsport" "zmq_stats_port" + fi + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + rconport="${rconport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + statsport="${statsport:-"0"}" +} + +# Config Type: QuakeC +# Comment: // or /* */ +# Example: hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_qw() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "maxplayers" "maxclients" + fn_info_game_quakec "rconpassword" "rcon_password" + fn_info_game_quakec "servername" "hostname" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_ro() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "AdminPassword" + fn_info_game_ini "httpenabled" "bEnabled" + fn_info_game_ini "httppassword" "AdminPassword" + fn_info_game_ini "httpport" "ListenPort" + fn_info_game_ini "httpuser" "AdminName" + fn_info_game_ini "lanport" "LANServerPort" + fn_info_game_ini "maxplayers" "MaxPlayers" + fn_info_game_ini "port" "Port" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "GamePassword" + fi + adminpassword="${adminpassword:-"NOT SET"}" + defaultmap="${defaultmap:-"NOT SET"}" + httpenabled="${httpenabled:-"NOT SET"}" + httppassword="${adminpassword}" + httpport="${httpport:-"0"}" + httpuser="${httpuser:-"NOT SET"}" + lanport="${lanport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport=$((28902 + (port - 7757))) # Valve Query Port + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + steamport="20610" + unreal2queryport="$((port + 1))" # Unreal2 Query Port +} + +# Config Type: QuakeC +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_rtcw() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "rconpassword" "rconpassword" + fn_info_game_quakec "servername" "sv_hostname" + fn_info_game_quakec "serverpassword" "g_password" + fn_info_game_quakec "maxplayers" "sv_maxclients" + fi + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port:-"0"}" + defaultmap="${defaultmap:-"NOT SET"}" +} + +# Config Type: Parameters (mostly) +fn_info_game_rust() { + # Parameters + servername="${servername:-"NOT SET"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + appport="${appport:-"0"}" + rconport="${rconport:-"0"}" + gamemode="${gamemode:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" + rconweb="${rconweb:-"NOT SET"}" + tickrate="${tickrate:-"0"}" + saveinterval="${saveinterval:-"0"}" + serverlevel="${serverlevel:-"NOT SET"}" + customlevelurl="${customlevelurl:-"NOT SET"}" + worldsize="${worldsize:-"0"}" + if [ -n "${seed}" ]; then + seed="${seed:-"0"}" + elif [ -f "${datadir}/${selfname}-seed.txt" ]; then + seed=$(cat "${datadir}/${selfname}-seed.txt") + fi + salt="${salt:-"0"}" +} + +fn_info_game_rw() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_keyvalue_pairs_equals "configip" "Server_IP" + fn_info_game_keyvalue_pairs_equals "gamemode" "World_GameMode" + fn_info_game_keyvalue_pairs_equals "maxplayers" "Server_MaxPlayers" + fn_info_game_keyvalue_pairs_equals "port" "Server_Port" + fn_info_game_keyvalue_pairs_equals "rconport" "RCON_Port" + fn_info_game_keyvalue_pairs_equals "seed" "World_Seed" + fn_info_game_keyvalue_pairs_equals "servername" "Server_Name" + fn_info_game_keyvalue_pairs_equals "worldname" "World_Name" + fi + configip="${configip:-"0.0.0.0"}" + gamemode="${gamemode:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="$((port - 1))" + rconport="${rconport:-"0"}" + seed="${seed:-"0"}" + servername="${servername:-"NOT SET"}" + worldname="${worldname:-"NOT SET"}" + +} + +# Config Type: custom +# Comment: // or /* */ +# example: hostname "SERVERNAME" +# filetypes: cfg +fn_info_game_samp() { + if [ -f "${servercfgfullpath}" ]; then + servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryport="${port}" + rconport="${port}" + maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not set + servername="${servername:-"NOT SET"}" + rconpassword="${rconpassword:-"NOT SET"}" + port="${port:-"7777"}" + queryport="${port:-"7777"}" + rconport="${rconport:-"7777"}" + maxplayers="${maxplayers:-"12"}" + fi +} + +# Config Type: json +# Parameters: false +# Comment: // or /* */ +fn_info_game_sb() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "maxplayers" ".maxPlayers" + fn_info_game_json "port" ".gameServerPort" + fn_info_game_json "queryenabled" ".runQueryServer" + fn_info_game_json "queryport" ".queryServerPort" + fn_info_game_json "rconenabled" ".runRconServer" + fn_info_game_json "rconpassword" ".rconServerPassword" + fn_info_game_json "rconport" ".rconServerPort" + fn_info_game_json "servername" ".serverName" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryenabled="${queryenabled:-"NOT SET"}" + queryport="${queryport:-"0"}" + rconenabled="${rconenabled:-"NOT SET"}" + rconpassword="${rconpassword:-"NOT SET"}" + rconport="${rconport:-"0"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: Parameters +fn_info_game_sbots() { + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" +} + +# Config Type: custom (possibly YAML) +# Comment: # +# Example: server_name: SERVERNAME +# Filetype: txt +fn_info_game_scpsl() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_pc_config "adminpassword" "administrator_query_password" + fn_info_game_pc_config "configip" "ipv4_bind_ip" + fn_info_game_pc_config "maxplayers" "max_players" + fn_info_game_pc_config "servername" "server_name" + fn_info_game_pc_config "tickrate" "server_tickrate" + fi + adminpassword="${adminpassword:-"NOT SET"}" + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + servername="${servername:-"NOT SET"}" + tickrate="${tickrate:-"NOT SET"}" +} + +# Config Type: xml +# Comment: +# Example: +# Filetype: xml +fn_info_game_sdtd() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_xml "gamemode" "/ServerSettings/property[@name='GameMode']/@value" + fn_info_game_xml "httpenabled" "/ServerSettings/property[@name='ControlPanelEnabled']/@value" + fn_info_game_xml "httppassword" "/ServerSettings/property[@name='ControlPanelPassword']/@value" + fn_info_game_xml "httpport" "/ServerSettings/property[@name='ControlPanelPort']/@value" + fn_info_game_xml "maxplayers" "/ServerSettings/property[@name='ServerMaxPlayerCount']/@value" + fn_info_game_xml "servername" "/ServerSettings/property[@name='ServerName']/@value" + fn_info_game_xml "serverpassword" "/ServerSettings/property[@name='ServerPassword']/@value" + fn_info_game_xml "port" "/ServerSettings/property[@name='ServerPort']/@value" + fn_info_game_xml "telnetenabled" "/ServerSettings/property[@name='TelnetEnabled']/@value" + fn_info_game_xml "telnetpass" "/ServerSettings/property[@name='TelnetPassword']/@value" + fn_info_game_xml "telnetport" "/ServerSettings/property[@name='TelnetPort']/@value" + fn_info_game_xml "worldname" "/ServerSettings/property[@name='GameWorld']/@value" + fi + gamemode="${gamemode:-"NOT SET"}" + httpenabled="${httpenabled:-"NOT SET"}" + httppassword="${httppassword:-"NOT SET"}" + httpport="${httpport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + port3="$((port + 2))" + queryport="${port:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + telnetenabled="${telnetenabled:-"NOT SET"}" + # Telnet IP will be localhost if no password is set + # check_ip will set the IP first. This will overwrite it. + if [ -z "${telnetpassword}" ]; then + telnetip="127.0.0.1" + fi + telnetpass="${telnetpass:-"NOT SET"}" + telnetport="${telnetport:-"0"}" + worldname="${worldname:-"NOT SET"}" + +} + +# Config Type: Parameters (with an ini) +fn_info_game_sf() { + # Parameters + servername="${servername:-"NOT SET"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + beaconport="${beaconport:-"0"}" +} + +# Config Type: Parameters (with an ini) +fn_info_game_sm() { + servername="${servername:-"NOT SET"}" + adminpassword="${adminpassword:-"NOT SET"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + maxplayers="${maxplayers:-"0"}" + # telnet config + telnetenabled=true + telnetip="127.0.0.1" + telnetport="${telnetport:-"0"}" +} + +# Config Type: QuakeC +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_sof2() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "rconpassword" "rconpassword" + fn_info_game_quakec "servername" "sv_hostname" + fn_info_game_quakec "serverpassword" "g_password" + fn_info_game_quakec "maxplayers" "sv_maxclients" + fi + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + defaultmap="${defaultmap:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Server_Name=SERVERNAME +# Filetype: ini +fn_info_game_sol() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "Admin_Password" + fn_info_game_ini "maxplayers" "Max_Players" + fn_info_game_ini "port" "Port" + fn_info_game_ini "servername" "Server_Name" + fn_info_game_ini "serverpassword" "Game_Password" + fi + adminpassword="${adminpassword:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + filesport="$((port + 10))" + queryport="${filesport}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: Valve KeyValues +# Comment: // +# Example: hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_source() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_valve_keyvalues "rconpassword" "rcon_password" + fn_info_game_valve_keyvalues "servername" "hostname" + fn_info_game_valve_keyvalues "serverpassword" "sv_password" + fi + # Steamport can be between 26901-26910 and is normally automatically set. + # Some servers might support -steamport parameter to set + if [ "${steamport}" == "0" ] || [ -v "${steamport}" ]; then + steamport="$(echo "${ssinfo}" | grep "${srcdslinuxpid}" | awk '{print $5}' | grep ":269" | cut -d ":" -f2)" + fi + clientport="${clientport:-"0"}" + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" + rconport="${port:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + # steamport="${steamport:-"0"}" Steamport is optional so we dont want it to show as not set. +} + +fn_info_game_spark() { + defaultmap="${defaultmap:-"NOT SET"}" + httppassword="${httppassword:-"NOT SET"}" + httpport="${httpport:-"0"}" + httpuser="${httpuser:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + modserverport=${modserverport:-"0"} + port="${port:-"0"}" + queryport="$((port + 1))" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: Custom (key-value pairs) +# Parameters: true +# Comment: # or // +# Example: ServerName="SERVERNAME" +# Filetype: cfg +fn_info_game_squad() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_keyvalue_pairs_equals "servername" "ServerName" + fn_info_game_keyvalue_pairs_equals "maxplayers" "MaxPlayers" + fi + if [ -f "${servercfgdir}/Rcon.cfg" ]; then + fn_info_game_keyvalue_pairs_equals "rconport" "Port" "${servercfgdir}/Rcon.cfg" + fn_info_game_keyvalue_pairs_equals "rconpassword" "Password" "${servercfgdir}/Rcon.cfg" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + rconport="${rconport:-"0"}" + servername="${servername:-"NOT SET"}" + if [ -z "${rconpassword}" ] || [ ${#rconpassword} == 1 ]; then + rconpassword="NOT SET" + fi +} + +# Config Type: Custom (key-value pairs) +# Comment: # or // +# Example: ServerName="SERVERNAME" +# Filetype: cfg +fn_info_game_terraria() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_keyvalue_pairs_equals "maxplayers" "maxplayers" + fn_info_game_keyvalue_pairs_equals "port" "port" + fn_info_game_keyvalue_pairs_equals "servername" "worldname" + fn_info_game_keyvalue_pairs_equals "worldname" "world" + fi + queryport="${port:-"0"}" + servername="${servername:-"NOT SET"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + worldname="${worldname:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" +} + +# Config Type: QuakeC (custom) +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_tw() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_keyvalue_pairs_space "servername" "sv_name" + fn_info_game_keyvalue_pairs_space "serverpassword" "password" + fn_info_game_keyvalue_pairs_space "rconpassword" "sv_rcon_password" + fn_info_game_keyvalue_pairs_space "port" "sv_port" + fn_info_game_keyvalue_pairs_space "maxplayers" "sv_max_clients" + fi + queryport="${port}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + rconpassword="${rconpassword:-"NOT SET"}" + port="${port:-"0"}" + maxplayers="${maxplayers:-"0"}" +} + +# Config Type: Parameters +fn_info_game_unt() { + servername="${servername:-"NOT SET"}" + port="${port:-"0"}" + queryport="${port}" + steamport="$((port + 1))" +} + +# Config Type: Parameters +fn_info_game_vh() { + port="${port:-"0"}" + # Query port only enabled if public server + if [ "${public}" != "0" ]; then + queryport="$((port + 1))" + else + querymode="1" + fi + worldname="${worldname:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: json +# Parameters: false +# Comment: // or /* */ +fn_info_game_vints() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "configip" "select(.Ip != null) | .Ip" + fn_info_game_json "maxplayers" ".MaxClients" + fn_info_game_json "port" ".Port" + fn_info_game_json "servername" ".ServerName" + fn_info_game_json "serverpassword" "select(.Password != null) | .Password" + fi + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: Java properties +# Comment: # or ! +# Example: motd=SERVERNAME +# Filetype: properties +fn_info_game_vpmc() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_java_properties "servername" "motd" + fn_info_game_java_properties "bindaddress" "bind" + fi + configip="$(echo "${bindaddress}" | cut -d ':' -f 1)" + port="$(echo "${bindaddress}" | cut -d ':' -f 2)" + queryport="${port:-"0"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: QuakeC +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_wet() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "configip" "net_ip" + fn_info_game_quakec "maxplayers" "sv_maxclients" + fn_info_game_quakec "port" "net_port" + fn_info_game_quakec "rconpassword" "zmq_rcon_password" + fn_info_game_quakec "servername" "sv_hostname" + fn_info_game_quakec "serverpassword" "g_password" + fi + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: QuakeC +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_wf() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "maxplayers" "sv_maxclients" + fn_info_game_quakec "rconpassword" "rcon_password" + fn_info_game_quakec "servername" "sv_hostname" + fi + httpport="${httpport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: QuakeC +# Comment: // +# Filetype: cfg +fn_info_game_xnt() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_keyvalue_pairs_space "maxplayers" "maxplayers" + fn_info_game_keyvalue_pairs_space "port" "port" + fn_info_game_keyvalue_pairs_space "rconpassword" "rcon_password" + fn_info_game_keyvalue_pairs_space "servername" "hostname" + fi + maxplayers="${maxplayers:-"8"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" +} + +fn_info_game_wmc() { + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + queryenabled="${unavailable}" + else + servername=$(sed -e '/^listeners:/,/^[a-z]/!d' "${servercfgfullpath}" | sed -nr 's/^[ ]+motd: (.*)$/\1/p' | tr -d "'" | sed 's/&1//') + queryport=$(sed -nr 's/^[ -]+query_port: ([0-9]+)/\1/p' "${servercfgfullpath}") + queryenabled=$(sed -nr 's/^[ ]+query_enabled: (.*)$/\1/p' "${servercfgfullpath}") + port=$(sed -nr 's/^[ ]+host: [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:([0-9]+)/\1/p' "${servercfgfullpath}") + # the normal max_players does only show in on the client side and has no effect how many players can connect. + maxplayers=$(sed -nr 's/^player_limit: ([-]*[0-9])/\1/p' "${servercfgfullpath}") + configip=$(sed -nr 's/^[ ]+host: ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+):[0-9]+/\1/p' "${servercfgfullpath}") + + if [ "${maxplayers}" == "-1" ] || [ "${maxplayers}" == "0" ]; then + maxplayers="UNLIMITED" + fi + + # Not set + servername="${servername:-"NOT SET"}" + queryport="${queryport:-"25577"}" + maxplayers="${maxplayers:-"0"}" + configip="${configip:-"0.0.0.0"}" + fi +} + +# Config Type: parameters +# Parameters: true +# Comment: +# Example: hostname='SERVERNAME' +# Filetype: parameters +fn_info_game_wurm() { + gamemode="${gamemode:-"NOT SET"}" + homekingdom="${homekingdom:-"0"}" + adminpassword="${adminpassword:-"NOT SET"}" + epicsettings="${epicsettings:-"NOT SET"}" + homeserver="${homeserver:-"NOT SET"}" + loginserver="${loginserver:-"NOT SET"}" + rmiport="${rmiport:-"0"}" + rmiregport="${rmiregport:-"0"}" + maxplayers="${maxplayers:-"0"}" + servername="${servername:-"NOT SET"}" + # serverpassword="${serverpassword:-"NOT SET"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" +} + +unavailable="${red}UNAVAILABLE${default}" +zero="${red}0${default}" + +if [ "${shortname}" == "ac" ]; then + fn_info_game_ac +elif [ "${shortname}" == "ark" ]; then + fn_info_game_ark +elif [ "${shortname}" == "arma3" ]; then + fn_info_game_arma3 +elif [ "${shortname}" == "armar" ]; then + fn_info_game_armar +elif [ "${shortname}" == "av" ]; then + fn_info_game_av +elif [ "${shortname}" == "bf1942" ]; then + fn_info_game_bf1942 +elif [ "${shortname}" == "bfv" ]; then + fn_info_game_bfv +elif [ "${shortname}" == "bo" ]; then + fn_info_game_bo +elif [ "${shortname}" == "bt" ]; then + fn_info_game_bt +elif [ "${shortname}" == "btl" ]; then + fn_info_game_btl +elif [ "${shortname}" == "ck" ]; then + fn_info_game_ck +elif [ "${shortname}" == "cmw" ]; then + fn_info_game_cmw +elif [ "${shortname}" == "cod" ]; then + fn_info_game_cod +elif [ "${shortname}" == "coduo" ]; then + fn_info_game_cod +elif [ "${shortname}" == "cod2" ]; then + fn_info_game_cod2 +elif [ "${shortname}" == "cod4" ]; then + fn_info_game_cod4 +elif [ "${shortname}" == "codwaw" ]; then + fn_info_game_codwaw +elif [ "${shortname}" == "col" ]; then + fn_info_game_col +elif [ "${shortname}" == "cs2" ]; then + fn_info_game_cs2 +elif [ "${shortname}" == "ct" ]; then + fn_info_game_ct +elif [ "${shortname}" == "dayz" ]; then + fn_info_game_dayz +elif [ "${shortname}" == "dodr" ]; then + fn_info_game_dodr +elif [ "${shortname}" == "dst" ]; then + fn_info_game_dst +elif [ "${shortname}" == "eco" ]; then + fn_info_game_eco +elif [ "${shortname}" == "etl" ]; then + fn_info_game_etl +elif [ "${shortname}" == "fctr" ]; then + fn_info_game_fctr +elif [ "${shortname}" == "hw" ]; then + fn_info_game_hw +elif [ "${shortname}" == "hz" ]; then + fn_info_game_hz +elif [ "${shortname}" == "inss" ]; then + fn_info_game_inss +elif [ "${shortname}" == "jc2" ]; then + fn_info_game_jc2 +elif [ "${shortname}" == "jc3" ]; then + fn_info_game_jc3 +elif [ "${shortname}" == "jk2" ]; then + fn_info_game_jk2 +elif [ "${shortname}" == "kf" ]; then + fn_info_game_kf +elif [ "${shortname}" == "kf2" ]; then + fn_info_game_kf2 +elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then + fn_info_game_mc +elif [ "${shortname}" == "mcb" ]; then + fn_info_game_mcb +elif [ "${shortname}" == "mh" ]; then + fn_info_game_mh +elif [ "${shortname}" == "mohaa" ]; then + fn_info_game_mohaa +elif [ "${shortname}" == "mta" ]; then + fn_info_game_mta +elif [ "${shortname}" == "nec" ]; then + fn_info_game_nec +elif [ "${shortname}" == "ohd" ]; then + fn_info_game_ohd +elif [ "${shortname}" == "onset" ]; then + fn_info_game_onset +elif [ "${shortname}" == "pc" ]; then + fn_info_game_pc +elif [ "${shortname}" == "pc2" ]; then + fn_info_game_pc2 +elif [ "${shortname}" == "ps" ]; then + fn_info_game_ps +elif [ "${shortname}" == "pvr" ]; then + fn_info_game_pvr +elif [ "${shortname}" == "pw" ]; then + fn_info_game_pw +elif [ "${shortname}" == "pz" ]; then + fn_info_game_pz +elif [ "${shortname}" == "q2" ]; then + fn_info_game_q2 +elif [ "${shortname}" == "q3" ]; then + fn_info_game_q3 +elif [ "${shortname}" == "q4" ]; then + fn_info_game_q4 +elif [ "${shortname}" == "ql" ]; then + fn_info_game_ql +elif [ "${shortname}" == "qw" ]; then + fn_info_game_qw +elif [ "${shortname}" == "ro" ]; then + fn_info_game_ro +elif [ "${shortname}" == "rtcw" ]; then + fn_info_game_rtcw +elif [ "${shortname}" == "rust" ]; then + fn_info_game_rust +elif [ "${shortname}" == "rw" ]; then + fn_info_game_rw +elif [ "${shortname}" == "samp" ]; then + fn_info_game_samp +elif [ "${shortname}" == "sb" ]; then + fn_info_game_sb +elif [ "${shortname}" == "sbots" ]; then + fn_info_game_sbots +elif [ "${shortname}" == "scpsl" ] || [ "${shortname}" == "scpslsm" ]; then + fn_info_game_scpsl +elif [ "${shortname}" == "sdtd" ]; then + fn_info_game_sdtd +elif [ "${shortname}" == "sf" ]; then + fn_info_game_sf +elif [ "${shortname}" == "sm" ]; then + fn_info_game_sm +elif [ "${shortname}" == "sof2" ]; then + fn_info_game_sof2 +elif [ "${shortname}" == "sol" ]; then + fn_info_game_sol +elif [ "${engine}" == "spark" ]; then + fn_info_game_spark +elif [ "${shortname}" == "squad" ]; then + fn_info_game_squad +elif [ "${shortname}" == "st" ]; then + fn_info_game_st +elif [ "${shortname}" == "stn" ]; then + fn_info_game_stn +elif [ "${shortname}" == "terraria" ]; then + fn_info_game_terraria +elif [ "${shortname}" == "tf" ]; then + fn_info_game_tf +elif [ "${shortname}" == "ti" ]; then + fn_info_game_ti +elif [ "${shortname}" == "ts3" ]; then + fn_info_game_ts3 +elif [ "${shortname}" == "tu" ]; then + fn_info_game_tu +elif [ "${shortname}" == "tw" ]; then + fn_info_game_tw +elif [ "${shortname}" == "unt" ]; then + fn_info_game_unt +elif [ "${shortname}" == "ut" ]; then + fn_info_game_ut +elif [ "${shortname}" == "ut2k4" ]; then + fn_info_game_ut2k4 +elif [ "${shortname}" == "ut3" ]; then + fn_info_game_ut3 +elif [ "${shortname}" == "ut99" ]; then + fn_info_game_ut99 +elif [ "${shortname}" == "vh" ]; then + fn_info_game_vh +elif [ "${shortname}" == "vints" ]; then + fn_info_game_vints +elif [ "${shortname}" == "vpmc" ]; then + fn_info_game_vpmc +elif [ "${shortname}" == "wet" ]; then + fn_info_game_wet +elif [ "${shortname}" == "wf" ]; then + fn_info_game_wf +elif [ "${shortname}" == "wmc" ]; then + fn_info_game_wmc +elif [ "${shortname}" == "wurm" ]; then + fn_info_game_wurm +elif [ "${engine}" == "prism3d" ]; then + fn_info_game_prism3d +elif [ "${engine}" == "source" ] || [ "${engine}" == "goldsrc" ]; then + fn_info_game_source +elif [ "${engine}" == "unreal2" ]; then + fn_info_game_unreal2 +elif [ "${shortname}" == "xnt" ]; then + fn_info_game_xnt +fi + +# Public IP address +# Cache public IP address for 24 hours +if [ ! -f "${tmpdir}/publicip.json" ] || [ "$(find "${tmpdir}/publicip.json" -mmin +1440)" ]; then + apiurl="http://ip-api.com/json" + fn_script_log_info "Querying ${apiurl} for public IP address" + + 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 + if [ "${exitcode}" -eq 0 ]; then + fn_script_log_pass "Queried ${apiurl} for public IP address" + + # Parse and reformat the response + publicip="$(echo "${ipresponse}" | jq -r '.query')" + country="$(echo "${ipresponse}" | jq -r '.country')" + countrycode="$(echo "${ipresponse}" | jq -r '.countryCode')" + # Construct a universal JSON format + echo "{\"ip\":\"${publicip}\",\"country\":\"${country}\",\"countryCode\":\"${countrycode}\",\"apiurl\":\"${apiurl}\"}" > "${tmpdir}/publicip.json" + else + # Fallback to myip.wtf if the initial request failed or timed out + apiurl="https://myip.wtf/json" + fn_script_log_pass "Querying ${apiurl} for public IP address" + + 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 + if [ "${exitcode}" -eq 0 ]; then + fn_script_log_pass "Queried ${apiurl} for public IP address" + + # Parse and reformat the response from myip.wtf + publicip="$(echo "${ipresponse}" | jq -r '.YourFuckingIPAddress')" + country="$(echo "${ipresponse}" | jq -r '.YourFuckingCountry')" + countrycode="$(echo "${ipresponse}" | jq -r '.YourFuckingCountryCode')" + # Construct a universal JSON format + echo "{\"ip\":\"${publicip}\",\"country\":\"${country}\",\"countryCode\":\"${countrycode}\",\"apiurl\":\"${apiurl}\"}" > "${tmpdir}/publicip.json" + else + fn_script_log_error "Unable to get public IP address" + publicip="NOT SET" + country="NOT SET" + countrycode="NOT SET" + fi + fi +else + # Cached IP is still valid + fn_script_log_pass "Using cached IP as public IP address" + publicip="$(jq -r '.ip' "${tmpdir}/publicip.json")" + country="$(jq -r '.country' "${tmpdir}/publicip.json")" + countrycode="$(jq -r '.countryCode' "${tmpdir}/publicip.json")" +fi + +# Alert IP address +if [ "${displayip}" ]; then + alertip="${displayip}" +elif [ "${publicip}" ]; then + alertip="${publicip}" +else + alertip="${ip}" +fi + +# Steam Master Server - checks if detected by master server. +# Checked after config init, as the queryport is needed +if [ -z "${displaymasterserver}" ]; then + # if queryport and port3 are not set then set them to 123456789 + # this is to prevent the query from failing. + if [ -z "${queryport}" ]; then + queryport="123456789" + fi + if [ -z "${port3}" ]; then + port3="123456789" + fi + if [ "$(command -v jq 2> /dev/null)" ]; then + if [ -n "${ip}" ] && [ -n "${port}" ]; then + if [ "${steammaster}" == "true" ] || [ "${commandname}" == "DEV-QUERY-RAW" ]; then + # Query external IP first as most liky to succeed. + masterserver="$(curl --connect-timeout 3 -m 3 -s "https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${publicip}&format=json" | jq --arg port "${port}" --arg queryport "${queryport}" --arg port3 "${port3}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber) or .gameport == ($port3|tonumber))) | .addr else empty end' | wc -l 2> /dev/null)" + if [ "${masterserver}" == "0" ]; then + # Loop though server IP addresses if external IP fails. + for queryip in "${queryips[@]}"; do + masterserver="$(curl --connect-timeout 3 -m 3 -s "https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${queryip}&format=json" | jq --arg port "${port}" --arg queryport "${queryport}" --arg port3 "${port3}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber) or .gameport == ($port3|tonumber))) | .addr else empty end' | wc -l 2> /dev/null)" + done + fi + if [ "${masterserver}" == "0" ]; then + displaymasterserver="false" + else + displaymasterserver="true" + fi + fi + fi + fi + # unset the ports if they are set to 123456789 + if [ "${port3}" == "123456789" ]; then + unset port3 + fi + if [ "${queryport}" == "123456789" ]; then + unset queryport + fi +fi diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh new file mode 100644 index 000000000..09576e861 --- /dev/null +++ b/lgsm/modules/info_messages.sh @@ -0,0 +1,1958 @@ +#!/bin/bash +# LinuxGSM info_messages.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Defines server info messages for details and alerts. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Removes the passwords form all but details. +fn_info_messages_password_strip() { + if [ "${commandname}" != "DETAILS" ]; then + if [ "${serverpassword}" ]; then + serverpassword="********" + fi + + if [ "${rconpassword}" ]; then + rconpassword="********" + fi + + if [ "${adminpassword}" ]; then + adminpassword="********" + fi + + if [ "${statspassword}" ]; then + statspassword="********" + fi + + if [ "${httppassword}" ]; then + httppassword="********" + fi + + if [ "${telnetpassword}" ]; then + telnetpassword="********" + fi + + if [ "${wsapikey}" ]; then + wsapikey="********" + fi + + if [ "${gslt}" ]; then + gslt="********" + fi + fi +} + +# Alert Summary +# used with alertlog +fn_info_messages_head() { + echo -e "" + echo -e "LinuxGSM Alert Summary" + fn_messages_separator + echo -e "" + echo -e "Server name" + echo -e "${servername}" + echo -e "" + echo -e "Information" + echo -e "${alertmessage}" + echo -e "" + echo -e "Game" + echo -e "${gamename}" + echo -e "" + echo -e "Server IP" + echo -e "${alertip}:${port}" + echo -e "" + echo -e "Hostname" + echo -e "${HOSTNAME}" + echo -e "" + echo -e "Server Time" + echo -e "$(date)" +} + +fn_info_messages_distro() { + # + # Distro Details + # ================================= + # Date: Sun 21 Feb 2021 09:22:53 AM UTC + # Distro: Ubuntu 20.04.2 LTS + # Arch: x86_64 + # Kernel: 5.4.0-65-generic + # Hostname: server + # Environment: kvm + # Uptime: 16d, 5h, 18m + # tmux: tmux 3.0a + # glibc: 2.31 + + echo -e "" + echo -e "${bold}${lightyellow}Distro Details${default}" + fn_messages_separator + { + echo -e "${lightblue}Date:\t${default}$(date)" + echo -e "${lightblue}Distro:\t${default}${distroname}" + echo -e "${lightblue}Arch:\t${default}${arch}" + echo -e "${lightblue}Kernel:\t${default}${kernel}" + echo -e "${lightblue}Hostname:\t${default}${HOSTNAME}" + echo -e "${lightblue}Environment:\t${default}${virtualenvironment}" + echo -e "${lightblue}Uptime:\t${default}${days}d, ${hours}h, ${minutes}m" + echo -e "${lightblue}tmux:\t${default}${tmuxversion}" + echo -e "${lightblue}glibc:\t${default}${glibcversion}" + if [ -n "${javaram}" ]; then + echo -e "${lightblue}Java:\t${default}${javaversion}" + fi + } | column -s $'\t' -t +} + +fn_info_messages_server_resource() { + # + # Server Resource + # ================================= + # CPU + # Model: AMD EPYC 7601 32-Core Processor + # Cores: 2 + # Frequency: 2199.994MHz + # Avg Load: 0.01, 0.05, 0.18 + # + # Memory + # Mem: total used free cached available + # Physical: 3.9GB 350MB 3.3GB 3.2GB 3.3GB + # Swap: 512MB 55MB 458MB + # + # Storage + # Filesystem: /dev/sda + # Total: 79G + # Used: 73G + # Available: 1.4G + # + # Network + # IP: 0.0.0.0 + # Internet IP: 176.58.124.96 + + echo -e "" + echo -e "${bold}${lightyellow}Server Resource${default}" + fn_messages_separator + { + 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" + echo -e "${lightblue}Avg Load:\t${default}${load}" + } | column -s $'\t' -t + echo -e "" + { + 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 "${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}" + echo -e "${lightblue}Available:\t${default}${availspace}" + } | column -s $'\t' -t + echo -e "" + { + echo -e "${bold}${lightyellow}Network${default}" + if [ -n "${netint}" ]; then + echo -e "${lightblue}Interface:\t${default}${netint}" + fi + if [ -n "${netlink}" ]; then + echo -e "${lightblue}Link Speed:\t${default}${netlink}" + fi + echo -e "${lightblue}IP:\t${default}${ip}" + if [ "${ip}" != "${publicip}" ]; then + echo -e "${lightblue}Internet IP:\t${default}${publicip}" + fi + } | column -s $'\t' -t +} + +fn_info_messages_gameserver_resource() { + # + # Game Server Resource Usage + # ================================= + # CPU Used: 1.1% + # Mem Used: 4.8% 189MB + # + # Storage + # Total: 241M + # Serverfiles: 240M + # Backups: 24K + + echo -e "" + echo -e "${bold}${lightgreen}${gamename} Resource Usage${default}" + fn_messages_separator + { + if [ "${status}" != "0" ] && [ -v status ]; then + if [ -n "${cpuused}" ]; then + echo -e "${lightblue}CPU Used:\t${default}${cpuused}%${default}" + else + echo -e "${lightblue}CPU Used:\t${red}unknown${default}" + fi + if [ -n "${memusedmb}" ]; then + echo -e "${lightblue}Mem Used:\t${default}${memusedpct}%\t${memusedmb}MB${default}" + else + echo -e "${lightblue}Mem Used:\t${default}${memusedpct}\t${red}unknown${default}" + fi + else + echo -e "${lightblue}CPU Used:\t${default}0%${default}" + echo -e "${lightblue}Mem Used:\t${default}0%\t0MB${default}" + fi + } | column -s $'\t' -t + echo -e "" + { + echo -e "${bold}${lightyellow}Storage${default}" + echo -e "${lightblue}Total:\t${default}${rootdirdu}" + echo -e "${lightblue}Serverfiles:\t${default}${serverfilesdu}" + if [ -d "${backupdir}" ]; then + echo -e "${lightblue}Backups:\t${default}${backupdirdu}" + fi + } | column -s $'\t' -t +} + +fn_info_messages_gameserver() { + # + # Counter-Strike: Global Offensive Server Details + # ================================= + # Server name: LinuxGSM + # Server IP: 0.0.0.0:27015 + # Internet IP: 176.48.124.96:34197 + # Server password: NOT SET + # RCON password: adminF54CC0VR + # Players: 0/16 + # Current map: de_mirage + # Default map: de_mirage + # Game type: 0 + # Game mode: 0 + # Tick rate: 64 + # Master Server: listed + # Status: STARTED + + echo -e "" + echo -e "${bold}${lightgreen}${gamename} Server Details${default}" + fn_info_messages_password_strip + fn_messages_separator + { + # Server name + if [ -n "${gdname}" ]; then + echo -e "${lightblue}Server name:\t${default}${gdname}" + elif [ -n "${servername}" ]; then + echo -e "${lightblue}Server name:\t${default}${servername}" + fi + + # Server description + if [ -n "${serverdescription}" ]; then + echo -e "${lightblue}Server Description:\t${default}${serverdescription}" + fi + + # Appid + if [ -n "${appid}" ]; then + echo -e "${lightblue}App ID:\t${default}${appid}" + fi + + # Branch + if [ -n "${branch}" ]; then + echo -e "${lightblue}Branch:\t${default}${branch}" + fi + + # Beta Password + if [ -n "${betapassword}" ]; then + echo -e "${lightblue}Beta Password:\t${default}${betapassword}" + fi + + # Server Version + if [ -n "${gdversion}" ]; then + echo -e "${lightblue}Server Version:\t${default}${gdversion}" + fi + + # Server ip + echo -e "${lightblue}Server IP:\t${default}${ip}:${port}" + + # Internet ip + if [ -n "${publicip}" ]; then + if [ "${ip}" != "${publicip}" ]; then + echo -e "${lightblue}Internet IP:\t${default}${publicip}:${port}" + fi + fi + + # Display ip + if [ -n "${displayip}" ]; then + echo -e "${lightblue}Display IP:\t${default}${displayip}:${port}" + fi + + # Server password enabled (Craftopia) + if [ -n "${serverpasswordenabled}" ]; then + echo -e "${lightblue}Server password enabled:\t${default}${serverpasswordenabled}" + fi + + # Server password + if [ -n "${serverpassword}" ]; then + echo -e "${lightblue}Server password:\t${default}${serverpassword}" + fi + + # Query enabled (Starbound, Minecraft) + if [ -n "${queryenabled}" ]; then + echo -e "${lightblue}Query enabled:\t${default}${queryenabled}" + fi + + # RCON enabled (Starbound) + if [ -n "${rconenabled}" ]; then + echo -e "${lightblue}RCON enabled:\t${default}${rconenabled}" + fi + + # RCON password + if [ -n "${rconpassword}" ]; then + echo -e "${lightblue}RCON password:\t${default}${rconpassword}" + fi + + # RCON web (Rust) + if [ -n "${rconweb}" ]; then + echo -e "${lightblue}RCON web:\t${default}${rconweb}" + fi + + # Admin password + if [ -n "${adminpassword}" ]; then + echo -e "${lightblue}Admin password:\t${default}${adminpassword}" + fi + + # Stats password (Quake Live) + if [ -n "${statspassword}" ]; then + echo -e "${lightblue}Stats password:\t${default}${statspassword}" + fi + + # Players + if [ "${querystatus}" != "0" ]; then + if [ -n "${maxplayers}" ]; then + echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}" + fi + else + if [ -n "${gdplayers}" ] && [ -n "${gdmaxplayers}" ]; then + echo -e "${lightblue}Players:\t${default}${gdplayers}/${gdmaxplayers}" + elif [ -n "${gdplayers}" ] && [ -n "${maxplayers}" ]; then + echo -e "${lightblue}Players:\t${default}${gdplayers}/${maxplayers}" + elif [ -z "${gdplayers}" ] && [ -n "${gdmaxplayers}" ]; then + echo -e "${lightblue}Players:\t${default}0/${gdmaxplayers}" + elif [ -n "${gdplayers}" ] && [ -z "${gdmaxplayers}" ]; then + echo -e "${lightblue}Players:\t${default}${gdplayers}/∞" + elif [ -z "${gdplayers}" ] && [ -z "${gdmaxplayers}" ] && [ -n "${maxplayers}" ]; then + echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}" + fi + fi + + # Reverved Slots + if [ -n "${statspassword}" ]; then + echo -e "${lightblue}Reserved Slots:\t${default}${reservedslots}" + fi + + # Bots + if [ -n "${gdbots}" ]; then + echo -e "${lightblue}Bots:\t${default}${gdbots}" + fi + + # Current map + if [ -n "${gdmap}" ]; then + echo -e "${lightblue}Current map:\t${default}${gdmap}" + fi + + # Default map + if [ -n "${defaultmap}" ]; then + echo -e "${lightblue}Default map:\t${default}${defaultmap}" + fi + + if [ -n "${defaultscenario}" ]; then + # Current scenario (Insurgency: Sandstorm) + if [ -n "${gdgamemode}" ]; then + echo -e "${lightblue}Current scenario:\t${default}${gdgamemode}" + fi + else + # Current game mode + if [ -n "${gdgamemode}" ]; then + echo -e "${lightblue}Current game mode:\t${default}${gdgamemode}" + fi + fi + + # Default scenario + if [ -n "${defaultscenario}" ]; then + echo -e "${lightblue}Default scenario:\t${default}${defaultscenario}" + fi + + # Game type + if [ -n "${gametype}" ]; then + echo -e "${lightblue}Game type:\t${default}${gametype}" + fi + + # Game mode + if [ -n "${gamemode}" ]; then + echo -e "${lightblue}Game mode:\t${default}${gamemode}" + fi + + # Game world + if [ -n "${gameworld}" ]; then + echo -e "${lightblue}Game world:\t${default}${gameworld}" + fi + + # Tick rate + if [ -n "${tickrate}" ]; then + echo -e "${lightblue}Tick rate:\t${default}${tickrate}" + fi + + # Sharding (Don't Starve Together) + if [ -n "${sharding}" ]; then + echo -e "${lightblue}Sharding:\t${default}${sharding}" + fi + + # Master (Don't Starve Together) + if [ -n "${master}" ]; then + echo -e "${lightblue}Master:\t${default}${master}" + fi + + # Shard (Don't Starve Together) + if [ -n "${shard}" ]; then + echo -e "${lightblue}Shard:\t${default}${shard}" + fi + + # Cluster (Don't Starve Together) + if [ -n "${cluster}" ]; then + echo -e "${lightblue}Cluster:\t${default}${cluster}" + fi + + # Cave (Don't Starve Together) + if [ -n "${cave}" ]; then + echo -e "${lightblue}Cave:\t${default}${cave}" + fi + + # Creativemode (Hurtworld) + if [ -n "${creativemode}" ]; then + echo -e "${lightblue}Creativemode:\t${default}${creativemode}" + fi + + # TeamSpeak dbplugin + if [ -n "${dbplugin}" ]; then + echo -e "${lightblue}dbplugin:\t${default}${dbplugin}" + fi + + # ASE (Multi Theft Auto) + if [ -n "${ase}" ]; then + echo -e "${lightblue}ASE:\t${default}${ase}" + fi + + # Save interval (Rust) + if [ -n "${saveinterval}" ]; then + echo -e "${lightblue}Save interval:\t${default}${saveinterval}s" + fi + + # Seed (Rust) + if [ -n "${seed}" ]; then + echo -e "${lightblue}Seed:\t${default}${seed}" + fi + + # Salt (Rust) + if [ -n "${salt}" ]; then + echo -e "${lightblue}Salt:\t${default}${salt}" + fi + + # World Size (Rust) + if [ -n "${worldsize}" ]; then + echo -e "${lightblue}World size:\t${default}${worldsize}m" + fi + + # Random map rotation mode (Squad and Post Scriptum) + if [ -n "${randommap}" ]; then + echo -e "${lightblue}Map rotation:\t${default}${randommap}" + fi + + # Server Version (Jedi Knight II: Jedi Outcast) + if [ -n "${serverversion}" ]; then + echo -e "${lightblue}Server Version:\t${default}${serverversion}" + fi + + # authentication token (Factorio) + if [ -n "${authtoken}" ]; then + echo -e "${lightblue}Auth Token:\t${default}${authtoken}" + fi + + # savegameinterval (Factorio) + if [ -n "${savegameinterval}" ]; then + echo -e "${lightblue}Savegame Interval:\t${default}${savegameinterval}" + fi + + # versioncount (Factorio) + if [ -n "${versioncount}" ]; then + echo -e "${lightblue}Version Count:\t${default}${versioncount}" + fi + + # backupinterval (Soulmask) + if [ -n "${backupinterval}" ]; then + echo -e "${lightblue}Backup Interval:\t${default}${backupinterval}" + fi + + # Listed on Master server + if [ -n "${displaymasterserver}" ]; then + if [ "${displaymasterserver}" == "true" ]; then + echo -e "${lightblue}Master server:\t${green}listed${default}" + else + echo -e "${lightblue}Master server:\t${red}not listed${default}" + fi + fi + + # Game server status + if [ "${status}" == "0" ]; then + echo -e "${lightblue}Status:\t${red}STOPPED${default}" + else + echo -e "${lightblue}Status:\t${green}STARTED${default}" + fi + } | column -s $'\t' -t + echo -e "" +} + +fn_info_messages_script() { + # csgoserver Script Details + # ================================= + # Script name: csgoserver + # LinuxGSM version: v21.1.3 + # glibc required: 2.18 + # Discord alert: off + # Email alert: off + # Gotify alert: off + # IFTTT alert: off + # Pushbullet alert: off + # Pushover alert: off + # Rocketchat alert: off + # Slack alert: off + # Telegram alert: off + # Update on start: off + # User: lgsm + # Location: /home/lgsm/csgoserver + # Config file: /home/lgsm/csgoserver/serverfiles/csgo/cfg/csgoserver.cfg + + echo -e "${bold}${lightgreen}${selfname} Script Details${default}" + fn_messages_separator + { + # Script name + echo -e "${lightblue}Script name:\t${default}${selfname}" + + # LinuxGSM version + if [ -n "${version}" ]; then + echo -e "${lightblue}LinuxGSM version:\t${default}${version}" + fi + + # glibc required + if [ -n "${glibc}" ]; then + if [ "${glibc}" == "null" ]; then + # Glibc is not required. + : + 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 + 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}" + fi + fi + + # Discord alert + if [ "${discordalert}" == "on" ]; then + echo -e "${lightblue}Discord alert:\t${default}${discordalert}" + fi + # Email alert + if [ "${emailalert}" == "on" ]; then + echo -e "${lightblue}Email alert:\t${default}${emailalert}" + fi + # Gotify alert + 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 + if [ "${pushbulletalert}" == "on" ]; then + echo -e "${lightblue}Pushbullet alert:\t${default}${pushbulletalert}" + fi + # Pushover alert + if [ "${pushoveralert}" == "on" ]; then + echo -e "${lightblue}Pushover alert:\t${default}${pushoveralert}" + fi + # Rocketchat alert + if [ "${rocketchatalert}" == "on" ]; then + echo -e "${lightblue}Rocketchat alert:\t${default}${rocketchatalert}" + fi + # Slack alert + if [ "${slackalert}" == "on" ]; then + echo -e "${lightblue}Slack alert:\t${default}${slackalert}" + fi + # Telegram alert + if [ "${telegramalert}" == "on" ]; then + echo -e "${lightblue}Telegram alert:\t${default}${telegramalert}" + fi + + # Update on start + if [ -n "${updateonstart}" ]; then + echo -e "${lightblue}Update on start:\t${default}${updateonstart}" + fi + + # User + echo -e "${lightblue}User:\t${default}$(whoami)" + + # Script location + echo -e "${lightblue}Location:\t${default}${rootdir}" + + # Config file location + if [ -n "${servercfgfullpath}" ]; then + if [ -f "${servercfgfullpath}" ]; then + echo -e "${lightblue}Config file:\t${default}${servercfgfullpath}" + elif [ -d "${servercfgfullpath}" ]; then + echo -e "${lightblue}Config dir:\t${default}${servercfgfullpath}" + else + echo -e "${lightblue}Config file:\t${default}${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})" + fi + fi + + # Network config file location (ARMA 3) + if [ -n "${networkcfgfullpath}" ]; then + echo -e "${lightblue}Network config file:\t${default}${networkcfgfullpath}" + fi + + # Cluster config file location (DST) + if [ -n "${clustercfgfullpath}" ]; then + echo -e "${lightblue}Cluster config file:\t${default}${clustercfgfullpath}" + fi + + } | column -s $'\t' -t +} + +fn_info_messages_backup() { + # + # Backups + # ================================= + # No. of backups: 1 + # Latest backup: + # date: Fri May 6 18:34:19 UTC 2016 + # file: /home/lgsm/qlserver/backups/ql-server-2016-05-06-183239.tar.gz + # size: 945M + + echo -e "" + echo -e "${bold}${lightgreen}Backups${default}" + fn_messages_separator + if [ ! -d "${backupdir}" ] || [ "${backupcount}" == "0" ]; then + echo -e "No Backups created" + else + { + echo -e "${lightblue}No. of backups:\t${default}${backupcount}" + echo -e "${lightblue}Latest backup:${default}" + if [ "${lastbackupdaysago}" == "0" ]; then + echo -e "${lightblue} date:\t${default}${lastbackupdate} (less than 1 day ago)" + elif [ "${lastbackupdaysago}" == "1" ]; then + echo -e "${lightblue} date:\t${default}${lastbackupdate} (1 day ago)" + else + echo -e "${lightblue} date:\t${default}${lastbackupdate} (${lastbackupdaysago} days ago)" + fi + echo -e "${lightblue} file:\t${default}${lastbackup}" + echo -e "${lightblue} size:\t${default}${lastbackupsize}" + } | column -s $'\t' -t + fi +} + +fn_info_messages_commandlineparms() { + # + # Command-line Parameters + # ================================= + # ./run_server_x86.sh +set net_strict 1 + + echo -e "" + echo -e "${bold}${lightgreen}Command-line Parameters${default}" + fn_info_messages_password_strip + fn_messages_separator + if [ "${serverpassword}" == "NOT SET" ]; then + unset serverpassword + fi + fn_reload_startparameters + echo -e "${preexecutable} ${executable} ${startparameters}" +} + +fn_info_messages_ports_edit() { + # + # Ports + # ================================= + # Change ports by editing the parameters in: + # /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg + echo -e "" + echo -e "${bold}${lightgreen}Ports${default}" + fn_messages_separator + echo -e "${lightblue}Change ports by editing the parameters in:${default}" + + startparameterslocation="${red}UNKNOWN${default}" + # engines/games that require editing in the config file. + local ports_edit_array=("ac" "arma3" "armar" "bo" "bt" "ct" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "nec" "pc" "pc2" "prism3d" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "stn" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "xnt" "wurm") + for port_edit in "${ports_edit_array[@]}"; do + if [ "${shortname}" == "ut3" ]; then + startparameterslocation="${servercfgdir}/UTWeb.ini" + elif [ "${shortname}" == "kf2" ]; then + startparameterslocation="${servercfgdir}/LinuxServer-KFEngine.ini\n${servercfgdir}/KFWeb.ini" + elif [ "${engine}" == "${port_edit}" ] || [ "${gamename}" == "${port_edit}" ] || [ "${shortname}" == "${port_edit}" ]; then + startparameterslocation="${servercfgfullpath}" + fi + done + # engines/games that require editing the start parameters. + local ports_edit_array=("av" "ck" "col" "cs2" "fctr" "goldsrc" "hcu" "hw" "iw3.0" "ioquake3" "pw" "qfusion" "rust" "scpsl" "scpslsm" "sf" "sol" "spark" "source" "unreal4" "arma3" "dayz" "unt" "vh") + for port_edit in "${ports_edit_array[@]}"; do + if [ "${engine}" == "${port_edit}" ] || [ "${gamename}" == "${port_edit}" ] || [ "${shortname}" == "${port_edit}" ]; then + startparameterslocation="${configdirserver}" + fi + done + echo -e "${startparameterslocation}" + echo -e "" +} + +fn_info_messages_ports() { + echo -e "${lightblue}Useful port diagnostic command:${default}" + if [ "${shortname}" == "armar" ]; then + portcommand="ss -tuplwn | grep enfMain" + elif [ "${shortname}" == "av" ]; then + portcommand="ss -tuplwn | grep AvorionServer" + elif [ "${shortname}" == "bf1942" ]; then + portcommand="ss -tuplwn | grep bf1942_lnxded" + elif [ "${shortname}" == "bfv" ]; then + portcommand="ss -tuplwn | grep bfv_linded" + elif [ "${shortname}" == "dayz" ]; then + portcommand="ss -tuplwn | grep enfMain" + elif [ "${shortname}" == "q4" ]; then + portcommand="ss -tuplwn | grep q4ded.x86" + elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "nec" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then + portcommand="ss -tuplwn | grep java" + elif [ "${shortname}" == "terraria" ]; then + portcommand="ss -tuplwn | grep Main" + elif [ "${shortname}" == "sm" ]; then + portcommand="ss -tuplwn | grep WSServer-Linux" + elif [ "${engine}" == "source" ]; then + portcommand="ss -tuplwn | grep srcds_linux" + elif [ "${engine}" == "goldsrc" ]; then + portcommand="ss -tuplwn | grep hlds_linux" + else + executableshort="$(basename "${executable}" | cut -c -15)" + portcommand="ss -tuplwn | grep ${executableshort}" + fi + echo -e "${portcommand}" + echo -e "" +} + +fn_info_messages_statusbottom() { + echo -e "" + if [ "${status}" == "0" ]; then + echo -e "${lightblue}Status:\t${red}STOPPED${default}" + else + echo -e "${lightblue}Status:\t${green}STARTED${default}" + fi + echo -e "" +} + +fn_info_logs() { + echo -e "" + echo -e "${bold}${selfname} Logs" + fn_messages_separator + + if [ -n "${lgsmlog}" ]; then + echo -e "\nScript log\n===================" + if [ ! "$(ls -A "${lgsmlogdir}")" ]; then + echo -e "${lgsmlogdir} (NO LOG FILES)" + elif [ ! -s "${lgsmlog}" ]; then + echo -e "${lgsmlog} (LOG FILE IS EMPTY)" + else + echo -e "${lgsmlog}" + tail -25 "${lgsmlog}" + fi + echo -e "" + fi + + if [ -n "${consolelog}" ]; then + echo -e "\nConsole log\n====================" + if [ ! "$(ls -A "${consolelogdir}")" ]; then + echo -e "${consolelogdir} (NO LOG FILES)" + elif [ ! -s "${consolelog}" ]; then + echo -e "${consolelog} (LOG FILE IS EMPTY)" + else + echo -e "${consolelog}" + tail -25 "${consolelog}" | awk '{ sub("\r$", ""); print }' + fi + echo -e "" + fi + + if [ -n "${gamelogdir}" ]; then + echo -e "\nServer log\n===================" + if [ ! "$(ls -A "${gamelogdir}")" ]; then + echo -e "${gamelogdir} (NO LOG FILES)" + else + echo -e "${gamelogdir}" + # dos2unix sed 's/\r//' + tail "${gamelogdir}"/* 2> /dev/null | grep -av "==>" | sed '/^$/d' | sed 's/\r//' | tail -25 + fi + echo -e "" + fi +} + +# Engine/Game Specific details + +# Function used to generate port info. by passing info to function. (Reduces repeating code) +# example output +# DESCRIPTION PORT PROTOCOL LISTEN +# Game 7777 udp 1 +# RAW UDP Socket 7778 udp 1 +# Query 27015 udp 1 +# RCON 27020 tcp 1 + +fn_port() { + if [ "${1}" == "header" ]; then + echo -e "${lightblue}DESCRIPTION\tPORT\tPROTOCOL\tLISTEN${default}" + else + portname="${1}" + porttype="${2}" + portprotocol="${3}" + echo -e "${portname}\t${!porttype}\t${portprotocol}\t$(echo "${ssinfo}" | grep "${portprotocol}" | grep -c "${!porttype}")" + fi +} + +fn_info_messages_ac() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Game" port tcp + fn_port "Query" queryport udp + fn_port "HTTP" httpport tcp + } | column -s $'\t' -t +} + +fn_info_messages_ark() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "RAW UDP Socket" rawport udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_messages_arma3() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Voice" voiceport udp + fn_port "Query" queryport udp + fn_port "Steam" steamport udp + fn_port "Voice (unused)" voiceunusedport udp + fn_port "BattleEye" battleeyeport udp + } | column -s $'\t' -t +} + +fn_info_messages_armar() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "BattleEye" battleeyeport tcp + } | column -s $'\t' -t +} + +fn_info_messages_av() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Steam" steamport udp + fn_port "Steamworks P2P" steamworksport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_messages_bf1942() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_bfv() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_bo() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_bt() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_btl() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_messages_cd() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Steam" steamport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_messages_ck() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_cmw() { + fn_info_messages_password_strip + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_messages_cod() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_coduo() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_cod2() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_cod4() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_codwaw() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_col() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "Steam" steamport tcp + } | column -s $'\t' -t +} + +fn_info_messages_cs2() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + } | column -s $'\t' -t +} + +fn_info_messages_csgo() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "RCON" rconport tcp + fn_port "SourceTV" sourcetvport udp + fn_port "Client" clientport udp + } | column -s $'\t' -t +} + +fn_info_messages_ct() { + fn_info_messages_password_strip + { + fn_port "header" + fn_port "Game" port udp + } | column -s $'\t' -t +} + +fn_info_messages_dayz() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query Steam" queryport udp + fn_port "Steam" steamport udp + fn_port "BattleEye" battleeyeport udp + } | column -s $'\t' -t +} + +fn_info_messages_dodr() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_dst() { + { + fn_port "header" + fn_port "Game: Server" port udp + fn_port "Game: Master" masterport udp + fn_port "Steam" steamport udp + fn_port "Steam: Auth" steamauthport udp + } | column -s $'\t' -t +} + +fn_info_messages_eco() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Web Interface" httpport tcp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_messages_etl() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_fctr() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_messages_goldsrc() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "Client" clientport udp + } | column -s $'\t' -t +} + +fn_info_messages_hcu() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + } | column -s $'\t' -t +} + +fn_info_messages_hw() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_hz() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_messages_ins() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "RCON" rconport tcp + fn_port "SourceTV" sourcetvport udp + fn_port "Client" clientport udp + } | column -s $'\t' -t +} + +fn_info_messages_inss() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_messages_jc2() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_jc3() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Steam" steamport udp + fn_port "HTTP" httpport tcp + } | column -s $'\t' -t +} + +fn_info_messages_jk2() { + { + fn_port "header" + fn_port "Game" port udp + } | column -s $'\t' -t +} + +fn_info_messages_kf() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query - Steam" queryport udp + fn_port "Query - Unreal 2" unreal2queryport udp + fn_port "Query - Gamespy" gamespyqueryport udp + fn_port "Web Interface" httpport tcp + fn_port "LAN" lanport udp + fn_port "Steam" steamport udp + } | column -s $'\t' -t + echo -e "" + echo -e "${bold}${lightgreen}${servername} Web Interface${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" + echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}" + echo -e "${lightblue}Web Interface username:\t${default}${httpuser}" + echo -e "${lightblue}Web Interface password:\t${default}${httppassword}" + } | column -s $'\t' -t +} + +fn_info_messages_kf2() { + fn_info_messages_password_strip + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Web Interface" httpport tcp + } | column -s $'\t' -t + echo -e "" + echo -e "${bold}${lightgreen}${servername} Web Interface${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" + echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}" + echo -e "${lightblue}Web Interface username:\t${default}${httpuser}" + echo -e "${lightblue}Web Interface password:\t${default}${httppassword}" + } | column -s $'\t' -t +} + +fn_info_messages_mc() { + { + fn_port "header" + fn_port "Game" port tcp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_messages_mcb() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Game" portipv6 udp6 + } | column -s $'\t' -t +} + +fn_info_messages_mh() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Beacon" beaconport udp + } | column -s $'\t' -t +} + +fn_info_messages_mohaa() { + { + fn_port "header" + fn_port "Game" port udp + } | column -s $'\t' -t +} + +fn_info_messages_mta() { + { + fn_port "header" + fn_port "Game" port udp + if [ "${ase}" == "Enabled" ]; then + fn_port "Query" queryport udp + fi + fn_port "HTTP" httpport tcp + } | column -s $'\t' -t +} + +fn_info_messages_nec() { + { + fn_port "header" + fn_port "Game" port udp + } | column -s $'\t' -t +} + +fn_info_messages_ohd() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_messages_onset() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "HTTP" httpport tcp + } | column -s $'\t' -t +} + +fn_info_messages_pc() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Steam" steamport udp + fn_port "HTTP" httpport tcp + fn_port "API" apiport tcp + } | column -s $'\t' -t + echo -e "" + echo -e "${bold}${lightgreen}${gamename} Web Interface${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" + echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}" + } | column -s $'\t' -t +} + +fn_info_messages_pc2() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Steam" steamport udp + } | column -s $'\t' -t +} + +fn_info_messages_ps() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_messages_pvr() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Game" port tcp + fn_port "Game+400" port401 udp + fn_port "Query" queryport tcp + } | column -s $'\t' -t +} + +fn_info_messages_pw() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Steam" steamport udp + fn_port "Unknown" unknownport tcp + } | column -s $'\t' -t +} + +fn_info_messages_pz() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_qw() { + { + fn_port "header" + fn_port "Game" port udp + } | column -s $'\t' -t +} + +fn_info_messages_q2() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_q3() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_q4() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_ql() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + fn_port "Stats" statsport udp + } | column -s $'\t' -t +} + +fn_info_messages_ro() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query - Steam" queryport udp + fn_port "Query - Unreal 2" unreal2queryport udp + fn_port "Web Interface" httpport tcp + fn_port "LAN" lanport udp + fn_port "Steam" steamport udp + + } | column -s $'\t' -t + echo -e "" + echo -e "${bold}${lightgreen}${servername} Web Interface${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" + echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}" + echo -e "${lightblue}Web Interface username:\t${default}${httpuser}" + echo -e "${lightblue}Web Interface password:\t${default}${httppassword}" + } | column -s $'\t' -t +} + +fn_info_messages_rtcw() { + { + fn_port "header" + fn_port "Game" port udp + } | column -s $'\t' -t +} + +fn_info_messages_rust() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + fn_port "App" appport tcp + } | column -s $'\t' -t +} + +fn_info_messages_rw() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_messages_samp() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "RCON" rconport udp + } | column -s $'\t' -t +} + +fn_info_messages_sb() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_messages_sbots() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_scpsl() { + { + fn_port "header" + fn_port "Game" port tcp + } | column -s $'\t' -t +} + +fn_info_messages_sdtd() { + fn_info_messages_password_strip + { + fn_port "header" + fn_port "Game" port udp + fn_port "Game+2" port3 udp + fn_port "Query" queryport tcp + fn_port "Web Interface" httpport tcp + fn_port "Telnet" telnetport tcp + } | column -s $'\t' -t + echo -e "" + echo -e "${bold}${lightgreen}${gamename} Web Interface${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" + echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}/index.html" + echo -e "${lightblue}Web Interface password:\t${default}${httppassword}" + } | column -s $'\t' -t + echo -e "" + echo -e "${bold}${lightgreen}${gamename} Telnet${default}" + fn_messages_separator + { + echo -e "${lightblue}Telnet enabled:\t${default}${telnetenabled}" + echo -e "${lightblue}Telnet address:\t${default}${telnetip} ${telnetport}" + echo -e "${lightblue}Telnet password:\t${default}${telnetpassword}" + } | column -s $'\t' -t +} + +fn_info_messages_sf() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Beacon" beaconport udp + } | column -s $'\t' -t +} + +fn_info_messages_sm() { + fn_info_messages_password_strip + { + 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 + echo -e "" + echo -e "${bold}${lightgreen}${gamename} Telnet${default}" + fn_messages_separator + { + echo -e "${lightblue}Telnet enabled:\t${default}${telnetenabled}" + echo -e "${lightblue}Telnet address:\t${default}${telnetip} ${telnetport}" + } | column -s $'\t' -t +} + +fn_info_messages_sof2() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_sol() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Files" filesport tcp + } | column -s $'\t' -t +} + +fn_info_messages_prism3d() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_source() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "RCON" rconport tcp + fn_port "SourceTV" sourcetvport udp + # Will not show if unavailable + if [ "${steamport}" == "0" ] || [ -v "${steamport}" ]; then + fn_port "Steam" steamport udp + fi + fn_port "Client" clientport udp + } | column -s $'\t' -t +} + +fn_info_messages_spark() { + fn_info_messages_password_strip + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Mod Server" modserverport tcp + fn_port "Web Interface" httpport tcp + } | column -s $'\t' -t + echo -e "" + echo -e "${bold}${lightgreen}${gamename} Web Interface${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}/index.html" + echo -e "${lightblue}Web Interface username:\t${default}${httpuser}" + echo -e "${lightblue}Web Interface password:\t${default}${httppassword}" + } | column -s $'\t' -t +} + +fn_info_messages_squad() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_messages_st() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_stn() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_ti() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Queue" queueport tcp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_messages_ts3() { + { + fn_port "header" + fn_port "Voice" port udp + fn_port "Query" queryport tcp + fn_port "Query (SSH)" sshqueryport tcp + fn_port "Query (http)" httpqueryport tcp + fn_port "Query (https)" httpsqueryport tcp + fn_port "File Transfer" fileport tcp + fn_port "Telnet" telnetport tcp + } | column -s $'\t' -t +} + +fn_info_messages_tw() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_terraria() { + { + fn_port "header" + fn_port "Game" port tcp + fn_port "Query" queryport tcp + } | column -s $'\t' -t +} + +fn_info_messages_tu() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Steam" steamport udp + } | column -s $'\t' -t +} + +fn_info_messages_tf() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "Beacon" beaconport udp + fn_port "Shutdown" shutdownport tcp + } | column -s $'\t' -t +} + +fn_info_messages_ut2k4() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query - Unreal 2" queryport udp + fn_port "Query - Gamespy" gamespyqueryport udp + fn_port "Web Interface" httpport tcp + fn_port "LAN" lanport udp + } | column -s $'\t' -t + echo -e "" + echo -e "${bold}${lightgreen}${gamename} Web Interface${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" + echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}" + echo -e "${lightblue}Web Interface username:\t${default}${httpuser}" + echo -e "${lightblue}Web Interface password:\t${default}${httppassword}" + } | column -s $'\t' -t +} + +fn_info_messages_unreal() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "LAN Beacon" beaconport udp + fn_port "Web Interface" httpport tcp + } | column -s $'\t' -t + echo -e "" + echo -e "${bold}${lightgreen}${gamename} Web Interface${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" + echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}" + echo -e "${lightblue}Web Interface username:\t${default}${httpuser}" + echo -e "${lightblue}Web Interface password:\t${default}${httppassword}" + } | column -s $'\t' -t +} + +fn_info_messages_unt() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Steam" steamport udp + } | column -s $'\t' -t +} + +fn_info_messages_ut() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_ut3() { + fn_info_messages_password_strip + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Web Interface" httpport tcp + } | column -s $'\t' -t + echo -e "" + echo -e "${bold}${lightgreen}${gamename} Web Interface${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" + echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}" + echo -e "${lightblue}Web Interface username:\t${default}${httpuser}" + echo -e "${lightblue}Web Interface password:\t${default}${httppassword}" + } | column -s $'\t' -t +} + +fn_info_messages_vh() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_vints() { + { + fn_port "header" + fn_port "Game" port tcp + } | column -s $'\t' -t +} + +fn_info_messages_vpmc() { + { + fn_port "header" + fn_port "Game" port tcp + } | column -s $'\t' -t +} + +fn_info_messages_wet() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_wf() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "HTTP" httpport tcp + } | column -s $'\t' -t +} + +fn_info_messages_wurm() { + { + fn_port "header" + fn_port "Game" port tcp + fn_port "Query" queryport udp + fn_port "RMI" rmiport tcp + fn_port "RMI Registry" rmiregport tcp + } | column -s $'\t' -t +} + +fn_info_messages_xnt() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_messages_select_engine() { + # Display details depending on game or engine. + if [ "${shortname}" == "ac" ]; then + fn_info_messages_ac + elif [ "${shortname}" == "ark" ]; then + fn_info_messages_ark + elif [ "${shortname}" == "arma3" ]; then + fn_info_messages_arma3 + elif [ "${shortname}" == "armar" ]; then + fn_info_messages_armar + elif [ "${shortname}" == "av" ]; then + fn_info_messages_av + elif [ "${shortname}" == "bf1942" ]; then + fn_info_messages_bf1942 + elif [ "${shortname}" == "bfv" ]; then + fn_info_messages_bfv + elif [ "${shortname}" == "bo" ]; then + fn_info_messages_bo + elif [ "${shortname}" == "bt" ]; then + fn_info_messages_bt + elif [ "${shortname}" == "btl" ]; then + fn_info_messages_btl + elif [ "${shortname}" == "ck" ]; then + fn_info_messages_ck + elif [ "${shortname}" == "cs2" ]; then + fn_info_messages_cs2 + elif [ "${shortname}" == "csgo" ]; then + fn_info_messages_csgo + elif [ "${shortname}" == "cmw" ]; then + fn_info_messages_cmw + elif [ "${shortname}" == "cod" ]; then + fn_info_messages_cod + elif [ "${shortname}" == "coduo" ]; then + fn_info_messages_coduo + elif [ "${shortname}" == "cod2" ]; then + fn_info_messages_cod2 + elif [ "${shortname}" == "cod4" ]; then + fn_info_messages_cod4 + elif [ "${shortname}" == "codwaw" ]; then + fn_info_messages_codwaw + elif [ "${shortname}" == "col" ]; then + fn_info_messages_col + elif [ "${shortname}" == "ct" ]; then + fn_info_messages_ct + elif [ "${shortname}" == "dayz" ]; then + fn_info_messages_dayz + elif [ "${shortname}" == "dodr" ]; then + fn_info_messages_dodr + elif [ "${shortname}" == "dst" ]; then + fn_info_messages_dst + elif [ "${shortname}" == "eco" ]; then + fn_info_messages_eco + elif [ "${shortname}" == "etl" ]; then + fn_info_messages_etl + elif [ "${shortname}" == "fctr" ]; then + fn_info_messages_fctr + elif [ "${shortname}" == "hcu" ]; then + fn_info_messages_hcu + elif [ "${shortname}" == "hw" ]; then + fn_info_messages_hw + elif [ "${shortname}" == "hz" ]; then + fn_info_messages_hz + elif [ "${shortname}" == "ins" ]; then + fn_info_messages_ins + elif [ "${shortname}" == "inss" ]; then + fn_info_messages_inss + elif [ "${shortname}" == "jc2" ]; then + fn_info_messages_jc2 + elif [ "${shortname}" == "jc3" ]; then + fn_info_messages_jc3 + elif [ "${shortname}" == "jk2" ]; then + fn_info_messages_jk2 + elif [ "${shortname}" == "kf" ]; then + fn_info_messages_kf + elif [ "${shortname}" == "kf2" ]; then + fn_info_messages_kf2 + elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "wmc" ]; then + fn_info_messages_mc + elif [ "${shortname}" == "mcb" ]; then + fn_info_messages_mcb + elif [ "${shortname}" == "mh" ]; then + fn_info_messages_mh + elif [ "${shortname}" == "mohaa" ]; then + fn_info_messages_mohaa + elif [ "${shortname}" == "mta" ]; then + fn_info_messages_mta + elif [ "${shortname}" == "nec" ]; then + fn_info_messages_nec + elif [ "${shortname}" == "ohd" ]; then + fn_info_messages_ohd + elif [ "${shortname}" == "onset" ]; then + fn_info_messages_onset + elif [ "${shortname}" == "pc" ]; then + fn_info_messages_pc + elif [ "${shortname}" == "pc2" ]; then + fn_info_messages_pc2 + elif [ "${shortname}" == "ps" ]; then + fn_info_messages_ps + elif [ "${shortname}" == "pvr" ]; then + fn_info_messages_pvr + elif [ "${shortname}" == "pw" ]; then + fn_info_messages_pw + elif [ "${shortname}" == "pz" ]; then + fn_info_messages_pz + elif [ "${shortname}" == "q2" ]; then + fn_info_messages_q2 + elif [ "${shortname}" == "q3" ]; then + fn_info_messages_q3 + elif [ "${shortname}" == "q4" ]; then + fn_info_messages_q3 + elif [ "${shortname}" == "ql" ]; then + fn_info_messages_ql + elif [ "${shortname}" == "qw" ]; then + fn_info_messages_qw + elif [ "${shortname}" == "ro" ]; then + fn_info_messages_ro + elif [ "${shortname}" == "rtcw" ]; then + fn_info_messages_rtcw + elif [ "${shortname}" == "samp" ]; then + fn_info_messages_samp + elif [ "${shortname}" == "sb" ]; then + fn_info_messages_sb + elif [ "${shortname}" == "sbots" ]; then + fn_info_messages_sbots + elif [ "${shortname}" == "scpsl" ] || [ "${shortname}" == "scpslsm" ]; then + fn_info_messages_scpsl + elif [ "${shortname}" == "sdtd" ]; then + fn_info_messages_sdtd + elif [ "${shortname}" == "sf" ]; then + fn_info_messages_sf + elif [ "${shortname}" == "sm" ]; then + fn_info_messages_sm + elif [ "${shortname}" == "sof2" ]; then + fn_info_messages_sof2 + elif [ "${shortname}" == "sol" ]; then + fn_info_messages_sol + elif [ "${shortname}" == "squad" ]; then + fn_info_messages_squad + elif [ "${shortname}" == "st" ]; then + fn_info_messages_st + elif [ "${shortname}" == "stn" ]; then + fn_info_messages_stn + elif [ "${shortname}" == "terraria" ]; then + fn_info_messages_terraria + elif [ "${shortname}" == "tf" ]; then + fn_info_messages_tf + elif [ "${shortname}" == "ti" ]; then + fn_info_messages_ti + elif [ "${shortname}" == "ts3" ]; then + fn_info_messages_ts3 + elif [ "${shortname}" == "tu" ]; then + fn_info_messages_tu + elif [ "${shortname}" == "tw" ]; then + fn_info_messages_tw + elif [ "${shortname}" == "unt" ]; then + fn_info_messages_unt + elif [ "${shortname}" == "vh" ]; then + fn_info_messages_vh + elif [ "${shortname}" == "vints" ]; then + fn_info_messages_vints + elif [ "${shortname}" == "rust" ]; then + fn_info_messages_rust + elif [ "${shortname}" == "rw" ]; then + fn_info_messages_rw + elif [ "${shortname}" == "ut" ]; then + fn_info_messages_ut + elif [ "${shortname}" == "ut2k4" ]; then + fn_info_messages_ut2k4 + elif [ "${shortname}" == "ut3" ]; then + fn_info_messages_ut3 + elif [ "${shortname}" == "vpmc" ]; then + fn_info_messages_vpmc + elif [ "${shortname}" == "wet" ]; then + fn_info_messages_wet + elif [ "${shortname}" == "wf" ]; then + fn_info_messages_wf + elif [ "${shortname}" == "wurm" ]; then + fn_info_messages_wurm + elif [ "${shortname}" == "xnt" ]; then + fn_info_messages_xnt + elif [ "${engine}" == "goldsrc" ]; then + fn_info_messages_goldsrc + elif [ "${engine}" == "prism3d" ]; then + fn_info_messages_prism3d + elif [ "${engine}" == "source" ]; then + fn_info_messages_source + elif [ "${engine}" == "spark" ]; then + fn_info_messages_spark + elif [ "${engine}" == "unreal" ]; then + fn_info_messages_unreal + else + fn_print_error_nl "Unable to detect game server." + fi +} diff --git a/lgsm/modules/info_stats.sh b/lgsm/modules/info_stats.sh new file mode 100644 index 000000000..b995d0e3b --- /dev/null +++ b/lgsm/modules/info_stats.sh @@ -0,0 +1,173 @@ +#!/bin/bash +# LinuxGSM info_stats.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Collect optional Stats sent to LinuxGSM project. +# Uses Google analytics. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +info_distro.sh + +# remove uuid that was used in v20.2.0 and below +if [ -f "${datadir}/uuid.txt" ]; then + rm -f "${datadir:?}/uuid.txt" +fi + +# generate uuid's +# this consists of a standard uuid and a docker style name +# to allow human readable uuid's. +# e.g angry_proskuriakova_38a9ef76-4ae3-46a6-a895-7af474831eba + +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" + fi + if [ ! -f "${datadir}/name-right.csv" ]; then + fn_fetch_file_github "${datadir}" "name-right.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nohash" + fi + + # generate instance uuid + if [ -n "$(command -v uuidgen 2> /dev/null)" ]; then + uuid="$(uuidgen)" + else + uuid="$(cat /proc/sys/kernel/random/uuid)" + fi + + nameleft="$(shuf -n 1 "${datadir}/name-left.csv")" + nameright="$(shuf -n 1 "${datadir}/name-right.csv")" + echo "instance_${nameleft}_${nameright}_${uuid}" > "${datadir}/uuid-${selfname}.txt" + # generate install uuid if missing + if [ ! -f "${datadir}/uuid-install.txt" ]; then + echo "${nameleft}_${nameright}_${uuid}" > "${datadir}/uuid-install.txt" + fi +fi + +uuidinstance=$(cat "${datadir}/uuid-${selfname}.txt") +uuidinstall=$(cat "${datadir}/uuid-install.txt") +# machine-id is a unique id set on OS install +uuidhardware=$(cat "/etc/machine-id") + +# results are rounded up to reduce number of different results in analytics. +# nearest 100Mhz. +cpuusedmhzroundup="$(((cpuusedmhz + 99) / 100 * 100))" +# nearest 100MB +memusedmbroundup="$(((memusedmb + 99) / 100 * 100))" + +# Convert any commas to dots. +physmemtotal="${physmemtotal//,/.}" + +apisecret="A-OzP02TSMWt4_vHi6ZpUw" +measurementid="G-0CR8V7EMT5" + +# Sending stats to Google Analytics GA4 +payload="{ + \"client_id\": \"${uuidinstance}\", + \"events\": [ + { + \"name\": \"LinuxGSM\", + \"params\": { + \"cpuusedmhzroundup\": \"${cpuusedmhzroundup}\", + \"diskused\": \"${serverfilesdu}\", + \"distro\": \"${distroname}\", + \"game\": \"${gamename}\", + \"memusedmbroundup\": \"${memusedmbroundup}\", + \"ramused\": \"${memusedmbroundup}\", + \"servercpu\": \"${cpumodel} ${cpucores} cores\", + \"servercpufreq\": \"${cpufreqency} x${cpucores}\", + \"serverdisk\": \"${totalspace}\", + \"serverfilesdu\": \"${serverfilesdu}\", + \"serverram\": \"${physmemtotal}\", + \"serverramgb\": \"${physmemtotalgb}\", + \"uuidhardware\": \"${uuidhardware}\", + \"uuidinstall\": \"${uuidinstall}\", + \"uuidinstance\": \"${uuidinstance}\", + \"version\": \"${version}\", + \"virtualenvironment\": \"${virtualenvironment}\", + \"tmuxversion\": \"${tmuxversion}\", + \"java\": \"${javaversion}\" + } + } + ] +}" + +fn_alert_payload() { + alertpayload="{ + \"client_id\": \"${uuidinstance}\", + \"events\": [ + { + \"name\": \"LinuxGSM\", + \"params\": { + \"alert\": \"${alerttype}\" + } + } + ] +}" +} + +curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=A-OzP02TSMWt4_vHi6ZpUw&measurement_id=G-0CR8V7EMT5" -H "Content-Type: application/json" -d "${payload}" + +if [ "${discordalert}" == "on" ]; then + alerttype="discord" + fn_alert_payload + curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" +fi +if [ "${emailalert}" == "on" ]; then + alerttype="email" + fn_alert_payload + curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" +fi +if [ "${gotifyalert}" == "on" ]; then + alerttype="gotify" + fn_alert_payload + curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" +fi +if [ "${iftttalert}" == "on" ]; then + alerttype="ifttt" + fn_alert_payload + curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" +fi +if [ "${pushbulletalert}" == "on" ]; then + alerttype="pushbullet" + fn_alert_payload + curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" +fi +if [ "${pushoveralert}" == "on" ]; then + alerttype="pushover" + fn_alert_payload + curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" +fi +if [ "${rocketchatalert}" == "on" ]; then + alerttype="rocketchat" + fn_alert_payload + curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" +fi +if [ "${slackalert}" == "on" ]; then + alerttype="slack" + fn_alert_payload + curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" +fi +if [ "${telegramalert}" == "on" ]; then + alerttype="telegram" + fn_alert_payload + curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" +fi + +fn_script_log_info "Send LinuxGSM stats" +fn_script_log_info "* uuid-${selfname}: ${uuidinstance}" +fn_script_log_info "* uuid-install: ${uuidinstall}" +fn_script_log_info "* uuid-hardware: ${uuidhardware}" +fn_script_log_info "* Game Name: ${gamename}" +fn_script_log_info "* Distro Name: ${distroname}" +fn_script_log_info "* Game Server CPU Used: ${cpuusedmhzroundup}MHz" +fn_script_log_info "* Game Server RAM Used: ${memusedmbroundup}MB" +fn_script_log_info "* Game Server Disk Used: ${serverfilesdu}" +fn_script_log_info "* Server CPU Model: ${cpumodel}" +fn_script_log_info "* Server CPU Frequency: ${cpufreqency}" +fn_script_log_info "* Server RAM: ${physmemtotal}" +fn_script_log_info "* Server Disk: ${totalspace}" +fn_script_log_info "* Virtual Environment: ${virtualenvironment}" +fn_script_log_info "* LinuxGSM Version: ${version}" +fn_script_log_info "* Enabled Alerts" diff --git a/lgsm/modules/install_complete.sh b/lgsm/modules/install_complete.sh new file mode 100644 index 000000000..c84e35fe0 --- /dev/null +++ b/lgsm/modules/install_complete.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# LinuxGSM install_complete.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Prints installation completion message and hints. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" + +if [ "${exitcode}" -eq 1 ]; then + echo -e "${bold}${red}Install Failed!${default}" + fn_script_log_fail "Install Failed!" +elif [ "${exitcode}" -eq 2 ]; then + echo -e "${bold}${red}Install Completed with Errors!${default}}" + fn_script_log_error "Install Completed with Errors!" +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}" -eq 0 ]; then + echo -e "${bold}${green}Install Complete!${default}" + fn_script_log_pass "Install Complete!" +fi +fn_messages_separator + +echo -e "" +echo -e "To start the ${gamename} server type:" +echo -e "${italic}./${selfname} start${default}" +echo -e "" +core_exit.sh diff --git a/lgsm/functions/install_config.sh b/lgsm/modules/install_config.sh similarity index 51% rename from lgsm/functions/install_config.sh rename to lgsm/modules/install_config.sh index ced111afb..c78c74fb2 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -1,113 +1,186 @@ #!/bin/bash -# LinuxGSM install_config.sh function +# LinuxGSM install_config.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Creates default server configs. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Checks if server cfg dir exists, creates it if it doesn't. -fn_check_cfgdir(){ +fn_check_cfgdir() { if [ ! -d "${servercfgdir}" ]; then echo -e "creating ${servercfgdir} config directory." - fn_script_log_info "creating ${servercfgdir} config directory." + fn_script_log_info "Creating ${servercfgdir} config directory." mkdir -pv "${servercfgdir}" fi } -# Downloads default configs from Game-Server-Configs repo to lgsm/config-default. -fn_fetch_default_config(){ - echo -e "" - echo -e "${lightyellow}Downloading ${gamename} Configs${default}" - echo -e "=================================" - echo -e "default configs from https://github.com/GameServerManagers/Game-Server-Configs" - fn_sleep_time - mkdir -p "${lgsmdir}/config-default/config-game" - githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/master" - for config in "${array_configs[@]}"; do - fn_fetch_file "${githuburl}/${gamedirname}/${config}" "${remote_fileurl_backup}" "GitHub" "Bitbucket" "${lgsmdir}/config-default/config-game" "${config}" "nochmodx" "norun" "forcedl" "nomd5" - done -} - # Copys default configs from Game-Server-Configs repo to server config location. -fn_default_config_remote(){ +fn_default_config_remote() { + echo -e "" + echo -e "${bold}${lightyellow}Downloading ${gamename} Configs${default}" + fn_messages_separator + 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 - # every config is copied - echo -e "copying ${config} config file." - fn_script_log_info "copying ${servercfg} config file." + # 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" + + # Every config is copied. if [ "${config}" == "${servercfgdefault}" ]; then mkdir -p "${servercfgdir}" - cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}" - elif [ "${shortname}" == "arma3" ]&&[ "${config}" == "${networkcfgdefault}" ]; then + 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}" - elif [ "${shortname}" == "dst" ]&&[ "${config}" == "${clustercfgdefault}" ]; then - cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}" + 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 + 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. -fn_default_config_local(){ - echo -e "copying ${servercfgdefault} config file." - cp -nv "${servercfgdir}/${servercfgdefault}" "${servercfgfullpath}" - fn_sleep_time +fn_default_config_local() { + echo -e "" + echo -e "${bold}${lightyellow}Copying ${gamename} Configs${default}" + fn_messages_separator + echo -e "Copying default configs." + fn_check_cfgdir + + # Check if the directory for ${servercfgfullpath} exists, if not, create it + if [ ! -d "$(dirname "${servercfgfullpath}")" ]; then + mkdir -p "$(dirname "${servercfgfullpath}")" + fi + + echo -en "copying config file [ ${italic}${servercfgdefault}${default} ]: " + cp --update=none "${servercfgdir}/${servercfgdefault}" "${servercfgfullpath}" + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol + fn_script_log_fail "copying config file [ ${servercfgdefault} ]: " + else + fn_print_ok_eol + fn_script_log_pass "copying config file [ ${servercfgdefault} ]: " + fi } # Changes some variables within the default configs. # SERVERNAME to LinuxGSM # PASSWORD to random password -fn_set_config_vars(){ +fn_set_config_vars() { if [ -f "${servercfgfullpath}" ]; then - random=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) + randomstring=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2> /dev/null | head -c 8 | xargs) servername="LinuxGSM" - rconpass="admin${random}" - echo -e "changing hostname." - fn_script_log_info "changing hostname." + adminpass="admin${randomstring}" + 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}" - elif grep -q "SERVERNAME=\"SERVERNAME\"" "${lgsmdir}/config-default/config-game/${config}" 2>/dev/null; then - sed -i "s/SERVERNAME=\"SERVERNAME\"/SERVERNAME=\"${servername}\"/g" "${servercfgfullpath}" + if grep -q "SERVERNAME=SERVERNAME" "${lgsmdir}/config-default/config-game/${config}" 2> /dev/null; then + 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 + 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." + 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 + fn_print_skip_eol_nl + fi + + echo -en "generating admin/rcon password\c" + fn_script_log_info "generating admin/rcon password" + fn_sleep_time if [ "${shortname}" == "squad" ]; then - sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgdir}/Rcon.cfg" + changes+=$(sed -i "s/ADMINPASSWORD/${adminpass}/g w /dev/stdout" "${servercfgdir}/Rcon.cfg") else - sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgfullpath}" + changes+=$(sed -i "s/ADMINPASSWORD/${adminpass}/g w /dev/stdout" "${servercfgfullpath}") fi - 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 + 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 } # Changes some variables within the default Don't Starve Together configs. -fn_set_dst_config_vars(){ +fn_set_dst_config_vars() { ## cluster.ini if grep -Fq "SERVERNAME" "${clustercfgfullpath}"; then echo -e "changing server name." - fn_script_log_info "changing server name." + fn_script_log_info "Changing server name." sed -i "s/SERVERNAME/LinuxGSM/g" "${clustercfgfullpath}" fn_sleep_time echo -e "changing shard mode." - fn_script_log_info "changing shard mode." + fn_script_log_info "Changing shard mode." sed -i "s/USESHARDING/${sharding}/g" "${clustercfgfullpath}" fn_sleep_time echo -e "randomizing cluster key." - fn_script_log_info "randomizing cluster key." - randomkey=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) - sed -i "s/CLUSTERKEY/${randomkey}/g" "${clustercfgfullpath}" + fn_script_log_info "Randomizing cluster key." + randomstring=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2> /dev/null | head -c 8 | xargs) + sed -i "s/CLUSTERKEY/${randomstring}/g" "${clustercfgfullpath}" fn_sleep_time else echo -e "${clustercfg} is already configured." @@ -124,701 +197,604 @@ fn_set_dst_config_vars(){ fi echo -e "changing shard name." - fn_script_log_info "changing shard name." + fn_script_log_info "Changing shard name." sed -i "s/SHARDNAME/${shard}/g" "${servercfgfullpath}" fn_sleep_time echo -e "changing master setting." - fn_script_log_info "changing master setting." + fn_script_log_info "Changing master setting." sed -i "s/ISMASTER/${master}/g" "${servercfgfullpath}" fn_sleep_time ## worldgenoverride.lua if [ "${cave}" == "true" ]; then echo -e "defining ${shard} as cave in ${servercfgdir}/worldgenoverride.lua." - fn_script_log_info "defining ${shard} as cave in ${servercfgdir}/worldgenoverride.lua." + fn_script_log_info "Defining ${shard} as cave in ${servercfgdir}/worldgenoverride.lua." echo 'return { override_enabled = true, preset = "DST_CAVE", }' > "${servercfgdir}/worldgenoverride.lua" fi fn_sleep_time echo -e "" } -# Lists local config file locations -fn_list_config_locations(){ +# Lists local config locations +fn_list_config_locations() { echo -e "" - echo -e "${lightyellow}Config File Locations${default}" - 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} (${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 "" + 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 - gamedirname="7DaysToDie" fn_default_config_local fn_list_config_locations elif [ "${shortname}" == "ac" ]; then - gamedirname="AssettoCorsa" - array_configs+=( server_cfg.ini ) - fn_fetch_default_config + array_configs+=(server_cfg.ini) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ahl" ]; then - gamedirname="ActionHalfLife" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ahl2" ]; then - gamedirname="ActionSource" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ark" ]; then - gamedirname="ARKSurvivalEvolved" - fn_check_cfgdir - array_configs+=( GameUserSettings.ini ) - fn_fetch_default_config + array_configs+=(GameUserSettings.ini) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "arma3" ]; then - gamedirname="Arma3" - fn_check_cfgdir - array_configs+=( server.cfg network.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg network.cfg) + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "armar" ]; then + array_configs+=(server.json) + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "ats" ]; then + array_configs+=(server_config.sii) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bo" ]; then - gamedirname="BallisticOverkill" - array_configs+=( config.txt ) - fn_fetch_default_config + array_configs+=(config.txt) fn_default_config_remote fn_set_config_vars fn_list_config_locations -elif [ "${shortname}" == "bo" ]; then - gamedirname="BaseDefense" - array_configs+=( server.cfg ) - fn_fetch_default_config +elif [ "${shortname}" == "bd" ]; then + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bt" ]; then - gamedirname="Barotrauma" - fn_check_cfgdir - array_configs+=( serversettings.xml ) - fn_fetch_default_config + array_configs+=(serversettings.xml) fn_default_config_remote fn_set_config_vars fn_list_config_locations -elif [ "${shortname}" == "bt1944" ]; then - gamedirname="Battalion1944" +elif [ "${shortname}" == "btl" ]; then fn_check_cfgdir - array_configs+=( DefaultGame.ini ) + array_configs+=(Game.ini) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bf1942" ]; then - gamedirname="Battlefield1942" - array_configs+=( serversettings.con ) - fn_fetch_default_config + array_configs+=(serversettings.con) + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "bfv" ]; then + array_configs+=(serversettings.con) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bs" ]; then - gamedirname="BladeSymphony" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bb" ]; then - gamedirname="BrainBread" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bb2" ]; then - gamedirname="BrainBread2" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bmdm" ]; then - gamedirname="BlackMesa" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "ck" ]; then + array_configs+=(ServerConfig.json) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cod" ]; then - gamedirname="CallOfDuty" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "coduo" ]; then - gamedirname="CallOfDutyUnitedOffensive" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cod2" ]; then - gamedirname="CallOfDuty2" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cod4" ]; then - gamedirname="CallOfDuty4" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "codwaw" ]; then - gamedirname="CallOfDutyWorldAtWar" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cc" ]; then - gamedirname="CodenameCURE" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "col" ]; then + array_configs+=(colserver.json) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cs" ]; then - gamedirname="CounterStrike" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) + fn_default_config_remote + fn_set_config_vars + 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 elif [ "${shortname}" == "cscz" ]; then - gamedirname="CounterStrikeConditionZero" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "csgo" ]; then - gamedirname="CounterStrikeGlobalOffensive" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "css" ]; then - gamedirname="CounterStrikeSource" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "ct" ]; then + array_configs+=(ServerSetting.ini) + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "dayz" ]; then + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dod" ]; then - gamedirname="DayOfDefeat" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "dodr" ]; then + array_configs+=(Game.ini) + fn_default_config_remote + fn_list_config_locations elif [ "${shortname}" == "dods" ]; then - gamedirname="DayOfDefeatSource" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "doi" ]; then - gamedirname="DayOfInfamy" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dmc" ]; then - gamedirname="DeathmatchClassic" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dst" ]; then - gamedirname="DontStarveTogether" - fn_check_cfgdir - array_configs+=( cluster.ini server.ini ) - fn_fetch_default_config + array_configs+=(cluster.ini server.ini) fn_default_config_remote fn_set_dst_config_vars fn_list_config_locations elif [ "${shortname}" == "dab" ]; then - gamedirname="DoubleActionBoogaloo" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dys" ]; then - gamedirname="Dystopia" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "eco" ]; then - gamedirname="Eco" - array_configs+=( Network.eco ) - fn_fetch_default_config + array_configs+=(Network.eco) fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "em" ]; then + fn_default_config_local + fn_list_config_locations elif [ "${shortname}" == "etl" ]; then - gamedirname="ETLegacy" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "ets2" ]; then + array_configs+=(server_config.sii) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "fctr" ]; then - gamedirname="Factorio" - array_configs+=( server-settings.json ) - fn_fetch_default_config + array_configs+=(server-settings.json) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "fof" ]; then - gamedirname="FistfulofFrags" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "gmod" ]; then - gamedirname="GarrysMod" - array_configs+=( server.cfg ) - fn_fetch_default_config - fn_default_config_remote - fn_set_config_vars - fn_list_config_locations -elif [ "${shortname}" == "ges" ]; then - gamedirname="GoldenEyeSource" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "hldm" ]; then - gamedirname="HalfLifeDeathmatch" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "hldms" ]; then - gamedirname="HalfLifeDeathmatchSource" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) + fn_default_config_remote + fn_set_config_vars + 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 elif [ "${shortname}" == "opfor" ]; then - gamedirname="OpposingForce" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "hl2dm" ]; then - gamedirname="HalfLife2Deathmatch" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "hz" ]; then + # Config is generated on first run + : elif [ "${shortname}" == "ins" ]; then - gamedirname="Insurgency" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ios" ]; then - gamedirname="IOSoccer" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "jc2" ]; then - gamedirname="JustCause2" - array_configs+=( config.lua ) - fn_fetch_default_config + array_configs+=(config.lua) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "jc3" ]; then - gamedirname="JustCause3" - array_configs+=( config.json ) - fn_fetch_default_config + array_configs+=(config.json) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "kf" ]; then - gamedirname="KillingFloor" - array_configs+=( Default.ini ) - fn_fetch_default_config + array_configs+=(Default.ini) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "l4d" ]; then - gamedirname="Left4Dead" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "l4d2" ]; then - gamedirname="Left4Dead2" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations -elif [ "${shortname}" == "mc" ]; then - gamedirname="Minecraft" - array_configs+=( server.properties ) - fn_fetch_default_config +elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then + array_configs+=(server.properties) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mcb" ]; then - gamedirname="MinecraftBedrock" - array_configs+=( server.properties ) - fn_fetch_default_config + array_configs+=(server.properties) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mohaa" ]; then - gamedirname="MedalOfHonorAlliedAssault" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mh" ]; then - gamedirname="Mordhau" - fn_check_cfgdir - array_configs+=( Game.ini ) - fn_fetch_default_config + array_configs+=(Game.ini) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ns" ]; then - gamedirname="NaturalSelection" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "nmrih" ]; then - gamedirname="NoMoreRoominHell" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "nd" ]; then - gamedirname="NuclearDawn" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mta" ]; then - gamedirname="MultiTheftAuto" - fn_check_cfgdir - array_configs+=( acl.xml mtaserver.conf vehiclecolors.conf ) - fn_fetch_default_config + array_configs+=(acl.xml mtaserver.conf vehiclecolors.conf) fn_default_config_remote fn_list_config_locations -elif [ "${shortname}" == "mumble" ]; then - gamedirname="Mumble" - array_configs+=( murmur.ini ) - fn_fetch_default_config +elif [ "${shortname}" == "pvr" ]; then + array_configs+=(Game.ini) fn_default_config_remote - fn_list_config_locations + fn_set_config_vars elif [ "${shortname}" == "pvkii" ]; then - gamedirname="PiratesVikingandKnightsII" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) + fn_default_config_remote + fn_set_config_vars + 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 elif [ "${shortname}" == "pz" ]; then - gamedirname="ProjectZomboid" - fn_check_cfgdir - array_configs+=( server.ini ) - fn_fetch_default_config + array_configs+=(server.ini) + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "nec" ]; then + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "pc" ]; then - gamedirname="ProjectCars" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "pc2" ]; then + fn_default_config_local + fn_list_config_locations elif [ "${shortname}" == "q2" ]; then - gamedirname="Quake2" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "q3" ]; then - gamedirname="Quake3Arena" - array_configs+=( server.cfg ) + 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 elif [ "${shortname}" == "ql" ]; then - gamedirname="QuakeLive" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "jk2" ]; then + array_configs+=(server.cfg) + fn_default_config_remote + fn_set_config_vars elif [ "${shortname}" == "qw" ]; then - gamedirname="QuakeWorld" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ricochet" ]; then - gamedirname="Ricochet" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "rtcw" ]; then - gamedirname="ReturnToCastleWolfenstein" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "rust" ]; then - gamedirname="Rust" - fn_check_cfgdir - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_list_config_locations -elif [ "${shortname}" == "samp" ]; then - gamedirname="SanAndreasMultiplayer" - array_configs+=( server.cfg ) - fn_fetch_default_config +elif [ "${shortname}" == "scpsl" ] || [ "${shortname}" == "scpslsm" ]; then + array_configs+=(config_gameplay.txt config_localadmin.txt) fn_default_config_remote fn_set_config_vars fn_list_config_locations -elif [ "${shortname}" == "ss3" ]; then - gamedirname="SeriousSam3BFE" - array_configs+=( server.ini ) - fn_fetch_default_config +elif [ "${shortname}" == "sf" ]; then + array_configs+=(GameUserSettings.ini) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sol" ]; then - gamedirname="Soldat" - array_configs+=( soldat.ini ) - fn_fetch_default_config + array_configs+=(soldat.ini) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sof2" ]; then - gamedirname="SoldierOfFortune2Gold" - array_configs+=( server.cfg mapcycle.txt) - fn_fetch_default_config + array_configs+=(server.cfg mapcycle.txt) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sfc" ]; then - gamedirname="SourceFortsClassic" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "squad" ]; then - gamedirname="Squad" - array_configs+=( Admins.cfg Bans.cfg License.cfg Server.cfg Rcon.cfg ) - fn_fetch_default_config + array_configs+=(Admins.cfg Bans.cfg License.cfg Server.cfg Rcon.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sb" ]; then - gamedirname="Starbound" - array_configs+=( starbound_server.config ) - fn_fetch_default_config + array_configs+=(starbound_server.config) fn_default_config_remote fn_set_config_vars fn_list_config_locations -elif [ "${shortname}" == "st" ]; then - gamedirname="Stationeers" - array_configs+=( default.ini ) - fn_fetch_default_config +elif [ "${shortname}" == "stn" ]; then + array_configs+=(ServerConfig.txt ServerUsers.txt TpPresets.json UserPermissions.json) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sven" ]; then - gamedirname="SvenCoop" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "tf2" ]; then - gamedirname="TeamFortress2" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "tfc" ]; then - gamedirname="TeamFortressClassic" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "ti" ]; then + array_configs+=(Game.ini Engine.ini) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ts" ]; then - gamedirname="TheSpecialists" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ts3" ]; then - gamedirname="TeamSpeak3" - array_configs+=( ts3server.ini ) - fn_fetch_default_config + array_configs+=(ts3server.ini) fn_default_config_remote fn_list_config_locations elif [ "${shortname}" == "tw" ]; then - gamedirname="Teeworlds" - array_configs+=( server.cfg ctf.cfg dm.cfg duel.cfg tdm.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg ctf.cfg dm.cfg duel.cfg tdm.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "terraria" ]; then - gamedirname="Terraria" - array_configs+=( serverconfig.txt ) - fn_fetch_default_config + array_configs+=(serverconfig.txt) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "tu" ]; then - gamedirname="TowerUnite" - fn_check_cfgdir - array_configs+=( TowerServer.ini ) - fn_fetch_default_config + array_configs+=(TowerServer.ini) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ut" ]; then - gamedirname="UnrealTournament" - array_configs+=( Game.ini Engine.ini ) - fn_fetch_default_config + array_configs+=(Game.ini Engine.ini) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ut2k4" ]; then - gamedirname="UnrealTournament2004" - array_configs+=( UT2004.ini ) - fn_fetch_default_config + array_configs+=(UT2004.ini) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ut99" ]; then - gamedirname="UnrealTournament99" - array_configs+=( Default.ini ) - fn_fetch_default_config + array_configs+=(Default.ini) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "unt" ]; then - gamedirname="Unturned" - array_configs+=( Config.json ) - fn_fetch_default_config - fn_default_config_remote - fn_set_config_vars - fn_list_config_locations + # Config is generated on first run + : +elif [ "${shortname}" == "vints" ]; then + # Config is generated on first run + : elif [ "${shortname}" == "vs" ]; then - gamedirname="VampireSlayer" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "wet" ]; then - gamedirname="WolfensteinEnemyTerritory" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "wf" ]; then - gamedirname="Warfork" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "wmc" ]; then + array_configs+=(config.yml) + fn_default_config_remote + fn_set_config_vars + 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 elif [ "${shortname}" == "wurm" ]; then - gamedirname="WurmUnlimited" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "zmr" ]; then - gamedirname="ZombieMasterReborn" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "zps" ]; then - gamedirname="ZombiePanicSource" - array_configs+=( server.cfg ) - fn_fetch_default_config + array_configs+=(server.cfg) fn_default_config_remote fn_set_config_vars fn_list_config_locations diff --git a/lgsm/functions/install_dst_token.sh b/lgsm/modules/install_dst_token.sh similarity index 78% rename from lgsm/functions/install_dst_token.sh rename to lgsm/modules/install_dst_token.sh index 7eab2a153..93ac1b8a4 100644 --- a/lgsm/functions/install_dst_token.sh +++ b/lgsm/modules/install_dst_token.sh @@ -1,18 +1,18 @@ #!/bin/bash -# LinuxGSM install_dst_token.sh function -# Author: Daniel Gibbs & Marvin Lehmann (marvinl97) +# LinuxGSM install_dst_token.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Configures Don't Starve Together cluster with given token. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "${lightyellow}Enter ${gamename} Cluster Token${default}" -echo -e "=================================" -fn_sleep_time +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/functions/install_eula.sh b/lgsm/modules/install_eula.sh similarity index 69% rename from lgsm/functions/install_eula.sh rename to lgsm/modules/install_eula.sh index cd51954d0..f32a1931e 100644 --- a/lgsm/functions/install_eula.sh +++ b/lgsm/modules/install_eula.sh @@ -1,45 +1,44 @@ #!/bin/bash -# LinuxGSM install_eula.sh function +# LinuxGSM install_eula.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Gets user to accept the EULA. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "${shortname}" == "ts3" ]; then eulaurl="https://www.teamspeak.com/en/privacy-and-terms" -elif [ "${shortname}" == "mc" ]; then +elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then eulaurl="https://account.mojang.com/documents/minecraft_eula" elif [ "${shortname}" == "ut" ]; then eulaurl="https://www.epicgames.com/unrealtournament/unreal-tournament-pre-alpha-test-development-build-eula" fi echo -e "" -echo -e "${lightyellow}Accept ${gamename} EULA${default}" -echo -e "=================================" -fn_sleep_time +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 fi elif [ "${commandname}" == "START" ]; then fn_print_info "By continuing you are indicating your agreement to the EULA." - echo -e "" - sleep 5 + fn_sleep_time_5 else echo -e "By using auto-install you are indicating your agreement to the EULA." - echo -e "" - sleep 5 + fn_sleep_time_5 fi if [ "${shortname}" == "ts3" ]; then touch "${executabledir}/.ts3server_license_accepted" -elif [ "${shortname}" == "mc" ]; then +elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then touch "${serverfiles}/eula.txt" echo -e "eula=true" > "${serverfiles}/eula.txt" elif [ "${shortname}" == "ut" ]; then diff --git a/lgsm/modules/install_factorio_save.sh b/lgsm/modules/install_factorio_save.sh new file mode 100644 index 000000000..5dfb4758c --- /dev/null +++ b/lgsm/modules/install_factorio_save.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# LinuxGSM install_factorio_save.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Creates the initial save file for Factorio. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "${bold}${lightyellow}Creating initial Factorio savefile${default}" +fn_messages_separator +check_glibc.sh +"${executabledir}"/factorio --create "${serverfiles}/save1" diff --git a/lgsm/modules/install_gslt.sh b/lgsm/modules/install_gslt.sh new file mode 100644 index 000000000..e4e4dbad7 --- /dev/null +++ b/lgsm/modules/install_gslt.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# LinuxGSM install_gslt.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Configures GSLT. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +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." + fn_script_log_info "GSLT is required to run a public ${gamename} server" +else + 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 "" +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 + echo -e "Enter token below (Can be blank)." + echo -n "GSLT TOKEN: " + read -r token + if ! grep -q "^gslt=" "${configdirserver}/${selfname}.cfg" > /dev/null 2>&1; then + echo -e "\ngslt=\"${token}\"" >> "${configdirserver}/${selfname}.cfg" + else + sed -i -e "s/gslt=\"[^\"]*\"/gslt=\"${token}\"/g" "${configdirserver}/${selfname}.cfg" + fi + fi +fi + +if [ "${shortname}" == "tu" ]; then + 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: ${italic}${configdirserver}/${selfname}.cfg${default}" + fn_script_log_info "The GSLT can be changed by editing: ${configdirserver}/${selfname}.cfg." +fi +fn_sleep_time_1 diff --git a/lgsm/modules/install_header.sh b/lgsm/modules/install_header.sh new file mode 100644 index 000000000..8fad78d2c --- /dev/null +++ b/lgsm/modules/install_header.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# LinuxGSM install_header.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Prints installation header. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +clear +fn_print_ascii_logo +fn_messages_separator +echo -e "${bold}${lightyellow}Linux${default}${bold}GSM_${default}" +echo -e "${italic}by Daniel Gibbs${default}" +echo -e "${lightblue}Version:${default} ${version}" +echo -e "${lightblue}Game:${default} ${gamename}" +echo -e "${lightblue}Website:${default} https://linuxgsm.com" +echo -e "${lightblue}Contributors:${default} https://linuxgsm.com/contrib" +echo -e "${lightblue}Sponsor:${default} https://linuxgsm.com/sponsor" +fn_messages_separator diff --git a/lgsm/modules/install_logs.sh b/lgsm/modules/install_logs.sh new file mode 100644 index 000000000..9e1b89dbd --- /dev/null +++ b/lgsm/modules/install_logs.sh @@ -0,0 +1,123 @@ +#!/bin/bash +# LinuxGSM install_logs.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Creates log directories. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ -z "${checklogs}" ]; then + echo -e "" + echo -e "${bold}${lightyellow}Creating Log Directories${default}" + fn_messages_separator +fi + +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_skip_eol_nl +fi + +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_skip_eol_nl +fi + +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 +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 + +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 [ -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 + 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/functions/install_mta_resources.sh b/lgsm/modules/install_mta_resources.sh similarity index 71% rename from lgsm/functions/install_mta_resources.sh rename to lgsm/modules/install_mta_resources.sh index 194d9f546..f13c39abd 100644 --- a/lgsm/functions/install_mta_resources.sh +++ b/lgsm/modules/install_mta_resources.sh @@ -1,11 +1,11 @@ #!/bin/bash -# LinuxGSM install_mta_resources.sh function +# LinuxGSM install_mta_resources.sh module # Author: Daniel Gibbs -# Contributor: ChaosMTA +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Installs the libmysqlclient for database functions on the server and optionally installs default resources required to run the server +# Description: Installs the libmysqlclient for database functions on the server and optionally installs default resources required to run the server. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_information_nl "${gamename} will not function without resources!" echo -e " * install default resources using ./${selfname} install-default-resources" diff --git a/lgsm/modules/install_retry.sh b/lgsm/modules/install_retry.sh new file mode 100644 index 000000000..71417a73f --- /dev/null +++ b/lgsm/modules/install_retry.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# LinuxGSM install_retry.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Asks for installation retry after failure. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if fn_prompt_yn "Retry install?" Y; then + command_install.sh + core_exit.sh +else + exitcode=0 + core_exit.sh +fi diff --git a/lgsm/modules/install_server_dir.sh b/lgsm/modules/install_server_dir.sh new file mode 100644 index 000000000..318e4bc80 --- /dev/null +++ b/lgsm/modules/install_server_dir.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# LinuxGSM install_server_dir.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Creates the server directory. + +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_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 + +if [ -z "${autoinstall}" ]; then + if ! fn_prompt_yn "Continue?" Y; then + exitcode=0 + core_exit.sh + fi +fi +if [ ! -d "${serverfiles}" ]; then + mkdir "${serverfiles}" +fi diff --git a/lgsm/modules/install_server_files.sh b/lgsm/modules/install_server_files.sh new file mode 100644 index 000000000..c667a7fe4 --- /dev/null +++ b/lgsm/modules/install_server_files.sh @@ -0,0 +1,295 @@ +#!/bin/bash +# LinuxGSM install_server_files.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Installs server files. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_install_server_files() { + 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" + 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" + 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" + 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}" + local_filename="cod-lnxded-1.5-large.tar.xz" + chmodx="nochmodx" + run="norun" + force="noforce" + md5="ee0ad1ccbfa1fd27fde01a4a431a5c2f" + 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" + 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" + elif [ "${shortname}" == "cod4" ]; then + remote_fileurl="http://linuxgsm.download/CallOfDuty4/cod4x18_lnxded.tar.xz" + local_filedir="${tmpdir}" + local_filename="cod4x18_lnxded.tar.xz" + chmodx="nochmodx" + run="norun" + force="noforce" + md5="d255b59b9756d7dbead67718208512ee" + 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" + 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}" + local_filename="moh_revival_v1.12_RC3.5.1.tar.xz" + chmodx="nochmodx" + run="norun" + force="noforce" + md5="7c664538999252eeaf2b6d9949416480" + 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" + 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" + 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" + elif [ "${shortname}" == "q4" ]; then + remote_fileurl="http://linuxgsm.download/Quake4/quake4-1.4.2-x86-linuxded.tar.xz" + local_filedir="${tmpdir}" + local_filename="quake4-1.4.2-x86-linuxded.tar.xz" + chmodx="nochmodx" + run="norun" + force="noforce" + md5="afe30b44f23c8ae2ce6f0f464473d8ba" + 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" + 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" + 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" + 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" + 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" + 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" + 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" + 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" + elif [ "${shortname}" == "ut3" ]; then + remote_fileurl="http://linuxgsm.download/UnrealTournament3/UT3-linux-server-2.1-openspy.tar.xz" + local_filedir="${tmpdir}" + local_filename="UT3-linux-server-2.1-openspy.tar.xz" + chmodx="nochmodx" + run="norun" + force="noforce" + md5="f60b745613a8676666eb6a2450cbdc8e" + 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" + 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" + elif [ "${shortname}" == "samp" ]; then + remote_fileurl="https://files.samp-sc.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 + remote_fileurl="http://linuxgsm.download/ZombieMasterReborn/zombie_master_reborn_b6_1.tar.xz" + local_filedir="${tmpdir}" + local_filename="zombie_master_reborn_b6_1.tar.xz" + chmodx="nochmodx" + run="norun" + force="noforce" + md5="0188ae86dbc9376f11ae3032dba2d665" + else + fn_print_fail_nl "Installing ${gamename} Server failed, missing default configuration" + fn_script_log_fail "Installing ${gamename} Server failed, missing default configuration" + fi + fn_fetch_file "${remote_fileurl}" "" "" "" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" + fn_dl_extract "${local_filedir}" "${local_filename}" "${serverfiles}" + 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 + +if [ "${appid}" ]; then + remotelocation="SteamCMD" + forceupdate=1 + update_steamcmd.sh + fn_check_steamcmd_appmanifest +fi + +if [ "${shortname}" == "ts3" ]; then + update_ts3.sh +elif [ "${shortname}" == "mc" ]; then + update_mc.sh +elif [ "${shortname}" == "mcb" ]; then + update_mcb.sh +elif [ "${shortname}" == "pmc" ]; then + update_pmc.sh +elif [ "${shortname}" == "wmc" ] || [ "${shortname}" == "vpmc" ]; then + update_pmc.sh +elif [ "${shortname}" == "mta" ]; then + update_mta.sh +elif [ "${shortname}" == "fctr" ]; then + update_fctr.sh + install_factorio_save.sh +elif [ "${shortname}" == "jk2" ]; then + update_jk2.sh +elif [ "${shortname}" == "vints" ]; then + update_vints.sh +elif [ "${shortname}" == "ut99" ]; then + fn_install_server_files + update_ut99.sh +elif [ "${shortname}" == "xnt" ]; then + update_xnt.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 + fi + fn_install_server_files +fi + +if [ -z "${autoinstall}" ]; then + echo -e "" + if ! fn_prompt_yn "Was the install successful?" Y; then + install_retry.sh + fi +fi diff --git a/lgsm/functions/install_squad_license.sh b/lgsm/modules/install_squad_license.sh similarity index 59% rename from lgsm/functions/install_squad_license.sh rename to lgsm/modules/install_squad_license.sh index b17b1ab7e..7b7d2ca66 100644 --- a/lgsm/functions/install_squad_license.sh +++ b/lgsm/modules/install_squad_license.sh @@ -1,24 +1,24 @@ #!/bin/bash -# LinuxGSM install_squad_license.sh function +# LinuxGSM install_squad_license.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Configures the Squad server's license. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "${lightyellow}Squad Server License${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}${gamename} Server License${default}" +fn_messages_separator 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 "http://forums.joinsquad.com/topic/16519-server-licensing-general-info/" +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 "http://forums.joinsquad.com/topic/16519-server-licensing-general-info/" +fn_script_log_info "https://squad.fandom.com/wiki/Server_licensing" echo -e "" -fn_sleep_time +fn_sleep_time_1 echo -e "The Squad server license can be changed by editing ${servercfgdir}/License.cfg." fn_script_log_info "The Squad server license can be changed by editing ${selfname}." echo -e "" diff --git a/lgsm/modules/install_stats.sh b/lgsm/modules/install_stats.sh new file mode 100644 index 000000000..16653578b --- /dev/null +++ b/lgsm/modules/install_stats.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# LinuxGSM install_stats.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Enabled LinuxGSM Stats. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "${bold}${lightyellow}LinuxGSM Stats${default}" +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" +echo -e "* game server resource usage" +echo -e "* server hardware info" +if [ -z "${autoinstall}" ]; then + if fn_prompt_yn "Allow anonymous usage statistics?" Y; then + echo "stats=\"on\"" >> "${configdirserver}/common.cfg" + fn_print_information_nl "Stats setting is now enabled in common.cfg." + fi +else + 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_steamcmd.sh b/lgsm/modules/install_steamcmd.sh new file mode 100644 index 000000000..475544a6a --- /dev/null +++ b/lgsm/modules/install_steamcmd.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# LinuxGSM install_steamcmd.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Downloads SteamCMD on install. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "${bold}${lightyellow}Installing SteamCMD${default}" +fn_messages_separator +check_steamcmd.sh diff --git a/lgsm/functions/install_ts3db.sh b/lgsm/modules/install_ts3db.sh similarity index 62% rename from lgsm/functions/install_ts3db.sh rename to lgsm/modules/install_ts3db.sh index a77a0ea38..584fbd7c0 100644 --- a/lgsm/functions/install_ts3db.sh +++ b/lgsm/modules/install_ts3db.sh @@ -1,31 +1,30 @@ #!/bin/bash -# LinuxGSM install_ts3db.sh function +# LinuxGSM install_ts3db.sh module # Author: Daniel Gibbs -# Contributor: PhilPhonic +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Installs the database server MariaDB for TeamSpeak 3. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_install_ts3db_mariadb(){ +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 + else fn_print_ok_eol_nl fn_script_log_pass "copying libmariadb.so.2" - else - fn_print_fail_eol_nl - fn_script_log_fatal "copying libmariadb.so.2" - core_exit.sh fi fi echo -e "" - echo -e "${lightyellow}Configure ${gamename} Server for MariaDB${default}" - echo -e "=================================" - fn_sleep_time + echo -e "${bold}${lightyellow}Configure ${gamename} Server for MariaDB${default}" + fn_messages_separator read -rp "Enter MariaDB hostname: " mariahostname read -rp "Enter MariaDB port: " mariaport read -rp "Enter MariaDB username: " mariausername @@ -34,43 +33,41 @@ fn_install_ts3db_mariadb(){ read -rp "Enter MariaDB socket path: " mariadbsocket { - echo -e "[config]" - echo -e "host='${mariahostname}'" - echo -e "port='${mariaport}'" - echo -e "username='${mariausername}'" - echo -e "password='${mariapassword}'" - echo -e "database='${mariadbname}'" - echo -e "socket='${mariadbsocket}'" + echo -e "[config]" + echo -e "host='${mariahostname}'" + echo -e "port='${mariaport}'" + echo -e "username='${mariausername}'" + echo -e "password='${mariapassword}'" + echo -e "database='${mariadbname}'" + echo -e "socket='${mariadbsocket}'" } >> "${servercfgdir}/ts3db_mariadb.ini" sed -i "s/dbplugin=ts3db_sqlite3/dbplugin=ts3db_mariadb/g" "${servercfgfullpath}" sed -i "s/dbpluginparameter=/dbpluginparameter=ts3db_mariadb.ini/g" "${servercfgfullpath}" sed -i "s/dbsqlcreatepath=create_sqlite\//dbsqlcreatepath=create_mariadb\//g" "${servercfgfullpath}" echo -e "updating ts3db_mariadb.ini." - fn_sleep_time + fn_sleep_time_1 } echo -e "" -echo -e "${lightyellow}Select Database${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}Select Database${default}" +fn_messages_separator if [ -z "${autoinstall}" ]; then if fn_prompt_yn "Do you want to use MariaDB instead of sqlite? (MariaDB must be pre-configured)" N; then fn_install_ts3db_mariadb fi else -fn_print_information_nl "./${selfname} auto-install is uses sqlite. For MariaDB use ./${selfname} install" + fn_print_information_nl "./${selfname} auto-install is uses sqlite. For MariaDB use ./${selfname} install" fi install_eula.sh echo -e "" -echo -e "${lightyellow}Getting privilege key${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}Getting Privilege Key${default}" +fn_messages_separator fn_print_information_nl "Save these details for later." fn_print_information_nl "Key also saved in:" echo -e "${serverfiles}/privilege_key.txt" cd "${executabledir}" || exit ./ts3server_startscript.sh start inifile=ts3-server.ini 2>&1 | tee "${serverfiles}/privilege_key.txt" -sleep 5 +fn_sleep_time_5 ./ts3server_startscript.sh stop diff --git a/lgsm/functions/install_ut2k4_key.sh b/lgsm/modules/install_ut2k4_key.sh similarity index 66% rename from lgsm/functions/install_ut2k4_key.sh rename to lgsm/modules/install_ut2k4_key.sh index 144ac278e..2829da8d6 100644 --- a/lgsm/functions/install_ut2k4_key.sh +++ b/lgsm/modules/install_ut2k4_key.sh @@ -1,18 +1,18 @@ #!/bin/bash -# LinuxGSM install_ut2k4_key.sh function +# LinuxGSM install_ut2k4_key.sh module # Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Activates ut2k4 server with given key. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "${lightyellow}Enter ${gamename} CD Key${default}" -echo -e "=================================" -fn_sleep_time +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/functions/mods_core.sh b/lgsm/modules/mods_core.sh similarity index 50% rename from lgsm/functions/mods_core.sh rename to lgsm/modules/mods_core.sh index da2576207..b88e0c05e 100644 --- a/lgsm/functions/mods_core.sh +++ b/lgsm/modules/mods_core.sh @@ -1,77 +1,83 @@ #!/bin/bash -# LinuxGSM command_mods_install.sh function +# LinuxGSM command_mods_install.sh module # Author: Daniel Gibbs -# Contributor: UltimateByte +# Contributors: https://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Core functions for mods list/install/update/remove +# Description: Core modules for mods list/install/update/remove -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Files and Directories. modsdir="${lgsmdir}/mods" modstmpdir="${modsdir}/tmp" -extractdir="${modstmpdir}/extract" +extractdest="${modstmpdir}/extract" modsinstalledlist="installed-mods.txt" modsinstalledlistfullpath="${modsdir}/${modsinstalledlist}" ## Installation. # Download management. -fn_mod_install_files(){ +fn_mod_install_files() { fn_fetch_file "${modurl}" "" "" "" "${modstmpdir}" "${modfilename}" # Check if variable is valid checking if file has been downloaded and exists. if [ ! -f "${modstmpdir}/${modfilename}" ]; then fn_print_failure "An issue occurred downloading ${modprettyname}" - fn_script_log_fatal "An issue occurred downloading ${modprettyname}" + fn_script_log_fail "An issue occurred downloading ${modprettyname}" core_exit.sh fi - if [ ! -d "${extractdir}" ]; then - mkdir -p "${extractdir}" + if [ ! -d "${extractdest}" ]; then + mkdir -p "${extractdest}" fi - fn_dl_extract "${modstmpdir}" "${modfilename}" "${extractdir}" + fn_dl_extract "${modstmpdir}" "${modfilename}" "${extractdest}" } # Convert mod files to lowercase if needed. -fn_mod_lowercase(){ +fn_mod_lowercase() { + # Checking lowercase settings from mods array definition if [ "${modlowercase}" == "LowercaseOn" ]; then - echo -en "converting ${modprettyname} files to lowercase..." fn_sleep_time fn_script_log_info "Converting ${modprettyname} files to lowercase" - fileswc=$(find "${extractdir}" -depth | wc -l) - echo -en "\r" + # Total files and directories for the mod, to output to the user + fileswc=$(find "${extractdest}" | wc -l) + # Total uppercase files and directories for the mod, to output to the user + filesupperwc=$(find "${extractdest}" -name '*[[:upper:]]*' | wc -l) + fn_script_log_info "Found ${filesupperwc} uppercase files out of ${fileswc}, converting" + echo -en "Found ${filesupperwc} uppercase files out of ${fileswc}, converting..." + # Convert files and directories starting from the deepest to prevent issues (-depth argument) while read -r src; do - dst=$(dirname "${src}$(/)basename" "${src}" | tr '[:upper:]' '[:lower:]') - if [ "${src}" != "${dst}" ] - then - [ ! -e "${dst}" ] && mv -T "${src}" "${dst}" || echo -e "${src} was not renamed" - local exitcode=$? - ((renamedwc++)) + # We have to convert only the last file from the path, otherwise we will fail to convert anything if a parent dir has any uppercase + # therefore, we have to separate the end of the filename to only lowercase it rather than the whole line + # Gather parent dir, filename lowercase filename, and set lowercase destination name + latestparentdir=$(dirname "${src}") + latestfilelc=$(basename "${src}" | tr '[:upper:]' '[:lower:]') + dst="${latestparentdir}/${latestfilelc}" + # Only convert if destination does not already exist for some reason + if [ ! -e "${dst}" ]; then + # Finally we can rename the file + mv "${src}" "${dst}" + # Exit if it fails for any reason + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + fi fi - echo -en "${renamedwc} / ${totalfileswc} / ${fileswc} converting ${modprettyname} files to lowercase..." $'\r' - ((totalfileswc++)) - done < <(find "${extractdir}" -depth) - echo -en "${renamedwc} / ${totalfileswc} / ${fileswc} converting ${modprettyname} files to lowercase..." - - if [ ${exitcode} -ne 0 ]; then - fn_print_fail_eol_nl - core_exit.sh - else - fn_print_ok_eol_nl - fi + done < <(find "${extractdest}" -depth -name '*[[:upper:]]*') + fn_print_ok_eol_nl fi } # Create ${modcommand}-files.txt containing the full extracted file/directory list. -fn_mod_create_filelist(){ +fn_mod_create_filelist() { echo -en "building ${modcommand}-files.txt..." fn_sleep_time # ${modsdir}/${modcommand}-files.txt. - find "${extractdir}" -mindepth 1 -printf '%P\n' > "${modsdir}/${modcommand}-files.txt" - local exitcode=$? - if [ ${exitcode} -ne 0 ]; then + find "${extractdest}" -mindepth 1 -printf '%P\n' > "${modsdir}/${modcommand}-files.txt" + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Building ${modsdir}/${modcommand}-files.txt" + fn_script_log_fail "Building ${modsdir}/${modcommand}-files.txt" core_exit.sh else fn_print_ok_eol_nl @@ -84,14 +90,14 @@ fn_mod_create_filelist(){ } # Copy the mod into serverfiles. -fn_mod_copy_destination(){ +fn_mod_copy_destination() { echo -en "copying ${modprettyname} to ${modinstalldir}..." fn_sleep_time - cp -Rf "${extractdir}/." "${modinstalldir}/" - local exitcode=$? - if [ ${exitcode} -ne 0 ]; then + cp -Rf "${extractdest}/." "${modinstalldir}/" + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Copying ${modprettyname} to ${modinstalldir}" + fn_script_log_fail "Copying ${modprettyname} to ${modinstalldir}" else fn_print_ok_eol_nl fn_script_log_pass "Copying ${modprettyname} to ${modinstalldir}" @@ -99,7 +105,7 @@ fn_mod_copy_destination(){ } # Add the mod to the installed-mods.txt. -fn_mod_add_list(){ +fn_mod_add_list() { if [ -z "$(sed -n "/^${modcommand}$/p" "${modsinstalledlistfullpath}")" ]; then echo -e "${modcommand}" >> "${modsinstalledlistfullpath}" fn_script_log_info "${modcommand} added to ${modsinstalledlist}" @@ -107,7 +113,7 @@ fn_mod_add_list(){ } # Prevent sensitive directories from being erased upon uninstall by removing them from: ${modcommand}-files.txt. -fn_mod_tidy_files_list(){ +fn_mod_tidy_files_list() { # Check file list validity. fn_check_mod_files_list # Output to the user @@ -120,16 +126,16 @@ fn_mod_tidy_files_list(){ # generate elements to remove from list. removefromlistamount=$(echo -e "${removefromlist}" | awk -F ';' '{ print NF }') # Test all subvalue of "removefromlist" using the ";" separator. - for ((filesindex=1; filesindex < removefromlistamount; filesindex++)); do + for ((filesindex = 1; filesindex < removefromlistamount; filesindex++)); do # Put current file into test variable. removefilevar=$(echo -e "${removefromlist}" | awk -F ';' -v x=${filesindex} '{ print $x }') # Delete line(s) matching exactly. sed -i "/^${removefilevar}$/d" "${modsdir}/${modcommand}-files.txt" # Exit on error. - local exitcode=$? - if [ ${exitcode} -ne 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Error while tidying line: ${removefilevar} from: ${modsdir}/${modcommand}-files.txt" + fn_script_log_fail "Error while tidying line: ${removefilevar} from: ${modsdir}/${modcommand}-files.txt" core_exit.sh break fi @@ -187,15 +193,15 @@ fn_mod_tidy_files_list(){ ## Information Gathering. # Get details of a mod any (relevant and unique, such as full mod name or install command) value. -fn_mod_get_info(){ +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 = index; index <= ${#mods_global_array[@]}; index--)); do # When "MOD" is found. if [ "${mods_global_array[index]}" == "MOD" ]; then # Get info. @@ -220,31 +226,31 @@ fn_mod_get_info(){ } # Define all variables for a mod at once when index is set to a separator. -fn_mods_define(){ -if [ -z "$index" ]; then - fn_script_log_fatal "index variable not set. Please report an issue." - fn_print_error "index variable not set. Please report an issue." - echo -e "* https://github.com/GameServerManagers/LinuxGSM/issues" - core_exit.sh -fi - modcommand="${mods_global_array[index+1]}" - modprettyname="${mods_global_array[index+2]}" - modurl="${mods_global_array[index+3]}" - modfilename="${mods_global_array[index+4]}" - modsubdirs="${mods_global_array[index+5]}" - modlowercase="${mods_global_array[index+6]}" - modinstalldir="${mods_global_array[index+7]}" - modkeepfiles="${mods_global_array[index+8]}" - modengines="${mods_global_array[index+9]}" - modgames="${mods_global_array[index+10]}" - modexcludegames="${mods_global_array[index+11]}" - modsite="${mods_global_array[index+12]}" - moddescription="${mods_global_array[index+13]}" +fn_mods_define() { + if [ -z "$index" ]; then + fn_script_log_fail "index variable not set. Please report an issue." + fn_print_error "index variable not set. Please report an issue." + echo -e "* https://github.com/GameServerManagers/LinuxGSM/issues" + core_exit.sh + fi + modcommand="${mods_global_array[index + 1]}" + modprettyname="${mods_global_array[index + 2]}" + modurl="${mods_global_array[index + 3]}" + modfilename="${mods_global_array[index + 4]}" + modsubdirs="${mods_global_array[index + 5]}" + modlowercase="${mods_global_array[index + 6]}" + modinstalldir="${mods_global_array[index + 7]}" + modkeepfiles="${mods_global_array[index + 8]}" + modengines="${mods_global_array[index + 9]}" + modgames="${mods_global_array[index + 10]}" + modexcludegames="${mods_global_array[index + 11]}" + modsite="${mods_global_array[index + 12]}" + moddescription="${mods_global_array[index + 13]}" } # Builds list of installed mods. # using installed-mods.txt grabing mod info from mods_list.sh. -fn_mods_installed_list(){ +fn_mods_installed_list() { fn_mods_count_installed # Set/reset variables. installedmodsline="1" @@ -259,7 +265,7 @@ fn_mods_installed_list(){ # Get mod info to make sure mod exists. fn_mod_get_info # Add the mod to available commands. - installedmodslist+=( "${modcommand}" ) + installedmodslist+=("${modcommand}") # Increment line check. ((installedmodsline++)) done @@ -269,13 +275,13 @@ fn_mods_installed_list(){ } # Loops through mods_global_array to define available mods & provide available commands for mods installation. -fn_mods_available(){ +fn_mods_available() { # First, reset variables. compatiblemodslist=() availablemodscommands=() # Find compatible games. # Find separators through the global array. - for ((index="0"; index <= ${#mods_global_array[@]}; index++)); do + for ((index = "0"; index <= ${#mods_global_array[@]}; index++)); do # If current value is a separator; then. if [ "${mods_global_array[index]}" == "${modseparator}" ]; then # Set mod variables. @@ -285,9 +291,9 @@ fn_mods_available(){ # If game is compatible. if [ "${modcompatibility}" == "1" ]; then # Put it into an array to prepare user output. - compatiblemodslist+=( "${modprettyname}" "${modcommand}" "${modsite}" "${moddescription}" ) + compatiblemodslist+=("${modprettyname}" "${modcommand}" "${modsite}" "${moddescription}") # Keep available commands in an array to make life easier. - availablemodscommands+=( "${modcommand}" ) + availablemodscommands+=("${modcommand}") fi fi done @@ -296,7 +302,7 @@ fn_mods_available(){ ## Mod compatibility check. # Find out if a game is compatible with a mod from a modgames (list of games supported by a mod) variable. -fn_compatible_mod_games(){ +fn_compatible_mod_games() { # Reset test value. modcompatiblegame="0" # If value is set to GAMES (ignore). @@ -304,9 +310,9 @@ fn_compatible_mod_games(){ # How many games we need to test. gamesamount=$(echo -e "${modgames}" | awk -F ';' '{ print NF }') # Test all subvalue of "modgames" using the ";" separator. - for ((gamevarindex=1; gamevarindex < gamesamount; gamevarindex++)); do + for ((gamevarindex = 1; gamevarindex < gamesamount; gamevarindex++)); do # Put current game name into modtest variable. - gamemodtest=$( echo -e "${modgames}" | awk -F ';' -v x=${gamevarindex} '{ print $x }' ) + gamemodtest=$(echo -e "${modgames}" | awk -F ';' -v x=${gamevarindex} '{ print $x }') # If game name matches. if [ "${gamemodtest}" == "${gamename}" ]; then # Mod is compatible. @@ -317,7 +323,7 @@ fn_compatible_mod_games(){ } # Find out if an engine is compatible with a mod from a modengines (list of engines supported by a mod) variable. -fn_compatible_mod_engines(){ +fn_compatible_mod_engines() { # Reset test value. modcompatibleengine="0" # If value is set to ENGINES (ignore). @@ -325,9 +331,9 @@ 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 }' ) + enginemodtest=$(echo -e "${modengines}" | awk -F ';' -v x=${gamevarindex} '{ print $x }') # If engine name matches. if [ "${enginemodtest}" == "${engine}" ]; then # Mod is compatible. @@ -338,7 +344,7 @@ fn_compatible_mod_engines(){ } # Find out if a game is not compatible with a mod from a modnotgames (list of games not supported by a mod) variable. -fn_not_compatible_mod_games(){ +fn_not_compatible_mod_games() { # Reset test value. modeincompatiblegame="0" # If value is set to NOTGAMES (ignore). @@ -346,9 +352,9 @@ fn_not_compatible_mod_games(){ # How many engines we need to test. excludegamesamount=$(echo -e "${modexcludegames}" | awk -F ';' '{ print NF }') # Test all subvalue of "modexcludegames" using the ";" separator. - for ((gamevarindex=1; gamevarindex < excludegamesamount; gamevarindex++)); do + for ((gamevarindex = 1; gamevarindex < excludegamesamount; gamevarindex++)); do # Put current engine name into modtest variable. - excludegamemodtest=$( echo -e "${modexcludegames}" | awk -F ';' -v x=${gamevarindex} '{ print $x }' ) + excludegamemodtest=$(echo -e "${modexcludegames}" | awk -F ';' -v x=${gamevarindex} '{ print $x }') # If engine name matches. if [ "${excludegamemodtest}" == "${gamename}" ]; then # Mod is compatible. @@ -359,14 +365,14 @@ fn_not_compatible_mod_games(){ } # Sums up if a mod is compatible or not with modcompatibility=0/1. -fn_mod_compatible_test(){ +fn_mod_compatible_test() { # Test game and engine compatibility. fn_compatible_mod_games fn_compatible_mod_engines fn_not_compatible_mod_games if [ "${modeincompatiblegame}" == "1" ]; then modcompatibility="0" - elif [ "${modcompatibleengine}" == "1" ]||[ "${modcompatiblegame}" == "1" ]; then + elif [ "${modcompatibleengine}" == "1" ] || [ "${modcompatiblegame}" == "1" ]; then modcompatibility="1" else modcompatibility="0" @@ -376,15 +382,15 @@ fn_mod_compatible_test(){ ## Directory management. # Create mods files and directories if it doesn't exist. -fn_create_mods_dir(){ +fn_create_mods_dir() { # Create lgsm data modsdir. if [ ! -d "${modsdir}" ]; then echo -en "creating LinuxGSM mods data directory ${modsdir}..." mkdir -p "${modsdir}" exitcode=$? - if [ ${exitcode} -ne 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Creating mod download dir ${modsdir}" + fn_script_log_fail "Creating mod download dir ${modsdir}" core_exit.sh else fn_print_ok_eol_nl @@ -396,9 +402,9 @@ fn_create_mods_dir(){ echo -en "creating mods install directory ${modinstalldir}..." mkdir -p "${modinstalldir}" exitcode=$? - if [ ${exitcode} -ne 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Creating mod install directory ${modinstalldir}" + fn_script_log_fail "Creating mod install directory ${modinstalldir}" core_exit.sh else fn_print_ok_eol_nl @@ -406,7 +412,7 @@ fn_create_mods_dir(){ fi fi - # Create lgsm/data/${modsinstalledlist}. + # Create ${datadir}/${modsinstalledlist}. if [ ! -f "${modsinstalledlistfullpath}" ]; then touch "${modsinstalledlistfullpath}" fn_script_log_info "Created ${modsinstalledlistfullpath}" @@ -414,14 +420,14 @@ fn_create_mods_dir(){ } # Create tmp download mod directory. -fn_mods_create_tmp_dir(){ +fn_mods_create_tmp_dir() { if [ ! -d "${modstmpdir}" ]; then mkdir -p "${modstmpdir}" exitcode=$? echo -en "creating mod download directory ${modstmpdir}..." - if [ ${exitcode} -ne 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Creating mod download directory ${modstmpdir}" + fn_script_log_fail "Creating mod download directory ${modstmpdir}" core_exit.sh else fn_print_ok_eol_nl @@ -431,14 +437,14 @@ fn_mods_create_tmp_dir(){ } # Remove the tmp mod download directory when finished. -fn_mods_clear_tmp_dir(){ +fn_mods_clear_tmp_dir() { if [ -d "${modstmpdir}" ]; then echo -en "clearing mod download directory ${modstmpdir}..." - rm -fr "${modstmpdir:?}" + rm -rf "${modstmpdir:?}" exitcode=$? - if [ ${exitcode} -ne 0 ]; then + if [ "${exitcode}" -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Clearing mod download directory ${modstmpdir}" + fn_script_log_fail "Clearing mod download directory ${modstmpdir}" core_exit.sh else fn_print_ok_eol_nl @@ -453,7 +459,7 @@ fn_mods_clear_tmp_dir(){ } # Counts how many mods were installed. -fn_mods_count_installed(){ +fn_mods_count_installed() { if [ -f "${modsinstalledlistfullpath}" ]; then installedmodscount=$(wc -l < "${modsinstalledlistfullpath}") else @@ -462,7 +468,7 @@ fn_mods_count_installed(){ } # Exits if no mods were installed. -fn_mods_check_installed(){ +fn_mods_check_installed() { # Count installed mods. fn_mods_count_installed # If no mods are found. @@ -476,25 +482,273 @@ fn_mods_check_installed(){ } # Checks that mod files list exists and isn't empty. -fn_check_mod_files_list(){ +fn_check_mod_files_list() { # File list must exist and be valid before any operation on it. if [ -f "${modsdir}/${modcommand}-files.txt" ]; then - # How many lines is the file list. + # How many lines is the file list. modsfilelistsize=$(wc -l < "${modsdir}/${modcommand}-files.txt") # If file list is empty. if [ "${modsfilelistsize}" -eq 0 ]; then fn_print_failure "${modcommand}-files.txt is empty" echo -e "* Unable to remove ${modprettyname}" - fn_script_log_fatal "${modcommand}-files.txt is empty: Unable to remove ${modprettyname}." + fn_script_log_fail "${modcommand}-files.txt is empty: Unable to remove ${modprettyname}." core_exit.sh fi else fn_print_failure "${modsdir}/${modcommand}-files.txt does not exist" - fn_script_log_fatal "${modsdir}/${modcommand}-files.txt does not exist: Unable to remove ${modprettyname}." + fn_script_log_fail "${modsdir}/${modcommand}-files.txt does not exist: Unable to remove ${modprettyname}." core_exit.sh fi } +fn_mod_exist() { + modreq=$1 + # requires one parameter, the mod + if [ -f "${modsdir}/${modreq}-files.txt" ]; then + # how many lines is the file list + modsfilelistsize=$(wc -l < "${modsdir}/${modreq}-files.txt") + # if file list is empty + if [ "${modsfilelistsize}" -eq 0 ]; then + fn_mod_required_fail_exist "${modreq}" + fi + else + fn_mod_required_fail_exist "${modreq}" + fi +} + +fn_mod_required_fail_exist() { + modreq=$1 + # requires one parameter, the mod + fn_script_log_fail "${modreq}-files.txt is empty: unable to find ${modreq} installed" + echo -en "* Unable to find '${modreq}' which is required prior to installing this mod..." + fn_print_fail_eol_nl + core_exit.sh +} + +fn_mod_liblist_gam_filenames() { + # clear variables just in case + moddll="" + modso="" + moddylib="" + + # default libraries + case ${gamename} in + "Counter-Strike 1.6") + moddll="mp.dll" + modso="cs.so" + moddylib="cs.dylib" + ;; + "Day of Defeat") + moddll="dod.dll" + modso="dod.so" + moddylib="dod.dylib" + ;; + "Team Fortress Classic") + moddll="tfc.dll" + modso="tfc.so" + moddylib="tfc.dylib" + ;; + "Natural Selection") + moddll="ns.dll" + modso="ns_i386.so" + moddylib="" + ;; + "The Specialists") + moddll="mp.dll" + modso="ts_i386.so" + moddylib="" + ;; + "Half-Life: Deathmatch") + moddll="hl.dll" + modso="hl.so" + moddylib="hl.dylib" + ;; + esac +} + +# modifers for liblist.gam to add/remote metamod binaries +fn_mod_install_liblist_gam_file() { + + fn_mod_liblist_gam_filenames + + if [ -f "${modinstalldir}/liblist.gam" ]; then + # modify the liblist.gam file to initialize Metamod + logentry="sed replace (dlls\\${moddll}) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll in liblist.gam..." + rpldll="s/dlls\\\\${moddll}/addons\/metamod\/dlls\/metamod.dll/g" + sed -i $rpldll "${modinstalldir}/liblist.gam" + grep -q "addons/metamod/dlls/metamod.dll" "${modinstalldir}/liblist.gam" + exitcode=$? + # if replacement back didn't happen, error out. + if [ "${exitcode}" -ne 0 ]; then + fn_script_log_fail "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass "${logentry}" + fn_print_ok_eol_nl + fi + + # modify the liblist.gam file to initialize metamod + logentry="sed replace (dlls\\${modso}) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll_linux in liblist.gam..." + rplso="s/dlls\/${modso}/addons\/metamod\/dlls\/metamod.so/g" + sed -i $rplso "${modinstalldir}/liblist.gam" + grep -q "addons/metamod/dlls/metamod.so" "${modinstalldir}/liblist.gam" + exitcode=$? + # if replacement back didn't happen, error out + if [ "${exitcode}" -ne 0 ]; then + fn_script_log_fail "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass "${logentry}" + fn_print_ok_eol_nl + fi + + # mac os needs to be checked not all mods support mac os + if [ -n "${moddylib}" ]; then + # modify the liblist.gam file to initialize metamod + logentry="sed replace (dlls\\${moddylib}) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll_osx in liblist.gam..." + rpldylib="s/dlls\/${moddylib}/addons\/metamod\/dlls\/metamod.dylib/g" + sed -i $rpldylib "${modinstalldir}/liblist.gam" + grep -q "addons/metamod/dlls/metamod.dylib" "${modinstalldir}/liblist.gam" + exitcode=$? + # if replacement back didn't happen, error out. + if [ "${exitcode}" -ne 0 ]; then + fn_script_log_fail "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass "${logentry}" + fn_print_ok_eol_nl + fi + fi + fi +} + +fn_mod_remove_liblist_gam_file() { + + fn_mod_liblist_gam_filenames + + if [ -f "${modinstalldir}/liblist.gam" ]; then + # modify the liblist.gam file back to defaults + logentry="sed replace (addons/metamod/dlls/metamod.dll) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll in liblist.gam..." + rpldll="s/addons\/metamod\/dlls\/metamod.dll/dlls\\\\${moddll}/g" + sed -i $rpldll "${modinstalldir}/liblist.gam" + grep -q "${moddll}" "${modinstalldir}/liblist.gam" + exitcode=$? + # if replacement back didn't happen, error out. + if [ "${exitcode}" -ne 0 ]; then + fn_script_log_fail "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass "${logentry}" + fn_print_ok_eol_nl + fi + + # modify the liblist.gam file back to defaults + logentry="sed replace (addons/metamod/dlls/metamod.so) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll_linux in liblist.gam..." + rplso="s/addons\/metamod\/dlls\/metamod.so/dlls\/${modso}/g" + sed -i $rplso "${modinstalldir}/liblist.gam" + grep -q "${modso}" "${modinstalldir}/liblist.gam" + exitcode=$? + # if replacement back didn't happen, error out + if [ "${exitcode}" -ne 0 ]; then + fn_script_log_fail "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass "${logentry}" + fn_print_ok_eol_nl + fi + + # mac os needs to be checked not all mods support mac os + if [ -n "${moddylib}" ]; then + # modify the liblist.gam file back to defaults + logentry="sed replace (addons/metamod/dlls/metamod.dylib) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll_osx in liblist.gam..." + rpldylib="s/addons\/metamod\/dlls\/metamod.dylib/dlls\/${moddylib}/g" + sed -i $rpldylib "${modinstalldir}/liblist.gam" + grep -q "${moddylib}" "${modinstalldir}/liblist.gam" + # if replacement back didn't happen, error out. + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_script_log_fail "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass "${logentry}" + fn_print_ok_eol_nl + fi + fi + fi +} + +fn_mod_install_amxmodx_file() { + # does plugins.ini exist? + if [ -f "${modinstalldir}/addons/metamod/plugins.ini" ]; then + # 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 + # 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 + fn_script_log_fail "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass "${logentry}" + fn_print_ok_eol_nl + fi + 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 + fn_script_log_fail "${logentry}" + fn_print_fail_eol_nl + core_exit.sh + else + fn_script_log_pass "${logentry}" + fn_print_ok_eol_nl + fi + fi +} + +fn_mod_remove_amxmodx_file() { + if [ -f "${modinstalldir}/addons/metamod/plugins.ini" ]; then + # 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 + # 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}" -ne 0 ]; then + fn_script_log_fail "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass "${logentry}" + fn_print_ok_eol_nl + fi + + # if file is empty, remove it. + if [ -f "${modinstalldir}/addons/metamod/plugins.ini" ]; then + rm -f "${modinstalldir}/addons/metamod/plugins.ini" + fn_script_log_pass "file removed ${modinstalldir}/addons/metamod/plugins.ini because it was empty" + fi + fi + fi +} + ## Database initialisation. mods_list.sh diff --git a/lgsm/modules/mods_list.sh b/lgsm/modules/mods_list.sh new file mode 100644 index 000000000..d6622d1b2 --- /dev/null +++ b/lgsm/modules/mods_list.sh @@ -0,0 +1,215 @@ +#!/bin/bash +# LinuxGSM mods_list.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Lists and defines available mods for LinuxGSM supported servers; works along with mods_core.sh. +# Usage: To add a mod, you need to add an array variable following the guide to set proper values; +# Usage: Then add this array to the mods_global_array. +# Usage: If needed, you can scrape the download URL first. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Get a proper URL for mods that don't provide a good one (optional) +fn_script_log_info "Retrieving latest mods URLs" + +# Metamod (Half-life 1 Classic Engine) +metamodversion="1.21.1-am" +metamodlatestfile="metamod-${metamodversion}.zip" +metamoddownloadurl="https://www.amxmodx.org/release/${metamodlatestfile}" +metamodurl="${metamoddownloadurl}" +# AMX Mod X: Base +amxxbaseversion="1.8.2" +amxxbasemod="base" +amxxbaselatestfile="amxmodx-${amxxbaseversion}-${amxxbasemod}-linux.tar.gz" +amxxbasedownloadurl="https://www.amxmodx.org/release/${amxxbaselatestfile}" +amxxbaseurl="${amxxbasedownloadurl}" +# AMX Mod X: Counter-Strike +amxxcsversion="1.8.2" +amxxcsmod="cstrike" +amxxcslatestfile="amxmodx-${amxxbaseversion}-${amxxcsmod}-linux.tar.gz" +amxxcsdownloadurl="https://www.amxmodx.org/release/${amxxcslatestfile}" +amxxcsurl="${amxxcsdownloadurl}" +# AMX Mod X: Day of Defeat +amxxdodversion="1.8.2" +amxxdodmod="dod" +amxxdodlatestfile="amxmodx-${amxxdodversion}-${amxxdodmod}-linux.tar.gz" +amxxdoddownloadurl="https://www.amxmodx.org/release/${amxxdodlatestfile}" +amxxdodurl="${amxxdoddownloadurl}" +# AMX Mod X: Team Fortress Classic +amxxtfcversion="1.8.2" +amxxtfcmod="tfc" +amxxtfclatestfile="amxmodx-${amxxtfcversion}-${amxxtfcmod}-linux.tar.gz" +amxxtfcdownloadurl="https://www.amxmodx.org/release/${amxxtfclatestfile}" +amxxtfcurl="${amxxtfcdownloadurl}" +# AMX Mod X: Natural Selection +amxxnsversion="1.8.2" +amxxnsmod="ns" +amxxnslatestfile="amxmodx-${amxxnsversion}-${amxxnsmod}-linux.tar.gz" +amxxnsdownloadurl="https://www.amxmodx.org/release/${amxxnslatestfile}" +amxxnsurl="${amxxnsdownloadurl}" +# AMX Mod X: The Specialists +amxxtsversion="1.8.2" +amxxtsmod="ts" +amxxtslatestfile="amxmodx-${amxxtsversion}-${amxxtsmod}-linux.tar.gz" +amxxtsdownloadurl="https://www.amxmodx.org/release/${amxxtslatestfile}" +amxxtsurl="${amxxtsdownloadurl}" +# Metamod:Source +metamodsourceversion="1.11" +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.11" +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}" +sourcemodurl="${sourcemoddownloadurl}" +# Steamworks +steamworksscrapeurl="https://users.alliedmods.net/~kyles/builds/SteamWorks" +steamworkslatestfile=$(curl --connect-timeout 3 -sL ${steamworksscrapeurl} | grep -m 1 linux | cut -d '"' -f 4) +steamworksdownloadurl="${steamworksscrapeurl}/${steamworkslatestfile}" +steamworksurl="${steamworksdownloadurl}" +# Stripper:Source +stripperversion="1.2.2-git141" +stripperlatestfile="stripper-${stripperversion}-linux.tar.gz" +stripperdownloadurl="http://www.bailopan.net/stripper/snapshots/1.2/${stripperlatestfile}" +stripperurl="${stripperdownloadurl}" + +# CS:GO Mods +get5lastbuild=$(curl --connect-timeout 3 -sL https://api.github.com/repos/splewis/get5/releases/latest | jq '.assets[] |select(.browser_download_url | endswith(".tar.gz"))') +get5latestfile=$(echo -e "${get5lastbuild}" | jq -r '.name') +get5latestfilelink=$(echo -e "${get5lastbuild}" | jq -r '.browser_download_url') +csgopracticelatest=$(curl --connect-timeout 3 -sL https://api.github.com/repos/splewis/csgo-practice-mode/releases/latest | jq '.assets[]') +csgopracticelatestfile=$(echo -e "${csgopracticelatest}" | jq -r '.name') +csgopracticelatestlink=$(echo -e "${csgopracticelatest}" | jq -r '.browser_download_url') +csgopuglatest=$(curl --connect-timeout 3 -sL https://api.github.com/repos/splewis/csgo-pug-setup/releases/latest | jq '.assets[]') +csgopuglatestfile=$(echo -e "${csgopuglatest}" | jq -r '.name') +csgopuglatestlink=$(echo -e "${csgopuglatest}" | jq -r '.browser_download_url') +gokzlatestversion=$(curl --connect-timeout 3 -s https://api.github.com/repos/KZGlobalTeam/gokz/releases/latest | grep "tag_name" | cut -d : -f 2,3 | sed -E 's/.*"([^"]+)".*/\1/') +gokzlatestfile="GOKZ-v${gokzlatestversion}.zip" +gokzlatestlink="https://github.com/KZGlobalTeam/gokz/releases/download/${gokzlatestversion}/${gokzlatestfile}" +movementapilatestversion=$(curl --connect-timeout 3 -s https://api.github.com/repos/danzayau/MovementAPI/releases/latest | grep "tag_name" | cut -d : -f 2,3 | sed -E 's/.*"([^"]+)".*/\1/') +movementapilatestfile="MovementAPI-v${movementapilatestversion}.zip" +movementapilatestlink="https://github.com/danzayau/MovementAPI/releases/download/${movementapilatestversion}/${movementapilatestfile}" + +# Rust +carbonrustapilatestfile="Carbon.Linux.Release.tar.gz" +carbonrustlatestlink=$(curl --connect-timeout 3 -sL https://api.github.com/repos/CarbonCommunity/Carbon.Core/releases/tags/production_build | jq -r '.assets[]|select(.name == "Carbon.Linux.Release.tar.gz") | .browser_download_url') + +# Oxide +oxiderustlatestlink=$(curl --connect-timeout 3 -sL https://api.github.com/repos/OxideMod/Oxide.Rust/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url') +oxidehurtworldlatestlink=$(curl --connect-timeout 3 -sL https://api.github.com/repos/OxideMod/Oxide.Hurtworld/releases/latest | jq -r '.assets[].browser_download_url') +oxidesdtdlatestlink=$(curl --connect-timeout 3 -sL https://api.github.com/repos/OxideMod/Oxide.SevenDaysToDie/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url') +# Valheim Plus +valheimpluslatestlink=$(curl --connect-timeout 3 -sL https://api.github.com/repos/Grantapher/ValheimPlus/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("UnixServer.tar.gz")) | .browser_download_url') +# Valheim BepInEx +bepinexvhlatestlink=$(curl --connect-timeout 3 -sL "https://thunderstore.io/api/experimental/package/denikson/BepInExPack_Valheim/" -H "accept: application/json" | jq -r '.latest.download_url') + +# Define mods information (required) + +# Separator name +modseparator="MOD" + +# REQUIRED: mod_info_name=( MOD "modcommand" "Pretty Name" "URL" "filename" "modsubdirs" "LowercaseOn/Off" "/files/to/keep;" "/install/path" "ENGINES" "GAMES" "NOTGAMES" "AUTHOR_URL" "Short Description" ) +# Example 1) Well made mod: mod_info_name=( MOD "awesomemod" "This is an Awesome Mod" "https://awesomemod.com/latest.zip" "awesomemod.zip" "0" "LowercaseOff" "OVERWRITE" "${systemdir}/addons" "source;unity3d;" "GAMES" "NOTGAMES" "https://awesomemod.com/" "This mod knows that 42 is the answer" ) +# Example 2) Poorly made mod: mod_info_name=( MOD "stupidmod" "This is a stupid mod" "${crappymodurl}" "StupidMod.zip" "2" "LowercaseOn" "cfg;data/crappymod;" "${systemdir}" "source;" "GAMES" "Garry's mod;Counter-Strike: Source;" "This mod is dumber than dumb" ) +# None of those values can be empty +# index | Usage +# [0] | MOD: separator, all mods must begin with it +# [1] | "modcommand": the LGSM name and command to install the mod (must be unique and lowercase) +# [2] | "Pretty Name": the common name people use to call the mod that will be displayed to the user +# [3] | "URL": link to the mod archive file; can be a variable previously defined while scraping a URL +# [4] | "filename": the output filename +# [5] | "modsubdirs": in how many subdirectories is the mod (none is 0) (not used at release, but could be in the future) +# [6] | "LowercaseOn/Off": LowercaseOff or LowercaseOn: enable/disable converting extracted files and directories to lowercase (some games require it) +# [7] | "modinstalldir": the directory in which to install the mode (use LGSM dir variables such as ${systemdir}) +# [8] | "/files/to/keep;", files & directories that should not be overwritten upon update, separated and ended with a semicolon; you can also use "OVERWRITE" value to ignore the value or "NOUPDATE" to disallow updating; for files to keep upon uninstall, see fn_mod_tidy_files_list from mods_core.sh +# [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 +# [13] | "Short Description" a description showed to the user upon installation/removal + +# Half-life 1 Engine Mods +mod_info_metamod=(MOD "metamod" "Metamod" "${metamodurl}" "${metamodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/plugins.ini;" "ENGINES" "Counter-Strike 1.6;Day of Defeat;Team Fortress Classic;Natural Selection;The Specialists;Half-Life: Deathmatch;" "NOTGAMES" "https://github.com/alliedmodders/metamod-hl1" "Plugins Framework") +mod_info_base_amxx=(MOD "amxmodx" "AMX Mod X: Base" "${amxxbaseurl}" "${amxxbaselatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Counter-Strike 1.6;Day of Defeat;Team Fortress Classic;Natural Selection;The Specialists;Half-Life: Deathmatch;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod)") + +# CS 1.6 (HL1) Engine Mods +mod_info_cs_amxx=(MOD "amxmodxcs" "AMX Mod X: Counter-Strike" "${amxxcsurl}" "${amxxcslatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Counter-Strike 1.6;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)") + +# DOD (HL1) Engine Mods +mod_info_dod_amxx=(MOD "amxmodxdod" "AMX Mod X: Day of Defeat" "${amxxdodurl}" "${amxxdodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Day of Defeat;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)") + +# TFC (HL1) Engine Mods +mod_info_tfc_amxx=(MOD "amxmodxtfc" "AMX Mod X: Team Fortress Classic" "${amxxtfcurl}" "${amxxtfclatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Team Fortress Classic;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)") + +# NS (Natural Selection) (HL1) Engine Mods +mod_info_ns_amxx=(MOD "amxmodxns" "AMX Mod X: Natural Selection" "${amxxnsurl}" "${amxxnslatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Natural Selection;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)") + +# TS (The Specialists) (HL1) Engine Mods +mod_info_ts_amxx=(MOD "amxmodxts" "AMX Mod X: The Specialists" "${amxxtsurl}" "${amxxtslatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "The Specialists;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)") + +# Source mods +mod_info_metamodsource=(MOD "metamodsource" "Metamod: Source" "${metamodsourceurl}" "${metamodsourcelatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/metaplugins.ini;" "source;" "GAMES" "NOTGAMES" "https://www.sourcemm.net" "Plugins Framework") +mod_info_sourcemod=(MOD "sourcemod" "SourceMod" "${sourcemodurl}" "${sourcemodlatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "GAMES" "NOTGAMES" "http://www.sourcemod.net" "Admin Features (requires Metamod: Source)") +mod_info_steamworks=(MOD "steamworks" "SteamWorks" "${steamworksurl}" "${steamworkslatestfile}" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/KyleSanderson/SteamWorks" "Exposing SteamWorks functions to SourcePawn") +mod_info_stripper=(MOD "stripper" "Stripper Source" "${stripperurl}" "${stripperlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/stripper/maps;" "ENGINES" "Counter-Strike: Global Offensive;Counter-Strike: Source;Day of Defeat: Source;Half Life: Deathmatch;Half Life 2: Deathmatch;Insurgency;Left 4 Dead;Left 4 Dead 2;Nuclear Dawn;Team Fortress 2;" "NOTGAMES" "http://www.bailopan.net/stripper/" "Add or remove objects from map (requires MetaMod)") + +# CS:GO Mods +mod_info_gokz=(MOD "gokz" "GOKZ" "${gokzlatestlink}" "${gokzlatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/KZGlobalTeam/gokz" "GOKZ ${gokzlatestversion} - Implements the KZ game mode (requires SourceMod and MetaMod)") +mod_info_ttt=(MOD "ttt" "Trouble in Terrorist Town" "https://csgottt.com/downloads/ttt-latest-dev-${sourcemodversion}.zip" "ttt-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/Bara/TroubleinTerroristTown" "Implements the TTT game mode (requires SourceMod and MetaMod)") +mod_info_get5=(MOD "get5" "Get 5" "${get5latestfilelink}" "${get5latestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/get5" "Plugin for competitive matches/scrims (requires SourceMod and MetaMod)") +mod_info_prac=(MOD "prac" "csgo practice mode" "${csgopracticelatestlink}" "${csgopracticelatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/csgo-practice-mode" "Practice Mode is a sourcemod plugin for helping players/teams run practices.") +mod_info_pug=(MOD "pug" "PUG" "${csgopuglatestlink}" "${csgopuglatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/csgo-pug-setup" "plugin for setting up private pug/10man games") +mod_info_dhook=(MOD "dhook" "dhook" "https://forums.alliedmods.net/attachment.php?attachmentid=190123&d=1625050030" "dhooks-2.2.0d17.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://forums.alliedmods.net/showpost.php?p=2588686&postcount=589" "DHooks 2.2.0 - Required for GOKZ") +mod_info_movement=(MOD "movementapi" "movementapi" "${movementapilatestlink}" "${movementapilatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/danzayau/MovementAPI" "Movement API ${movementapilatestversion} - Required for GOKZ") +mod_info_cleaner=(MOD "cleaner" "cleaner" "https://github.com/e54385991/console-cleaner/archive/refs/heads/master.zip" "console-cleaner.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/e54385991/console-cleaner" "Console Cleaner - Optional for GOKZ") + +# Garry's Mod Addons +mod_info_ulib=(MOD "ulib" "ULib" "https://codeload.github.com/TeamUlysses/ulib/zip/master" "ulib-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "Complete Framework") +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_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") +mod_info_wiremod=(MOD "wiremod" "Wiremod" "https://github.com/wiremod/wire/archive/master.zip" "wire-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/wiremod/wire" "Base Wiremod Addon") +mod_info_wiremodextras=(MOD "wiremod-extras" "Wiremod Extras" "https://github.com/wiremod/wire-extras/archive/master.zip" "wire-extras-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/wiremod/wire-extras/" "Addition to Wiremod, Extra Content") +mod_info_advduplicator=(MOD "advdupe1" "Advanced Duplicator 1" "https://github.com/wiremod/advduplicator/archive/master.zip" "advduplicator-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/wiremod/advduplicator" "Save your constructions. First version") +mod_info_trackassemblytool=(MOD "trackassemblytool" "Track Assembly Tool" "https://github.com/dvdvideo1234/trackassemblytool/archive/master.zip" "trackassemblytool-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/TrackAssemblyTool" "Assembles segmented track. Supports wire") +mod_info_physpropertiesadv=(MOD "physpropertiesadv" "Phys Properties Adv" "https://github.com/dvdvideo1234/physpropertiesadv/archive/master.zip" "physpropertiesadv-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/PhysPropertiesAdv" "Advanced configurable properties") +mod_info_controlsystemse2=(MOD "controlsystemse2" "Control Systems E2" "https://github.com/dvdvideo1234/controlsystemse2/archive/master.zip" "controlsystemse2-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/ControlSystemsE2" "PID controllers and fast traces for E2. Minor included in wire-extas") +mod_info_e2pistontiming=(MOD "e2pistontiming" "E2 Piston Timing" "https://github.com/dvdvideo1234/e2pistontiming/archive/master.zip" "e2pistontiming-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/E2PistonTiming" "Routine driven piston engine timings for E2") +mod_info_propcannontool=(MOD "propcannontool" "Prop Cannon Tool" "https://github.com/dvdvideo1234/propcannontool/archive/master.zip" "propcannontool-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/PropCannonTool" "Cannon entity that can fire props. Supports wire") +mod_info_gearassemblytool=(MOD "gearassemblytool" "Gear Assembly Tool" "https://github.com/dvdvideo1234/gearassemblytool/archive/master.zip" "gearassemblytool-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/GearAssemblyTool" "Assembles segmented gearbox") +mod_info_spinnertool=(MOD "spinnertool" "Spinner Tool" "https://github.com/dvdvideo1234/spinnertool/archive/master.zip" "spinnertool-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/SpinnerTool" "Torque lever controlled spinner. Supports wire") +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") +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") + +# Rust +mod_info_rustcarbon=(MOD "rustcarbon" "Carbon for Rust" "${carbonrustlatestlink}" "Carbon.Linux.Release.tar.gz" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Rust;" "NOTGAMES" "carbonmod.gg" "Allows for the use of both plugins and harmony mods") + +# Oxidemod +mod_info_rustoxide=(MOD "rustoxide" "Oxide for Rust" "${oxiderustlatestlink}" "Oxide.Rust-linux.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Rust;" "NOTGAMES" "https://umod.org/games/rust" "Allows for the use of plugins") +mod_info_hwoxide=(MOD "hwoxide" "Oxide for Hurtworld" "${oxidehurtworldlatestlink}" "Oxide.Hurtworld.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Hurtworld;" "NOTGAMES" "https://umod.org/games/hurtworld" "Allows for the use of plugins") +mod_info_sdtdoxide=(MOD "sdtdoxide" "Oxide for 7 Days To Die" "${oxidesdtdlatestlink}" "Oxide.SevenDaysToDie.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "7 Days To Die;" "NOTGAMES" "https://umod.org/games/7-days-to-die" "Allows for the use of plugins") + +# ValheimPlus +mod_info_valheimplus=(MOD "valheimplus" "Valheim PLUS" "${valheimpluslatestlink}" "ValheimPlus.tar.gz" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Valheim;" "NOTGAMES" "https://github.com/Grantapher/ValheimPlus.git" "Mod to improve Valheim gameplay") + +# BepInEx Valheim +mod_info_bepinexvh=(MOD "bepinexvh" "BepInEx Valheim" "${bepinexvhlatestlink}" "denikson-BepInExPack_Valheim.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Valheim;" "NOTGAMES" "https://valheim.thunderstore.io/package/denikson/BepInExPack_Valheim/" "Unity / XNA game patcher and plugin framework") + +# REQUIRED: Set all mods info into the global array +mods_global_array=("${mod_info_metamod[@]}" "${mod_info_base_amxx[@]}" "${mod_info_cs_amxx[@]}" "${mod_info_dod_amxx[@]}" "${mod_info_tfc_amxx[@]}" "${mod_info_ns_amxx[@]}" "${mod_info_ts_amxx[@]}" "${mod_info_metamodsource[@]}" "${mod_info_sourcemod[@]}" "${mod_info_steamworks[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_get5[@]}" "${mod_info_prac[@]}" "${mod_info_pug[@]}" "${mod_info_dhook[@]}" "${mod_info_movement[@]}" "${mod_info_cleaner[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustcarbon[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" "${mod_info_advduplicator[@]}" "${mod_info_trackassemblytool[@]}" "${mod_info_physpropertiesadv[@]}" "${mod_info_controlsystemse2[@]}" "${mod_info_e2pistontiming[@]}" "${mod_info_propcannontool[@]}" "${mod_info_gearassemblytool[@]}" "${mod_info_spinnertool[@]}" "${mod_info_surfacefrictiontool[@]}" "${mod_info_magneticdipole[@]}" "${mod_info_environmentorganizer[@]}" "${mod_info_precision_alignment[@]}" "${mod_info_improved_stacker[@]}" "${mod_info_improved_weight[@]}" "${mod_info_improved_antinoclip[@]}" "${mod_info_laserstool[@]}" "${mod_info_valheimplus[@]}" "${mod_info_bepinexvh[@]}") diff --git a/lgsm/modules/query_gamedig.sh b/lgsm/modules/query_gamedig.sh new file mode 100644 index 000000000..f370fae97 --- /dev/null +++ b/lgsm/modules/query_gamedig.sh @@ -0,0 +1,95 @@ +#!/bin/bash +# LinuxGSM query_gamedig.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Querys a gameserver using node-gamedig. +# https://github.com/gamedig/node-gamedig + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +# Default query status to failure. Will be changed to 0 if query is successful. +querystatus="2" +# Check if gamedig and jq are installed. + +if [ -f "${lgsmdir}/node_modules/gamedig/bin/gamedig.js" ]; then + gamedigbinary="${lgsmdir}/node_modules/gamedig/bin/gamedig.js" +else + gamedigbinary="gamedig" +fi + +if [ "$(command -v "${gamedigbinary}" 2> /dev/null)" ] && [ "$(command -v jq 2> /dev/null)" ]; then + + # will bypass query if server offline. + check_status.sh + if [ "${status}" != "0" ]; then + # GameDig requires you use the voice port when querying. + if [ "${querytype}" == "teamspeak3" ]; then + queryport="${port}" + fi + # checks if query is working null = pass. + gamedigcmd=$(echo -e "${gamedigbinary} --type \"${querytype}\" \"${queryip}:${queryport}\"|jq") + gamedigraw=$(${gamedigbinary} --type "${querytype}" "${queryip}:${queryport}") + querystatus=$(echo "${gamedigraw}" | jq '.error|length') + + if [ "${querytype}" == "teamspeak3" ]; then + fn_info_game_ts3 + fi + + # server name. + gdname=$(echo "${gamedigraw}" | jq -re '.name') + if [ "${gdname}" == "null" ]; then + unset gdname + fi + + # numplayers. + if [ "${querytype}" == "minecraft" ]; then + gdplayers=$(echo "${gamedigraw}" | jq -re '.players | length-1') + elif [ "${querytype}" == "teamspeak3" ]; then + gdplayers=$(echo "${gamedigraw}" | jq -re '.raw.virtualserver_clientsonline') + else + gdplayers=$(echo "${gamedigraw}" | jq -re '.players | length') + fi + if [ "${gdplayers}" == "null" ]; then + unset gdplayers + elif [ "${gdplayers}" == "[]" ] || [ "${gdplayers}" == "-1" ]; then + gdplayers=0 + fi + + # maxplayers. + gdmaxplayers=$(echo "${gamedigraw}" | jq -re '.maxplayers') + if [ "${gdmaxplayers}" == "null" ]; then + unset gdmaxplayers + elif [ "${gdmaxplayers}" == "[]" ]; then + gdmaxplayers=0 + fi + + # current map. + gdmap=$(echo "${gamedigraw}" | jq -re '.map') + if [ "${gdmap}" == "null" ]; then + unset gdmap + fi + + # current gamemode. + gdgamemode=$(echo "${gamedigraw}" | jq -re '.raw.rules.GameMode_s') + if [ "${gdgamemode}" == "null" ]; then + unset gdgamemode + fi + + # numbots. + gdbots=$(echo "${gamedigraw}" | jq -re '.bots | length') + if [ "${gdbots}" == "null" ] || [ "${gdbots}" == "0" ]; then + unset gdbots + fi + + # server version. + if [ "${querytype}" == "teamspeak3" ]; then + gdversion=$(echo "${gamedigraw}" | jq -re '.raw.virtualserver_version') + else + gdversion=$(echo "${gamedigraw}" | jq -re '.raw.version') + fi + + if [ "${gdversion}" == "null" ] || [ "${gdversion}" == "0" ]; then + unset gdversion + fi + fi +fi diff --git a/lgsm/modules/query_gsquery.py b/lgsm/modules/query_gsquery.py new file mode 100644 index 000000000..ecdf8165c --- /dev/null +++ b/lgsm/modules/query_gsquery.py @@ -0,0 +1,159 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# LinuxGSM query_gsquery.py module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Allows querying of various game servers. + +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') + + +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') + + def __init__(self, arguments): + self.argument = arguments + # + if self.argument.engine in self.sourcequery: + 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' + elif self.argument.engine in self.idtech3query: + 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' + elif self.argument.engine in self.minecraftquery: + 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' + elif self.argument.engine in self.mumblequery: + 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' + elif self.argument.engine in self.twquery: + 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' + elif self.argument.engine in self.unreal2query: + 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.connected = False + self.response = None + + @staticmethod + def fatal_error(error_message, error_code=1): + 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') + sys.exit(0) + + def responding(self): + # 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))) + except socket.timeout: + self.fatal_error('Request timed out', 1) + except Exception: + 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) + connection.close() + # Response. + if self.response is None: + self.fatal_error('No response', 3) + if len(self.response) < 5: + sys.exit('Short response.', 3) + else: + self.exit_success(str(self.response)) + + +def parse_args(): + parser = argparse.ArgumentParser( + description='Allows querying of various game servers.', + usage='usage: python3 %(prog)s [options]', + add_help=False + ) + parser.add_argument( + '-a', '--address', + type=str, + required=True, + help='The IPv4 address of the server.' + ) + parser.add_argument( + '-p', '--port', + type=int, + required=True, + help='The IPv4 port of the server.' + ) + parser.add_argument( + '-e', '--engine', + metavar='ENGINE', + choices=engine_types, + help='Engine type: ' + ' '.join(engine_types) + ) + parser.add_argument( + '-v', '--verbose', + action='store_true', + help='Display verbose output.' + ) + parser.add_argument( + '-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.' + ) + return parser.parse_args() + + +def main(): + arguments = parse_args() + server = gsquery(arguments) + server.responding() + + +if __name__ == '__main__': + main() diff --git a/lgsm/modules/update_fctr.sh b/lgsm/modules/update_fctr.sh new file mode 100644 index 000000000..b49386654 --- /dev/null +++ b/lgsm/modules/update_fctr.sh @@ -0,0 +1,171 @@ +#!/bin/bash +# LinuxGSM update_fctr.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Factorio 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" "nohash" + fn_dl_extract "${tmpdir}" "factorio_headless_${factorioarch}-${remotebuildversion}.tar.xz" "${serverfiles}" "factorio" + fn_clear_tmp +} + +fn_update_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # 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" + 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() { + # Get 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) + remotebuildurl="https://factorio.com/get-download/${branch}/headless/${factorioarch}" + remotebuildfilename="factorio_headless_${factorioarch}-${remotebuildversion}.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 + 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 "${remotebuildversion}" ] || [ "${remotebuildversion}" == "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}" != "${remotebuildversion}" ] || [ "${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}" + if [ -n "${branch}" ]; then + echo -e "* 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}" + fi + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild} ${factorioarch}" + fn_script_log_info "Remote build: ${remotebuildversion} ${factorioarch}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" + + 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}" + echo -en "\n" + echo -e "No update available" + echo -e "* Local build: ${green}${localbuild} ${factorioarch}${default}" + echo -e "* Remote build: ${green}${remotebuildversion} ${factorioarch}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild} ${factorioarch}" + fn_script_log_info "Remote build: ${remotebuildversion} ${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}" + fi + fi +} + +# Game server architecture. +factorioarch="linux64" + +# The location where the builds are checked and downloaded. +remotelocation="factorio.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_jk2.sh b/lgsm/modules/update_jk2.sh new file mode 100644 index 000000000..ed4886a48 --- /dev/null +++ b/lgsm/modules/update_jk2.sh @@ -0,0 +1,166 @@ +#!/bin/bash +# LinuxGSM update_jk2.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Jedi Knight 2 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" "nohash" + fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}/GameData" "linux-amd64" + fn_clear_tmp +} + +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 | sed 's/.*://' | awk '{print $1}' | head -n 1 | sed 's/v//') + 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() { + # Get 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') + remotebuildurl=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("dedicated.zip")) | .browser_download_url') + remotebuildversion=$(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 + 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 "${remotebuildversion}" ] || [ "${remotebuildversion}" == "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}" != "${remotebuildversion}" ] || [ "${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}" + if [ -n "${branch}" ]; then + echo -e "* 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}" + fi + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" + + if [ "${commandname}" == "UPDATE" ]; then + 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 + date +%s > "${lockdir}/last-updated.lock" + alert="update" + elif [ "${commandname}" == "CHECK-UPDATE" ]; then + alert="check-update" + fi + 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}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + 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}" + 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 + 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 diff --git a/lgsm/modules/update_mc.sh b/lgsm/modules/update_mc.sh new file mode 100644 index 000000000..6ece44da4 --- /dev/null +++ b/lgsm/modules/update_mc.sh @@ -0,0 +1,180 @@ +#!/bin/bash +# LinuxGSM update_mc.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Minecraft: Java Edition servers. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_dl() { + # Download and extract files to serverfiles. + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "chmodx" "norun" "noforce" "nohash" + cp -f "${tmpdir}/${remotebuildfilename}" "${serverfiles}/minecraft_server.jar" + fn_clear_tmp +} + +fn_update_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Uses executable to get local build. + if [ -d "${executabledir}" ]; then + cd "${executabledir}" || exit + localbuild=$(unzip -p "minecraft_server.jar" version.json | jq -r '.id') + 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() { + # Get remote build info. + apiurl="https://launchermeta.mojang.com/mc/game/version_manifest.json" + remotebuildresponse=$(curl -s "${apiurl}") + # Latest release. + if [ "${branch}" == "release" ] && [ "${mcversion}" == "latest" ]; then + remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '.latest.release') + # Latest snapshot. + elif [ "${branch}" == "snapshot" ] && [ "${mcversion}" == "latest" ]; then + remotebuildversion=$(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') + fi + remotebuildfilename="minecraft_server.${remotebuildversion}.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') + # 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 + 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 "${remotebuildversion}" ] || [ "${remotebuildversion}" == "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}" != "${remotebuildversion}" ] || [ "${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}" + if [ -n "${branch}" ]; then + echo -e "* 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}" + fi + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" + + 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}" + echo -en "\n" + echo -e "No update available" + echo -e "* Local build: ${green}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + 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}" + fi + fi +} + +# The location where the builds are checked and downloaded. +remotelocation="mojang.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_mcb.sh b/lgsm/modules/update_mcb.sh new file mode 100644 index 000000000..e3a4776ce --- /dev/null +++ b/lgsm/modules/update_mcb.sh @@ -0,0 +1,188 @@ +#!/bin/bash +# LinuxGSM update_mcb.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Minecraft Bedrock servers. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_dl() { + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "bedrock_server.${remotebuildversion}.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}" + else + unzip -oq "${tmpdir}/bedrock_server.${remotebuildversion}.zip" -x "permissions.json" "server.properties" "allowlist.json" -d "${serverfiles}" + fi + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fail "Extracting ${local_filename}" + if [ -f "${lgsmlog}" ]; then + echo -e "${extractcmd}" >> "${lgsmlog}" + fi + echo -e "${extractcmd}" + fn_clear_tmp + core_exit.sh + else + fn_print_ok_eol_nl + if [ -f "${lgsmlog}" ]; then + fn_script_log_pass "Extracting ${local_filename}" + fi + fn_clear_tmp + fi +} + +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') + 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() { + # 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]") + else + remotebuildversion="${mcversion}" + fi + remotebuildurl="https://www.minecraft.net/bedrockdedicatedserver/bin-linux/bedrock-server-${remotebuildversion}.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 + 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 "${remotebuildversion}" ] || [ "${remotebuildversion}" == "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}" != "${remotebuildversion}" ] || [ "${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}" + if [ -n "${branch}" ]; then + echo -e "* 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}" + fi + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" + + 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}" + echo -en "\n" + echo -e "No update available" + echo -e "* Local build: ${green}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + 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}" + fi + fi +} + +# The location where the builds are checked and downloaded. +remotelocation="minecraft.net" + +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_mta.sh b/lgsm/modules/update_mta.sh new file mode 100644 index 000000000..b93dc9af1 --- /dev/null +++ b/lgsm/modules/update_mta.sh @@ -0,0 +1,173 @@ +#!/bin/bash +# LinuxGSM update_mta.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Multi Theft Auto servers. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_dl() { + # Download and extract files to tmpdir. + fn_fetch_file "http://linux.mtasa.com/dl/multitheftauto_linux_x64.tar.gz" "" "" "" "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "nochmodx" "norun" "force" "nohash" + fn_dl_extract "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "${serverfiles}" "multitheftauto_linux_x64" + fn_clear_tmp +} + +fn_update_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Uses executable to get local build. + if [ -d "${executabledir}" ]; then + cd "${executabledir}" || exit + localbuild=$(${executable} -v 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() { + # Get remote build info. + apiurl="https://linux.multitheftauto.com/revision/latest.txt" + remotebuildresponse=$(curl -s "${apiurl}") + remotebuildfilename="multitheftauto_linux_x64.tar.gz" + remotebuildurl="http://linux.mtasa.com/dl/multitheftauto_linux_x64.tar.gz" + remotebuildversion=$(echo "${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 + 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 "${remotebuildversion}" ] || [ "${remotebuildversion}" == "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}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + # Create update lockfile. + date '+%s' > "${lockdir:?}/update.lock" + if [ "${forceupdate}" == "1" ]; then + # forceupdate bypasses checks, useful for small build changes + mtaupdatestatus="forced" + else + 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}" + if [ -n "${branch}" ]; then + echo -e "* 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}" + fi + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" + + if [ "${commandname}" == "UPDATE" ]; then + 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 + date +%s > "${lockdir}/last-updated.lock" + alert="update" + elif [ "${commandname}" == "CHECK-UPDATE" ]; then + alert="check-update" + fi + 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}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + 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}" + fi + fi +} + +# The location where the builds are checked and downloaded. +remotelocation="linux.mtasa.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_pmc.sh b/lgsm/modules/update_pmc.sh new file mode 100644 index 000000000..75d99d140 --- /dev/null +++ b/lgsm/modules/update_pmc.sh @@ -0,0 +1,198 @@ +#!/bin/bash +# LinuxGSM update_pmc.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of PaperMC and Waterfall servers. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +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" + 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() { + # Get remote build info. + apiurl="https://api.papermc.io/v2/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]') + else + # Checks if user specified version exists. + remotebuildmcversion=$(echo "${remotebuildresponseproject}" | jq -r -e --arg mcversion "${mcversion}" '.versions[]|select(. == $mcversion)') + if [ -z "${remotebuildmcversion}" ]; then + # user passed version does not exist + fn_print_error_nl "Version ${mcversion} not available from ${remotelocation}" + fn_script_log_error "Version ${mcversion} not available from ${remotelocation}" + core_exit.sh + fi + fi + # 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]') + # 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}" + # Combines Minecraft: Java Edition version and paper build. e.g 1.16.5-456 + remotebuildversion="${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 + 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 "${remotebuildversion}" ] || [ "${remotebuildversion}" == "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}" != "${remotebuildversion}" ] || [ "${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}" + if [ -n "${branch}" ]; then + echo -e "* 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}" + fi + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" + + 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}" + echo -en "\n" + echo -e "No update available" + echo -e "* Local build: ${green}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + 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}" + fi + fi +} + +# The location where the builds are checked and downloaded. +remotelocation="papermc.io" + +if [ "${shortname}" == "pmc" ]; then + paperproject="paper" +elif [ "${shortname}" == "vpmc" ]; then + paperproject="velocity" +elif [ "${shortname}" == "wmc" ]; then + paperproject="waterfall" +fi + +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_steamcmd.sh b/lgsm/modules/update_steamcmd.sh new file mode 100644 index 000000000..ccc8d6b36 --- /dev/null +++ b/lgsm/modules/update_steamcmd.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# LinuxGSM update_steamcmd.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating using SteamCMD. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# init steamcmd functions +core_steamcmd.sh + +# The location where the builds are checked and downloaded. +remotelocation="SteamCMD" +check.sh + +fn_print_dots "${remotelocation}" + +if [ "${forceupdate}" == "1" ]; then + # forceupdate bypasses update checks. + if [ "${status}" != "0" ] && [ -v "${status}" ]; then + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + date '+%s' > "${lockdir:?}/update.lock" + fn_dl_steamcmd + date +%s > "${lockdir}/last-updated.lock" + exitbypass=1 + command_start.sh + fn_firstcommand_reset + else + fn_dl_steamcmd + date +%s > "${lockdir}/last-updated.lock" + fi +else + fn_update_steamcmd_localbuild + fn_update_steamcmd_remotebuild + fn_update_steamcmd_compare +fi diff --git a/lgsm/modules/update_ts3.sh b/lgsm/modules/update_ts3.sh new file mode 100644 index 000000000..30ddf2801 --- /dev/null +++ b/lgsm/modules/update_ts3.sh @@ -0,0 +1,184 @@ +#!/bin/bash +# LinuxGSM command_ts3.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Teamspeak 3 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}" "teamspeak3-server_linux_${ts3arch}" + fn_clear_tmp +} + +fn_update_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Uses log file to get local build. + localbuild=$(grep -Eo "TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" "$(find "${serverfiles}"/* -name "ts3server*_0.log" 2> /dev/null | sort | tail -1)" | grep -Eo "((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | tail -1) + 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() { + # Get remote build info. + apiurl="https://www.teamspeak.com/versions/server.json" + remotebuildresponse=$(curl -s "${apiurl}") + + if [ "${ts3arch}" == "amd64" ]; then + remotebuildurl=$(echo -e "${remotebuildresponse}" | jq -r '.linux.x86_64.mirrors."teamspeak.com"') + remotebuildhash=$(echo -e "${remotebuildresponse}" | jq -r '.linux.x86_64.checksum') + elif [ "${ts3arch}" == "x86" ]; then + remotebuildurl=$(echo -e "${remotebuildresponse}" | jq -r '.linux.x86.mirrors."teamspeak.com"') + remotebuildhash=$(echo -e "${remotebuildresponse}" | jq -r '.linux.x86.checksum') + fi + remotebuildfilename=$(basename "${remotebuildurl}") + remotebuildversion=$(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 + 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 "${remotebuildversion}" ] || [ "${remotebuildversion}" == "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}" != "${remotebuildversion}" ] || [ "${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}" + if [ -n "${branch}" ]; then + echo -e "* 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}" + fi + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" + + 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}" + echo -en "\n" + echo -e "No update available" + echo -e "* Local build: ${green}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + 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}" + fi + fi +} + +# Game server architecture. +info_distro.sh +if [ "${arch}" == "x86_64" ]; then + ts3arch="amd64" +elif [ "${arch}" == "i386" ] || [ "${arch}" == "i686" ]; then + ts3arch="x86" +else + fn_print_failure "Unknown or unsupported architecture: ${arch}" + fn_script_log_fail "Unknown or unsupported architecture: ${arch}" + core_exit.sh +fi + +# The location where the builds are checked and downloaded. +remotelocation="teamspeak.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_ut99.sh b/lgsm/modules/update_ut99.sh new file mode 100644 index 000000000..58927fd18 --- /dev/null +++ b/lgsm/modules/update_ut99.sh @@ -0,0 +1,166 @@ +#!/bin/bash +# LinuxGSM command_ut99.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Unreal Tournament 99 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" "nohash" + fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" + echo "${remotebuildversion}" > "${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() { + # Get 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') + remotebuildurl=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("Linux-amd64")) | .browser_download_url') + remotebuildversion=$(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 + 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 "${remotebuildversion}" ] || [ "${remotebuildversion}" == "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}" != "${remotebuildversion}" ] || [ "${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}" + if [ -n "${branch}" ]; then + echo -e "* 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}" + fi + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" + + 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}" + echo -en "\n" + echo -e "No update available" + echo -e "* Local build: ${green}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + 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}" + 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_vints.sh b/lgsm/modules/update_vints.sh new file mode 100644 index 000000000..2f7f857a1 --- /dev/null +++ b/lgsm/modules/update_vints.sh @@ -0,0 +1,173 @@ +#!/bin/bash +# LinuxGSM update_vints.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Vintage Story 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}" + fn_clear_tmp +} + +fn_update_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Uses executable to get local build. + if [ -d "${executabledir}" ]; then + cd "${executabledir}" || exit + localbuild="$(${preexecutable} ${executable} --version 2> /dev/null | sed '/^[[:space:]]*$/d')" + 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() { + # Get remote build info. + 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) + else + remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -E "\-rc|\-pre" | sort -r -V | head -1) + 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') + + if [ "${firstcommandname}" != "INSTALL" ]; then + fn_print_dots "Checking remote build: ${remotelocation}" + # Checks if remotebuildversion variable has been set. + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "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 "${remotebuildversion}" ] || [ "${remotebuildversion}" == "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}" != "${remotebuildversion}" ] || [ "${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}" + if [ -n "${branch}" ]; then + echo -e "* 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}" + fi + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" + + 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}" + echo -en "\n" + echo -e "No update available" + echo -e "* Local build: ${green}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + 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}" + fi + fi +} + +# The location where the builds are checked and downloaded. +remotelocation="vintagestory.at" + +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 new file mode 100644 index 000000000..c0b0ddaeb --- /dev/null +++ b/lgsm/modules/update_xnt.sh @@ -0,0 +1,173 @@ +#!/bin/bash +# LinuxGSM command_ut99.sh module +# Author: Daniel Gibbs +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Unreal Tournament 99 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}" "Xonotic" + fn_clear_tmp +} + +fn_update_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + + # Send version command to Xonotic server. + tmux -L "${socketname}" send-keys -t "${sessionname}" "version\r" > /dev/null 2>&1 + fn_sleep_time_1 + + # 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') + 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() { + # Get remote build info. + apiurl="https://api.github.com/repos/xonotic/xonotic/tags" + remotebuildresponse=$(curl -s "${apiurl}") + remotebuildtag=$(echo "${remotebuildresponse}" | jq -r '.[0].name') + remotebuildfilename=$(echo "${remotebuildtag}" | tr -d 'v') + remotebuildfilename="${remotebuildfilename}.zip" + remotebuildurl="https://dl.xonotic.org/${remotebuildfilename}" + + remotebuildversion="${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 + 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 "${remotebuildversion}" ] || [ "${remotebuildversion}" == "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}" != "${remotebuildversion}" ] || [ "${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}" + if [ -n "${branch}" ]; then + echo -e "* 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}" + fi + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" + + 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}" + echo -en "\n" + echo -e "No update available" + echo -e "* Local build: ${green}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + 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}" + 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/linuxgsm.sh b/linuxgsm.sh index aececaed8..7df2ef066 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -1,7 +1,7 @@ #!/bin/bash -# Project: Game Server Managers - LinuxGSM +# Project: Linux Game Server Managers - LinuxGSM # Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2020 Daniel Gibbs +# License: MIT License, see LICENSE.md # Purpose: Linux Game Server Management Script # Contributors: https://linuxgsm.com/contrib # Documentation: https://docs.linuxgsm.com @@ -15,50 +15,98 @@ # Debugging if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log + if [ -f /.dockerenv ]; then + exec 5> /data/log/dev-debug.log + else + exec 5> dev-debug.log + fi BASH_XTRACEFD="5" set -x fi -version="v20.3.3" +version="v24.3.3" shortname="core" gameservername="core" commandname="CORE" rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") -sessionname=$(echo "${selfname}" | cut -f1 -d".") lgsmdir="${rootdir}/lgsm" -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" steamcmddir="${HOME}/.steam/steamcmd" -serverfiles="${rootdir}/serverfiles" -functionsdir="${lgsmdir}/functions" +[ -n "${LGSM_SERVERFILES}" ] && serverfiles="${LGSM_SERVERFILES}" || serverfiles="${rootdir}/serverfiles" +modulesdir="${lgsmdir}/modules" tmpdir="${lgsmdir}/tmp" -datadir="${lgsmdir}/data" +[ -n "${LGSM_DATADIR}" ] && datadir="${LGSM_DATADIR}" || datadir="${lgsmdir}/data" lockdir="${lgsmdir}/lock" +sessionname="${selfname}" +[ -f "${datadir}/${selfname}.uid" ] && socketname="${sessionname}-$(cat "${datadir}/${selfname}.uid")" serverlist="${datadir}/serverlist.csv" serverlistmenu="${datadir}/serverlistmenu.csv" -configdir="${lgsmdir}/config-lgsm" +[ -n "${LGSM_CONFIG}" ] && configdir="${LGSM_CONFIG}" || configdir="${lgsmdir}/config-lgsm" configdirserver="${configdir}/${gameservername}" configdirdefault="${lgsmdir}/config-default" userinput="${1}" +userinput2="${2}" ## GitHub Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" +[ -n "${LGSM_GITHUBUSER}" ] && githubuser="${LGSM_GITHUBUSER}" || githubuser="GameServerManagers" +[ -n "${LGSM_GITHUBREPO}" ] && githubrepo="${LGSM_GITHUBREPO}" || githubrepo="LinuxGSM" +[ -n "${LGSM_GITHUBBRANCH}" ] && githubbranch="${LGSM_GITHUBBRANCH}" || githubbranch="master" -# Core function that is required first. -core_functions.sh(){ - functionfile="${FUNCNAME[0]}" - fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" +# Check that curl is installed before doing anything +if [ ! "$(command -v curl 2> /dev/null)" ]; then + echo -e "[ FAIL ] Curl is not installed" + exit 1 +fi + +# Core module that is required first. +core_modules.sh() { + modulefile="${FUNCNAME[0]}" + fn_bootstrap_fetch_file_github "lgsm/modules" "core_modules.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nomd5" } # Bootstrap -# Fetches the core functions required before passed off to core_dl.sh. -fn_bootstrap_fetch_file(){ +# 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}" remote_fileurl_name="${3}" @@ -68,22 +116,22 @@ 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 [ ! -f "${local_filedir}/${local_filename}" ] || [ "${forcedl}" == "forcedl" ]; then # If backup fileurl exists include it. if [ -n "${remote_fileurl_backup}" ]; then # counter set to 0 to allow second try counter=0 - remote_fileurls_array=( remote_fileurl remote_fileurl_backup ) + remote_fileurls_array=(remote_fileurl remote_fileurl_backup) else # counter set to 1 to not allow second try counter=1 - remote_fileurls_array=( remote_fileurl ) + remote_fileurls_array=(remote_fileurl) fi - for remote_fileurl_array in "${remote_fileurls_array[@]}" - do + for remote_fileurl_array in "${remote_fileurls_array[@]}"; do if [ "${remote_fileurl_array}" == "remote_fileurl" ]; then fileurl="${remote_fileurl}" fileurl_name="${remote_fileurl_name}" @@ -91,49 +139,59 @@ fn_bootstrap_fetch_file(){ fileurl="${remote_fileurl_backup}" fileurl_name="${remote_fileurl_backup_name}" fi - counter=$((counter+1)) + counter=$((counter + 1)) if [ ! -d "${local_filedir}" ]; then mkdir -p "${local_filedir}" fi # Trap will remove part downloaded files if canceled. - trap fn_fetch_trap INT - # Larger files show a progress bar. + 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") - echo -en "fetching ${fileurl_name} ${local_filename}...\c" - curlcmd=$(curl -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) - - local exitcode=$? + # 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 + 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} -ne 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_fatal "Downloading ${local_filename}" - fn_script_log_fatal "${fileurl}" + 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. @@ -158,10 +216,11 @@ fn_bootstrap_fetch_file(){ fi } -fn_bootstrap_fetch_file_github(){ +fn_bootstrap_fetch_file_github() { github_file_url_dir="${1}" github_file_url_name="${2}" - if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + # By default modules will be downloaded from the version release to prevent potential version mixing. Only update-lgsm will allow an update. + 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 @@ -176,7 +235,7 @@ fn_bootstrap_fetch_file_github(){ run="${5:-0}" forcedl="${6:-0}" md5="${7:-0}" - # Passes vars to the file download function. + # Passes vars to the file download module. fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } @@ -185,10 +244,10 @@ fn_bootstrap_fetch_file_github(){ fn_print_center() { columns=$(tput cols) line="$*" - printf "%*s\n" $(( (${#line} + columns) / 2)) "${line}" + printf "%*s\n" $(((${#line} + columns) / 2)) "${line}" } -fn_print_horizontal(){ +fn_print_horizontal() { printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "=" } @@ -205,11 +264,11 @@ fn_install_menu_bash() { menu_options=() while read -r line || [[ -n "${line}" ]]; do var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') - menu_options+=( "${var}" ) + menu_options+=("${var}") done < "${options}" - menu_options+=( "Cancel" ) + menu_options+=("Cancel") select option in "${menu_options[@]}"; do - if [ "${option}" ]&&[ "${option}" != "Cancel" ]; then + if [ "${option}" ] && [ "${option}" != "Cancel" ]; then eval "$resultvar=\"${option/%\ */}\"" fi break @@ -231,10 +290,11 @@ fn_install_menu_whiptail() { while read -r line; do key=$(echo -e "${line}" | awk -F "," '{print $3}') val=$(echo -e "${line}" | awk -F "," '{print $2}') - menu_options+=( "${val//\"}" "${key//\"}" ) + 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=" @@ -256,24 +316,26 @@ fn_install_menu() { fi done case "$(basename "${menucmd}")" in - whiptail|dialog) - fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; + whiptail | dialog) + 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 eval "$resultvar=\"${selection}\"" } # Gets server info from serverlist.csv and puts in to array. -fn_server_info(){ +fn_server_info() { IFS="," server_info_array=($(grep -aw "${userinput}" "${serverlist}")) - shortname="${server_info_array[0]}" # csgo + shortname="${server_info_array[0]}" # csgo gameservername="${server_info_array[1]}" # csgoserver - gamename="${server_info_array[2]}" # Counter Strike: Global Offensive + gamename="${server_info_array[2]}" # Counter Strike: Global Offensive } -fn_install_getopt(){ +fn_install_getopt() { userinput="empty" echo -e "Usage: $0 [option]" echo -e "" @@ -287,13 +349,13 @@ fn_install_getopt(){ exit } -fn_install_file(){ +fn_install_file() { local_filename="${gameservername}" if [ -e "${local_filename}" ]; then i=2 - while [ -e "${local_filename}-${i}" ] ; do - (( i++ )) - done + while [ -e "${local_filename}-${i}" ]; do + ((i++)) + done local_filename="${local_filename}-${i}" fi cp -R "${selfname}" "${local_filename}" @@ -313,17 +375,18 @@ fn_install_file(){ # Prevent LinuxGSM from running as root. Except if doing a dependency install. if [ "$(whoami)" == "root" ]; then - if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then - if [ "${shortname}" == "core" ]; then - echo -e "[ FAIL ] Do NOT run this script as root!" + if [ -f "${modulesdir}/core_modules.sh" ] || [ -f "${modulesdir}/check_root.sh" ] || [ -f "${modulesdir}/core_messages.sh" ]; then + if [ "${userinput}" != "install" ] && [ "${userinput}" != "auto-install" ] && [ "${userinput}" != "i" ] && [ "${userinput}" != "ai" ]; then + core_modules.sh + core_messages.sh + fn_ansi_loader + check_root.sh + fi + else + if [ "${userinput}" != "install" ] && [ "${userinput}" != "auto-install" ] && [ "${userinput}" != "i" ] && [ "${userinput}" != "ai" ]; then + echo -e "[ FAIL ] Do NOT run as root!" exit 1 fi - elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then - echo -e "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh fi fi @@ -336,12 +399,12 @@ if [ "${shortname}" == "core" ]; then exit 1 fi - if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then + if [ "${userinput}" == "list" ] || [ "${userinput}" == "l" ]; then { tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' } | column -s $'\t' -t | more exit - elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then + elif [ "${userinput}" == "install" ] || [ "${userinput}" == "i" ]; then tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" userinput="${result}" @@ -357,10 +420,11 @@ if [ "${shortname}" == "core" ]; then fi elif [ "${userinput}" ]; then fn_server_info - if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then + if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo -e "[ FAIL ] unknown game server" + echo -e "[ FAIL ] Unknown game server" + exit 1 fi else fn_install_getopt @@ -368,7 +432,7 @@ if [ "${shortname}" == "core" ]; then # LinuxGSM server mode. else - core_functions.sh + core_modules.sh if [ "${shortname}" != "core-dep" ]; then # Load LinuxGSM configs. # These are required to get all the default variables for the specific server. @@ -379,59 +443,117 @@ 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 [ $? -ne 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 - function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") - if [ "${function_file_diff}" != "" ]; then + config_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${config_file_diff}" != "" ]; then 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 [ $? -ne 0 ]; then + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then echo -e "FAIL" exit 1 else - echo -e "OK" + echo -e " ... OK" fi fi fi + fi + + # Load the IP details before the first config is loaded. + check_ip.sh + # Configs have to be loaded twice to allow start startparameters to pick up all vars + # shellcheck source=/dev/null + source "${configdirserver}/_default.cfg" + # Load the common.cfg config. If missing download it. + if [ ! -f "${configdirserver}/common.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" # shellcheck source=/dev/null - source "${configdirserver}/_default.cfg" - # Load the common.cfg config. If missing download it. - if [ ! -f "${configdirserver}/common.cfg" ]; then - fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + source "${configdirserver}/common.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/common.cfg" + fi + # Load the secrets-common.cfg config. If missing download it. + if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/secrets-common.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/secrets-common.cfg" + fi + # Load the instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/${selfname}.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/${selfname}.cfg" + fi + # Load the secrets-instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/secrets-${selfname}.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/secrets-${selfname}.cfg" + fi + + # Reloads start parameter to ensure all vars in startparameters are set. + # Will reload the last defined startparameter. + fn_reload_startparameters() { + # reload Wurm config. + if [ "${shortname}" == "wurm" ]; then # shellcheck source=/dev/null - source "${configdirserver}/common.cfg" - else - # shellcheck source=/dev/null - source "${configdirserver}/common.cfg" + source "${servercfgfullpath}" fi - # Load the instance.cfg config. If missing download it. - if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then - fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" - # shellcheck source=/dev/null - source "${configdirserver}/${selfname}.cfg" - else - # shellcheck source=/dev/null - source "${configdirserver}/${selfname}.cfg" + # reload startparameters. + if grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/secrets-${selfname}.cfg"; then + eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/secrets-${selfname}.cfg")" + elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/${selfname}.cfg"; then + eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/${selfname}.cfg")" + elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/secrets-common.cfg"; then + eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/secrets-common.cfg")" + elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/common.cfg"; then + eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/common.cfg")" + elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/_default.cfg"; then + eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/_default.cfg")" fi - # Load the linuxgsm.sh in to tmpdir. If missing download it. - if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then - fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5" + # reload preexecutable. + if grep -qE "^[[:blank:]]*preexecutable=" "${configdirserver}/secrets-${selfname}.cfg"; then + eval preexecutable="$(sed -nr 's/^ *preexecutable=(.*)$/\1/p' "${configdirserver}/secrets-${selfname}.cfg")" + elif grep -qE "^[[:blank:]]*preexecutable=" "${configdirserver}/${selfname}.cfg"; then + eval preexecutable="$(sed -nr 's/^ *preexecutable=(.*)$/\1/p' "${configdirserver}/${selfname}.cfg")" + elif grep -qE "^[[:blank:]]*preexecutable=" "${configdirserver}/secrets-common.cfg"; then + eval preexecutable="$(sed -nr 's/^ *preexecutable=(.*)$/\1/p' "${configdirserver}/secrets-common.cfg")" + elif grep -qE "^[[:blank:]]*preexecutable=" "${configdirserver}/common.cfg"; then + eval preexecutable="$(sed -nr 's/^ *preexecutable=(.*)$/\1/p' "${configdirserver}/common.cfg")" + elif grep -qE "^[[:blank:]]*preexecutable=" "${configdirserver}/_default.cfg"; then + eval preexecutable="$(sed -nr 's/^ *preexecutable=(.*)$/\1/p' "${configdirserver}/_default.cfg")" fi + } + + # Load the linuxgsm.sh in to tmpdir. If missing download it. + if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then + fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5" fi + # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. fn_ansi_loader - # Prevents running of core_exit.sh for Travis-CI. - if [ "${travistest}" != "1" ]; then - getopt=$1 - core_getopt.sh - fi + + getopt=$1 + core_getopt.sh fi diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 000000000..581f6ea8a --- /dev/null +++ b/package-lock.json @@ -0,0 +1,706 @@ +{ + "name": "linuxgsm", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "linuxgsm", + "license": "MIT", + "dependencies": { + "gamedig": "^5.1.4" + }, + "devDependencies": { + "prettier": "^3.4.2", + "prettier-plugin-sh": "^0.14.0" + } + }, + "node_modules/@sindresorhus/is": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", + "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/@szmarczak/http-timer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", + "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", + "dependencies": { + "defer-to-connect": "^2.0.1" + }, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/@types/http-cache-semantics": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", + "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==" + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" + }, + "node_modules/barse": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/barse/-/barse-0.4.3.tgz", + "integrity": "sha512-UEpvriJqAn8zuVinYICuKoPttZy3XxXEoqX/V2uYAL4zzJRuNzCK3+20nAu3YUIa2U7G53kf90wfBIp9/A+Odw==", + "dependencies": { + "readable-stream": "~1.0.2" + } + }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" + }, + "node_modules/cacheable-lookup": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", + "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", + "engines": { + "node": ">=14.16" + } + }, + "node_modules/cacheable-request": { + "version": "10.2.14", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", + "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", + "dependencies": { + "@types/http-cache-semantics": "^4.0.2", + "get-stream": "^6.0.1", + "http-cache-semantics": "^4.1.1", + "keyv": "^4.5.3", + "mimic-response": "^4.0.0", + "normalize-url": "^8.0.0", + "responselike": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + } + }, + "node_modules/cheerio": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", + "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", + "dependencies": { + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "htmlparser2": "^8.0.1", + "parse5": "^7.0.0", + "parse5-htmlparser2-tree-adapter": "^7.0.0" + }, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/cheeriojs/cheerio?sponsor=1" + } + }, + "node_modules/cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "dependencies": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "engines": { + "node": ">= 6" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decompress-response/node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/defer-to-connect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", + "engines": { + "node": ">=10" + } + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/event-to-promise": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/event-to-promise/-/event-to-promise-0.7.0.tgz", + "integrity": "sha512-VOBBfyaADfe378ZzG0tgkzmsvzUyeU5arehrFzNRt5yaASUDshgctTwSrPI17ocAwR3+YftsxRClHF+GBKFByQ==", + "deprecated": "Use promise-toolbox/fromEvent instead" + }, + "node_modules/form-data-encoder": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.4.tgz", + "integrity": "sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==", + "engines": { + "node": ">= 14.17" + } + }, + "node_modules/gamedig": { + "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", + "seek-bzip": "2.0.0", + "varint": "6.0.0" + }, + "bin": { + "gamedig": "bin/gamedig.js" + }, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/gbxremote": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/gbxremote/-/gbxremote-0.2.1.tgz", + "integrity": "sha512-SMehu6Y6ndq2Qgp9VxAb8Np3f+UUD+RWoW2SAMaxzGS96rWXyr4T1GGkecO0HHtxeH1m7pEh4FJWB8a/6aM2XQ==", + "dependencies": { + "any-promise": "^1.1.0", + "barse": "~0.4.2", + "event-to-promise": "^0.7.0", + "string-to-stream": "^1.0.1", + "xmlrpc": "^1.3.1" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/got": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/got/-/got-13.0.0.tgz", + "integrity": "sha512-XfBk1CxOOScDcMr9O1yKkNaQyy865NbYs+F7dr4H0LZMVgCj2Le59k6PqbNHoL5ToeaEQUYh6c6yMfVcc6SJxA==", + "dependencies": { + "@sindresorhus/is": "^5.2.0", + "@szmarczak/http-timer": "^5.0.1", + "cacheable-lookup": "^7.0.0", + "cacheable-request": "^10.2.8", + "decompress-response": "^6.0.0", + "form-data-encoder": "^2.1.2", + "get-stream": "^6.0.1", + "http2-wrapper": "^2.1.10", + "lowercase-keys": "^3.0.0", + "p-cancelable": "^3.0.0", + "responselike": "^3.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" + } + }, + "node_modules/htmlparser2": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", + "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "entities": "^4.4.0" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" + }, + "node_modules/http2-wrapper": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", + "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", + "dependencies": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.2.0" + }, + "engines": { + "node": ">=10.19.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, + "node_modules/lowercase-keys": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", + "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mimic-response": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", + "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mvdan-sh": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/mvdan-sh/-/mvdan-sh-0.10.1.tgz", + "integrity": "sha512-kMbrH0EObaKmK3nVRKUIIya1dpASHIEusM13S4V1ViHFuxuNxCo+arxoa6j/dbV22YBGjl7UKJm9QQKJ2Crzhg==", + "dev": true + }, + "node_modules/normalize-url": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", + "integrity": "sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/p-cancelable": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", + "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", + "engines": { + "node": ">=12.20" + } + }, + "node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", + "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", + "dependencies": { + "domhandler": "^5.0.2", + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/prettier": { + "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" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-plugin-sh": { + "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", + "sh-syntax": "^0.4.1" + }, + "engines": { + "node": ">=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + }, + "peerDependencies": { + "prettier": "^3.0.3" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "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/quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/resolve-alpn": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==" + }, + "node_modules/responselike": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", + "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", + "dependencies": { + "lowercase-keys": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + }, + "node_modules/seek-bzip": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-2.0.0.tgz", + "integrity": "sha512-SMguiTnYrhpLdk3PwfzHeotrcwi8bNV4iemL9tx9poR/yeaMYwB9VzR1w7b57DuWpuqR8n6oZboi0hj3AxZxQg==", + "dependencies": { + "commander": "^6.0.0" + }, + "bin": { + "seek-bunzip": "bin/seek-bunzip", + "seek-table": "bin/seek-bzip-table" + } + }, + "node_modules/sh-syntax": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/sh-syntax/-/sh-syntax-0.4.1.tgz", + "integrity": "sha512-MW/ZsCYTu11EIYYTSZcfAgMFszAodCmQVB27XssHoIN6L4EG0KSA3h32x8whaSOKuYBX5wz9EybfnPBUFQMCKA==", + "dev": true, + "dependencies": { + "tslib": "^2.6.0" + }, + "engines": { + "node": ">=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" + }, + "node_modules/string-to-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string-to-stream/-/string-to-stream-1.1.1.tgz", + "integrity": "sha512-QySF2+3Rwq0SdO3s7BAp4x+c3qsClpPQ6abAmb0DGViiSBAkT5kL6JT2iyzEVP+T1SmzHrQD1TwlP9QAHCc+Sw==", + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "^2.1.0" + } + }, + "node_modules/string-to-stream/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/string-to-stream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/string-to-stream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/varint": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz", + "integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==" + }, + "node_modules/xmlbuilder": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-8.2.2.tgz", + "integrity": "sha512-eKRAFz04jghooy8muekqzo8uCSVNeyRedbuJrp0fovbLIi7wlsYtdUn3vBAAPq2Y3/0xMz2WMEUQ8yhVVO9Stw==", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/xmlrpc": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/xmlrpc/-/xmlrpc-1.3.2.tgz", + "integrity": "sha512-jQf5gbrP6wvzN71fgkcPPkF4bF/Wyovd7Xdff8d6/ihxYmgETQYSuTc+Hl+tsh/jmgPLro/Aro48LMFlIyEKKQ==", + "dependencies": { + "sax": "1.2.x", + "xmlbuilder": "8.2.x" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.0.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 000000000..404356e5e --- /dev/null +++ b/package.json @@ -0,0 +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" + } +} diff --git a/tests/tests_defaultcfg/defaultcfg_0.txt b/tests/tests_defaultcfg/defaultcfg_0.txt deleted file mode 100644 index 50c1d0ee6..000000000 --- a/tests/tests_defaultcfg/defaultcfg_0.txt +++ /dev/null @@ -1,60 +0,0 @@ -stats -displayip -postalert -postdays -posttarget -discordalert -discordwebhook -emailalert -email -emailfrom -iftttalert -ifttttoken -iftttevent -mailgunalert -mailguntoken -mailgundomain -mailgunemailfrom -mailgunemail -pushbulletalert -pushbullettoken -channeltag -pushoveralert -pushovertoken -slackalert -slackwebhook -telegramalert -telegramtoken -telegramchatid -curlcustomstring -maxbackups -maxbackupdays -stoponbackup -consolelogging -logdays -querydelay -ansi -sleeptime -stopmode -querymode -querytype -gamename -engine -glibc -systemdir -executabledir -executable -servercfgdir -servercfg -servercfgdefault -servercfgfullpath -backupdir -logdir -lgsmlogdir -consolelogdir -lgsmlog -consolelog -alertlog -postdetailslog -lgsmlogdate -consolelogdate diff --git a/tests/tests_defaultcfg/defaultcfg_1.txt b/tests/tests_defaultcfg/defaultcfg_1.txt deleted file mode 100644 index 505b6b1f0..000000000 --- a/tests/tests_defaultcfg/defaultcfg_1.txt +++ /dev/null @@ -1,51 +0,0 @@ -################################## -######## 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 #### -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -#### LinuxGSM Settings #### -## Notification Alerts -# (on|off) -# Display IP | https://docs.linuxgsm.com/alerts#display-ip -# More info | https://docs.linuxgsm.com/alerts#more-info -# Discord Alerts | https://docs.linuxgsm.com/alerts/discord -# Email Alerts | https://docs.linuxgsm.com/alerts/email -# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet -# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover -# Slack Alerts | https://docs.linuxgsm.com/alerts/slack -# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram -# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need -# any custom string in curl - simple ignore this parameter. -## Backup | https://docs.linuxgsm.com/commands/backup -## Logging | https://docs.linuxgsm.com/features/logging -## Monitor | https://docs.linuxgsm.com/commands/monitor -# Query delay time -## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors -#### Advanced Settings #### -## Message Display Time | https://docs.linuxgsm.com/features/message-display-time -## 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 -## Game Server Details -# Do not edit -#### Directories #### -# Edit with care -## Game Server Directories -## Backup Directory -## Logging Directories -## Logs Naming diff --git a/tests/tests_defaultcfg/tests_defaultcfg.sh b/tests/tests_defaultcfg/tests_defaultcfg.sh deleted file mode 100644 index 4039d90e7..000000000 --- a/tests/tests_defaultcfg/tests_defaultcfg.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -echo -e "" -echo -e "0.1 - Full comparison Output" -echo -e "==================================================================" -echo -e "Description:" -echo -e "test checks that vars present in ALL _default.cfg files are correct." -echo -e "" -echo -e "In master config < | > In game config" -find "lgsm/config-default/config-lgsm/" ! -name '*template.cfg' -name "*.cfg" -type f -print0 | -while IFS= read -r -d $'\0' line; do - grep "=" "${line}" | cut -f1 -d"=" > defaultcfgtemp.txt - diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_0.txt defaultcfgtemp.txt) - if [ "${diffoutput}" ]; then - echo "File with errors:" - echo "${line}" - echo -e "=================================" - echo -e "In master config < | > In game config" - echo "${diffoutput}" - echo "" - fi - rm -f defaultcfgtemp.txt -done - -echo -e "" -echo -e "1.0 - Master Comparison" -echo -e "==================================================================" -echo -e "Description:" -echo -e "test checks that vars present in ALL _default.cfg files are correct." -echo -e "" -echo -e "In master config < | > In game config" -find lgsm/config-default/config-lgsm/ ! -name '*template.cfg' -name "*.cfg" -type f -print0 | -while IFS= read -r -d $'\0' line; do - grep "=" "${line}" | cut -f1 -d"=" > defaultcfgtemp.txt - diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_0.txt defaultcfgtemp.txt | grep '^<') - if [ "${diffoutput}" ]; then - echo "File with errors:" - echo "${line}" - echo -e "=================================" - echo -e "In master config < | > In game config" - echo "${diffoutput}" - echo "" - fi - rm -f defaultcfgtemp.txt -done - -echo -e "" -echo -e "2.0 - Check Comment" -echo -e "==================================================================" -echo -e "Description:" -echo -e "test checks that comments in ALL _default.cfg files are correct." -echo -e "" -echo -e "In master config < | > In game config" -find lgsm/config-default/config-lgsm/ ! -name '*template.cfg' -name "*.cfg" -type f -print0 | -while IFS= read -r -d $'\0' line; do - grep "#" "${line}" > defaultcfgtemp.txt - diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_1.txt defaultcfgtemp.txt | grep '^<') - if [ "${diffoutput}" ]; then - echo "File with errors:" - echo "${line}" - echo -e "=================================" - echo "${diffoutput}" - echo "" - fi - rm -f defaultcfgtemp.txt -done diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh deleted file mode 100644 index da71c2b5a..000000000 --- a/tests/tests_fctrserver.sh +++ /dev/null @@ -1,1163 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2020 Daniel Gibbs -# Purpose: Travis CI Tests: Factorio | Linux Game Server Management Script -# Contributors: https://linuxgsm.com/contrib -# Documentation: https://docs.linuxgsm.com -# Website: https://linuxgsm.com - -# DO NOT EDIT THIS FILE -# LinuxGSM configuration is no longer edited here -# To update your LinuxGSM config go to: -# lgsm/config-lgsm -# https://docs.linuxgsm.com/configuration/linuxgsm-config - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="v20.3.3" -shortname="fctr" -gameservername="fctrserver" -commandname="CORE" -rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") -selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") -sessionname=$(echo "${selfname}" | cut -f1 -d".") -lgsmdir="${rootdir}/lgsm" -logdir="${rootdir}/log" -lgsmlogdir="${logdir}/lgsm" -steamcmddir="${HOME}/.steam/steamcmd" -serverfiles="${rootdir}/serverfiles" -functionsdir="${lgsmdir}/functions" -tmpdir="${lgsmdir}/tmp" -datadir="${lgsmdir}/data" -lockdir="${lgsmdir}/lock" -serverlist="${datadir}/serverlist.csv" -serverlistmenu="${datadir}/serverlistmenu.csv" -configdir="${lgsmdir}/config-lgsm" -configdirserver="${configdir}/${gameservername}" -configdirdefault="${lgsmdir}/config-default" -userinput="${1}" - -# Allows for testing not on Travis CI. -# if using travis for tests -if [ -z "${TRAVIS}" ]; then - TRAVIS_BRANCH="develop" - TRAVIS_BUILD_DIR="${rootdir}" -fi -travistest="1" -## GitHub Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="${TRAVIS_BRANCH}" - -# Core function that is required first. -core_functions.sh(){ - functionfile="${FUNCNAME[0]}" - fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" -} - -# Bootstrap -# Fetches the core functions required before passed off to core_dl.sh. -fn_bootstrap_fetch_file(){ - remote_fileurl="${1}" - remote_fileurl_backup="${2}" - remote_fileurl_name="${3}" - remote_fileurl_backup_name="${4}" - local_filedir="${5}" - local_filename="${6}" - chmodx="${7:-0}" - run="${8:-0}" - forcedl="${9:-0}" - md5="${10:-0}" - # Download file if missing or download forced. - if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then - # If backup fileurl exists include it. - if [ -n "${remote_fileurl_backup}" ]; then - # counter set to 0 to allow second try - counter=0 - remote_fileurls_array=( remote_fileurl remote_fileurl_backup ) - else - # counter set to 1 to not allow second try - 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}" - fileurl_name="${remote_fileurl_name}" - elif [ "${remote_fileurl_array}" == "remote_fileurl_backup" ]; then - fileurl="${remote_fileurl_backup}" - fileurl_name="${remote_fileurl_backup_name}" - fi - counter=$((counter+1)) - if [ ! -d "${local_filedir}" ]; then - 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 -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) - - local exitcode=$? - # 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 "${local_filedir:?}/${local_filename:?}" - local exitcode=2 - fi - fi - - # On first try will error. On second try will fail. - if [ ${exitcode} -ne 0 ]; then - if [ ${counter} -ge 2 ]; then - echo -e "FAIL" - if [ -f "${lgsmlog}" ]; then - fn_script_log_fatal "Downloading ${local_filename}" - fn_script_log_fatal "${fileurl}" - fi - core_exit.sh - else - echo -e "ERROR" - if [ -f "${lgsmlog}" ]; then - 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" - if [ -f "${lgsmlog}" ]; then - fn_script_log_pass "Downloading ${local_filename}" - fi - - # Make file executable if chmodx is set. - if [ "${chmodx}" == "chmodx" ]; then - chmod +x "${local_filedir}/${local_filename}" - fi - - # Remove trap. - trap - INT - - break - fi - done - fi - - if [ -f "${local_filedir}/${local_filename}" ]; then - # Execute file if run is set. - if [ "${run}" == "run" ]; then - # shellcheck source=/dev/null - source "${local_filedir}/${local_filename}" - fi - fi -} - -fn_bootstrap_fetch_file_github(){ - github_file_url_dir="${1}" - github_file_url_name="${2}" - if [ "${githubbranch}" == "master" ]&&[ "${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="${3}" - local_filename="${github_file_url_name}" - chmodx="${4:-0}" - run="${5:-0}" - forcedl="${6:-0}" - md5="${7:-0}" - # Passes vars to the file download function. - fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" -} - -# Installer menu. - -fn_print_center() { - columns=$(tput cols) - line="$*" - printf "%*s\n" $(( (${#line} + columns) / 2)) "${line}" -} - -fn_print_horizontal(){ - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "=" -} - -# Bash menu. -fn_install_menu_bash() { - local resultvar=$1 - title=$2 - caption=$3 - options=$4 - fn_print_horizontal - fn_print_center "${title}" - fn_print_center "${caption}" - fn_print_horizontal - menu_options=() - while read -r line || [[ -n "${line}" ]]; do - var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') - menu_options+=( "${var}" ) - done < "${options}" - menu_options+=( "Cancel" ) - select option in "${menu_options[@]}"; do - if [ "${option}" ]&&[ "${option}" != "Cancel" ]; then - eval "$resultvar=\"${option/%\ */}\"" - fi - break - done -} - -# Whiptail/Dialog menu. -fn_install_menu_whiptail() { - local menucmd=$1 - local resultvar=$2 - title=$3 - caption=$4 - options=$5 - height=${6:-40} - width=${7:-80} - menuheight=${8:-30} - IFS="," - menu_options=() - while read -r line; do - key=$(echo -e "${line}" | awk -F "," '{print $3}') - val=$(echo -e "${line}" | awk -F "," '{print $2}') - 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 - eval "$resultvar=\"${OPTION}\"" - else - eval "$resultvar=" - fi -} - -# Menu selector. -fn_install_menu() { - local resultvar=$1 - local selection="" - title=$2 - caption=$3 - options=$4 - # Get menu command. - for menucmd in whiptail dialog bash; do - if [ "$(command -v "${menucmd}")" ]; then - menucmd=$(command -v "${menucmd}") - break - fi - done - case "$(basename "${menucmd}")" in - whiptail|dialog) - fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; - *) - fn_install_menu_bash selection "${title}" "${caption}" "${options}";; - esac - eval "$resultvar=\"${selection}\"" -} - -# Gets server info from serverlist.csv and puts in to array. -fn_server_info(){ - IFS="," - server_info_array=($(grep -aw "${userinput}" "${serverlist}")) - shortname="${server_info_array[0]}" # csgo - gameservername="${server_info_array[1]}" # csgoserver - gamename="${server_info_array[2]}" # Counter Strike: Global Offensive -} - -fn_install_getopt(){ - userinput="empty" - echo -e "Usage: $0 [option]" - echo -e "" - echo -e "Installer - Linux Game Server Managers - Version ${version}" - echo -e "https://linuxgsm.com" - echo -e "" - echo -e "Commands" - echo -e "install\t\t| Select server to install." - echo -e "servername\t| Enter name of game server to install. e.g $0 csgoserver." - echo -e "list\t\t| List all servers available for install." - exit -} - -fn_install_file(){ - local_filename="${gameservername}" - if [ -e "${local_filename}" ]; then - i=2 - while [ -e "${local_filename}-${i}" ] ; do - (( i++ )) - done - local_filename="${local_filename}-${i}" - fi - cp -R "${selfname}" "${local_filename}" - sed -i -e "s/shortname=\"core\"/shortname=\"${shortname}\"/g" "${local_filename}" - sed -i -e "s/gameservername=\"core\"/gameservername=\"${gameservername}\"/g" "${local_filename}" - echo -e "Installed ${gamename} server as ${local_filename}" - echo -e "" - if [ ! -d "${serverfiles}" ]; then - echo -e "./${local_filename} install" - else - echo -e "Remember to check server ports" - echo -e "./${local_filename} details" - fi - echo -e "" - exit -} - -# Prevent LinuxGSM from running as root. Except if doing a dependency install. -if [ "$(whoami)" == "root" ]; then - if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then - if [ "${shortname}" == "core" ]; then - echo -e "[ FAIL ] Do NOT run this script as root!" - exit 1 - fi - elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then - echo -e "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -# LinuxGSM installer mode. -if [ "${shortname}" == "core" ]; then - # Download the latest serverlist. This is the complete list of all supported servers. - fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" - if [ ! -f "${serverlist}" ]; then - echo -e "[ FAIL ] serverlist.csv could not be loaded." - exit 1 - fi - - if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then - { - tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' - } | column -s $'\t' -t | more - exit - elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then - tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" - fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" - userinput="${result}" - fn_server_info - if [ "${result}" == "${gameservername}" ]; then - fn_install_file - elif [ "${result}" == "" ]; then - echo -e "Install canceled" - else - echo -e "[ FAIL ] menu result does not match gameservername" - echo -e "result: ${result}" - echo -e "gameservername: ${gameservername}" - fi - elif [ "${userinput}" ]; then - fn_server_info - if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then - fn_install_file - else - echo -e "[ FAIL ] unknown game server" - fi - else - fn_install_getopt - fi - -# LinuxGSM server mode. -else - core_functions.sh - if [ "${shortname}" != "core-dep" ]; then - # Load LinuxGSM configs. - # These are required to get all the default variables for the specific server. - # Load the default config. If missing download it. If changed reload it. - if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then - mkdir -p "${configdirdefault}/config-lgsm/${gameservername}" - fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5" - fi - if [ ! -f "${configdirserver}/_default.cfg" ]; then - mkdir -p "${configdirserver}" - echo -en "copying _default.cfg...\c" - cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" - exitcode=$? - if [ ${exitcode} -ne 0 ]; then - echo -e "FAIL" - exit 1 - else - echo -e "OK" - fi - else - function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") - if [ "${function_file_diff}" != "" ]; then - fn_print_warn_nl "_default.cfg has been altered. reloading config." - echo -en "copying _default.cfg...\c" - cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" - exitcode=$? - if [ ${exitcode} -ne 0 ]; then - echo -e "FAIL" - exit 1 - else - echo -e "OK" - fi - fi - fi - # shellcheck source=/dev/null - source "${configdirserver}/_default.cfg" - # Load the common.cfg config. If missing download it. - if [ ! -f "${configdirserver}/common.cfg" ]; then - fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" - # shellcheck source=/dev/null - source "${configdirserver}/common.cfg" - else - # shellcheck source=/dev/null - source "${configdirserver}/common.cfg" - fi - # Load the instance.cfg config. If missing download it. - if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then - fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" - # shellcheck source=/dev/null - source "${configdirserver}/${selfname}.cfg" - else - # shellcheck source=/dev/null - source "${configdirserver}/${selfname}.cfg" - fi - - # Load the linuxgsm.sh in to tmpdir. If missing download it. - if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then - fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5" - fi - fi - # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. - fn_ansi_loader - # Prevents running of core_exit.sh for Travis-CI. - if [ "${travistest}" != "1" ]; then - getopt=$1 - core_getopt.sh - fi -fi - -fn_currentstatus_tmux(){ - check_status.sh - if [ "${status}" != "0" ]; then - currentstatus="ONLINE" - else - currentstatus="OFFLINE" - fi -} - -fn_setstatus(){ - fn_currentstatus_tmux - echo"" - echo -e "Required status: ${requiredstatus}" - counter=0 - echo -e "Current status: ${currentstatus}" - while [ "${requiredstatus}" != "${currentstatus}" ]; do - counter=$((counter+1)) - fn_currentstatus_tmux - echo -en "New status: ${currentstatus}\\r" - - if [ "${requiredstatus}" == "ONLINE" ]; then - (command_start.sh > /dev/null 2>&1) - else - (command_stop.sh > /dev/null 2>&1) - fi - if [ "${counter}" -gt "5" ]; then - currentstatus="FAIL" - echo -e "Current status: ${currentstatus}" - echo -e "" - echo -e "Unable to start or stop server." - exit 1 - fi - done - echo -en "New status: ${currentstatus}\\r" - echo -e "\n" - echo -e "Test starting:" - echo -e "" -} - -# End of every test will expect the result to either pass or fail -# If the script does not do as intended the whole test will fail -# if expecting a pass -fn_test_result_pass(){ - if [ $? != 0 ]; then - echo -e "=================================" - echo -e "Expected result: PASS" - echo -e "Actual result: FAIL" - fn_print_fail_nl "TEST FAILED" - exitcode=1 - core_exit.sh - else - echo -e "=================================" - echo -e "Expected result: PASS" - echo -e "Actual result: PASS" - fn_print_ok_nl "TEST PASSED" - echo -e "" - fi -} - -# if expecting a fail -fn_test_result_fail(){ - if [ $? == 0 ]; then - echo -e "=================================" - echo -e "Expected result: FAIL" - echo -e "Actual result: PASS" - fn_print_fail_nl "TEST FAILED" - exitcode=1 - core_exit.sh - else - echo -e "=================================" - echo -e "Expected result: FAIL" - echo -e "Actual result: FAIL" - fn_print_ok_nl "TEST PASSED" - echo -e "" - fi -} - -# test result n/a -fn_test_result_na(){ - echo -e "=================================" - echo -e "Expected result: N/A" - echo -e "Actual result: N/A" - fn_print_fail_nl "TEST N/A" -} - -sleeptime="0" - -echo -e "=================================" -echo -e "Travis CI Tests" -echo -e "Linux Game Server Manager" -echo -e "by Daniel Gibbs" -echo -e "Contributors: http://goo.gl/qLmitD" -echo -e "https://linuxgsm.com" -echo -e "=================================" -echo -e "" -echo -e "=================================" -echo -e "Server Tests" -echo -e "Using: ${gamename}" -echo -e "Testing Branch: ${TRAVIS_BRANCH}" -echo -e "=================================" - -echo -e "" -echo -e "Tests Summary" -echo -e "=================================" -echo -e "0.0 - Pre-test Tasks" -echo -e "0.1 - Create log dir's" -echo -e "0.2 - Enable dev-debug" -echo -e "" -echo -e "1.0 - Pre-install tests" -echo -e "1.1 - start - no files" -echo -e "1.2 - getopt" -echo -e "1.3 - getopt with incorrect args" -echo -e "" -echo -e "2.0 - Installation" -echo -e "2.1 - install" -echo -e "" -echo -e "3.0 - Start/Stop/Restart Tests" -echo -e "3.1 - start" -echo -e "3.2 - start - online" -echo -e "3.3 - start - updateonstart" -echo -e "3.4 - stop" -echo -e "3.5 - stop - offline" -echo -e "3.6 - restart" -echo -e "3.7 - restart - offline" -echo -e "" -echo -e "4.0 - Update Tests" -echo -e "4.1 - update" -echo -e "4.2 - update-lgsm" -echo -e "" -echo -e "5.0 - Monitor Tests" -echo -e "5.1 - monitor - online" -echo -e "5.2 - monitor - offline - with lockfile" -echo -e "5.3 - monitor - offline - no lockfile" -echo -e "5.4 - test-alert" -echo -e "" -echo -e "6.0 - Details Tests" -echo -e "6.1 - details" -echo -e "6.2 - postdetails" -echo -e "" -echo -e "7.0 - Backup Tests" -echo -e "7.1 - backup" -echo -e "" -echo -e "8.0 - Development Tools Tests" -echo -e "8.1 - dev - detect glibc" -echo -e "8.2 - dev - detect ldd" -echo -e "8.3 - dev - detect deps" -echo -e "8.4 - dev - query-raw" - -echo -e "" -echo -e "9.0 - Donate" -echo -e "9.1 - donate" -echo -e "" - -echo -e "0.0 - Pre-test Tasks" -echo -e "==================================================================" -echo -e "Description:" -echo -e "Create log dir's" -echo -e "" - -echo -e "" -echo -e "0.1 - Create log dir's" -echo -e "=================================" -echo -e "" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - install_logs.sh -) -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "0.2 - Enable dev-debug" -echo -e "=================================" -echo -e "Description:" -echo -e "Enable dev-debug" -echo -e "" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_debug.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "1.0 - Pre-install tests" -echo -e "==================================================================" -echo -e "" - -echo -e "1.1 - start - no files" -echo -e "=================================" -echo -e "Description:" -echo -e "test script reaction to missing server files." -echo -e "Command: ./${gameservername} start" -echo -e "" -# Allows for testing not on Travis CI -if [ -z "${TRAVIS}" ]; then -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_start.sh -) -fn_test_result_fail -else - echo -e "Test bypassed" -fi - -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "1.2 - getopt" -echo -e "=================================" -echo -e "Description:" -echo -e "displaying options messages." -echo -e "Command: ./${gameservername}" -echo -e "" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - core_getopt.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "1.3 - getopt with incorrect args" -echo -e "=================================" -echo -e "Description:" -echo -e "displaying options messages." -echo -e "Command: ./${gameservername} abc123" -echo -e "" -getopt="abc123" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - core_getopt.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "2.0 - Installation" -echo -e "==================================================================" - -echo -e "" -echo -e "2.1 - install" -echo -e "=================================" -echo -e "Description:" -echo -e "install ${gamename} server." -echo -e "Command: ./${gameservername} auto-install" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - fn_autoinstall -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.0 - Start/Stop/Restart Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "3.1 - start" -echo -e "=================================" -echo -e "Description:" -echo -e "start ${gamename} server." -echo -e "Command: ./${gameservername} start" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_start.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.2 - start - online" -echo -e "=================================" -echo -e "Description:" -echo -e "start ${gamename} server while already running." -echo -e "Command: ./${gameservername} start" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_start.sh -) -fn_test_result_fail -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.3 - start - updateonstart" -echo -e "=================================" -echo -e "Description:" -echo -e "will update server on start." -echo -e "Command: ./${gameservername} start" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - updateonstart="on";command_start.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.4 - stop" -echo -e "=================================" -echo -e "Description:" -echo -e "stop ${gamename} server." -echo -e "Command: ./${gameservername} stop" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_stop.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.5 - stop - offline" -echo -e "=================================" -echo -e "Description:" -echo -e "stop ${gamename} server while already stopped." -echo -e "Command: ./${gameservername} stop" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_stop.sh -) -fn_test_result_fail -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.6 - restart" -echo -e "=================================" -echo -e "Description:" -echo -e "restart ${gamename}." -echo -e "Command: ./${gameservername} restart" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_restart.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.7 - restart - offline" -echo -e "=================================" -echo -e "Description:" -echo -e "restart ${gamename} while already stopped." -echo -e "Command: ./${gameservername} restart" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_restart.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "4.0 - Update Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "4.1 - update" -echo -e "=================================" -echo -e "Description:" -echo -e "check for updates." -echo -e "Command: ./${gameservername} update" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_update.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "4.2 - update-lgsm" -echo -e "=================================" -echo -e "Description:" -echo -e "update LinuxGSM." -echo -e "" -echo -e "Command: ./jc2server update-lgam" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_update_linuxgsm.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "5.0 - Monitor Tests" -echo -e "==================================================================" -echo -e "" -info_config.sh -echo -e "Server IP - Port: ${ip}:${port}" -echo -e "Server IP - Query Port: ${ip}:${queryport}" - -echo -e "" -echo -e "5.1 - monitor - online" -echo -e "=================================" -echo -e "Description:" -echo -e "run monitor server while already running." -echo -e "Command: ./${gameservername} monitor" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_monitor.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "5.2 - monitor - offline - with lockfile" -echo -e "=================================" -echo -e "Description:" -echo -e "run monitor while server is offline with lockfile." -echo -e "Command: ./${gameservername} monitor" -requiredstatus="OFFLINE" -fn_setstatus -fn_print_info_nl "creating lockfile." -date '+%s' > "${lockdir}/${selfname}.lock" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_monitor.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "5.3 - monitor - offline - no lockfile" -echo -e "=================================" -echo -e "Description:" -echo -e "run monitor while server is offline with no lockfile." -echo -e "Command: ./${gameservername} monitor" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_monitor.sh -) -fn_test_result_fail -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "5.4 - test-alert" -echo -e "=================================" -echo -e "Description:" -echo -e "run monitor while server is offline with no lockfile." -echo -e "Command: ./${gameservername} test-alert" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_test_alert.sh -) -fn_test_result_fail -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "6.0 - Details Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "6.1 - details" -echo -e "=================================" -echo -e "Description:" -echo -e "display details." -echo -e "Command: ./${gameservername} details" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_details.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "6.2 - postdetails" -echo -e "=================================" -echo -e "Description:" -echo -e "post details." -echo -e "Command: ./${gameservername} postdetails" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_postdetails.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "7.0 - Backup Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "7.1 - backup" -echo -e "=================================" -echo -e "Description:" -echo -e "run a backup." -echo -e "Command: ./${gameservername} backup" -requiredstatus="ONLINE" -fn_setstatus -echo -e "test de-activated until issue #1839 fixed" -#(command_backup.sh) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "8.0 - Development Tools Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "8.1 - dev - detect glibc" -echo -e "=================================" -echo -e "Description:" -echo -e "detect glibc." -echo -e "Command: ./${gameservername} detect-glibc" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_detect_glibc.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "8.2 - dev - detect ldd" -echo -e "=================================" -echo -e "Description:" -echo -e "detect ldd." -echo -e "Command: ./${gameservername} detect-ldd" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_detect_ldd.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "8.3 - dev - detect deps" -echo -e "=================================" -echo -e "Description:" -echo -e "detect dependencies." -echo -e "Command: ./${gameservername} detect-deps" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_detect_deps.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "8.4 - dev - query-raw" -echo -e "=================================" -echo -e "Description:" -echo -e "raw query output." -echo -e "Command: ./${gameservername} query-raw" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_query_raw.sh -) -fn_test_result_na -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" - -echo -e "9.0 - Donate" -echo -e "==================================================================" - -echo -e "" -echo -e "9.1 - donate" -echo -e "=================================" -echo -e "Description:" -echo -e "donate." -echo -e "Command: ./${gameservername} donate" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_donate.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "=================================" -echo -e "Server Tests - Complete!" -echo -e "Using: ${gamename}" -echo -e "=================================" -requiredstatus="OFFLINE" -fn_setstatus - -core_exit.sh diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh deleted file mode 100644 index b52cf1f1b..000000000 --- a/tests/tests_jc2server.sh +++ /dev/null @@ -1,1327 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2020 Daniel Gibbs -# Purpose: Travis CI Tests: Just Cause 2 | Linux Game Server Management Script -# Contributors: https://linuxgsm.com/contrib -# Documentation: https://docs.linuxgsm.com -# Website: https://linuxgsm.com - -# DO NOT EDIT THIS FILE -# LinuxGSM configuration is no longer edited here -# To update your LinuxGSM config go to: -# lgsm/config-lgsm -# https://docs.linuxgsm.com/configuration/linuxgsm-config - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="v20.3.3" -shortname="jc2" -gameservername="jc2server" -commandname="CORE" -rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") -selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") -sessionname=$(echo "${selfname}" | cut -f1 -d".") -lgsmdir="${rootdir}/lgsm" -logdir="${rootdir}/log" -lgsmlogdir="${logdir}/lgsm" -steamcmddir="${HOME}/.steam/steamcmd" -serverfiles="${rootdir}/serverfiles" -functionsdir="${lgsmdir}/functions" -tmpdir="${lgsmdir}/tmp" -datadir="${lgsmdir}/data" -lockdir="${lgsmdir}/lock" -serverlist="${datadir}/serverlist.csv" -serverlistmenu="${datadir}/serverlistmenu.csv" -configdir="${lgsmdir}/config-lgsm" -configdirserver="${configdir}/${gameservername}" -configdirdefault="${lgsmdir}/config-default" -userinput="${1}" - -# Allows for testing not on Travis CI. -# if using travis for tests -if [ -z "${TRAVIS}" ]; then - TRAVIS_BRANCH="develop" - TRAVIS_BUILD_DIR="${rootdir}" -fi -travistest="1" - -## GitHub Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="${TRAVIS_BRANCH}" - -# Core function that is required first. -core_functions.sh(){ - functionfile="${FUNCNAME[0]}" - fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" -} - -# Bootstrap -# Fetches the core functions required before passed off to core_dl.sh. -fn_bootstrap_fetch_file(){ - remote_fileurl="${1}" - remote_fileurl_backup="${2}" - remote_fileurl_name="${3}" - remote_fileurl_backup_name="${4}" - local_filedir="${5}" - local_filename="${6}" - chmodx="${7:-0}" - run="${8:-0}" - forcedl="${9:-0}" - md5="${10:-0}" - # Download file if missing or download forced. - if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then - # If backup fileurl exists include it. - if [ -n "${remote_fileurl_backup}" ]; then - # counter set to 0 to allow second try - counter=0 - remote_fileurls_array=( remote_fileurl remote_fileurl_backup ) - else - # counter set to 1 to not allow second try - 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}" - fileurl_name="${remote_fileurl_name}" - elif [ "${remote_fileurl_array}" == "remote_fileurl_backup" ]; then - fileurl="${remote_fileurl_backup}" - fileurl_name="${remote_fileurl_backup_name}" - fi - counter=$((counter+1)) - if [ ! -d "${local_filedir}" ]; then - 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 -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) - - local exitcode=$? - # 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 "${local_filedir:?}/${local_filename:?}" - local exitcode=2 - fi - fi - - # On first try will error. On second try will fail. - if [ ${exitcode} -ne 0 ]; then - if [ ${counter} -ge 2 ]; then - echo -e "FAIL" - if [ -f "${lgsmlog}" ]; then - fn_script_log_fatal "Downloading ${local_filename}" - fn_script_log_fatal "${fileurl}" - fi - core_exit.sh - else - echo -e "ERROR" - if [ -f "${lgsmlog}" ]; then - 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" - if [ -f "${lgsmlog}" ]; then - fn_script_log_pass "Downloading ${local_filename}" - fi - - # Make file executable if chmodx is set. - if [ "${chmodx}" == "chmodx" ]; then - chmod +x "${local_filedir}/${local_filename}" - fi - - # Remove trap. - trap - INT - - break - fi - done - fi - - if [ -f "${local_filedir}/${local_filename}" ]; then - # Execute file if run is set. - if [ "${run}" == "run" ]; then - # shellcheck source=/dev/null - source "${local_filedir}/${local_filename}" - fi - fi -} - -fn_bootstrap_fetch_file_github(){ - github_file_url_dir="${1}" - github_file_url_name="${2}" - if [ "${githubbranch}" == "master" ]&&[ "${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="${3}" - local_filename="${github_file_url_name}" - chmodx="${4:-0}" - run="${5:-0}" - forcedl="${6:-0}" - md5="${7:-0}" - # Passes vars to the file download function. - fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" -} - -# Installer menu. - -fn_print_center() { - columns=$(tput cols) - line="$*" - printf "%*s\n" $(( (${#line} + columns) / 2)) "${line}" -} - -fn_print_horizontal(){ - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "=" -} - -# Bash menu. -fn_install_menu_bash() { - local resultvar=$1 - title=$2 - caption=$3 - options=$4 - fn_print_horizontal - fn_print_center "${title}" - fn_print_center "${caption}" - fn_print_horizontal - menu_options=() - while read -r line || [[ -n "${line}" ]]; do - var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') - menu_options+=( "${var}" ) - done < "${options}" - menu_options+=( "Cancel" ) - select option in "${menu_options[@]}"; do - if [ "${option}" ]&&[ "${option}" != "Cancel" ]; then - eval "$resultvar=\"${option/%\ */}\"" - fi - break - done -} - -# Whiptail/Dialog menu. -fn_install_menu_whiptail() { - local menucmd=$1 - local resultvar=$2 - title=$3 - caption=$4 - options=$5 - height=${6:-40} - width=${7:-80} - menuheight=${8:-30} - IFS="," - menu_options=() - while read -r line; do - key=$(echo -e "${line}" | awk -F "," '{print $3}') - val=$(echo -e "${line}" | awk -F "," '{print $2}') - 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 - eval "$resultvar=\"${OPTION}\"" - else - eval "$resultvar=" - fi -} - -# Menu selector. -fn_install_menu() { - local resultvar=$1 - local selection="" - title=$2 - caption=$3 - options=$4 - # Get menu command. - for menucmd in whiptail dialog bash; do - if [ "$(command -v "${menucmd}")" ]; then - menucmd=$(command -v "${menucmd}") - break - fi - done - case "$(basename "${menucmd}")" in - whiptail|dialog) - fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; - *) - fn_install_menu_bash selection "${title}" "${caption}" "${options}";; - esac - eval "$resultvar=\"${selection}\"" -} - -# Gets server info from serverlist.csv and puts in to array. -fn_server_info(){ - IFS="," - server_info_array=($(grep -aw "${userinput}" "${serverlist}")) - shortname="${server_info_array[0]}" # csgo - gameservername="${server_info_array[1]}" # csgoserver - gamename="${server_info_array[2]}" # Counter Strike: Global Offensive -} - -fn_install_getopt(){ - userinput="empty" - echo -e "Usage: $0 [option]" - echo -e "" - echo -e "Installer - Linux Game Server Managers - Version ${version}" - echo -e "https://linuxgsm.com" - echo -e "" - echo -e "Commands" - echo -e "install\t\t| Select server to install." - echo -e "servername\t| Enter name of game server to install. e.g $0 csgoserver." - echo -e "list\t\t| List all servers available for install." - exit -} - -fn_install_file(){ - local_filename="${gameservername}" - if [ -e "${local_filename}" ]; then - i=2 - while [ -e "${local_filename}-${i}" ] ; do - (( i++ )) - done - local_filename="${local_filename}-${i}" - fi - cp -R "${selfname}" "${local_filename}" - sed -i -e "s/shortname=\"core\"/shortname=\"${shortname}\"/g" "${local_filename}" - sed -i -e "s/gameservername=\"core\"/gameservername=\"${gameservername}\"/g" "${local_filename}" - echo -e "Installed ${gamename} server as ${local_filename}" - echo -e "" - if [ ! -d "${serverfiles}" ]; then - echo -e "./${local_filename} install" - else - echo -e "Remember to check server ports" - echo -e "./${local_filename} details" - fi - echo -e "" - exit -} - -# Prevent LinuxGSM from running as root. Except if doing a dependency install. -if [ "$(whoami)" == "root" ]; then - if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then - if [ "${shortname}" == "core" ]; then - echo -e "[ FAIL ] Do NOT run this script as root!" - exit 1 - fi - elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then - echo -e "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -# LinuxGSM installer mode. -if [ "${shortname}" == "core" ]; then - # Download the latest serverlist. This is the complete list of all supported servers. - fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" - if [ ! -f "${serverlist}" ]; then - echo -e "[ FAIL ] serverlist.csv could not be loaded." - exit 1 - fi - - if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then - { - tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' - } | column -s $'\t' -t | more - exit - elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then - tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" - fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" - userinput="${result}" - fn_server_info - if [ "${result}" == "${gameservername}" ]; then - fn_install_file - elif [ "${result}" == "" ]; then - echo -e "Install canceled" - else - echo -e "[ FAIL ] menu result does not match gameservername" - echo -e "result: ${result}" - echo -e "gameservername: ${gameservername}" - fi - elif [ "${userinput}" ]; then - fn_server_info - if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then - fn_install_file - else - echo -e "[ FAIL ] unknown game server" - fi - else - fn_install_getopt - fi - -# LinuxGSM server mode. -else - core_functions.sh - if [ "${shortname}" != "core-dep" ]; then - # Load LinuxGSM configs. - # These are required to get all the default variables for the specific server. - # Load the default config. If missing download it. If changed reload it. - if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then - mkdir -p "${configdirdefault}/config-lgsm/${gameservername}" - fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5" - fi - if [ ! -f "${configdirserver}/_default.cfg" ]; then - mkdir -p "${configdirserver}" - echo -en "copying _default.cfg...\c" - cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" - exitcode=$? - if [ ${exitcode} -ne 0 ]; then - echo -e "FAIL" - exit 1 - else - echo -e "OK" - fi - else - function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") - if [ "${function_file_diff}" != "" ]; then - fn_print_warn_nl "_default.cfg has been altered. reloading config." - echo -en "copying _default.cfg...\c" - cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" - exitcode=$? - if [ ${exitcode} -ne 0 ]; then - echo -e "FAIL" - exit 1 - else - echo -e "OK" - fi - fi - fi - # shellcheck source=/dev/null - source "${configdirserver}/_default.cfg" - # Load the common.cfg config. If missing download it. - if [ ! -f "${configdirserver}/common.cfg" ]; then - fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" - # shellcheck source=/dev/null - source "${configdirserver}/common.cfg" - else - # shellcheck source=/dev/null - source "${configdirserver}/common.cfg" - fi - # Load the instance.cfg config. If missing download it. - if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then - fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" - # shellcheck source=/dev/null - source "${configdirserver}/${selfname}.cfg" - else - # shellcheck source=/dev/null - source "${configdirserver}/${selfname}.cfg" - fi - - # Load the linuxgsm.sh in to tmpdir. If missing download it. - if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then - fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5" - fi - fi - # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. - fn_ansi_loader - # Prevents running of core_exit.sh for Travis-CI. - if [ "${travistest}" != "1" ]; then - getopt=$1 - core_getopt.sh - fi -fi - -fn_currentstatus_tmux(){ - check_status.sh - if [ "${status}" != "0" ]; then - currentstatus="ONLINE" - else - currentstatus="OFFLINE" - fi -} - -fn_setstatus(){ - fn_currentstatus_tmux - echo"" - echo -e "Required status: ${requiredstatus}" - counter=0 - echo -e "Current status: ${currentstatus}" - while [ "${requiredstatus}" != "${currentstatus}" ]; do - counter=$((counter+1)) - fn_currentstatus_tmux - echo -en "New status: ${currentstatus}\\r" - - if [ "${requiredstatus}" == "ONLINE" ]; then - (command_start.sh > /dev/null 2>&1) - else - (command_stop.sh > /dev/null 2>&1) - fi - if [ "${counter}" -gt "5" ]; then - currentstatus="FAIL" - echo -e "Current status: ${currentstatus}" - echo -e "" - echo -e "Unable to start or stop server." - exit 1 - fi - done - echo -en "New status: ${currentstatus}\\r" - echo -e "\n" - echo -e "Test starting:" - echo -e "" -} - -# End of every test will expect the result to either pass or fail -# If the script does not do as intended the whole test will fail -# if expecting a pass -fn_test_result_pass(){ - if [ $? != 0 ]; then - echo -e "=================================" - echo -e "Expected result: PASS" - echo -e "Actual result: FAIL" - fn_print_fail_nl "TEST FAILED" - exitcode=1 - core_exit.sh - else - echo -e "=================================" - echo -e "Expected result: PASS" - echo -e "Actual result: PASS" - fn_print_ok_nl "TEST PASSED" - echo -e "" - fi -} - -# if expecting a fail -fn_test_result_fail(){ - if [ $? == 0 ]; then - echo -e "=================================" - echo -e "Expected result: FAIL" - echo -e "Actual result: PASS" - fn_print_fail_nl "TEST FAILED" - exitcode=1 - core_exit.sh - else - echo -e "=================================" - echo -e "Expected result: FAIL" - echo -e "Actual result: FAIL" - fn_print_ok_nl "TEST PASSED" - echo -e "" - fi -} - -# test result n/a -fn_test_result_na(){ - echo -e "=================================" - echo -e "Expected result: N/A" - echo -e "Actual result: N/A" - fn_print_fail_nl "TEST N/A" -} - -sleeptime="0" - -echo -e "=================================" -echo -e "Travis CI Tests" -echo -e "Linux Game Server Manager" -echo -e "by Daniel Gibbs" -echo -e "Contributors: http://goo.gl/qLmitD" -echo -e "https://linuxgsm.com" -echo -e "=================================" -echo -e "" -echo -e "=================================" -echo -e "Server Tests" -echo -e "Using: ${gamename}" -echo -e "Testing Branch: ${TRAVIS_BRANCH}" -echo -e "=================================" -echo -e "" -echo -e "Tests Summary" -echo -e "=================================" -echo -e "0.0 - Pre-test Tasks" -echo -e "0.1 - Create log dir's" -echo -e "0.2 - Enable dev-debug" -echo -e "" -echo -e "1.0 - Pre-install tests" -echo -e "1.1 - start - no files" -echo -e "1.2 - getopt" -echo -e "1.3 - getopt with incorrect args" -echo -e "" -echo -e "2.0 - Installation" -echo -e "2.1 - install" -echo -e "" -echo -e "3.0 - Start/Stop/Restart Tests" -echo -e "3.1 - start" -echo -e "3.2 - start - online" -echo -e "3.3 - start - updateonstart" -echo -e "3.4 - stop" -echo -e "3.5 - stop - offline" -echo -e "3.6 - restart" -echo -e "3.7 - restart - offline" -echo -e "" -echo -e "4.0 - Update Tests" -echo -e "4.1 - update" -echo -e "4.2 - update - change buildid" -echo -e "4.3 - update - change buildid - online" -echo -e "4.4 - update - remove appmanifest file" -echo -e "4.5 - force-update" -echo -e "4.6 - force-update - online" -echo -e "4.7 - validate" -echo -e "4.8 - validate - online" -echo -e "4.9 - update-lgsm" -echo -e "" -echo -e "5.0 - Monitor Tests" -echo -e "5.1 - monitor - online" -echo -e "5.2 - monitor - offline - with lockfile" -echo -e "5.3 - monitor - offline - no lockfile" -echo -e "5.4 - test-alert" -echo -e "" -echo -e "6.0 - Details Tests" -echo -e "6.1 - details" -echo -e "6.2 - postdetails" -echo -e "" -echo -e "7.0 - Backup Tests" -echo -e "7.1 - backup" -echo -e "" -echo -e "8.0 - Development Tools Tests" -echo -e "8.1 - dev - detect glibc" -echo -e "8.2 - dev - detect ldd" -echo -e "8.3 - dev - detect deps" -echo -e "8.4 - dev - query-raw" -echo -e "" -echo -e "9.0 - Donate" -echo -e "9.1 - donate" -echo -e "" -echo -e "0.0 - Pre-test Tasks" -echo -e "==================================================================" -echo -e "Description:" -echo -e "Create log dir's" -echo -e "" - -echo -e "" -echo -e "0.1 - Create log dir's" -echo -e "=================================" -echo -e "" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - install_logs.sh -) -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "0.2 - Enable dev-debug" -echo -e "=================================" -echo -e "Description:" -echo -e "Enable dev-debug" -echo -e "" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_debug.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "1.0 - Pre-install tests" -echo -e "==================================================================" -echo -e "" - -echo -e "1.1 - start - no files" -echo -e "=================================" -echo -e "Description:" -echo -e "test script reaction to missing server files." -echo -e "Command: ./${gameservername} start" -echo -e "" -# Allows for testing not on Travis CI -if [ -z "${TRAVIS}" ]; then -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_start.sh -) -fn_test_result_fail -else - echo -e "Test bypassed" -fi - -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "1.2 - getopt" -echo -e "=================================" -echo -e "Description:" -echo -e "displaying options messages." -echo -e "Command: ./${gameservername}" -echo -e "" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - core_getopt.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "1.3 - getopt with incorrect args" -echo -e "=================================" -echo -e "Description:" -echo -e "displaying options messages." -echo -e "Command: ./${gameservername} abc123" -echo -e "" -getopt="abc123" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - core_getopt.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "2.0 - Installation" -echo -e "==================================================================" - -echo -e "" -echo -e "2.1 - install" -echo -e "=================================" -echo -e "Description:" -echo -e "install ${gamename} server." -echo -e "Command: ./${gameservername} auto-install" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - fn_autoinstall -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.0 - Start/Stop/Restart Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "3.1 - start" -echo -e "=================================" -echo -e "Description:" -echo -e "start ${gamename} server." -echo -e "Command: ./${gameservername} start" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_start.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.2 - start - online" -echo -e "=================================" -echo -e "Description:" -echo -e "start ${gamename} server while already running." -echo -e "Command: ./${gameservername} start" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_start.sh -) -fn_test_result_fail -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.3 - start - updateonstart" -echo -e "=================================" -echo -e "Description:" -echo -e "will update server on start." -echo -e "Command: ./${gameservername} start" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - updateonstart="on";command_start.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.4 - stop" -echo -e "=================================" -echo -e "Description:" -echo -e "stop ${gamename} server." -echo -e "Command: ./${gameservername} stop" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_stop.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.5 - stop - offline" -echo -e "=================================" -echo -e "Description:" -echo -e "stop ${gamename} server while already stopped." -echo -e "Command: ./${gameservername} stop" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_stop.sh -) -fn_test_result_fail -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.6 - restart" -echo -e "=================================" -echo -e "Description:" -echo -e "restart ${gamename}." -echo -e "Command: ./${gameservername} restart" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_restart.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.7 - restart - offline" -echo -e "=================================" -echo -e "Description:" -echo -e "restart ${gamename} while already stopped." -echo -e "Command: ./${gameservername} restart" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_restart.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "4.0 - Update Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "4.1 - update" -echo -e "=================================" -echo -e "Description:" -echo -e "check for updates." -echo -e "Command: ./${gameservername} update" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_update.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "4.2 - update - change buildid" -echo -e "=================================" -echo -e "Description:" -echo -e "change the buildid tricking SteamCMD to update." -echo -e "Command: ./jc2server update" -requiredstatus="OFFLINE" -fn_setstatus -fn_print_info_nl "changed buildid to 0." -sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_update.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "4.3 - update - change buildid - online" -echo -e "=================================" -echo -e "Description:" -echo -e "change the buildid tricking SteamCMD to update server while already running." -echo -e "Command: ./jc2server update" -requiredstatus="ONLINE" -fn_setstatus -fn_print_info_nl "changed buildid to 0." -sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_update.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "4.4 - update - remove appmanifest file" -echo -e "=================================" -echo -e "Description:" -echo -e "removing appmanifest file will cause script to repair." -echo -e "Command: ./jc2server update" -requiredstatus="OFFLINE" -fn_setstatus -fn_print_info_nl "removed appmanifest_${appid}.acf." -rm --verbose "${serverfiles:?}/steamapps/appmanifest_${appid}.acf" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_update.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "4.5 - force-update" -echo -e "=================================" -echo -e "Description:" -echo -e "force-update bypassing update check." -echo -e "Command: ./jc2server force-update" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - forceupdate=1;command_update.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "4.6 - force-update - online" -echo -e "=================================" -echo -e "Description:" -echo -e "force-update bypassing update check server while already running." -echo -e "Command: ./jc2server force-update" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - forceupdate=1;command_update.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "4.7 - validate" -echo -e "=================================" -echo -e "Description:" -echo -e "validate server files." -echo -e "Command: ./jc2server validate" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_validate.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "4.8 - validate - online" -echo -e "=================================" -echo -e "Description:" -echo -e "validate server files while server already running." -echo -e "" -echo -e "Command: ./jc2server validate" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_validate.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "4.9 - update-lgsm" -echo -e "=================================" -echo -e "Description:" -echo -e "update LinuxGSM." -echo -e "" -echo -e "Command: ./jc2server update-lgam" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_update_linuxgsm.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "Inserting IP address" -echo -e "=================================" -echo -e "Description:" -echo -e "Inserting Travis IP in to config." -echo -e "Allows monitor to work" -if [ "$(ip -o -4 addr|grep eth0)" ]; then - travisip=$(ip -o -4 addr | grep eth0 | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | grep -v 127.0.0) -else - travisip=$(ip -o -4 addr | grep ens | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -v 127.0.0) -fi -sed -i "/BindIP/c\BindIP = \"${travisip}\"," "${serverfiles}/config.lua" -echo -e "IP: ${travisip}" - -echo -e "" -echo -e "5.0 - Monitor Tests" -echo -e "==================================================================" -echo -e "" -info_config.sh -echo -e "Server IP - Port: ${ip}:${port}" -echo -e "Server IP - Query Port: ${ip}:${queryport}" - -echo -e "" -echo -e "5.1 - monitor - online" -echo -e "=================================" -echo -e "Description:" -echo -e "run monitor server while already running." -echo -e "Command: ./${gameservername} monitor" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_monitor.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "5.2 - monitor - offline - with lockfile" -echo -e "=================================" -echo -e "Description:" -echo -e "run monitor while server is offline with lockfile." -echo -e "Command: ./${gameservername} monitor" -requiredstatus="OFFLINE" -fn_setstatus -fn_print_info_nl "creating lockfile." -date '+%s' > "${lockdir}/${selfname}.lock" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_monitor.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "5.3 - monitor - offline - no lockfile" -echo -e "=================================" -echo -e "Description:" -echo -e "run monitor while server is offline with no lockfile." -echo -e "Command: ./${gameservername} monitor" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_monitor.sh -) -fn_test_result_fail -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "5.4 - test-alert" -echo -e "=================================" -echo -e "Description:" -echo -e "run monitor while server is offline with no lockfile." -echo -e "Command: ./${gameservername} test-alert" -requiredstatus="OFFLINE" -fn_setstatus -cp "${servercfgfullpath}" "config.lua" -sed -i 's/[0-9]\+/0/' "${servercfgfullpath}" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_test_alert.sh -) -fn_test_result_fail -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -fn_print_info_nl "Re-generating ${servercfg}." -cp -v "config.lua" "${servercfgfullpath}" -echo -e "=================================" - -echo -e "" -echo -e "6.0 - Details Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "6.1 - details" -echo -e "=================================" -echo -e "Description:" -echo -e "display details." -echo -e "Command: ./${gameservername} details" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_details.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "6.2 - postdetails" -echo -e "=================================" -echo -e "Description:" -echo -e "post details." -echo -e "Command: ./${gameservername} postdetails" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_postdetails.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "7.0 - Backup Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "7.1 - backup" -echo -e "=================================" -echo -e "Description:" -echo -e "run a backup." -echo -e "Command: ./${gameservername} backup" -requiredstatus="ONLINE" -fn_setstatus -echo -e "test de-activated until issue #1839 fixed" -#(command_backup.sh) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "8.0 - Development Tools Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "8.1 - dev - detect glibc" -echo -e "=================================" -echo -e "Description:" -echo -e "detect glibc." -echo -e "Command: ./${gameservername} detect-glibc" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_detect_glibc.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "8.2 - dev - detect ldd" -echo -e "=================================" -echo -e "Description:" -echo -e "detect ldd." -echo -e "Command: ./${gameservername} detect-ldd" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_detect_ldd.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "8.3 - dev - detect deps" -echo -e "=================================" -echo -e "Description:" -echo -e "detect dependencies." -echo -e "Command: ./${gameservername} detect-deps" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_detect_deps.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "8.4 - dev - query-raw" -echo -e "=================================" -echo -e "Description:" -echo -e "raw query output." -echo -e "Command: ./${gameservername} query-raw" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_query_raw.sh -) -fn_test_result_na -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "9.0 - Donate" -echo -e "==================================================================" - -echo -e "" -echo -e "9.1 - donate" -echo -e "=================================" -echo -e "Description:" -echo -e "donate." -echo -e "Command: ./${gameservername} donate" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_donate.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "=================================" -echo -e "Server Tests - Complete!" -echo -e "Using: ${gamename}" -echo -e "=================================" -requiredstatus="OFFLINE" -fn_setstatus -core_exit.sh diff --git a/tests/tests_kcov.sh b/tests/tests_kcov.sh deleted file mode 100644 index 743e2fda2..000000000 --- a/tests/tests_kcov.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -echo -e "Installing kcov" -curl -L "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/shunit2/shunit2-2.1.6.tgz" | tar zx -wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz -tar xzf master.tar.gz -cd kcov-master || exit -mkdir build -cd build || exit -cmake .. -make -sudo make install -cd ../.. -rm -rf kcov-master -mkdir -p coverage diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh deleted file mode 100644 index 8d7bab6b6..000000000 --- a/tests/tests_mcserver.sh +++ /dev/null @@ -1,1208 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2020 Daniel Gibbs -# Purpose: Travis CI Tests: Minecraft | Linux Game Server Management Script -# Contributors: https://linuxgsm.com/contrib -# Documentation: https://docs.linuxgsm.com -# Website: https://linuxgsm.com - -# DO NOT EDIT THIS FILE -# LinuxGSM configuration is no longer edited here -# To update your LinuxGSM config go to: -# lgsm/config-lgsm -# https://docs.linuxgsm.com/configuration/linuxgsm-config - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="v20.3.3" -shortname="mc" -gameservername="mcserver" -commandname="CORE" -rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") -selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") -sessionname=$(echo "${selfname}" | cut -f1 -d".") -lgsmdir="${rootdir}/lgsm" -logdir="${rootdir}/log" -lgsmlogdir="${logdir}/lgsm" -steamcmddir="${HOME}/.steam/steamcmd" -serverfiles="${rootdir}/serverfiles" -functionsdir="${lgsmdir}/functions" -tmpdir="${lgsmdir}/tmp" -datadir="${lgsmdir}/data" -lockdir="${lgsmdir}/lock" -serverlist="${datadir}/serverlist.csv" -serverlistmenu="${datadir}/serverlistmenu.csv" -configdir="${lgsmdir}/config-lgsm" -configdirserver="${configdir}/${gameservername}" -configdirdefault="${lgsmdir}/config-default" -userinput="${1}" - -# Allows for testing not on Travis CI. -# if using travis for tests -if [ -z "${TRAVIS}" ]; then - TRAVIS_BRANCH="develop" - TRAVIS_BUILD_DIR="${rootdir}" -fi -travistest="1" - -## GitHub Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="${TRAVIS_BRANCH}" - -# Core function that is required first. -core_functions.sh(){ - functionfile="${FUNCNAME[0]}" - fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" -} - -# Bootstrap -# Fetches the core functions required before passed off to core_dl.sh. -fn_bootstrap_fetch_file(){ - remote_fileurl="${1}" - remote_fileurl_backup="${2}" - remote_fileurl_name="${3}" - remote_fileurl_backup_name="${4}" - local_filedir="${5}" - local_filename="${6}" - chmodx="${7:-0}" - run="${8:-0}" - forcedl="${9:-0}" - md5="${10:-0}" - # Download file if missing or download forced. - if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then - # If backup fileurl exists include it. - if [ -n "${remote_fileurl_backup}" ]; then - # counter set to 0 to allow second try - counter=0 - remote_fileurls_array=( remote_fileurl remote_fileurl_backup ) - else - # counter set to 1 to not allow second try - 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}" - fileurl_name="${remote_fileurl_name}" - elif [ "${remote_fileurl_array}" == "remote_fileurl_backup" ]; then - fileurl="${remote_fileurl_backup}" - fileurl_name="${remote_fileurl_backup_name}" - fi - counter=$((counter+1)) - if [ ! -d "${local_filedir}" ]; then - 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 -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) - - local exitcode=$? - # 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 "${local_filedir:?}/${local_filename:?}" - local exitcode=2 - fi - fi - - # On first try will error. On second try will fail. - if [ ${exitcode} -ne 0 ]; then - if [ ${counter} -ge 2 ]; then - echo -e "FAIL" - if [ -f "${lgsmlog}" ]; then - fn_script_log_fatal "Downloading ${local_filename}" - fn_script_log_fatal "${fileurl}" - fi - core_exit.sh - else - echo -e "ERROR" - if [ -f "${lgsmlog}" ]; then - 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" - if [ -f "${lgsmlog}" ]; then - fn_script_log_pass "Downloading ${local_filename}" - fi - - # Make file executable if chmodx is set. - if [ "${chmodx}" == "chmodx" ]; then - chmod +x "${local_filedir}/${local_filename}" - fi - - # Remove trap. - trap - INT - - break - fi - done - fi - - if [ -f "${local_filedir}/${local_filename}" ]; then - # Execute file if run is set. - if [ "${run}" == "run" ]; then - # shellcheck source=/dev/null - source "${local_filedir}/${local_filename}" - fi - fi -} - -fn_bootstrap_fetch_file_github(){ - github_file_url_dir="${1}" - github_file_url_name="${2}" - if [ "${githubbranch}" == "master" ]&&[ "${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="${3}" - local_filename="${github_file_url_name}" - chmodx="${4:-0}" - run="${5:-0}" - forcedl="${6:-0}" - md5="${7:-0}" - # Passes vars to the file download function. - fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" -} - -# Installer menu. - -fn_print_center() { - columns=$(tput cols) - line="$*" - printf "%*s\n" $(( (${#line} + columns) / 2)) "${line}" -} - -fn_print_horizontal(){ - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "=" -} - -# Bash menu. -fn_install_menu_bash() { - local resultvar=$1 - title=$2 - caption=$3 - options=$4 - fn_print_horizontal - fn_print_center "${title}" - fn_print_center "${caption}" - fn_print_horizontal - menu_options=() - while read -r line || [[ -n "${line}" ]]; do - var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') - menu_options+=( "${var}" ) - done < "${options}" - menu_options+=( "Cancel" ) - select option in "${menu_options[@]}"; do - if [ "${option}" ]&&[ "${option}" != "Cancel" ]; then - eval "$resultvar=\"${option/%\ */}\"" - fi - break - done -} - -# Whiptail/Dialog menu. -fn_install_menu_whiptail() { - local menucmd=$1 - local resultvar=$2 - title=$3 - caption=$4 - options=$5 - height=${6:-40} - width=${7:-80} - menuheight=${8:-30} - IFS="," - menu_options=() - while read -r line; do - key=$(echo -e "${line}" | awk -F "," '{print $3}') - val=$(echo -e "${line}" | awk -F "," '{print $2}') - 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 - eval "$resultvar=\"${OPTION}\"" - else - eval "$resultvar=" - fi -} - -# Menu selector. -fn_install_menu() { - local resultvar=$1 - local selection="" - title=$2 - caption=$3 - options=$4 - # Get menu command. - for menucmd in whiptail dialog bash; do - if [ "$(command -v "${menucmd}")" ]; then - menucmd=$(command -v "${menucmd}") - break - fi - done - case "$(basename "${menucmd}")" in - whiptail|dialog) - fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; - *) - fn_install_menu_bash selection "${title}" "${caption}" "${options}";; - esac - eval "$resultvar=\"${selection}\"" -} - -# Gets server info from serverlist.csv and puts in to array. -fn_server_info(){ - IFS="," - server_info_array=($(grep -aw "${userinput}" "${serverlist}")) - shortname="${server_info_array[0]}" # csgo - gameservername="${server_info_array[1]}" # csgoserver - gamename="${server_info_array[2]}" # Counter Strike: Global Offensive -} - -fn_install_getopt(){ - userinput="empty" - echo -e "Usage: $0 [option]" - echo -e "" - echo -e "Installer - Linux Game Server Managers - Version ${version}" - echo -e "https://linuxgsm.com" - echo -e "" - echo -e "Commands" - echo -e "install\t\t| Select server to install." - echo -e "servername\t| Enter name of game server to install. e.g $0 csgoserver." - echo -e "list\t\t| List all servers available for install." - exit -} - -fn_install_file(){ - local_filename="${gameservername}" - if [ -e "${local_filename}" ]; then - i=2 - while [ -e "${local_filename}-${i}" ] ; do - (( i++ )) - done - local_filename="${local_filename}-${i}" - fi - cp -R "${selfname}" "${local_filename}" - sed -i -e "s/shortname=\"core\"/shortname=\"${shortname}\"/g" "${local_filename}" - sed -i -e "s/gameservername=\"core\"/gameservername=\"${gameservername}\"/g" "${local_filename}" - echo -e "Installed ${gamename} server as ${local_filename}" - echo -e "" - if [ ! -d "${serverfiles}" ]; then - echo -e "./${local_filename} install" - else - echo -e "Remember to check server ports" - echo -e "./${local_filename} details" - fi - echo -e "" - exit -} - -# Prevent LinuxGSM from running as root. Except if doing a dependency install. -if [ "$(whoami)" == "root" ]; then - if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then - if [ "${shortname}" == "core" ]; then - echo -e "[ FAIL ] Do NOT run this script as root!" - exit 1 - fi - elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then - echo -e "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -# LinuxGSM installer mode. -if [ "${shortname}" == "core" ]; then - # Download the latest serverlist. This is the complete list of all supported servers. - fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" - if [ ! -f "${serverlist}" ]; then - echo -e "[ FAIL ] serverlist.csv could not be loaded." - exit 1 - fi - - if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then - { - tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' - } | column -s $'\t' -t | more - exit - elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then - tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" - fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" - userinput="${result}" - fn_server_info - if [ "${result}" == "${gameservername}" ]; then - fn_install_file - elif [ "${result}" == "" ]; then - echo -e "Install canceled" - else - echo -e "[ FAIL ] menu result does not match gameservername" - echo -e "result: ${result}" - echo -e "gameservername: ${gameservername}" - fi - elif [ "${userinput}" ]; then - fn_server_info - if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then - fn_install_file - else - echo -e "[ FAIL ] unknown game server" - fi - else - fn_install_getopt - fi - -# LinuxGSM server mode. -else - core_functions.sh - if [ "${shortname}" != "core-dep" ]; then - # Load LinuxGSM configs. - # These are required to get all the default variables for the specific server. - # Load the default config. If missing download it. If changed reload it. - if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then - mkdir -p "${configdirdefault}/config-lgsm/${gameservername}" - fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5" - fi - if [ ! -f "${configdirserver}/_default.cfg" ]; then - mkdir -p "${configdirserver}" - echo -en "copying _default.cfg...\c" - cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" - exitcode=$? - if [ ${exitcode} -ne 0 ]; then - echo -e "FAIL" - exit 1 - else - echo -e "OK" - fi - else - function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") - if [ "${function_file_diff}" != "" ]; then - fn_print_warn_nl "_default.cfg has been altered. reloading config." - echo -en "copying _default.cfg...\c" - cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" - exitcode=$? - if [ ${exitcode} -ne 0 ]; then - echo -e "FAIL" - exit 1 - else - echo -e "OK" - fi - fi - fi - # shellcheck source=/dev/null - source "${configdirserver}/_default.cfg" - # Load the common.cfg config. If missing download it. - if [ ! -f "${configdirserver}/common.cfg" ]; then - fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" - # shellcheck source=/dev/null - source "${configdirserver}/common.cfg" - else - # shellcheck source=/dev/null - source "${configdirserver}/common.cfg" - fi - # Load the instance.cfg config. If missing download it. - if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then - fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" - # shellcheck source=/dev/null - source "${configdirserver}/${selfname}.cfg" - else - # shellcheck source=/dev/null - source "${configdirserver}/${selfname}.cfg" - fi - - # Load the linuxgsm.sh in to tmpdir. If missing download it. - if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then - fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5" - fi - fi - # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. - fn_ansi_loader - # Prevents running of core_exit.sh for Travis-CI. - if [ "${travistest}" != "1" ]; then - getopt=$1 - core_getopt.sh - fi -fi - -fn_currentstatus_tmux(){ - check_status.sh - if [ "${status}" != "0" ]; then - currentstatus="ONLINE" - else - currentstatus="OFFLINE" - fi -} - -fn_setstatus(){ - fn_currentstatus_tmux - echo"" - echo -e "Required status: ${requiredstatus}" - counter=0 - echo -e "Current status: ${currentstatus}" - while [ "${requiredstatus}" != "${currentstatus}" ]; do - counter=$((counter+1)) - fn_currentstatus_tmux - echo -en "New status: ${currentstatus}\\r" - - if [ "${requiredstatus}" == "ONLINE" ]; then - (command_start.sh > /dev/null 2>&1) - else - (command_stop.sh > /dev/null 2>&1) - fi - if [ "${counter}" -gt "5" ]; then - currentstatus="FAIL" - echo -e "Current status: ${currentstatus}" - echo -e "" - echo -e "Unable to start or stop server." - exit 1 - fi - done - echo -en "New status: ${currentstatus}\\r" - echo -e "\n" - echo -e "Test starting:" - echo -e "" -} - -# End of every test will expect the result to either pass or fail -# If the script does not do as intended the whole test will fail -# if expecting a pass -fn_test_result_pass(){ - if [ $? != 0 ]; then - echo -e "=================================" - echo -e "Expected result: PASS" - echo -e "Actual result: FAIL" - fn_print_fail_nl "TEST FAILED" - exitcode=1 - core_exit.sh - else - echo -e "=================================" - echo -e "Expected result: PASS" - echo -e "Actual result: PASS" - fn_print_ok_nl "TEST PASSED" - echo -e "" - fi -} - -# if expecting a fail -fn_test_result_fail(){ - if [ $? == 0 ]; then - echo -e "=================================" - echo -e "Expected result: FAIL" - echo -e "Actual result: PASS" - fn_print_fail_nl "TEST FAILED" - exitcode=1 - core_exit.sh - else - echo -e "=================================" - echo -e "Expected result: FAIL" - echo -e "Actual result: FAIL" - fn_print_ok_nl "TEST PASSED" - echo -e "" - fi -} - -# test result n/a -fn_test_result_na(){ - echo -e "=================================" - echo -e "Expected result: N/A" - echo -e "Actual result: N/A" - fn_print_fail_nl "TEST N/A" -} - -sleeptime="0" - -echo -e "=================================" -echo -e "Travis CI Tests" -echo -e "Linux Game Server Manager" -echo -e "by Daniel Gibbs" -echo -e "Contributors: http://goo.gl/qLmitD" -echo -e "https://linuxgsm.com" -echo -e "=================================" -echo -e "" -echo -e "=================================" -echo -e "Server Tests" -echo -e "Using: ${gamename}" -echo -e "Testing Branch: ${TRAVIS_BRANCH}" -echo -e "=================================" -echo -e "" -echo -e "Tests Summary" -echo -e "=================================" -echo -e "0.0 - Pre-test Tasks" -echo -e "0.1 - Create log dir's" -echo -e "0.2 - Enable dev-debug" -echo -e "" -echo -e "1.0 - Pre-install tests" -echo -e "1.1 - start - no files" -echo -e "1.2 - getopt" -echo -e "1.3 - getopt with incorrect args" -echo -e "" -echo -e "2.0 - Installation" -echo -e "2.1 - install" -echo -e "" -echo -e "3.0 - Start/Stop/Restart Tests" -echo -e "3.1 - start" -echo -e "3.2 - start - online" -echo -e "3.3 - start - updateonstart" -echo -e "3.4 - stop" -echo -e "3.5 - stop - offline" -echo -e "3.6 - restart" -echo -e "3.7 - restart - offline" -echo -e "" -echo -e "4.0 - Update Tests" -echo -e "4.1 - update" -echo -e "4.2 - update-lgsm" -echo -e "" -echo -e "5.0 - Monitor Tests" -echo -e "5.1 - monitor - online" -echo -e "5.2 - monitor - offline - with lockfile" -echo -e "5.3 - monitor - offline - no lockfile" -echo -e "5.4 - test-alert" -echo -e "" -echo -e "6.0 - Details Tests" -echo -e "6.1 - details" -echo -e "6.2 - postdetails" -echo -e "" -echo -e "7.0 - Backup Tests" -echo -e "7.1 - backup" -echo -e "" -echo -e "8.0 - Development Tools Tests" -echo -e "8.1 - dev - detect glibc" -echo -e "8.2 - dev - detect ldd" -echo -e "8.3 - dev - detect deps" -echo -e "8.4 - dev - query-raw" -echo -e "" -echo -e "9.0 - Donate" -echo -e "9.1 - donate" - -echo -e "" -echo -e "0.0 - Pre-test Tasks" -echo -e "==================================================================" -echo -e "Description:" -echo -e "Create log dir's" -echo -e "" - -echo -e "" -echo -e "0.1 - Create log dir's" -echo -e "=================================" -echo -e "" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - install_logs.sh -) -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "0.2 - Enable dev-debug" -echo -e "=================================" -echo -e "Description:" -echo -e "Enable dev-debug" -echo -e "" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_debug.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "1.0 - Pre-install tests" -echo -e "==================================================================" -echo -e "" - -echo -e "1.1 - start - no files" -echo -e "=================================" -echo -e "Description:" -echo -e "test script reaction to missing server files." -echo -e "Command: ./${gameservername} start" -echo -e "" -# Allows for testing not on Travis CI -if [ -z "${TRAVIS}" ]; then -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_start.sh -) -fn_test_result_fail -else - echo -e "Test bypassed" -fi - -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "1.2 - getopt" -echo -e "=================================" -echo -e "Description:" -echo -e "displaying options messages." -echo -e "Command: ./${gameservername}" -echo -e "" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - core_getopt.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "1.3 - getopt with incorrect args" -echo -e "=================================" -echo -e "Description:" -echo -e "displaying options messages." -echo -e "Command: ./${gameservername} abc123" -echo -e "" -getopt="abc123" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - core_getopt.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "2.0 - Installation" -echo -e "==================================================================" - -echo -e "" -echo -e "2.1 - install" -echo -e "=================================" -echo -e "Description:" -echo -e "install ${gamename} server." -echo -e "Command: ./${gameservername} auto-install" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - fn_autoinstall -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.0 - Start/Stop/Restart Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "3.1 - start" -echo -e "=================================" -echo -e "Description:" -echo -e "start ${gamename} server." -echo -e "Command: ./${gameservername} start" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_start.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.2 - start - online" -echo -e "=================================" -echo -e "Description:" -echo -e "start ${gamename} server while already running." -echo -e "Command: ./${gameservername} start" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_start.sh -) -fn_test_result_fail -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.3 - start - updateonstart" -echo -e "=================================" -echo -e "Description:" -echo -e "will update server on start." -echo -e "Command: ./${gameservername} start" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - updateonstart="on";command_start.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo -e "" -echo -e "30s Pause" -echo -e "=================================" -echo -e "Description:" -echo -e "give time for server to fully start." -echo -e "Command: sleep 30" -requiredstatus="ONLINE" -fn_setstatus -sleep 30 - -echo -e "" -echo -e "3.4 - stop" -echo -e "=================================" -echo -e "Description:" -echo -e "stop ${gamename} server." -echo -e "Command: ./${gameservername} stop" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_stop.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.5 - stop - offline" -echo -e "=================================" -echo -e "Description:" -echo -e "stop ${gamename} server while already stopped." -echo -e "Command: ./${gameservername} stop" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_stop.sh -) -fn_test_result_fail -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.6 - restart" -echo -e "=================================" -echo -e "Description:" -echo -e "restart ${gamename}." -echo -e "Command: ./${gameservername} restart" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_restart.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.7 - restart - offline" -echo -e "=================================" -echo -e "Description:" -echo -e "restart ${gamename} while already stopped." -echo -e "Command: ./${gameservername} restart" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_restart.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "4.0 - Update Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "4.1 - update" -echo -e "=================================" -echo -e "Description:" -echo -e "check for updates." -echo -e "Command: ./${gameservername} update" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_update.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "4.2 - update-lgsm" -echo -e "=================================" -echo -e "Description:" -echo -e "update LinuxGSM." -echo -e "" -echo -e "Command: ./jc2server update-lgam" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_update_linuxgsm.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "Inserting IP address" -echo -e "=================================" -echo -e "Description:" -echo -e "Inserting Travis IP in to config." -echo -e "Allows monitor to work" -if [ "$(ip -o -4 addr|grep eth0)" ]; then - travisip=$(ip -o -4 addr | grep eth0 | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | grep -v 127.0.0) -else - travisip=$(ip -o -4 addr | grep ens | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -v 127.0.0) -fi -sed -i "/server-ip=/c\server-ip=${travisip}" "${serverfiles}/server.properties" -echo -e "IP: ${travisip}" - -echo -e "" -echo -e "5.0 - Monitor Tests" -echo -e "==================================================================" -echo -e "" -info_config.sh -echo -e "Server IP - Port: ${ip}:${port}" -echo -e "Server IP - Query Port: ${ip}:${queryport}" - -echo -e "" -echo -e "30s Pause" -echo -e "=================================" -echo -e "Description:" -echo -e "give time for server to fully start." -echo -e "Command: sleep 30" -requiredstatus="ONLINE" -fn_setstatus -sleep 30 - -echo -e "" -echo -e "5.1 - monitor - online" -echo -e "=================================" -echo -e "Description:" -echo -e "run monitor server while already running." -echo -e "Command: ./${gameservername} monitor" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_monitor.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "5.2 - monitor - offline - with lockfile" -echo -e "=================================" -echo -e "Description:" -echo -e "run monitor while server is offline with lockfile." -echo -e "Command: ./${gameservername} monitor" -requiredstatus="OFFLINE" -fn_setstatus -fn_print_info_nl "creating lockfile." -date '+%s' > "${lockdir}/${selfname}.lock" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_monitor.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "5.3 - monitor - offline - no lockfile" -echo -e "=================================" -echo -e "Description:" -echo -e "run monitor while server is offline with no lockfile." -echo -e "Command: ./${gameservername} monitor" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_monitor.sh -) -fn_test_result_fail -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "5.4 - test-alert" -echo -e "=================================" -echo -e "Description:" -echo -e "run monitor while server is offline with no lockfile." -echo -e "Command: ./${gameservername} test-alert" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_test_alert.sh -) -fn_test_result_fail -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "6.0 - Details Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "6.1 - details" -echo -e "=================================" -echo -e "Description:" -echo -e "display details." -echo -e "Command: ./${gameservername} details" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_details.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "6.2 - postdetails" -echo -e "=================================" -echo -e "Description:" -echo -e "post details." -echo -e "Command: ./${gameservername} postdetails" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_postdetails.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "7.0 - Backup Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "7.1 - backup" -echo -e "=================================" -echo -e "Description:" -echo -e "run a backup." -echo -e "Command: ./${gameservername} backup" -requiredstatus="ONLINE" -fn_setstatus -echo -e "test de-activated until issue #1839 fixed" -#(command_backup.sh) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "8.0 - Development Tools Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "8.1 - dev - detect glibc" -echo -e "=================================" -echo -e "Description:" -echo -e "detect glibc." -echo -e "Command: ./${gameservername} detect-glibc" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_detect_glibc.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "8.2 - dev - detect ldd" -echo -e "=================================" -echo -e "Description:" -echo -e "detect ldd." -echo -e "Command: ./${gameservername} detect-ldd" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_detect_ldd.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "8.3 - dev - detect deps" -echo -e "=================================" -echo -e "Description:" -echo -e "detect dependencies." -echo -e "Command: ./${gameservername} detect-deps" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_detect_deps.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "Inserting IP address" -echo -e "=================================" -echo -e "Description:" -echo -e "Inserting Travis IP in to config." -echo -e "Allows monitor to work" -if [ "$(ip -o -4 addr|grep eth0)" ]; then - travisip=$(ip -o -4 addr | grep eth0 | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | grep -v 127.0.0) -else - travisip=$(ip -o -4 addr | grep ens | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -v 127.0.0) -fi -sed -i "/server-ip=/c\server-ip=${travisip}" "${serverfiles}/server.properties" -echo -e "IP: ${travisip}" - -echo -e "" -echo -e "8.4 - dev - query-raw" -echo -e "=================================" -echo -e "Description:" -echo -e "raw query output." -echo -e "Command: ./${gameservername} query-raw" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_query_raw.sh -) -fn_test_result_na -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "9.0 - Donate" -echo -e "==================================================================" - -echo -e "" -echo -e "9.1 - donate" -echo -e "=================================" -echo -e "Description:" -echo -e "donate." -echo -e "Command: ./${gameservername} donate" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_donate.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "=================================" -echo -e "Server Tests - Complete!" -echo -e "Using: ${gamename}" -echo -e "=================================" -requiredstatus="OFFLINE" -fn_setstatus - -core_exit.sh diff --git a/tests/tests_shellcheck.sh b/tests/tests_shellcheck.sh deleted file mode 100644 index f4bbf4868..000000000 --- a/tests/tests_shellcheck.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2020 Daniel Gibbs -# Purpose: Travis CI Tests: Shellcheck | Linux Game Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://docs.linuxgsm.com/ -# Website: https://linuxgsm.com - -echo -e "=================================" -echo -e "Travis CI Tests" -echo -e "Linux Game Server Manager" -echo -e "by Daniel Gibbs" -echo -e "Contributors: http://goo.gl/qLmitD" -echo -e "https://linuxgsm.com" -echo -e "=================================" -echo -e "" -echo -e "=================================" -echo -e "Bash Analysis Tests" -echo -e "Using: Shellcheck" -echo -e "Testing Branch: $TRAVIS_BRANCH" -echo -e "=================================" -echo -e "" -scissues=$(find . -type f \( -name "*.sh" -o -name "*.cfg" \) -not -path "./shunit2-2.1.6/*" -exec shellcheck --shell=bash --exclude=SC2154,SC2034 {} \; | grep -F "^--" | wc -l) -echo -e "Found issues: ${scissues}" -echo -e "=================================" -find . -type f \( -name "*.sh" -o -name "*.cfg" \) -not -path "./shunit2-2.1.6/*" -exec shellcheck --shell=bash --exclude=SC2154,SC2034 {} \; -echo -e "" -echo -e "=================================" -echo -e "Bash Analysis Tests - Complete!" -echo -e "Using: Shellcheck" -echo -e "=================================" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh deleted file mode 100644 index fb4f889bf..000000000 --- a/tests/tests_ts3server.sh +++ /dev/null @@ -1,1161 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2020 Daniel Gibbs -# Purpose: Travis CI Tests: Teamspeak 3 | Linux Game Server Management Script -# Contributors: https://linuxgsm.com/contrib -# Documentation: https://docs.linuxgsm.com -# Website: https://linuxgsm.com - -# DO NOT EDIT THIS FILE -# LinuxGSM configuration is no longer edited here -# To update your LinuxGSM config go to: -# lgsm/config-lgsm -# https://docs.linuxgsm.com/configuration/linuxgsm-config - -# Debugging -if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log - BASH_XTRACEFD="5" - set -x -fi - -version="v20.3.3" -shortname="ts3" -gameservername="ts3server" -commandname="CORE" -rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") -selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") -sessionname=$(echo "${selfname}" | cut -f1 -d".") -lgsmdir="${rootdir}/lgsm" -logdir="${rootdir}/log" -lgsmlogdir="${logdir}/lgsm" -steamcmddir="${HOME}/.steam/steamcmd" -serverfiles="${rootdir}/serverfiles" -functionsdir="${lgsmdir}/functions" -tmpdir="${lgsmdir}/tmp" -datadir="${lgsmdir}/data" -lockdir="${lgsmdir}/lock" -serverlist="${datadir}/serverlist.csv" -serverlistmenu="${datadir}/serverlistmenu.csv" -configdir="${lgsmdir}/config-lgsm" -configdirserver="${configdir}/${gameservername}" -configdirdefault="${lgsmdir}/config-default" -userinput="${1}" - -# Allows for testing not on Travis CI. -# if using travis for tests -if [ -z "${TRAVIS}" ]; then - TRAVIS_BRANCH="develop" - TRAVIS_BUILD_DIR="${rootdir}" -fi -travistest="1" - -## GitHub Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="${TRAVIS_BRANCH}" - -# Core function that is required first. -core_functions.sh(){ - functionfile="${FUNCNAME[0]}" - fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" -} - -# Bootstrap -# Fetches the core functions required before passed off to core_dl.sh. -fn_bootstrap_fetch_file(){ - remote_fileurl="${1}" - remote_fileurl_backup="${2}" - remote_fileurl_name="${3}" - remote_fileurl_backup_name="${4}" - local_filedir="${5}" - local_filename="${6}" - chmodx="${7:-0}" - run="${8:-0}" - forcedl="${9:-0}" - md5="${10:-0}" - # Download file if missing or download forced. - if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then - # If backup fileurl exists include it. - if [ -n "${remote_fileurl_backup}" ]; then - # counter set to 0 to allow second try - counter=0 - remote_fileurls_array=( remote_fileurl remote_fileurl_backup ) - else - # counter set to 1 to not allow second try - 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}" - fileurl_name="${remote_fileurl_name}" - elif [ "${remote_fileurl_array}" == "remote_fileurl_backup" ]; then - fileurl="${remote_fileurl_backup}" - fileurl_name="${remote_fileurl_backup_name}" - fi - counter=$((counter+1)) - if [ ! -d "${local_filedir}" ]; then - 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 -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) - - local exitcode=$? - # 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 "${local_filedir:?}/${local_filename:?}" - local exitcode=2 - fi - fi - - # On first try will error. On second try will fail. - if [ ${exitcode} -ne 0 ]; then - if [ ${counter} -ge 2 ]; then - echo -e "FAIL" - if [ -f "${lgsmlog}" ]; then - fn_script_log_fatal "Downloading ${local_filename}" - fn_script_log_fatal "${fileurl}" - fi - core_exit.sh - else - echo -e "ERROR" - if [ -f "${lgsmlog}" ]; then - 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" - if [ -f "${lgsmlog}" ]; then - fn_script_log_pass "Downloading ${local_filename}" - fi - - # Make file executable if chmodx is set. - if [ "${chmodx}" == "chmodx" ]; then - chmod +x "${local_filedir}/${local_filename}" - fi - - # Remove trap. - trap - INT - - break - fi - done - fi - - if [ -f "${local_filedir}/${local_filename}" ]; then - # Execute file if run is set. - if [ "${run}" == "run" ]; then - # shellcheck source=/dev/null - source "${local_filedir}/${local_filename}" - fi - fi -} - -fn_bootstrap_fetch_file_github(){ - github_file_url_dir="${1}" - github_file_url_name="${2}" - if [ "${githubbranch}" == "master" ]&&[ "${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="${3}" - local_filename="${github_file_url_name}" - chmodx="${4:-0}" - run="${5:-0}" - forcedl="${6:-0}" - md5="${7:-0}" - # Passes vars to the file download function. - fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" -} - -# Installer menu. - -fn_print_center() { - columns=$(tput cols) - line="$*" - printf "%*s\n" $(( (${#line} + columns) / 2)) "${line}" -} - -fn_print_horizontal(){ - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "=" -} - -# Bash menu. -fn_install_menu_bash() { - local resultvar=$1 - title=$2 - caption=$3 - options=$4 - fn_print_horizontal - fn_print_center "${title}" - fn_print_center "${caption}" - fn_print_horizontal - menu_options=() - while read -r line || [[ -n "${line}" ]]; do - var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') - menu_options+=( "${var}" ) - done < "${options}" - menu_options+=( "Cancel" ) - select option in "${menu_options[@]}"; do - if [ "${option}" ]&&[ "${option}" != "Cancel" ]; then - eval "$resultvar=\"${option/%\ */}\"" - fi - break - done -} - -# Whiptail/Dialog menu. -fn_install_menu_whiptail() { - local menucmd=$1 - local resultvar=$2 - title=$3 - caption=$4 - options=$5 - height=${6:-40} - width=${7:-80} - menuheight=${8:-30} - IFS="," - menu_options=() - while read -r line; do - key=$(echo -e "${line}" | awk -F "," '{print $3}') - val=$(echo -e "${line}" | awk -F "," '{print $2}') - 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 - eval "$resultvar=\"${OPTION}\"" - else - eval "$resultvar=" - fi -} - -# Menu selector. -fn_install_menu() { - local resultvar=$1 - local selection="" - title=$2 - caption=$3 - options=$4 - # Get menu command. - for menucmd in whiptail dialog bash; do - if [ "$(command -v "${menucmd}")" ]; then - menucmd=$(command -v "${menucmd}") - break - fi - done - case "$(basename "${menucmd}")" in - whiptail|dialog) - fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; - *) - fn_install_menu_bash selection "${title}" "${caption}" "${options}";; - esac - eval "$resultvar=\"${selection}\"" -} - -# Gets server info from serverlist.csv and puts in to array. -fn_server_info(){ - IFS="," - server_info_array=($(grep -aw "${userinput}" "${serverlist}")) - shortname="${server_info_array[0]}" # csgo - gameservername="${server_info_array[1]}" # csgoserver - gamename="${server_info_array[2]}" # Counter Strike: Global Offensive -} - -fn_install_getopt(){ - userinput="empty" - echo -e "Usage: $0 [option]" - echo -e "" - echo -e "Installer - Linux Game Server Managers - Version ${version}" - echo -e "https://linuxgsm.com" - echo -e "" - echo -e "Commands" - echo -e "install\t\t| Select server to install." - echo -e "servername\t| Enter name of game server to install. e.g $0 csgoserver." - echo -e "list\t\t| List all servers available for install." - exit -} - -fn_install_file(){ - local_filename="${gameservername}" - if [ -e "${local_filename}" ]; then - i=2 - while [ -e "${local_filename}-${i}" ] ; do - (( i++ )) - done - local_filename="${local_filename}-${i}" - fi - cp -R "${selfname}" "${local_filename}" - sed -i -e "s/shortname=\"core\"/shortname=\"${shortname}\"/g" "${local_filename}" - sed -i -e "s/gameservername=\"core\"/gameservername=\"${gameservername}\"/g" "${local_filename}" - echo -e "Installed ${gamename} server as ${local_filename}" - echo -e "" - if [ ! -d "${serverfiles}" ]; then - echo -e "./${local_filename} install" - else - echo -e "Remember to check server ports" - echo -e "./${local_filename} details" - fi - echo -e "" - exit -} - -# Prevent LinuxGSM from running as root. Except if doing a dependency install. -if [ "$(whoami)" == "root" ]; then - if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then - if [ "${shortname}" == "core" ]; then - echo -e "[ FAIL ] Do NOT run this script as root!" - exit 1 - fi - elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then - echo -e "[ FAIL ] Do NOT run this script as root!" - exit 1 - else - core_functions.sh - check_root.sh - fi -fi - -# LinuxGSM installer mode. -if [ "${shortname}" == "core" ]; then - # Download the latest serverlist. This is the complete list of all supported servers. - fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" - if [ ! -f "${serverlist}" ]; then - echo -e "[ FAIL ] serverlist.csv could not be loaded." - exit 1 - fi - - if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then - { - tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' - } | column -s $'\t' -t | more - exit - elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then - tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" - fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" - userinput="${result}" - fn_server_info - if [ "${result}" == "${gameservername}" ]; then - fn_install_file - elif [ "${result}" == "" ]; then - echo -e "Install canceled" - else - echo -e "[ FAIL ] menu result does not match gameservername" - echo -e "result: ${result}" - echo -e "gameservername: ${gameservername}" - fi - elif [ "${userinput}" ]; then - fn_server_info - if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then - fn_install_file - else - echo -e "[ FAIL ] unknown game server" - fi - else - fn_install_getopt - fi - -# LinuxGSM server mode. -else - core_functions.sh - if [ "${shortname}" != "core-dep" ]; then - # Load LinuxGSM configs. - # These are required to get all the default variables for the specific server. - # Load the default config. If missing download it. If changed reload it. - if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then - mkdir -p "${configdirdefault}/config-lgsm/${gameservername}" - fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5" - fi - if [ ! -f "${configdirserver}/_default.cfg" ]; then - mkdir -p "${configdirserver}" - echo -en "copying _default.cfg...\c" - cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" - exitcode=$? - if [ ${exitcode} -ne 0 ]; then - echo -e "FAIL" - exit 1 - else - echo -e "OK" - fi - else - function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") - if [ "${function_file_diff}" != "" ]; then - fn_print_warn_nl "_default.cfg has been altered. reloading config." - echo -en "copying _default.cfg...\c" - cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" - exitcode=$? - if [ ${exitcode} -ne 0 ]; then - echo -e "FAIL" - exit 1 - else - echo -e "OK" - fi - fi - fi - # shellcheck source=/dev/null - source "${configdirserver}/_default.cfg" - # Load the common.cfg config. If missing download it. - if [ ! -f "${configdirserver}/common.cfg" ]; then - fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" - # shellcheck source=/dev/null - source "${configdirserver}/common.cfg" - else - # shellcheck source=/dev/null - source "${configdirserver}/common.cfg" - fi - # Load the instance.cfg config. If missing download it. - if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then - fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" - # shellcheck source=/dev/null - source "${configdirserver}/${selfname}.cfg" - else - # shellcheck source=/dev/null - source "${configdirserver}/${selfname}.cfg" - fi - - # Load the linuxgsm.sh in to tmpdir. If missing download it. - if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then - fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5" - fi - fi - # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. - fn_ansi_loader - # Prevents running of core_exit.sh for Travis-CI. - if [ "${travistest}" != "1" ]; then - getopt=$1 - core_getopt.sh - fi -fi - -fn_currentstatus_tmux(){ - check_status.sh - if [ "${status}" != "0" ]; then - currentstatus="ONLINE" - else - currentstatus="OFFLINE" - fi -} - -fn_setstatus(){ - fn_currentstatus_tmux - echo"" - echo -e "Required status: ${requiredstatus}" - counter=0 - echo -e "Current status: ${currentstatus}" - while [ "${requiredstatus}" != "${currentstatus}" ]; do - counter=$((counter+1)) - fn_currentstatus_tmux - echo -en "New status: ${currentstatus}\\r" - - if [ "${requiredstatus}" == "ONLINE" ]; then - (command_start.sh > /dev/null 2>&1) - else - (command_stop.sh > /dev/null 2>&1) - fi - if [ "${counter}" -gt "5" ]; then - currentstatus="FAIL" - echo -e "Current status: ${currentstatus}" - echo -e "" - echo -e "Unable to start or stop server." - exit 1 - fi - done - echo -en "New status: ${currentstatus}\\r" - echo -e "\n" - echo -e "Test starting:" - echo -e "" -} - -# End of every test will expect the result to either pass or fail -# If the script does not do as intended the whole test will fail -# if expecting a pass -fn_test_result_pass(){ - if [ $? != 0 ]; then - echo -e "=================================" - echo -e "Expected result: PASS" - echo -e "Actual result: FAIL" - fn_print_fail_nl "TEST FAILED" - exitcode=1 - core_exit.sh - else - echo -e "=================================" - echo -e "Expected result: PASS" - echo -e "Actual result: PASS" - fn_print_ok_nl "TEST PASSED" - echo -e "" - fi -} - -# if expecting a fail -fn_test_result_fail(){ - if [ $? == 0 ]; then - echo -e "=================================" - echo -e "Expected result: FAIL" - echo -e "Actual result: PASS" - fn_print_fail_nl "TEST FAILED" - exitcode=1 - core_exit.sh - else - echo -e "=================================" - echo -e "Expected result: FAIL" - echo -e "Actual result: FAIL" - fn_print_ok_nl "TEST PASSED" - echo -e "" - fi -} - -# test result n/a -fn_test_result_na(){ - echo -e "=================================" - echo -e "Expected result: N/A" - echo -e "Actual result: N/A" - fn_print_fail_nl "TEST N/A" -} - -sleeptime="0" - -echo -e "=================================" -echo -e "Travis CI Tests" -echo -e "Linux Game Server Manager" -echo -e "by Daniel Gibbs" -echo -e "Contributors: http://goo.gl/qLmitD" -echo -e "https://linuxgsm.com" -echo -e "=================================" -echo -e "" -echo -e "=================================" -echo -e "Server Tests" -echo -e "Using: ${gamename}" -echo -e "Testing Branch: ${TRAVIS_BRANCH}" -echo -e "=================================" - -echo -e "" -echo -e "Tests Summary" -echo -e "=================================" -echo -e "0.0 - Pre-test Tasks" -echo -e "0.1 - Create log dir's" -echo -e "0.2 - Enable dev-debug" -echo -e "" -echo -e "1.0 - Pre-install tests" -echo -e "1.1 - start - no files" -echo -e "1.2 - getopt" -echo -e "1.3 - getopt with incorrect args" -echo -e "" -echo -e "2.0 - Installation" -echo -e "2.1 - install" -echo -e "" -echo -e "3.0 - Start/Stop/Restart Tests" -echo -e "3.1 - start" -echo -e "3.2 - start - online" -echo -e "3.3 - start - updateonstart" -echo -e "3.4 - stop" -echo -e "3.5 - stop - offline" -echo -e "3.6 - restart" -echo -e "3.7 - restart - offline" -echo -e "" -echo -e "4.0 - Update Tests" -echo -e "4.1 - update" -echo -e "4.2 - update-lgsm" -echo -e "" -echo -e "5.0 - Monitor Tests" -echo -e "5.1 - monitor - online" -echo -e "5.2 - monitor - offline - with lockfile" -echo -e "5.3 - monitor - offline - no lockfile" -echo -e "5.4 - test-alert" -echo -e "" -echo -e "6.0 - Details Tests" -echo -e "6.1 - details" -echo -e "6.2 - postdetails" -echo -e "" -echo -e "7.0 - Backup Tests" -echo -e "7.1 - backup" -echo -e "" -echo -e "8.0 - Development Tools Tests" -echo -e "8.1 - dev - detect glibc" -echo -e "8.2 - dev - detect ldd" -echo -e "8.3 - dev - detect deps" -echo -e "8.4 - dev - query-raw" -echo -e "" -echo -e "9.0 - Donate" -echo -e "9.1 - donate" -echo -e "" -echo -e "0.0 - Pre-test Tasks" -echo -e "==================================================================" -echo -e "Description:" -echo -e "Create log dir's" -echo -e "" - -echo -e "" -echo -e "0.1 - Create log dir's" -echo -e "=================================" -echo -e "" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - install_logs.sh -) -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "0.2 - Enable dev-debug" -echo -e "=================================" -echo -e "Description:" -echo -e "Enable dev-debug" -echo -e "" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_debug.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "1.0 - Pre-install tests" -echo -e "==================================================================" -echo -e "" - -echo -e "1.1 - start - no files" -echo -e "=================================" -echo -e "Description:" -echo -e "test script reaction to missing server files." -echo -e "Command: ./${gameservername} start" -echo -e "" -# Allows for testing not on Travis CI -if [ -z "${TRAVIS}" ]; then -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_start.sh -) -fn_test_result_fail -else - echo -e "Test bypassed" -fi - -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "1.2 - getopt" -echo -e "=================================" -echo -e "Description:" -echo -e "displaying options messages." -echo -e "Command: ./${gameservername}" -echo -e "" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - core_getopt.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "1.3 - getopt with incorrect args" -echo -e "=================================" -echo -e "Description:" -echo -e "displaying options messages." -echo -e "Command: ./${gameservername} abc123" -echo -e "" -getopt="abc123" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - core_getopt.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "2.0 - Installation" -echo -e "==================================================================" - -echo -e "" -echo -e "2.1 - install" -echo -e "=================================" -echo -e "Description:" -echo -e "install ${gamename} server." -echo -e "Command: ./${gameservername} auto-install" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - fn_autoinstall -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.0 - Start/Stop/Restart Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "3.1 - start" -echo -e "=================================" -echo -e "Description:" -echo -e "start ${gamename} server." -echo -e "Command: ./${gameservername} start" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_start.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.2 - start - online" -echo -e "=================================" -echo -e "Description:" -echo -e "start ${gamename} server while already running." -echo -e "Command: ./${gameservername} start" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_start.sh -) -fn_test_result_fail -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.3 - start - updateonstart" -echo -e "=================================" -echo -e "Description:" -echo -e "will update server on start." -echo -e "Command: ./${gameservername} start" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - updateonstart="on";command_start.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.4 - stop" -echo -e "=================================" -echo -e "Description:" -echo -e "stop ${gamename} server." -echo -e "Command: ./${gameservername} stop" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_stop.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.5 - stop - offline" -echo -e "=================================" -echo -e "Description:" -echo -e "stop ${gamename} server while already stopped." -echo -e "Command: ./${gameservername} stop" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_stop.sh -) -fn_test_result_fail -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.6 - restart" -echo -e "=================================" -echo -e "Description:" -echo -e "restart ${gamename}." -echo -e "Command: ./${gameservername} restart" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_restart.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "3.7 - restart - offline" -echo -e "=================================" -echo -e "Description:" -echo -e "restart ${gamename} while already stopped." -echo -e "Command: ./${gameservername} restart" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_restart.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "4.0 - Update Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "4.1 - update" -echo -e "=================================" -echo -e "Description:" -echo -e "check for updates." -echo -e "Command: ./${gameservername} update" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_update.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "4.2 - update-lgsm" -echo -e "=================================" -echo -e "Description:" -echo -e "update LinuxGSM." -echo -e "" -echo -e "Command: ./jc2server update-lgam" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_update_linuxgsm.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "5.0 - Monitor Tests" -echo -e "==================================================================" -echo -e "" -info_config.sh -echo -e "Server IP - Port: ${ip}:${port}" -echo -e "Server IP - Query Port: ${ip}:${queryport}" - -echo -e "" -echo -e "5.1 - monitor - online" -echo -e "=================================" -echo -e "Description:" -echo -e "run monitor server while already running." -echo -e "Command: ./${gameservername} monitor" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_monitor.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "5.2 - monitor - offline - with lockfile" -echo -e "=================================" -echo -e "Description:" -echo -e "run monitor while server is offline with lockfile." -echo -e "Command: ./${gameservername} monitor" -requiredstatus="OFFLINE" -fn_setstatus -fn_print_info_nl "creating lockfile." -date '+%s' > "${lockdir}/${selfname}.lock" -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_monitor.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "5.3 - monitor - offline - no lockfile" -echo -e "=================================" -echo -e "Description:" -echo -e "run monitor while server is offline with no lockfile." -echo -e "Command: ./${gameservername} monitor" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_monitor.sh -) -fn_test_result_fail -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "5.4 - test-alert" -echo -e "=================================" -echo -e "Description:" -echo -e "run monitor while server is offline with no lockfile." -echo -e "Command: ./${gameservername} test-alert" -requiredstatus="OFFLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_test_alert.sh -) -fn_test_result_fail -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "6.0 - Details Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "6.1 - details" -echo -e "=================================" -echo -e "Description:" -echo -e "display details." -echo -e "Command: ./${gameservername} details" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_details.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "6.2 - postdetails" -echo -e "=================================" -echo -e "Description:" -echo -e "post details." -echo -e "Command: ./${gameservername} postdetails" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_postdetails.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "7.0 - Backup Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "7.1 - backup" -echo -e "=================================" -echo -e "Description:" -echo -e "run a backup." -echo -e "Command: ./${gameservername} backup" -requiredstatus="ONLINE" -fn_setstatus -echo -e "test de-activated until issue #1839 fixed" -#(command_backup.sh) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "8.0 - Development Tools Tests" -echo -e "==================================================================" - -echo -e "" -echo -e "8.1 - dev - detect glibc" -echo -e "=================================" -echo -e "Description:" -echo -e "detect glibc." -echo -e "Command: ./${gameservername} detect-glibc" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_detect_glibc.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "8.2 - dev - detect ldd" -echo -e "=================================" -echo -e "Description:" -echo -e "detect ldd." -echo -e "Command: ./${gameservername} detect-ldd" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_detect_ldd.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "8.3 - dev - detect deps" -echo -e "=================================" -echo -e "Description:" -echo -e "detect dependencies." -echo -e "Command: ./${gameservername} detect-deps" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_detect_deps.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "8.4 - dev - query-raw" -echo -e "=================================" -echo -e "Description:" -echo -e "raw query output." -echo -e "Command: ./${gameservername} query-raw" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_dev_query_raw.sh -) -fn_test_result_na -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "9.0 - Donate" -echo -e "==================================================================" - -echo -e "" -echo -e "9.1 - donate" -echo -e "=================================" -echo -e "Description:" -echo -e "donate." -echo -e "Command: ./${gameservername} donate" -requiredstatus="ONLINE" -fn_setstatus -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_donate.sh -) -fn_test_result_pass -echo -e "run order" -echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' - -echo -e "" -echo -e "=================================" -echo -e "Server Tests - Complete!" -echo -e "Using: ${gamename}" -echo -e "=================================" -requiredstatus="OFFLINE" -fn_setstatus - -core_exit.sh