diff --git a/.gitattributes b/.gitattributes index 802343b27..bbe6490d1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -19,4 +19,4 @@ *.pdf diff=astextplain *.PDF diff=astextplain *.rtf diff=astextplain -*.RTF diff=astextplain \ No newline at end of file +*.RTF diff=astextplain diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..79d78730b --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: dgibbs # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: dgibbs # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: https://www.paypal.me/dgibbs64 # Replace with a single custom sponsorship URL diff --git a/.github/ISSUE_TEMPLATE/new-server-request.md b/.github/ISSUE_TEMPLATE/new-server-request.md index d27b3b497..adb1f5f4f 100644 --- a/.github/ISSUE_TEMPLATE/new-server-request.md +++ b/.github/ISSUE_TEMPLATE/new-server-request.md @@ -26,4 +26,4 @@ If yes Use SteamDB to get the appid. (https://steamdb.info). We only support Linux servers and do not support Wine. * [ ] Yes -* [ ] No \ No newline at end of file +* [ ] No diff --git a/.github/issue_label_bot.yaml b/.github/issue_label_bot.yaml new file mode 100644 index 000000000..ee6d724f1 --- /dev/null +++ b/.github/issue_label_bot.yaml @@ -0,0 +1,4 @@ +label-alias: + bug: 'type: bug' + feature_request: 'type: feature request' + question: 'question' diff --git a/.github/potential-duplicates.yml b/.github/potential-duplicates.yml index 9c973de06..3ca5a7cb8 100644 --- a/.github/potential-duplicates.yml +++ b/.github/potential-duplicates.yml @@ -10,4 +10,4 @@ referenceComment: > Potential duplicates: {{#issues}} - [#{{ number }}] {{ title }} ({{ accuracy }}%) - {{/issues}} \ No newline at end of file + {{/issues}} diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..a04f0dc68 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,33 @@ +# Description + +Please include a summary of the change and which issues is fixed + +Fixes #[issue] + +## Type of change + +* [ ] Bug fix (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). + +## 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 code follows the style guidelines of this project. +* [ ] I have performed a self-review of my own 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 + +**Thank you for your Pull Request!** diff --git a/.github/request-info.yml b/.github/request-info.yml index 1b354d9f7..ed407c3b5 100644 --- a/.github/request-info.yml +++ b/.github/request-info.yml @@ -3,7 +3,7 @@ # *Required* Comment to reply with requestInfoReplyComment: > ![More Data required](https://i.imgur.com/yS9cecv.png) - More data is required to assist with this issue + More data is required to assist with this issue or issue template was not used correctly. https://linuxgsm.com/support/#guide @@ -14,4 +14,4 @@ requestInfoReplyComment: > # - updates # *OPTIONAL* Label to be added to Issues and Pull Requests with insufficient information given -requestInfoLabelToAdd: "needs more info" \ No newline at end of file +requestInfoLabelToAdd: "needs more info" diff --git a/.github/topissuebot.yml b/.github/topissuebot.yml index b02540a2d..06c64ae01 100644 --- a/.github/topissuebot.yml +++ b/.github/topissuebot.yml @@ -1,4 +1,4 @@ # Configuration for top-issue-bot labelName: ":thumbsup: Top Issue!" labelColor: "f442c2" -numberOfIssuesToLabel: 5 \ No newline at end of file +numberOfIssuesToLabel: 5 diff --git a/.github/welcome.yml b/.github/welcome.yml index 7a120a2fa..7d0cb281b 100644 --- a/.github/welcome.yml +++ b/.github/welcome.yml @@ -18,4 +18,4 @@ newPRWelcomeComment: > firstPRMergeComment: > Congratulations on merging your first pull request! Thank you for supporting LinuxGSM! -# It is recommend to include as many gifs and emojis as possible \ No newline at end of file +# It is recommend to include as many gifs and emojis as possible diff --git a/.github/write-good.yml b/.github/write-good.yml index 2bdb512ad..00eefa99c 100644 --- a/.github/write-good.yml +++ b/.github/write-good.yml @@ -1,4 +1,4 @@ # .github/write-good.yml writeGood: true alex: true -spellchecker: true \ No newline at end of file +spellchecker: true diff --git a/.gitignore b/.gitignore index 2b0bcabc1..12218bea3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ *.db -.idea \ No newline at end of file +.idea diff --git a/.travis.yml b/.travis.yml index 59c6d892b..5606c8e6a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ addons: - gzip - unzip - bsdmainutils - - python + - python3 - util-linux - ca-certificates - binutils diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 764f21e19..33650771e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,4 +33,4 @@ This will help us in understanding your code and determining where problems may Start reading our code and you'll get the hang of it. Explore how functions are organized and you'll see how we strive for readable code. Please give the following document a read and adjust your code according to its specifications. -[Syntax & Coding Conventions](https://github.com/GameServerManagers/LinuxGSM/wiki/Syntax-and-Conventions) \ No newline at end of file +[Syntax & Coding Conventions](https://github.com/GameServerManagers/LinuxGSM/wiki/Syntax-and-Conventions) diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md deleted file mode 100644 index c08b7705a..000000000 --- a/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,15 +0,0 @@ -Follow **[this guide](https://linuxgsm.com/support/#guide)** to make sure you post the correct info. -For general support visit the **[LinuxGSM-Support](https://github.com/GameServerManagers/LinuxGSM-Support)**. - -Issues here are **ONLY** for: -* LinuxGSM bugs -* feature suggestions -* code contributions - -Issues 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 - -Any general support issues on GitHub will be closed. diff --git a/LICENSE b/LICENSE index 9bcd64251..950cea23a 100644 --- a/LICENSE +++ b/LICENSE @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 749aadeed..000000000 --- a/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,40 +0,0 @@ -# Description - -Please include a summary of the change and which issue is fixed. - -Fixes #[issue] - -## Type of change - -* [ ] Bug fix (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). -* [ ] This change requires a documentation update. - -## Checklist - -* [ ] This code follows the style guidelines of this project. -* [ ] This pull request links to an issue. -* [ ] This pull request uses the `develop` branch as its base. -* [ ] I have provided Co-author details below. -* [ ] I have performed a self-review of my own code. -* [ ] I have squashed commits. -* [ ] I have commented my code, particularly in hard to understand areas. -* [ ] I have made corresponding changes to the documentation if required. - -## Provide Github Email - -Fill out below info or tick box below: -``` -Co-authored-by: John Doe -``` - -- [ ] I do not wish to provide an email. I am aware this will hide me as the author of this commit. - - -All pull requests will now be squashed to create a tidy commit history and simplify changelog creation. You can provide either your own email or a GitHub-provided no-reply email. - -When a PR is squashed the author becomes the person who squashed the PR. This removes you as the author of your own PR. -The only workaround for this is to add your details as a co-author. More info about co-authors can be found [here](https://help.github.com/en/articles/creating-a-commit-with-multiple-authors). diff --git a/README.md b/README.md index a028258e8..6c32bab75 100644 --- a/README.md +++ b/README.md @@ -2,46 +2,44 @@
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) [![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/) [![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors) - -[LinuxGSM](https://linuxgsm.com) is the command line tool for quick, simple deployment and management of dedicated game servers. + +[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 just messing around trying to get their server working. LinuxGSM is 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 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. ## Main features -80+ game servers supported +100+ game servers supported -* :truck: Installer -* :mag: Monitor -* :phone: Alerts -* :cloud: Updater -* :blue_book: Server Details -* :floppy_disk: Backup +* :truck: Installer +* :mag: Monitor +* :phone: Alerts +* :cloud: Updater +* :blue_book: Server Details +* :floppy_disk: Backup * :computer: Console -## :penguin: Compatibility +## :penguin: Compatibility -Linux Game Server Managers are tested to work on the following Linux distros. +LinuxGSM will run on popular distros as long as the minimum requirements are met. -* Debian based (Ubuntu, Mint etc.) -* Red Hat based (CentOS, Fedora etc.) +* Ubuntu +* Debian +* CentOS -Other distros are likely to work but are not fully tested. +Other distros are likely to work but are not fully tested. ## :wrench: Requirements -Each game server has its own specific dependency requirements, but most require GLIBC and Tmux. Visit the specific game server installation page on the [LinuxGSM](https://linuxgsm.com) website to see dependencies. - -* [GLIBC](https://docs.linuxgsm.com/requirements/glibc) >= 2.15 recommended [[specific requirements]](https://docs.linuxgsm.com/requirements/glibc#server-requirements) -* [Tmux](https://docs.linuxgsm.com/requirements/tmux) >= 1.6 recommended (Avoid Tmux 1.8) +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. ## :blue_book: Documentation -Documentation is found at [linuxgsm.com](https://linuxgsm.com) and [docs.linuxgsm.com](https://docs.linuxgsm.com) +Documentation is found at [linuxgsm.com](https://linuxgsm.com) and [docs.linuxgsm.com](https://docs.linuxgsm.com). ## :question: Support @@ -49,7 +47,7 @@ There are a various ways to get support, check out the [support](https://linuxgs ## :heart: Donate -If you would like to [donate](https://linuxgsm.com/donate) to the project there are several ways you can, via [PayPal](https://www.paypal.me/dgibbs64), [Patreon](https://www.patreon.com/dgibbs) and [Flattr](https://flattr.com/@dgibbs). I would like to thank everyone who has previously sent a donation. LinuxGSM has been going since 2012 and I have spent 1000s of hours developing and improving the project and continue to regularly add support for new servers. +If you would like to [donate](https://linuxgsm.com/donate) to the project there are several ways you can, via [Patreon](https://www.patreon.com/dgibbs), [Ko-Fi](https://ko-fi.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. ## Contributors @@ -61,4 +59,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d -This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! \ No newline at end of file +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! diff --git a/lgsm/config-default/config-lgsm/ahl2server/_default.cfg b/lgsm/config-default/config-lgsm/ahl2server/_default.cfg new file mode 100644 index 000000000..03befbd00 --- /dev/null +++ b/lgsm/config-default/config-lgsm/ahl2server/_default.cfg @@ -0,0 +1,162 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT 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 + +#### 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 +ip="0.0.0.0" +port="27015" +clientport="27005" +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}" +} + +#### LinuxGSM Settings #### + +## 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" +postdays="7" +posttarget="https://hastebin.com" + +# 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="" + +# 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" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# 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. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" + +## SteamCMD Settings +# 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" + +## LinuxGSM Server Details +# Do not edit +gamename="Action: Source" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/ahl2" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ahlserver/_default.cfg b/lgsm/config-default/config-lgsm/ahlserver/_default.cfg new file mode 100644 index 000000000..65cfd5fab --- /dev/null +++ b/lgsm/config-default/config-lgsm/ahlserver/_default.cfg @@ -0,0 +1,158 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT 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 + +#### Server Settings #### + +## Server Start Settings | 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} " +} + +#### LinuxGSM Settings #### + +## 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" +postdays="7" +posttarget="https://hastebin.com" + +# 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="" + +# 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" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# 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. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="90" +appidmod="cstrike" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="9" + +## LinuxGSM Server Details +# Do not edit +gamename="Action half-life" +engine="goldsource" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/action" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/arkserver/_default.cfg b/lgsm/config-default/config-lgsm/arkserver/_default.cfg index 47189ae12..f69643c12 100644 --- a/lgsm/config-default/config-lgsm/arkserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/arkserver/_default.cfg @@ -27,6 +27,9 @@ parms="\"${defaultmap}?AltSaveDirectoryName=${defaultmap}?listen?MultiHome=${ip} ## 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" postdays="7" @@ -62,6 +65,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -83,23 +90,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="5" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="376030" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="ARK: Survival Evolved" engine="unreal4" +glibc="2.15" #### Directories #### # Edit with care diff --git a/lgsm/config-default/config-lgsm/arma3server/_default.cfg b/lgsm/config-default/config-lgsm/arma3server/_default.cfg index c7f9f1187..d58cb76e5 100644 --- a/lgsm/config-default/config-lgsm/arma3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/arma3server/_default.cfg @@ -41,6 +41,9 @@ parms="-ip=${ip} -port=${port} -cfg=${networkcfgfullpath} -config=${servercfgful ## 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" postdays="7" @@ -76,6 +79,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -97,23 +104,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="5" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="233780" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="ARMA 3" engine="realvirtuality" +glibc="2.13" #### Directories #### # Edit with care diff --git a/lgsm/config-default/config-lgsm/bb2server/_default.cfg b/lgsm/config-default/config-lgsm/bb2server/_default.cfg index 17014193d..aa5ffca37 100644 --- a/lgsm/config-default/config-lgsm/bb2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/bb2server/_default.cfg @@ -31,6 +31,9 @@ parms="-game brainbread2 -strictportbind -ip ${ip} -port ${port} +clientport ${c ## 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" postdays="7" @@ -66,6 +69,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -87,23 +94,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="475370" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="BrainBread 2" engine="source" +glibc="2.17" #### Directories #### # Edit with care @@ -118,7 +146,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/bbserver/_default.cfg b/lgsm/config-default/config-lgsm/bbserver/_default.cfg index 0002910f9..11e7b23a0 100644 --- a/lgsm/config-default/config-lgsm/bbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bbserver/_default.cfg @@ -25,6 +25,9 @@ parms="-game brainbread -strictportbind +ip ${ip} -port ${port} +clientport ${cl ## 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" postdays="7" @@ -60,6 +63,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -81,24 +88,45 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="90" appidmod="cstrike" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="9" ## LinuxGSM Server Details # Do not edit gamename="BrainBread" engine="goldsource" +glibc="2.3.4" #### Directories #### # Edit with care @@ -113,7 +141,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/bdserver/_default.cfg b/lgsm/config-default/config-lgsm/bdserver/_default.cfg index ad5bc4a7b..c2c148113 100644 --- a/lgsm/config-default/config-lgsm/bdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bdserver/_default.cfg @@ -25,6 +25,9 @@ parms="-game bdef -strictportbind +ip ${ip} -port ${port} +clientport ${clientpo ## 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" postdays="7" @@ -60,6 +63,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -81,19 +88,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="817300" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="9" ## LinuxGSM Server Details # Do not edit gamename="Base Defense" engine="goldsource" +glibc="2.14" #### Directories #### # Edit with care @@ -108,7 +140,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/bf1942server/_default.cfg b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg index 0323fa414..19e919726 100644 --- a/lgsm/config-default/config-lgsm/bf1942server/_default.cfg +++ b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg @@ -18,6 +18,9 @@ parms="+hostServer 1 +dedicated 1" ## 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" postdays="7" @@ -53,6 +56,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -74,15 +81,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" + ## LinuxGSM Server Details # Do not edit gamename="Battlefield: 1942" engine="refractor" +glibc="2.0" #### Directories #### # Edit with care @@ -97,7 +125,7 @@ servercfgdir="${systemdir}/mods/bf1942/settings" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg index d3036144e..4a42b24aa 100644 --- a/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg @@ -31,6 +31,9 @@ parms="-game bms -strictportbind -ip ${ip} -port ${port} +clientport ${clientpor ## 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" postdays="7" @@ -66,6 +69,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -87,23 +94,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="346680" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Black Mesa: Deathmatch" engine="source" +glibc="2.15" #### Directories #### # Edit with care @@ -118,7 +146,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/boserver/_default.cfg b/lgsm/config-default/config-lgsm/boserver/_default.cfg index c9fc1c954..6f66c1680 100644 --- a/lgsm/config-default/config-lgsm/boserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/boserver/_default.cfg @@ -16,7 +16,7 @@ ip="" ## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters fn_parms(){ -parms=" -batchmode -nographics -dedicated -configfile=${servercfgfullpath}" +parms="-batchmode -nographics -dedicated -configfile=${servercfgfullpath}" } #### LinuxGSM Settings #### @@ -24,6 +24,9 @@ parms=" -batchmode -nographics -dedicated -configfile=${servercfgfullpath}" ## 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" postdays="7" @@ -59,6 +62,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -80,23 +87,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="416880" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Ballistic Overkill" engine="unity3d" +glibc="2.15" #### Directories #### # Edit with care @@ -111,7 +139,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/bsserver/_default.cfg b/lgsm/config-default/config-lgsm/bsserver/_default.cfg index 3792882b1..29f8d9814 100644 --- a/lgsm/config-default/config-lgsm/bsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bsserver/_default.cfg @@ -35,6 +35,9 @@ parms="-game "${serverfiles}/berimbau" -autoupdate -strictportbind -ip ${ip} -po ## 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" postdays="7" @@ -70,6 +73,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -91,23 +98,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="228780" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Blade Symphony" engine="source" +glibc="2.15" #### Directories #### # Edit with care @@ -122,7 +150,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/bt1944server/_default.cfg b/lgsm/config-default/config-lgsm/bt1944server/_default.cfg index 22b3f4e4d..5ea155b17 100644 --- a/lgsm/config-default/config-lgsm/bt1944server/_default.cfg +++ b/lgsm/config-default/config-lgsm/bt1944server/_default.cfg @@ -15,7 +15,7 @@ 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.BombGameMode?listen -log -broadcastip=\"${ip}\" -PORT=${port} -QueryPort=${queryport} -defgameini=\"${servercfgfullpath}\"" +parms="/Game/Maps/Final_Maps/Derailed?Game=/Script/ShooterGame.WartideGameMode?listen -log -broadcastip=\"${extip}\" -PORT=${port} -QueryPort=${queryport} -defgameini=\"${servercfgfullpath}\"" } #### LinuxGSM Settings #### @@ -23,6 +23,9 @@ parms="/Game/Maps/Final_Maps/Derailed?Game=/Script/ShooterGame.BombGameMode?list ## 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" postdays="7" @@ -58,6 +61,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -79,23 +86,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="805140" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Battalion 1944" engine="unreal4" +glibc="2.17" #### Directories #### # Edit with care diff --git a/lgsm/config-default/config-lgsm/btserver/_default.cfg b/lgsm/config-default/config-lgsm/btserver/_default.cfg new file mode 100644 index 000000000..600e016c7 --- /dev/null +++ b/lgsm/config-default/config-lgsm/btserver/_default.cfg @@ -0,0 +1,150 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT 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 + +#### Server Settings #### + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="" +} + +#### LinuxGSM Settings #### + +## 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" +postdays="7" +posttarget="https://hastebin.com" + +# 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="" + +# 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" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# 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. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="1026340" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="7" + +## LinuxGSM Server Details +# Do not edit +gamename="Barotrauma" +engine="barotrauma" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./DedicatedServer.exe" +servercfg="serversettings.xml" +servercfgdefault="serversettings.xml" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/ServerLogs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ccserver/_default.cfg b/lgsm/config-default/config-lgsm/ccserver/_default.cfg index c85af6137..fb6f47507 100644 --- a/lgsm/config-default/config-lgsm/ccserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ccserver/_default.cfg @@ -26,6 +26,9 @@ parms="-game cure -strictportbind -ip ${ip} -port ${port} +clientport ${clientpo ## 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" postdays="7" @@ -61,6 +64,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -82,23 +89,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="383410" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Codename CURE" engine="source" +glibc="2.15" #### Directories #### # Edit with care @@ -113,7 +141,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/cod2server/_default.cfg b/lgsm/config-default/config-lgsm/cod2server/_default.cfg index 61b0a56e8..523b61755 100644 --- a/lgsm/config-default/config-lgsm/cod2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cod2server/_default.cfg @@ -24,6 +24,9 @@ parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +se ## 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" postdays="7" @@ -59,6 +62,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -77,15 +84,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" + ## LinuxGSM Server Details # Do not edit gamename="Call of Duty 2" engine="iw2.0" +glibc="2.1.3" #### Directories #### # Edit with care @@ -100,7 +128,7 @@ servercfgdir="${systemdir}/main" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/cod4server/_default.cfg b/lgsm/config-default/config-lgsm/cod4server/_default.cfg index a46248950..546ad2b44 100644 --- a/lgsm/config-default/config-lgsm/cod4server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cod4server/_default.cfg @@ -24,6 +24,9 @@ parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set fs_homepath ${s ## 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" postdays="7" @@ -59,6 +62,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -77,15 +84,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" + ## LinuxGSM Server Details # Do not edit gamename="Call of Duty 4" engine="iw3.0" +glibc="2.12" #### Directories #### # Edit with care @@ -100,7 +128,7 @@ servercfgdir="${systemdir}/main" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/codserver/_default.cfg b/lgsm/config-default/config-lgsm/codserver/_default.cfg index 67c6dc918..f527bc194 100644 --- a/lgsm/config-default/config-lgsm/codserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/codserver/_default.cfg @@ -24,6 +24,9 @@ parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +se ## 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" postdays="7" @@ -59,6 +62,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -77,15 +84,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" + ## LinuxGSM Server Details # Do not edit gamename="Call of Duty" engine="idtech3" +glibc="2.1" #### Directories #### # Edit with care @@ -100,7 +128,7 @@ servercfgdir="${systemdir}/main" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/coduoserver/_default.cfg b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg index c61d3f96b..cc4109847 100644 --- a/lgsm/config-default/config-lgsm/coduoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg @@ -24,6 +24,9 @@ parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +se ## 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" postdays="7" @@ -59,6 +62,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -77,15 +84,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" + ## LinuxGSM Server Details # Do not edit gamename="Call of Duty: United Offensive" engine="idtech3" +glibc="2.1" #### Directories #### # Edit with care @@ -100,7 +128,7 @@ servercfgdir="${systemdir}/uo" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/codwawserver/_default.cfg b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg index 4296b4b7c..484d64194 100644 --- a/lgsm/config-default/config-lgsm/codwawserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg @@ -24,6 +24,9 @@ parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +se ## 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" postdays="7" @@ -59,6 +62,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -77,15 +84,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" + ## LinuxGSM Server Details # Do not edit gamename="Call of Duty: World at War" engine="iw3.0" +glibc="2.3.2" #### Directories #### # Edit with care @@ -100,7 +128,7 @@ servercfgdir="${systemdir}/main" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/csczserver/_default.cfg b/lgsm/config-default/config-lgsm/csczserver/_default.cfg index 363d82e6b..15909d0f9 100644 --- a/lgsm/config-default/config-lgsm/csczserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csczserver/_default.cfg @@ -25,6 +25,9 @@ parms="-game czero -strictportbind +ip ${ip} -port ${port} +clientport ${clientp ## 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" postdays="7" @@ -60,6 +63,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -81,24 +88,45 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="90" appidmod="czero" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="9" ## LinuxGSM Server Details # Do not edit gamename="Counter-Strike: Condition Zero" engine="goldsource" +glibc="2.3.6" #### Directories #### # Edit with care @@ -113,7 +141,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg index 8fb88de8b..1358a186c 100644 --- a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg @@ -17,7 +17,7 @@ # Custom 3 0 # Deathmatch 1 2 mg_deathmatch # Demolition 1 1 mg_demolition -# Wingman 0 2 +# Wingman 0 2 # Danger Zone 6 0 mg_dz_blacksite (map: dz_blacksite), mg_dz_sirocco (map: dz_sirocco) gametype="0" gamemode="0" @@ -51,6 +51,9 @@ parms="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport $ ## 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" postdays="7" @@ -86,6 +89,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -107,23 +114,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="740" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Counter-Strike: Global Offensive" engine="source" +glibc="2.15" #### Directories #### # Edit with care diff --git a/lgsm/config-default/config-lgsm/csserver/_default.cfg b/lgsm/config-default/config-lgsm/csserver/_default.cfg index c3f087a0f..7141f33a9 100644 --- a/lgsm/config-default/config-lgsm/csserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csserver/_default.cfg @@ -25,6 +25,9 @@ parms="-game cstrike -strictportbind +ip ${ip} -port ${port} +clientport ${clien ## 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" postdays="7" @@ -60,6 +63,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -81,24 +88,45 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="90" appidmod="cstrike" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="9" ## LinuxGSM Server Details # Do not edit gamename="Counter-Strike 1.6" engine="goldsource" +glibc="2.3.6" #### Directories #### # Edit with care @@ -113,7 +141,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/cssserver/_default.cfg b/lgsm/config-default/config-lgsm/cssserver/_default.cfg index 47ba05037..aa750fe1c 100644 --- a/lgsm/config-default/config-lgsm/cssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/cssserver/_default.cfg @@ -31,6 +31,9 @@ parms="-game cstrike -strictportbind -ip ${ip} -port ${port} +clientport ${clien ## 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" postdays="7" @@ -66,6 +69,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -87,23 +94,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="232330" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Counter-Strike: Source" engine="source" +glibc="2.3.6" #### Directories #### # Edit with care @@ -118,7 +146,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/dabserver/_default.cfg b/lgsm/config-default/config-lgsm/dabserver/_default.cfg index efa06c0a0..e256c2a47 100644 --- a/lgsm/config-default/config-lgsm/dabserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dabserver/_default.cfg @@ -26,6 +26,9 @@ parms="-strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_por ## 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" postdays="7" @@ -61,6 +64,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -82,23 +89,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="317800" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Double Action: Boogaloo" engine="source" +glibc="2.15" #### Directories #### # Edit with care @@ -113,7 +141,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/dmcserver/_default.cfg b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg index 008ebfe60..779f33632 100644 --- a/lgsm/config-default/config-lgsm/dmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg @@ -25,6 +25,9 @@ parms="-game dmc -strictportbind +ip ${ip} -port ${port} +clientport ${clientpor ## 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" postdays="7" @@ -60,6 +63,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -81,24 +88,45 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="90" appidmod="dmc" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="9" ## LinuxGSM Server Details # Do not edit gamename="Deathmatch Classic" engine="goldsource" +glibc="2.3.4" #### Directories #### # Edit with care @@ -113,7 +141,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/dodserver/_default.cfg b/lgsm/config-default/config-lgsm/dodserver/_default.cfg index 09eb2eb1d..2c47d5501 100644 --- a/lgsm/config-default/config-lgsm/dodserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodserver/_default.cfg @@ -25,6 +25,9 @@ parms="-game dod -strictportbind +ip ${ip} -port ${port} +clientport ${clientpor ## 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" postdays="7" @@ -60,6 +63,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -81,24 +88,45 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="90" appidmod="dod" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="9" ## LinuxGSM Server Details # Do not edit gamename="Day of Defeat" engine="goldsource" +glibc="2.3.4" #### Directories #### # Edit with care @@ -113,7 +141,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/dodsserver/_default.cfg b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg index 5e9438356..83ba5072a 100644 --- a/lgsm/config-default/config-lgsm/dodsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg @@ -26,6 +26,9 @@ parms="-game dod -strictportbind -ip ${ip} -port ${port} +clientport ${clientpor ## 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" postdays="7" @@ -61,6 +64,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -82,23 +89,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="232290" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Day of Defeat: Source" engine="source" +glibc="2.3.6" #### Directories #### # Edit with care @@ -113,7 +141,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/doiserver/_default.cfg b/lgsm/config-default/config-lgsm/doiserver/_default.cfg index cb507f756..f74935f60 100644 --- a/lgsm/config-default/config-lgsm/doiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/doiserver/_default.cfg @@ -13,14 +13,13 @@ ip="0.0.0.0" port="27015" clientport="27005" sourcetvport="27020" -defaultmap="bastogne" -maxplayers="16" +defaultmap="bastogne stronghold" +maxplayers="32" tickrate="64" -workshop="0" ## 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} +sv_workshop_enabled ${workshop}" +parms="-game doi -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers} -workshop" } #### LinuxGSM Settings #### @@ -28,6 +27,9 @@ parms="-game doi -strictportbind -ip ${ip} -port ${port} +clientport ${clientpor ## 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" postdays="7" @@ -63,6 +65,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -84,23 +90,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="462310" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Day of Infamy" engine="source" +glibc="2.15" #### Directories #### # Edit with care @@ -115,7 +142,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/dstserver/_default.cfg b/lgsm/config-default/config-lgsm/dstserver/_default.cfg index 645826951..fc054e87d 100644 --- a/lgsm/config-default/config-lgsm/dstserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dstserver/_default.cfg @@ -29,6 +29,9 @@ parms="-persistent_storage_root ${persistentstorageroot} -conf_dir ${confdir} -c ## 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" postdays="7" @@ -64,6 +67,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -85,23 +92,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="343050" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Don't Starve Together" engine="dontstarve" +glibc="2.15" ## Service Name | https://docs.linuxgsm.com/features/multiple-game-servers servicename="dst-server-${shard}" @@ -123,7 +151,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" servercfgdefault="server.ini" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/dysserver/_default.cfg b/lgsm/config-default/config-lgsm/dysserver/_default.cfg index 84342b6fa..717c17078 100644 --- a/lgsm/config-default/config-lgsm/dysserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dysserver/_default.cfg @@ -31,6 +31,9 @@ parms="-game "${serverfiles}/dystopia" -strictportbind -ip ${ip} -port ${port} + ## 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" postdays="7" @@ -66,6 +69,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -87,23 +94,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="17585" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Dystopia" engine="source" +glibc="2.15" #### Directories #### # Edit with care @@ -118,7 +146,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg index 10908f448..4d2e15d7c 100644 --- a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg @@ -18,6 +18,9 @@ fn_parms(){ ## 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" postdays="7" @@ -53,6 +56,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + # Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram telegramalert="off" telegramtoken="accesstoken" @@ -70,23 +77,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="739590" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta 7.3.0" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Eco" engine="unity3d" +glibc="null" #### Directories #### # Edit with care @@ -101,7 +129,7 @@ servercfgdir="${systemdir}/Configs" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/emserver/_default.cfg b/lgsm/config-default/config-lgsm/emserver/_default.cfg index 3188dcf47..a33e7f71a 100644 --- a/lgsm/config-default/config-lgsm/emserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/emserver/_default.cfg @@ -31,6 +31,9 @@ parms="-game empires -strictportbind -ip ${ip} -port ${port} +clientport ${clien ## 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" postdays="7" @@ -66,6 +69,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -87,23 +94,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="460040" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Empires Mod" engine="source" +glibc="2.15" #### Directories #### # Edit with care @@ -118,7 +146,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/etlserver/_default.cfg b/lgsm/config-default/config-lgsm/etlserver/_default.cfg index 86e71c8bb..6c6a50734 100644 --- a/lgsm/config-default/config-lgsm/etlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/etlserver/_default.cfg @@ -10,7 +10,7 @@ ## 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}" +parms="+set net_strict 1 +set fs_homepath ${serverfiles} +exec ${servercfg}" } #### LinuxGSM Settings #### @@ -18,6 +18,9 @@ fn_parms(){ ## 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" postdays="7" @@ -53,6 +56,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -71,15 +78,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" + ## LinuxGSM Server Details # Do not edit gamename="ET: Legacy" engine="idtech3" +glibc="2.7" #### Directories #### # Edit with care @@ -94,7 +122,7 @@ servercfgdir="${systemdir}/etmain" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg index 4117dfbe5..da4f64da8 100644 --- a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg @@ -26,6 +26,9 @@ parms="--start-server ${serverfiles}/save1.zip --server-settings ${servercfgfull ## 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" postdays="7" @@ -61,6 +64,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -82,15 +89,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" + ## LinuxGSM Server Details # Do not edit gamename="Factorio" engine="factorio" +glibc="2.18" #### Directories #### # Edit with care @@ -105,7 +133,7 @@ servercfgdir="${serverfiles}/data" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories gamelogdir="${serverfiles}" diff --git a/lgsm/config-default/config-lgsm/fofserver/_default.cfg b/lgsm/config-default/config-lgsm/fofserver/_default.cfg index 18d0081f0..d78916c6f 100644 --- a/lgsm/config-default/config-lgsm/fofserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/fofserver/_default.cfg @@ -14,7 +14,7 @@ port="27015" clientport="27005" sourcetvport="27020" defaultmap="fof_depot" -maxplayers="16" +maxplayers="20" ## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters fn_parms(){ @@ -26,6 +26,9 @@ parms="-game fof -strictportbind -ip ${ip} -port ${port} +clientport ${clientpor ## 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" postdays="7" @@ -61,6 +64,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -82,23 +89,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="295230" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Fistful of Frags" engine="source" +glibc="2.15" #### Directories #### # Edit with care @@ -113,7 +141,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/gesserver/_default.cfg b/lgsm/config-default/config-lgsm/gesserver/_default.cfg index 6f810f409..08adc02aa 100644 --- a/lgsm/config-default/config-lgsm/gesserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/gesserver/_default.cfg @@ -26,6 +26,9 @@ parms="-game gesource -strictportbind -ip ${ip} -port ${port} +clientport ${clie ## 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" postdays="7" @@ -61,6 +64,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -82,23 +89,45 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="310" # Source 2007 SDK -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="GoldenEye: Source" engine="source" +glibc="2.15" + #### Directories #### # Edit with care @@ -112,7 +141,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/gmodserver/_default.cfg b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg index 00732dd30..06c92867d 100644 --- a/lgsm/config-default/config-lgsm/gmodserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg @@ -42,6 +42,9 @@ parms="-game garrysmod -strictportbind -ip ${ip} -port ${port} -tickrate ${tickr ## 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" postdays="7" @@ -77,6 +80,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -98,23 +105,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="5" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="4020" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Garry's Mod" engine="source" +glibc="2.15" #### Directories #### # Edit with care @@ -130,7 +158,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg index c5796eab5..c710cbb62 100644 --- a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg @@ -26,6 +26,9 @@ parms="-game hl2mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientp ## 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" postdays="7" @@ -61,6 +64,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -82,23 +89,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="232370" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Half Life 2: Deathmatch" engine="source" +glibc="2.3.6" #### Directories #### # Edit with care @@ -113,7 +141,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/hldmserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg index 41308db1f..eddf8143b 100644 --- a/lgsm/config-default/config-lgsm/hldmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg @@ -25,6 +25,9 @@ parms="-game valve -strictportbind +ip ${ip} -port ${port} +clientport ${clientp ## 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" postdays="7" @@ -60,6 +63,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -81,23 +88,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="90" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="9" ## LinuxGSM Server Details # Do not edit gamename="Half Life: Deathmatch" engine="goldsource" +glibc="2.3.4" #### Directories #### # Edit with care @@ -112,7 +140,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg index 91ae5546b..77b164052 100644 --- a/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg @@ -26,6 +26,9 @@ parms="-game hl1mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientp ## 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" postdays="7" @@ -61,6 +64,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -82,23 +89,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="255470" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Half-Life Deathmatch: Source" engine="source" +glibc="2.3.6" #### Directories #### # Edit with care @@ -113,7 +141,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/hwserver/_default.cfg b/lgsm/config-default/config-lgsm/hwserver/_default.cfg index 19fadc681..70e55e792 100644 --- a/lgsm/config-default/config-lgsm/hwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hwserver/_default.cfg @@ -25,8 +25,6 @@ admins="" ## Advanced Server Start Settings # Rollback server state (remove after start command) loadsave="" -# Use unstable 64 bit server executable (O/1) -x64mode="0" ## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters # Edit with care | http://hurtworld.wikia.com/wiki/Hosting_A_Server @@ -39,6 +37,9 @@ parms="-batchmode -nographics -exec \"host ${port} ${defaultmap} ${loadsave};que ## 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" postdays="7" @@ -74,6 +75,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -95,23 +100,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="405100" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Hurtworld" engine="unity3d" +glibc="2.15" #### Directories #### # Edit with care @@ -119,14 +145,10 @@ engine="unity3d" ## Server Specific Directories systemdir="${serverfiles}" executabledir="${serverfiles}" -if [ "${x64mode}" == "1" ]; then - executable="./Hurtworld.x86_64" -else - executable="./Hurtworld.x86" -fi +executable=$([ "$(uname -m)" == "x86_64" ] && echo -e "./Hurtworld.x86_64" || echo -e "./Hurtworld.x86") ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" @@ -143,4 +165,3 @@ postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" gamelogdate="${gamelogdir}/${servicename}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - diff --git a/lgsm/config-default/config-lgsm/insserver/_default.cfg b/lgsm/config-default/config-lgsm/insserver/_default.cfg index 7adb4b718..246b00584 100644 --- a/lgsm/config-default/config-lgsm/insserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/insserver/_default.cfg @@ -13,10 +13,9 @@ ip="0.0.0.0" port="27015" clientport="27005" sourcetvport="27020" -defaultmap="ministry" -maxplayers="16" +defaultmap="embassy_coop checkpoint" +maxplayers="32" tickrate="64" -workshop="0" ## Optional: Game Server Login Token # GSLT can be used for running a public server. @@ -25,7 +24,7 @@ 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} +sv_workshop_enabled ${workshop} -norestart" +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" } #### LinuxGSM Settings #### @@ -33,6 +32,9 @@ parms="-game insurgency -strictportbind -ip ${ip} -port ${port} +clientport ${cl ## 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" postdays="7" @@ -68,6 +70,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -89,23 +95,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="237410" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Insurgency" engine="source" +glibc="2.15" #### Directories #### # Edit with care @@ -120,7 +147,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/inssserver/_default.cfg b/lgsm/config-default/config-lgsm/inssserver/_default.cfg index 1ba1df679..cc54b8d3f 100644 --- a/lgsm/config-default/config-lgsm/inssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/inssserver/_default.cfg @@ -34,6 +34,9 @@ fn_parms(){ ## 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" postdays="7" @@ -69,6 +72,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -90,23 +97,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="581330" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Insurgency: Sandstorm" engine="unreal4" +glibc="2.17" #### Directories #### # Edit with care diff --git a/lgsm/config-default/config-lgsm/iosserver/_default.cfg b/lgsm/config-default/config-lgsm/iosserver/_default.cfg index f42987541..0beecbdab 100644 --- a/lgsm/config-default/config-lgsm/iosserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/iosserver/_default.cfg @@ -26,6 +26,9 @@ parms="-game iosoccer -strictportbind -ip ${ip} -port ${port} +clientport ${clie ## 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" postdays="7" @@ -61,6 +64,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -82,23 +89,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="673990" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="IOSoccer" engine="source" +glibc="2.3.6" #### Directories #### # Edit with care @@ -113,7 +141,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/jc2server/_default.cfg b/lgsm/config-default/config-lgsm/jc2server/_default.cfg index cb67c18d3..52248161c 100644 --- a/lgsm/config-default/config-lgsm/jc2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc2server/_default.cfg @@ -18,6 +18,9 @@ parms="" ## 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" postdays="7" @@ -53,6 +56,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -74,23 +81,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="261140" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Just Cause 2" engine="avalanche2.0" +glibc="2.13" #### Directories #### # Edit with care @@ -105,7 +133,7 @@ servercfgdir="${serverfiles}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/jc3server/_default.cfg b/lgsm/config-default/config-lgsm/jc3server/_default.cfg index ced884359..b99603c03 100644 --- a/lgsm/config-default/config-lgsm/jc3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc3server/_default.cfg @@ -18,6 +18,9 @@ parms="" ## 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" postdays="7" @@ -53,6 +56,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -74,23 +81,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="619960" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Just Cause 3" engine="avalanche3.0" +glibc="2.17" #### Directories #### # Edit with care @@ -105,7 +133,7 @@ servercfgdir="${serverfiles}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/kf2server/_default.cfg b/lgsm/config-default/config-lgsm/kf2server/_default.cfg index c6db77168..da31e737a 100644 --- a/lgsm/config-default/config-lgsm/kf2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/kf2server/_default.cfg @@ -24,6 +24,9 @@ parms="\"${defaultmap}?Game=${gamemode}?ConfigSubDir=${servicename} -QueryPort=$ ## 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" postdays="7" @@ -59,6 +62,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -80,23 +87,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="232130" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Killing Floor 2" engine="unreal3" +glibc="2.3.2" #### Directories #### # Edit with care @@ -125,4 +153,3 @@ postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - diff --git a/lgsm/config-default/config-lgsm/kfserver/_default.cfg b/lgsm/config-default/config-lgsm/kfserver/_default.cfg index 25b828a1b..82d67bc62 100644 --- a/lgsm/config-default/config-lgsm/kfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/kfserver/_default.cfg @@ -30,6 +30,9 @@ parms="server ${defaultmap}?game=KFmod.KFGameType?VACSecured=true -nohomedir ini ## 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" postdays="7" @@ -65,6 +68,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -86,23 +93,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="215360" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Killing Floor" engine="unreal2" +glibc="2.4" #### Directories #### # Edit with care @@ -119,7 +147,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" compressedmapsdir="${rootdir}/Maps-Compressed" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/l4d2server/_default.cfg b/lgsm/config-default/config-lgsm/l4d2server/_default.cfg index 9bd1b8bac..2250b7393 100644 --- a/lgsm/config-default/config-lgsm/l4d2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/l4d2server/_default.cfg @@ -25,6 +25,9 @@ parms="-game left4dead2 -strictportbind -ip ${ip} -port ${port} +clientport ${cl ## 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" postdays="7" @@ -60,6 +63,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -81,23 +88,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="222860" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Left 4 Dead 2" engine="source" +glibc="2.3.6" #### Directories #### # Edit with care @@ -112,7 +140,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/l4dserver/_default.cfg b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg index d4003b91e..33ff44c30 100644 --- a/lgsm/config-default/config-lgsm/l4dserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg @@ -25,6 +25,9 @@ parms="-game left4dead -strictportbind -ip ${ip} -port ${port} +clientport ${cli ## 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" postdays="7" @@ -60,6 +63,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -81,23 +88,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="222840" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Left 4 Dead" engine="source" +glibc="2.3.6" #### Directories #### # Edit with care @@ -112,7 +140,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/mcserver/_default.cfg b/lgsm/config-default/config-lgsm/mcserver/_default.cfg index 5d904a61b..663c141a7 100644 --- a/lgsm/config-default/config-lgsm/mcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcserver/_default.cfg @@ -20,6 +20,9 @@ parms="nogui" ## 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" postdays="7" @@ -55,6 +58,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -76,15 +83,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="5" + ## LinuxGSM Server Details # Do not edit gamename="Minecraft" engine="lwjgl2" +glibc="null" #### Directories #### # Edit with care @@ -99,7 +127,7 @@ servercfgdir="${serverfiles}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/mhserver/_default.cfg b/lgsm/config-default/config-lgsm/mhserver/_default.cfg new file mode 100644 index 000000000..f3846d238 --- /dev/null +++ b/lgsm/config-default/config-lgsm/mhserver/_default.cfg @@ -0,0 +1,155 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT 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 + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="7777" +beaconport="15000" +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}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# 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" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# 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. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="629800" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" + +## LinuxGSM Server Details +# Do not edit +gamename="MORDHAU" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/Mordhau" +executabledir="${systemdir}/Binaries/Linux" +executable="./MordhauServer-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" +gamelogdir="${systemdir}/Saved/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg new file mode 100644 index 000000000..4ee5487e7 --- /dev/null +++ b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg @@ -0,0 +1,144 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT 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 + +#### Server Settings #### + +## Server Start Settings | 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}" +} + +#### LinuxGSM Settings #### + +## 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" +postdays="7" +posttarget="https://hastebin.com" + +# 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="" + +# 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" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# 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. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +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" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" + +## LinuxGSM Server Details +# Do not edit +gamename="Medal of Honor: Allied Assault" +engine="idtech3" +glibc="2.3" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/main" +executabledir="${serverfiles}" +executable="./mohaa_lnxded" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${serverfiles}" +servercfgfullpath="${serverfiles}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg index 459c2a45e..5dc5dbbcc 100644 --- a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg @@ -19,6 +19,9 @@ parms="" ## 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" postdays="7" @@ -54,6 +57,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -72,15 +79,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="4" + ## LinuxGSM Server Details # Do not edit gamename="Multi Theft Auto" engine="renderware" +glibc="2.7" #### Directories #### # Edit with care @@ -95,7 +123,7 @@ servercfgdir="${systemdir}/mods/deathmatch" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/mumbleserver/_default.cfg b/lgsm/config-default/config-lgsm/mumbleserver/_default.cfg index c151ff914..4c6190596 100644 --- a/lgsm/config-default/config-lgsm/mumbleserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mumbleserver/_default.cfg @@ -19,6 +19,9 @@ parms="-fg -ini ${servercfgfullpath}" ## 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" postdays="7" @@ -54,6 +57,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -75,14 +82,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" + ## LinuxGSM Server Details # Do not edit gamename="Mumble" +engine="null" +glibc="null" #### Directories #### # Edit with care @@ -97,7 +126,7 @@ servercfgdir="${serverfiles}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/ndserver/_default.cfg b/lgsm/config-default/config-lgsm/ndserver/_default.cfg index 192bac7e8..4f54b6318 100644 --- a/lgsm/config-default/config-lgsm/ndserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ndserver/_default.cfg @@ -26,6 +26,9 @@ parms="-game nucleardawn -strictportbind -ip ${ip} -port ${port} +clientport ${c ## 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" postdays="7" @@ -61,6 +64,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -82,23 +89,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="111710" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Nuclear Dawn" engine="source" +glibc="2.3.6" #### Directories #### # Edit with care @@ -113,7 +141,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg index 9de8fd81e..57869bc3e 100644 --- a/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg @@ -31,6 +31,9 @@ parms="-game nmrih -strictportbind -ip ${ip} -port ${port} +clientport ${clientp ## 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" postdays="7" @@ -66,6 +69,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -87,23 +94,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="317670" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="No More Room in Hell" engine="source" +glibc="2.15" #### Directories #### # Edit with care @@ -118,7 +146,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg index 7398c3cb9..7e6bca42a 100644 --- a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg @@ -33,6 +33,9 @@ parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ## 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" postdays="7" @@ -68,6 +71,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -89,23 +96,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="313900" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="6" ## LinuxGSM Server Details # Do not edit gamename="NS2: Combat" engine="spark" +glibc="2.15" #### Directories #### # Edit with care @@ -119,7 +147,7 @@ servercfgfullpath="${servercfgdir}" modstoragedir="${servercfgdir}/Workshop" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/ns2server/_default.cfg b/lgsm/config-default/config-lgsm/ns2server/_default.cfg index 3786e558c..41e52d53d 100644 --- a/lgsm/config-default/config-lgsm/ns2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2server/_default.cfg @@ -37,6 +37,9 @@ parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ## 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" postdays="7" @@ -72,6 +75,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -93,23 +100,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="4940" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="6" ## LinuxGSM Server Details # Do not edit gamename="Natural Selection 2" engine="spark" +glibc="2.17" #### Directories #### # Edit with care @@ -123,7 +151,7 @@ servercfgfullpath="${servercfgdir}" modstoragedir="${servercfgdir}/Workshop" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/nsserver/_default.cfg b/lgsm/config-default/config-lgsm/nsserver/_default.cfg index 25c22e9dd..59e61097d 100644 --- a/lgsm/config-default/config-lgsm/nsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/nsserver/_default.cfg @@ -25,6 +25,9 @@ parms="-game ns -strictportbind +ip ${ip} -port ${port} +clientport ${clientport ## 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" postdays="7" @@ -60,6 +63,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -81,24 +88,45 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="90" appidmod="cstrike" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="9" ## LinuxGSM Server Details # Do not edit gamename="Natural Selection" engine="goldsource" +glibc="2.3.4" #### Directories #### # Edit with care @@ -113,7 +141,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/opforserver/_default.cfg b/lgsm/config-default/config-lgsm/opforserver/_default.cfg index b7f449e28..f5cf34813 100644 --- a/lgsm/config-default/config-lgsm/opforserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/opforserver/_default.cfg @@ -25,6 +25,9 @@ parms="-game gearbox -strictportbind +ip ${ip} -port ${port} +clientport ${clien ## 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" postdays="7" @@ -60,6 +63,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -81,24 +88,45 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="90" appidmod="gearbox" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="9" ## LinuxGSM Server Details # Do not edit gamename="Half-Life: Opposing Force" engine="goldsource" +glibc="2.3.4" #### Directories #### # Edit with care @@ -113,7 +141,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/pcserver/_default.cfg b/lgsm/config-default/config-lgsm/pcserver/_default.cfg index 2dd4f0514..ef1fb6925 100644 --- a/lgsm/config-default/config-lgsm/pcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pcserver/_default.cfg @@ -18,6 +18,9 @@ parms="--config ${servercfg}" ## 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" postdays="7" @@ -53,6 +56,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -74,23 +81,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="332670" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Project Cars" engine="madness" +glibc="2.4" #### Directories #### # Edit with care @@ -105,7 +133,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg b/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg index b331cc134..ad692c635 100644 --- a/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg @@ -17,11 +17,11 @@ queryport="10037" #servername="LinuxGSM Server" # If your server is not meeting the minimal server requirement, do not host the server for 80 players, decrease that number. maxplayers="40" -numreservedslots="2" +reservedslots="2" ## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters fn_parms(){ -parms="MULTIHOME=${ip}?RANDOM=${randommap}?Port=${port}?QueryPort=${queryport}?MaxPlayers=${maxplayers}?NumReservedSlots=${numreservedslots}" +parms="MULTIHOME=${ip}?RANDOM=${randommap}?Port=${port}?QueryPort=${queryport}?MaxPlayers=${maxplayers}?NumReservedSlots=${reservedslots}" } #### LinuxGSM Settings #### @@ -29,6 +29,9 @@ parms="MULTIHOME=${ip}?RANDOM=${randommap}?Port=${port}?QueryPort=${queryport}?M ## 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" postdays="7" @@ -64,6 +67,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -85,23 +92,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="746200" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="pstbsserver" engine="unreal4" +glibc="2.17" #### Directories #### # Edit with care diff --git a/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg index b75b07348..cdfc1b20f 100644 --- a/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg @@ -26,6 +26,9 @@ parms="-game pvkii -strictportbind -ip ${ip} -port ${port} +clientport ${clientp ## 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" postdays="7" @@ -61,6 +64,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -82,23 +89,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="17575" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Pirates, Vikings, and Knights II" engine="source" +glibc="2.15" #### Directories #### # Edit with care @@ -113,7 +141,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/pzserver/_default.cfg b/lgsm/config-default/config-lgsm/pzserver/_default.cfg index 179c7dd34..1b5bc2296 100644 --- a/lgsm/config-default/config-lgsm/pzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pzserver/_default.cfg @@ -21,6 +21,9 @@ parms="-ip ${ip} -adminpassword \"${adminpassword}\" -servername ${servicename}" ## 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" postdays="7" @@ -56,6 +59,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -77,23 +84,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="380870" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Project Zomboid" engine="projectzomboid" +glibc="2.15" #### Directories #### # Edit with care @@ -108,7 +136,7 @@ servercfgdir="${HOME}/Zomboid/Server" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/q2server/_default.cfg b/lgsm/config-default/config-lgsm/q2server/_default.cfg index 6eac2ebd8..42525ec9b 100644 --- a/lgsm/config-default/config-lgsm/q2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/q2server/_default.cfg @@ -23,6 +23,9 @@ parms="+set dedicated 1 +set ip ${ip} +set port ${port} +exec ${servercfg} +set ## 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" postdays="7" @@ -58,6 +61,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -76,15 +83,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" + ## LinuxGSM Server Details # Do not edit gamename="Quake 2" engine="idtech2" +glibc="null" #### Directories #### # Edit with care @@ -99,7 +127,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/q3server/_default.cfg b/lgsm/config-default/config-lgsm/q3server/_default.cfg index 80b1b464d..105a66895 100644 --- a/lgsm/config-default/config-lgsm/q3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/q3server/_default.cfg @@ -15,7 +15,7 @@ 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 1 +set com_hunkMegs 32 +set net_ip ${ip} +set net_port ${port} +exec ${servercfg} +map ${defaultmap}" +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}" } #### LinuxGSM Settings #### @@ -23,6 +23,9 @@ parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 1 +se ## 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" postdays="7" @@ -58,6 +61,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -76,15 +83,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" + ## LinuxGSM Server Details # Do not edit gamename="Quake 3: Arena" engine="idtech3" +glibc="2.1" #### Directories #### # Edit with care @@ -99,7 +127,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/qlserver/_default.cfg b/lgsm/config-default/config-lgsm/qlserver/_default.cfg index 0c8ffa81b..bf144b578 100644 --- a/lgsm/config-default/config-lgsm/qlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/qlserver/_default.cfg @@ -8,12 +8,9 @@ #### Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters -arch="x64" # x64 or x86 - ## 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/ +# Console Commands : http://www.regurge.at/ql fn_parms(){ parms="+exec ${servercfg}" } @@ -23,6 +20,9 @@ parms="+exec ${servercfg}" ## 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" postdays="7" @@ -58,6 +58,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -79,23 +83,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="349090" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Quake Live" engine="idtech3_ql" +glibc="2.15" #### Directories #### # Edit with care @@ -103,14 +128,14 @@ engine="idtech3_ql" ## Server Specific Directories systemdir="${serverfiles}" executabledir="${serverfiles}" -executable=$([ "${arch}" == 'x64' ] && echo "./run_server_x64.sh" || echo "./run_server_x86.sh") +executable=$([ "$(uname -m)" == "x86_64" ] && echo -e "./run_server_x64.sh" || echo -e "./run_server_x86.sh") servercfg="${servicename}.cfg" servercfgdefault="server.cfg" servercfgdir="${serverfiles}/baseq3" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/qwserver/_default.cfg b/lgsm/config-default/config-lgsm/qwserver/_default.cfg index 07ed79cf6..5069e4818 100644 --- a/lgsm/config-default/config-lgsm/qwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/qwserver/_default.cfg @@ -22,6 +22,9 @@ parms="-port ${port} -game ktx +exec ${servercfg}" ## 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" postdays="7" @@ -57,6 +60,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -75,15 +82,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" + ## LinuxGSM Server Details # Do not edit gamename="QuakeWorld" engine="quake" +glibc="2.17" #### Directories #### # Edit with care @@ -98,7 +126,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg index 51c34163b..67e810d5b 100644 --- a/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg @@ -25,6 +25,9 @@ parms="-game ricochet -strictportbind +ip ${ip} -port ${port} +clientport ${clie ## 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" postdays="7" @@ -60,6 +63,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -81,24 +88,45 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="90" appidmod="ricochet" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="9" ## LinuxGSM Server Details # Do not edit gamename="Ricochet" engine="goldsource" +glibcr="2.3.4" #### Directories #### # Edit with care @@ -113,7 +141,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/roserver/_default.cfg b/lgsm/config-default/config-lgsm/roserver/_default.cfg index 8ac336381..d378dc455 100644 --- a/lgsm/config-default/config-lgsm/roserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/roserver/_default.cfg @@ -26,6 +26,9 @@ parms="server ${defaultmap}?game=ROGame.ROTeamGame?VACSecured=true -nohomedir in ## 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" postdays="7" @@ -61,6 +64,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -82,23 +89,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="223250" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Red Orchestra: Ostfront 41-45" engine="unreal2" +glibc="2.4" #### Directories #### # Edit with care @@ -115,7 +143,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" compressedmapsdir="${rootdir}/Maps-Compressed" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg b/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg index a863c5425..a70042e49 100644 --- a/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg @@ -23,6 +23,9 @@ parms="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 1 +se ## 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" postdays="7" @@ -58,6 +61,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -76,15 +83,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" + ## LinuxGSM Server Details # Do not edit gamename="Return to Castle Wolfenstein" engine="ioquake3" +glibc="2.1" #### Directories #### # Edit with care @@ -99,7 +127,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/rustserver/_default.cfg b/lgsm/config-default/config-lgsm/rustserver/_default.cfg index df590c2f3..e643ef8a4 100644 --- a/lgsm/config-default/config-lgsm/rustserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rustserver/_default.cfg @@ -50,6 +50,9 @@ parms="-batchmode +server.ip ${ip} +server.port ${port} +server.tickrate ${tickr ## 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" postdays="7" @@ -85,6 +88,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -106,23 +113,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="258550" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Rust" engine="unity3d" +glibc="2.15" #### Directories #### # Edit with care @@ -138,7 +166,7 @@ servercfgdir="${serveridentitydir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/rwserver/_default.cfg b/lgsm/config-default/config-lgsm/rwserver/_default.cfg index ace8d23ae..2ab86085b 100644 --- a/lgsm/config-default/config-lgsm/rwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rwserver/_default.cfg @@ -21,6 +21,9 @@ parms="" ## 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" postdays="7" @@ -56,6 +59,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -77,23 +84,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="339010" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Rising World" engine="risingworld" +glibc="null" #### Directories #### # Edit with care @@ -108,7 +136,7 @@ servercfgdir="${serverfiles}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/sampserver/_default.cfg b/lgsm/config-default/config-lgsm/sampserver/_default.cfg index 5302a842b..43f0d3cba 100644 --- a/lgsm/config-default/config-lgsm/sampserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sampserver/_default.cfg @@ -22,6 +22,9 @@ parms="" ## 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" postdays="7" @@ -57,6 +60,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -75,15 +82,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" + ## LinuxGSM Server Details # Do not edit gamename="San Andreas Multiplayer" engine="renderware" +glibc="2.3" #### Directories #### # Edit with care @@ -97,7 +125,7 @@ servercfgdir="${systemdir}/samp03" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg index 72e55c0a4..8278af21d 100644 --- a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg @@ -26,6 +26,9 @@ parms="Port=${port}?QueryPort=${queryport} -startup_map ${defaultmap} -server_na ## 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" postdays="7" @@ -61,6 +64,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -79,23 +86,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="974130" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="StickyBots" engine="unreal4" +glibc="2.17" #### Directories #### # Edit with care @@ -110,7 +138,7 @@ servercfgdir="${systemdir}/blank1/Saved/Config/LinuxServer" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" @@ -124,4 +152,4 @@ postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" \ No newline at end of file +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/sbserver/_default.cfg b/lgsm/config-default/config-lgsm/sbserver/_default.cfg index 2d76ce0b3..09de95570 100644 --- a/lgsm/config-default/config-lgsm/sbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sbserver/_default.cfg @@ -25,6 +25,9 @@ parms="" ## 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" postdays="7" @@ -60,6 +63,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -81,23 +88,43 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="211820" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +steammaster="flase" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Starbound" engine="starbound" +glibc="2.17" #### Directories #### # Edit with care @@ -112,7 +139,7 @@ servercfgdir="${serverfiles}/storage" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg index 6a9b6ab79..5043bcac3 100644 --- a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg @@ -21,6 +21,9 @@ parms="-logfile ${gamelogdir}/output_log__$(date +%Y-%m-%d__%H-%M-%S).txt -quit ## 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" postdays="7" @@ -56,6 +59,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -77,23 +84,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="294420" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# teamspeak 3 +stopmode="8" ## LinuxGSM Server Details # Do not edit gamename="7 Days To Die" engine="unity3d" +glibc="2.15" #### Directories #### # Edit with care @@ -101,11 +129,7 @@ engine="unity3d" ## Server Specific Directories systemdir="${serverfiles}" executabledir="${serverfiles}" -if [ "$(uname -m)" == "x86_64" ]; then - executable="./7DaysToDieServer.x86_64" -else - executable="./7DaysToDieServer.x86" -fi +executable=$([ "$(uname -m)" == "x86_64" ] && echo -e "./7DaysToDieServer.x86_64" || echo -e "./7DaysToDieServer.x86") servercfgdefault="serverconfig.xml" servercfgdirdefault="${serverfiles}" servercfgfullpathdefault="${servercfgdirdefault}/${servercfgdefault}" diff --git a/lgsm/config-default/config-lgsm/sfcserver/_default.cfg b/lgsm/config-default/config-lgsm/sfcserver/_default.cfg new file mode 100644 index 000000000..aafdc7be8 --- /dev/null +++ b/lgsm/config-default/config-lgsm/sfcserver/_default.cfg @@ -0,0 +1,158 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT 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 + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +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}" +} + +#### LinuxGSM Settings #### + +## 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" +postdays="7" +posttarget="https://hastebin.com" + +# 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="" + +# 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" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# 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. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="244310" # Source 2013 SDK +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" + +## LinuxGSM Server Details +# Do not edit +gamename="SourceForts Classic" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/sfclassic" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/sof2server/_default.cfg b/lgsm/config-default/config-lgsm/sof2server/_default.cfg new file mode 100644 index 000000000..a1dcea4d7 --- /dev/null +++ b/lgsm/config-default/config-lgsm/sof2server/_default.cfg @@ -0,0 +1,144 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT 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 + +#### Server Settings #### + +## Server Start Settings | 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}" +} + +#### LinuxGSM Settings #### + +## 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" +postdays="7" +posttarget="https://hastebin.com" + +# 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="" + +# 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" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# 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. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +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" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" + +## LinuxGSM Server Details +# Do not edit +gamename="Soldier Of Fortune 2: Gold Edition" +engine="idtech3" +glibc="2.1" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/main" +executabledir="${serverfiles}" +executable="./sof2ded" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/solserver/_default.cfg b/lgsm/config-default/config-lgsm/solserver/_default.cfg new file mode 100644 index 000000000..5cc80f3df --- /dev/null +++ b/lgsm/config-default/config-lgsm/solserver/_default.cfg @@ -0,0 +1,144 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT 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 + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="23073" +maxplayers="32" +maplist="mapslist.txt" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-b ${ip} -p ${port} -l ${maxplayers} -m ${maplist} -c ${servercfg}" +} + +#### LinuxGSM Settings #### + +## 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" +postdays="7" +posttarget="https://hastebin.com" + +# 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="" + +# 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" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# 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. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +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" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" + +## LinuxGSM Server Details +# Do not edit +gamename="Soldat" +engine="soldat" +glibc="2.1" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./soldatserver" +servercfg="soldat.ini" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/squadserver/_default.cfg b/lgsm/config-default/config-lgsm/squadserver/_default.cfg index e947bb462..97991d083 100644 --- a/lgsm/config-default/config-lgsm/squadserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/squadserver/_default.cfg @@ -23,6 +23,9 @@ parms="MULTIHOME=${ip} RANDOM=${randommap} Port=${port} QueryPort=${queryport}" ## 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" postdays="7" @@ -58,6 +61,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -79,23 +86,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="403240" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Squad" engine="unreal4" +glibc="2.17" #### Directories #### # Edit with care @@ -103,7 +131,7 @@ engine="unreal4" ## Server Specific Directories systemdir="${serverfiles}/Squad" executabledir="${serverfiles}" -executable="./SquadServer.sh" +executable="./SquadGameServer.sh" servercfg="${servicename}.cfg" servercfgdefault="Server.cfg" servercfgdir="${systemdir}/ServerConfig" diff --git a/lgsm/config-default/config-lgsm/ss3server/_default.cfg b/lgsm/config-default/config-lgsm/ss3server/_default.cfg index 563a93c4d..5fe555d86 100644 --- a/lgsm/config-default/config-lgsm/ss3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ss3server/_default.cfg @@ -22,6 +22,9 @@ parms="+ip ${ip} +logfile ${gamelog} +exec ${servercfgfullpath}" ## 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" postdays="7" @@ -57,6 +60,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -78,23 +85,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="41080" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Serious Sam 3: BFE" engine="seriousengine35" +glibc="2.13" #### Directories #### # Edit with care @@ -109,7 +137,7 @@ servercfgdir="${serverfiles}/Content/SeriousSam3/Config" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/stserver/_default.cfg b/lgsm/config-default/config-lgsm/stserver/_default.cfg index 1b4bef940..c295b947d 100644 --- a/lgsm/config-default/config-lgsm/stserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stserver/_default.cfg @@ -28,6 +28,9 @@ parms="-batchmode -nographics -autostart -gameport=${port} -updateport=${querypo ## 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" postdays="7" @@ -63,6 +66,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -84,23 +91,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="600760" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Stationeers" engine="unity3d" +glibc="2.15" #### Directories #### # Edit with care @@ -115,7 +143,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" @@ -130,4 +158,3 @@ postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" - diff --git a/lgsm/config-default/config-lgsm/svenserver/_default.cfg b/lgsm/config-default/config-lgsm/svenserver/_default.cfg index 34a1a70f0..837c2db37 100644 --- a/lgsm/config-default/config-lgsm/svenserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/svenserver/_default.cfg @@ -25,6 +25,9 @@ parms="-game svencoop -strictportbind +ip ${ip} -port ${port} +clientport ${clie ## 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" postdays="7" @@ -60,6 +63,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -81,23 +88,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="276060" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="9" ## LinuxGSM Server Details # Do not edit gamename="Sven Co-op" engine="goldsource" +glibc="2.24" #### Directories #### # Edit with care @@ -112,7 +140,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg index 9dc763f19..238bc71f9 100644 --- a/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg @@ -25,6 +25,9 @@ parms="-config ${servercfgfullpath}" ## 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" postdays="7" @@ -60,6 +63,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -81,23 +88,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="105600" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="7" ## LinuxGSM Server Details # Do not edit gamename="Terraria" engine="terraria" +glibc="2.7" #### Directories #### # Edit with care @@ -112,7 +140,7 @@ servercfgdir="${serverfiles}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/tf2server/_default.cfg b/lgsm/config-default/config-lgsm/tf2server/_default.cfg index 92eaa64b4..606853630 100644 --- a/lgsm/config-default/config-lgsm/tf2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/tf2server/_default.cfg @@ -31,6 +31,9 @@ parms="-game tf -strictportbind -ip ${ip} -port ${port} +clientport ${clientport ## 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" postdays="7" @@ -66,6 +69,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -87,23 +94,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="232250" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Team Fortress 2" engine="source" +glibc="2.15" #### Directories #### # Edit with care @@ -118,7 +146,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/tfcserver/_default.cfg b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg index d31998a0b..cf02a2be3 100644 --- a/lgsm/config-default/config-lgsm/tfcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg @@ -25,6 +25,9 @@ parms="-game tfc -strictportbind _ip ${ip} -port ${port} +clientport ${clientpor ## 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" postdays="7" @@ -60,6 +63,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -81,24 +88,45 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="90" appidmod="tfc" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="9" ## LinuxGSM Server Details # Do not edit gamename="Team Fortress Classic" engine="goldsource" +glibc="2.3.4" #### Directories #### # Edit with care @@ -113,7 +141,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/ts3server/_default.cfg b/lgsm/config-default/config-lgsm/ts3server/_default.cfg index f448c2f09..6f7ab5f5e 100644 --- a/lgsm/config-default/config-lgsm/ts3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ts3server/_default.cfg @@ -14,6 +14,9 @@ ## 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" postdays="7" @@ -49,6 +52,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -70,15 +77,37 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="10" + ## LinuxGSM Server Details # Do not edit gamename="TeamSpeak 3" servername="TeamSpeak 3 Server" +engine="null" +glibc="2.17" #### Directories #### # Edit with care @@ -93,7 +122,7 @@ servercfgdir="${serverfiles}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/tsserver/_default.cfg b/lgsm/config-default/config-lgsm/tsserver/_default.cfg new file mode 100644 index 000000000..3ab453689 --- /dev/null +++ b/lgsm/config-default/config-lgsm/tsserver/_default.cfg @@ -0,0 +1,158 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT 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 + +#### Server Settings #### + +## Server Start Settings | 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} " +} + +#### LinuxGSM Settings #### + +## 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" +postdays="7" +posttarget="https://hastebin.com" + +# 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="" + +# 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" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# 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. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="90" +appidmod="cstrike" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="9" + +## LinuxGSM Server Details +# Do not edit +gamename="The Specialists" +engine="goldsource" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/ts" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/tuserver/_default.cfg b/lgsm/config-default/config-lgsm/tuserver/_default.cfg index 91544d2f1..871847600 100644 --- a/lgsm/config-default/config-lgsm/tuserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tuserver/_default.cfg @@ -28,6 +28,9 @@ parms="-log -MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -TowerServerI ## 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" postdays="7" @@ -63,6 +66,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -84,23 +91,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="439660" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Tower Unite" engine="unreal4" +glibc="2.17" #### Directories #### # Edit with care @@ -115,7 +143,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" servercfgdefault="TowerServer.ini" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/twserver/_default.cfg b/lgsm/config-default/config-lgsm/twserver/_default.cfg index b983e3b21..9381b8a88 100644 --- a/lgsm/config-default/config-lgsm/twserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/twserver/_default.cfg @@ -25,6 +25,9 @@ parms="-f ${servercfg}" ## 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" postdays="7" @@ -60,6 +63,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -81,23 +88,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="380840" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Teeworlds" engine="teeworlds" +glibc="2.14" #### Directories #### # Edit with care @@ -112,7 +140,7 @@ servercfgdir="${serverfiles}/tw" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/untserver/_default.cfg b/lgsm/config-default/config-lgsm/untserver/_default.cfg index 26db0910b..32b468a12 100644 --- a/lgsm/config-default/config-lgsm/untserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/untserver/_default.cfg @@ -14,10 +14,6 @@ port="27015" maxplayers="20" defaultmap="pei" -## SteamCMD Login | https://github.com/GameServerManagers/LinuxGSM/wiki/SteamCMD#steamcmd-login -steamuser="username" -steampass='password' - ## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters # Parameters are changed in game.ini and engine.ini (Location: ${systemdir}/Saved/Config/LinuxServer) @@ -41,6 +37,10 @@ posttarget="https://hastebin.com" discordalert="off" discordwebhook="webhook" +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + # Email Alerts | https://docs.linuxgsm.com/alerts/email emailalert="off" email="email@example.com" @@ -88,23 +88,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid -appid="304930" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +appid="1110390" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Unturned" engine="unity3d" +glibc="2.15" #### Directories #### # Edit with care @@ -112,7 +133,7 @@ engine="unity3d" ## Server Specific Directories systemdir="${serverfiles}" executabledir="${serverfiles}" -executable="./Unturned_Headless.x86" +executable="./Unturned_Headless.x86_64" servercfgdir="${systemdir}/Servers/${servicename}" servercfg="Config.json" servercfgdefault="Config.json" diff --git a/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg index 5f32042df..942f8526e 100644 --- a/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg @@ -22,6 +22,9 @@ parms="server ${defaultmap}?game=XGame.xDeathMatch -nohomedir ini=${servercfg} l ## 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" postdays="7" @@ -57,6 +60,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -75,15 +82,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" + ## LinuxGSM Server Details # Do not edit gamename="Unreal Tournament 2004" engine="unreal2" +glibc="2.4" #### Directories #### # Edit with care @@ -99,7 +127,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" compressedmapsdir="${rootdir}/Maps-Compressed" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/ut3server/_default.cfg b/lgsm/config-default/config-lgsm/ut3server/_default.cfg index 1716e3c0f..ebb9eee7b 100644 --- a/lgsm/config-default/config-lgsm/ut3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut3server/_default.cfg @@ -33,6 +33,9 @@ parms="server ${defaultmap}?Game=${game}?bIsDedicated=${isdedicated}?bIsLanMatch ## 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" postdays="7" @@ -68,6 +71,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -86,15 +93,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" + ## LinuxGSM Server Details # Do not edit gamename="Unreal Tournament 3" engine="unreal3" +glibc="2.3.2" #### Directories #### # Edit with care @@ -109,7 +137,7 @@ servercfgdir="${systemdir}/UTGame/Config/${servicename}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/ut99server/_default.cfg b/lgsm/config-default/config-lgsm/ut99server/_default.cfg index 9942968d1..b87486ecd 100644 --- a/lgsm/config-default/config-lgsm/ut99server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut99server/_default.cfg @@ -22,6 +22,9 @@ parms="server ${defaultmap}.unr ini=${servercfgfullpath}" ## 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" postdays="7" @@ -57,6 +60,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -75,15 +82,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" + ## LinuxGSM Server Details # Do not edit gamename="Unreal Tournament 99" engine="unreal" +glibc="2.1" #### Directories #### # Edit with care @@ -99,7 +127,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" compressedmapsdir="${rootdir}/Maps-Compressed" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/utserver/_default.cfg b/lgsm/config-default/config-lgsm/utserver/_default.cfg index 8f81eb7da..ddce48d22 100644 --- a/lgsm/config-default/config-lgsm/utserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/utserver/_default.cfg @@ -26,6 +26,9 @@ parms="UnrealTournament ${defaultmap}?Game=${gametype}?TimeLimit=${timelimit} -p ## 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" postdays="7" @@ -61,6 +64,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -79,15 +86,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" + ## LinuxGSM Server Details # Do not edit gamename="Unreal Tournament" engine="unreal4" +glibc="2.17" #### Directories #### # Edit with care @@ -101,7 +129,7 @@ servercfgdir="${systemdir}/UnrealTournament/Saved/Config/LinuxServer" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/vsserver/_default.cfg b/lgsm/config-default/config-lgsm/vsserver/_default.cfg index e6e85f0f9..0d8be68fa 100644 --- a/lgsm/config-default/config-lgsm/vsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vsserver/_default.cfg @@ -25,6 +25,9 @@ parms="-game vs -strictportbind +ip ${ip} -port ${port} +clientport ${clientport ## 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" postdays="7" @@ -60,6 +63,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -81,24 +88,45 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="90" appidmod="cstrike" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="9" ## LinuxGSM Server Details # Do not edit gamename="Vampire Slayer" engine="goldsource" +glibc="2.3.4" #### Directories #### # Edit with care @@ -113,7 +141,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/wetserver/_default.cfg b/lgsm/config-default/config-lgsm/wetserver/_default.cfg index 31daa3252..7a2473945 100644 --- a/lgsm/config-default/config-lgsm/wetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wetserver/_default.cfg @@ -18,6 +18,9 @@ fn_parms(){ ## 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" postdays="7" @@ -53,6 +56,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -71,15 +78,36 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" + ## LinuxGSM Server Details # Do not edit gamename="Wolfenstein: Enemy Territory" engine="idtech3" +glibc="2.2.4" #### Directories #### # Edit with care @@ -94,7 +122,7 @@ servercfgdir="${systemdir}/etmain" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/wfserver/_default.cfg b/lgsm/config-default/config-lgsm/wfserver/_default.cfg new file mode 100644 index 000000000..f6d028c2b --- /dev/null +++ b/lgsm/config-default/config-lgsm/wfserver/_default.cfg @@ -0,0 +1,153 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT 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 + +#### Server Settings #### + +## Server Start Settings | 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}" +} + +#### LinuxGSM Settings #### + +## 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" +postdays="7" +posttarget="https://hastebin.com" + +# 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="" + +# 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" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# 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. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +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" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" + +## SteamCMD Settings +# 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" + +## LinuxGSM Server Details +# Do not edit +gamename="Warfork" +engine="qfusion" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/Warfork.app/Contents/Resources" +executabledir="${systemdir}" +executable="./wf_server.x86_64" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/basewf" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg index c57f1f7c0..50e5348c5 100644 --- a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg @@ -20,6 +20,9 @@ fn_parms(){ ## 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" postdays="7" @@ -55,6 +58,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -73,23 +80,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="402370" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="2" ## LinuxGSM Server Details # Do not edit gamename="Wurm Unlimited" engine="wurm" +glibc="2.14" #### Directories #### # Edit with care @@ -104,7 +132,7 @@ servercfgdir="${systemdir}" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/config-default/config-lgsm/zmrserver/_default.cfg b/lgsm/config-default/config-lgsm/zmrserver/_default.cfg new file mode 100644 index 000000000..e3e21369b --- /dev/null +++ b/lgsm/config-default/config-lgsm/zmrserver/_default.cfg @@ -0,0 +1,158 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT 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 + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +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}" +} + +#### LinuxGSM Settings #### + +## 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" +postdays="7" +posttarget="https://hastebin.com" + +# 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="" + +# 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" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# 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. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings +# Server appid +appid="244310" # Source 2013 SDK +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" + +## LinuxGSM Server Details +# Do not edit +gamename="Zombie Master: Reborn" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/zombie_master_reborn" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +alertlog="${lgsmlogdir}/${servicename}-alert.log" +postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/zpsserver/_default.cfg b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg index 9b9c38347..971fe70f3 100644 --- a/lgsm/config-default/config-lgsm/zpsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg @@ -31,6 +31,9 @@ parms="-game zps -strictportbind -ip ${ip} -port ${port} +clientport ${clientpor ## 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" postdays="7" @@ -66,6 +69,10 @@ channeltag="" pushoveralert="off" pushovertoken="accesstoken" +# 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 @@ -87,23 +94,44 @@ stoponbackup="on" consolelogging="on" logdays="7" +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + #### LinuxGSM Advanced Settings #### # ANSI Colors ansi="on" +# Message Display Time +sleeptime="0.5" + ## SteamCMD Settings # Server appid appid="17505" -# Steam App Branch Select -# Allows to opt into the various Steam app branches. Default branch is "". -# Example: "-beta latest_experimental" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" ## LinuxGSM Server Details # Do not edit gamename="Zombie Panic! Source" engine="source" +glibc="2.15" #### Directories #### # Edit with care @@ -118,7 +146,7 @@ servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory -backupdir="${rootdir}/backups" +backupdir="${lgsmdir}/backup" ## Logging Directories logdir="${rootdir}/log" diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 960947995..60c02feff 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -1,3 +1,5 @@ +ahl,ahlserver,Action half-life +ahl2,ahl2server,Action: Source arma3,arma3server,ARMA 3 sdtd,sdtdserver,7 Days to Die ark,arkserver,ARK: Survival Evolved @@ -8,6 +10,7 @@ bmdm,bmdmserver,Black Mesa: Deathmatch bs,bsserver,Blade Symphony bb,bbserver,BrainBread bb2,bb2server,BrainBread 2 +bt,btserver,Barotrauma bt1944,bt1944server,Battalion 1944 cod,codserver,Call of Duty cod2,cod2server,Call of Duty 2 @@ -46,6 +49,8 @@ kf2,kf2server,Killing Floor 2 l4d,l4dserver,Left 4 Dead l4d2,l4d2server,Left 4 Dead 2 mc,mcserver,Minecraft +mh,mhserver,MORDHAU +mohaa,mohaaserver,Medal of Honor: Allied Assault mta,mtaserver,Multi Theft Auto mumble,mumbleserver,Mumble nd,ndserver,Nuclear Dawn @@ -69,6 +74,9 @@ rust,rustserver,Rust rw,rwserver, Rising World samp,sampserver,San Andreas Multiplayer sbots,sbotsserver, StickyBots +sfc,sfcserver,SourceForts Classic +sof2,sof2server,Soldier Of Fortune 2: Gold Edition +sol,solserver,Soldat ss3,ss3server,Serious Sam 3: BFE sb,sbserver,Starbound st,stserver,Stationeers @@ -76,6 +84,7 @@ squad,squadserver,Squad sven,svenserver,Sven Co-op tf2,tf2server,Team Fortress 2 tfc,tfcserver,Team Fortress Classic +ts,tsserver,The Specialists ts3,ts3server,Teamspeak 3 tw,twserver,Teeworlds terraria,terrariaserver,Terraria @@ -86,6 +95,8 @@ ut99,ut99server,Unreal Tournament 99 unt,untserver,Unturned vs,vsserver,Vampire Slayer wet,wetserver,Wolfenstein: Enemy Territory +wf,wfserver,Warfork wurm,wurmserver,Wurm Unlimited etl,etlserver,ET: Legacy +zmr,zmrserver,Zombie Master: Reborn zps,zpsserver,Zombie Panic! Source diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index 508c704a6..8de6b370e 100644 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -10,7 +10,6 @@ local commandaction="Alert" fn_alert_log(){ info_distro.sh info_config.sh - info_glibc.sh info_messages.sh if [ -f "${alertlog}" ]; then rm "${alertlog}" @@ -19,8 +18,8 @@ fn_alert_log(){ { fn_info_message_head fn_info_message_distro - fn_info_message_performance - fn_info_message_disk + 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 @@ -94,10 +93,10 @@ elif [ "${alert}" == "config" ]; then fn_alert_config fi -# Generate alert log +# Generate alert log. fn_alert_log -# Generates the more info link +# Generates the more info link. if [ "${postalert}" == "on" ]&&[ -n "${postalert}" ]; then alertflag=1 command_postdetails.sh @@ -119,7 +118,7 @@ elif [ "${discordalert}" != "on" ]&&[ "${function_selfname}" == "command_test_al fn_script_log_warn "Discord alerts not enabled" elif [ -z "${discordtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then fn_print_error_nl "Discord token not set" - echo " * https://docs.linuxgsm.com/alerts/discord" + echo -e " * https://docs.linuxgsm.com/alerts/discord" fn_script_error "Discord token not set" fi @@ -140,7 +139,7 @@ elif [ "${iftttalert}" != "on" ]&&[ "${function_selfname}" == "command_test_aler fn_script_log_warn "IFTTT alerts not enabled" elif [ -z "${ifttttoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then fn_print_error_nl "IFTTT token not set" - echo " * https://docs.linuxgsm.com/alerts/ifttt" + echo -e " * https://docs.linuxgsm.com/alerts/ifttt" fn_script_error "IFTTT token not set" fi @@ -151,7 +150,7 @@ elif [ "${mailgunalert}" != "on" ]&&[ "${function_selfname}" == "command_test_al fn_script_log_warn "Mailgun alerts not enabled" elif [ -z "${mailguntoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then fn_print_error_nl "Mailgun token not set" - echo " * https://docs.linuxgsm.com/alerts/mailgun" + echo -e " * https://docs.linuxgsm.com/alerts/mailgun" fn_script_error "Mailgun token not set" fi @@ -162,7 +161,7 @@ elif [ "${pushbulletalert}" != "on" ]&&[ "${function_selfname}" == "command_test fn_script_log_warn "Pushbullet alerts not enabled" elif [ -z "${pushbullettoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then fn_print_error_nl "Pushbullet token not set" - echo " * https://docs.linuxgsm.com/alerts/pushbullet" + echo -e " * https://docs.linuxgsm.com/alerts/pushbullet" fn_script_error "Pushbullet token not set" fi @@ -173,7 +172,7 @@ elif [ "${pushoveralert}" != "on" ]&&[ "${function_selfname}" == "command_test_a fn_script_log_warn "Pushover alerts not enabled" elif [ -z "${pushovertoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then fn_print_error_nl "Pushover token not set" - echo " * https://docs.linuxgsm.com/alerts/pushover" + echo -e " * https://docs.linuxgsm.com/alerts/pushover" fn_script_error "Pushover token not set" fi @@ -184,10 +183,21 @@ elif [ "${telegramalert}" != "on" ]&&[ "${function_selfname}" == "command_test_a fn_script_log_warn "Telegram Messages not enabled" elif [ -z "${telegramtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then fn_print_error_nl "Telegram token not set." - echo " * https://docs.linuxgsm.com/alerts/telegram" + echo -e " * https://docs.linuxgsm.com/alerts/telegram" fn_script_error "Telegram token not set." elif [ -z "${telegramchatid}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then fn_print_error_nl "Telegram chat id not set." - echo " * https://docs.linuxgsm.com/alerts/telegram" + 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" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then + fn_print_warn_nl "Slack alerts not enabled" + fn_script_log_warn "Slack alerts not enabled" +elif [ -z "${slacktoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; 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 \ No newline at end of file diff --git a/lgsm/functions/alert_discord.sh b/lgsm/functions/alert_discord.sh index 2ace8935f..0d4b22123 100644 --- a/lgsm/functions/alert_discord.sh +++ b/lgsm/functions/alert_discord.sh @@ -35,7 +35,7 @@ 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 <${alertsubject} ${alertemoji}\n\nMessage\n${alertbody}\n\nGame\n${gamename}\n\nServer name\n${servername}\n\nHostname\n${HOSTNAME}\n\nServer IP\n${extip:-$ip}:${port}\n\nMore info\n${alerturl}", + "text": "${alertemoji} ${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" -sleep 0.5 telegramsend=$(${curlpath} -sSL -H "Content-Type: application/json" -X POST -d """${json}""" "https://api.telegram.org/bot${telegramtoken}/sendMessage" ${curlcustomstring} | grep "error_code") if [ -n "${telegramsend}" ]; then diff --git a/lgsm/functions/check.sh b/lgsm/functions/check.sh index 0a1768884..21e63aca4 100644 --- a/lgsm/functions/check.sh +++ b/lgsm/functions/check.sh @@ -7,8 +7,8 @@ local commandname="CHECK" -# Every command that requires checks just references check.sh -# check.sh selects which checks to run by using arrays +# Every command that requires checks just references check.sh. +# check.sh selects which checks to run by using arrays. if [ "${userinput}" != "install" ]&&[ "${userinput}" != "auto-install" ]&&[ "${userinput}" != "i" ]&&[ "${userinput}" != "ai" ]; then check_root.sh diff --git a/lgsm/functions/check_config.sh b/lgsm/functions/check_config.sh index dff515742..0b352070e 100644 --- a/lgsm/functions/check_config.sh +++ b/lgsm/functions/check_config.sh @@ -10,12 +10,10 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -e "${servercfgfullpath}" ]; then if [ "${shortname}" != "hw" ]&&[ "${shortname}" != "ut3" ]&&[ "${shortname}" != "kf2" ]; then fn_print_dots "" - sleep 0.5 fn_print_warn_nl "Configuration file missing!" - echo "${servercfgfullpath}" + echo -e "${servercfgfullpath}" fn_script_log_warn "Configuration file missing!" fn_script_log_warn "${servercfgfullpath}" - sleep 1 install_config.sh fi fi @@ -23,18 +21,15 @@ fi if [ "${shortname}" == "rust" ]; then if [ -z "${rconpassword}" ]; then fn_print_dots "" - sleep 0.5 fn_print_fail_nl "RCON password is not set!" - echo " * Not setting an RCON password causes issues with ${gamename}" + 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 "" - sleep 0.5 fn_print_warn_nl "Default RCON Password detected!" - echo " * Having ${rconpassword} as a password is not very safe." + echo -e " * Having ${rconpassword} as a password is not very safe." fn_script_log_warn "Default RCON Password detected" - sleep 2 fi fi diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 351c848d3..bbf7686b3 100644 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -9,7 +9,6 @@ local commandname="CHECK" fn_install_mono_repo(){ if [ "${monostatus}" != "0" ]; then fn_print_dots "Adding Mono repository" - sleep 0.5 if [ "${autoinstall}" == "1" ]; then sudo -n true > /dev/null 2>&1 else @@ -37,22 +36,25 @@ fn_install_mono_repo(){ eval ${cmd} else fn_print_warn_nl "Installing Mono repository" - echo "Mono auto install not available for ${distroname}" - echo " Follow instructions on mono site to install the latest version of Mono." - echo " https://www.mono-project.com/download/stable/#download-lin" + 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}" == "9" ]; then + if [ "${distroversion}" == "10" ]; then + cmd="sudo apt 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 update" + eval ${cmd} + elif [ "${distroversion}" == "9" ]; then cmd="sudo apt 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 update" eval ${cmd} elif [ "${distroversion}" == "8" ]; then cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt 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 update" eval ${cmd} else - echo "Mono auto install not available for ${distroname}" - echo " Follow instructions on mono site to install the latest version of Mono." - echo " https://www.mono-project.com/download/stable/#download-lin" + 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 @@ -66,18 +68,18 @@ fn_install_mono_repo(){ cmd="rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos6-stable.repo | tee /etc/yum.repos.d/mono-centos6-stable.repo'" eval ${cmd} else - echo "Mono auto install not available for ${distroname}" - echo " Follow instructions on mono site to install the latest version of Mono." - echo " https://www.mono-project.com/download/stable/#download-lin" + 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 "Mono auto install not available for ${distroname}" - echo " Follow instructions on mono site to install the latest version of Mono." - echo " https://www.mono-project.com/download/stable/#download-lin" + 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 @@ -93,21 +95,20 @@ fn_install_mono_repo(){ fi else fn_print_information_nl "Installing Mono repository" - echo "" + 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 " Follow instructions on mono site to install the latest version of Mono." - echo " https://www.mono-project.com/download/stable/#download-lin" + 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 + # 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 Repo" - sleep 0.5 if [ "${autoinstall}" == "1" ]; then sudo -n true > /dev/null 2>&1 else @@ -122,7 +123,7 @@ fn_install_universe_repo(){ sleep 1 echo -en " \r" cmd="sudo apt-add-repository universe" - eval ${cmd} + eval "${cmd}" if [ $? -eq 0 ]; then fn_print_complete_nl "Installing universe repository completed." fn_script_log_pass "Installing universe repository completed." @@ -133,14 +134,14 @@ fn_install_universe_repo(){ 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 " Please run the following command as a user with sudo access, and re-run the installation" - echo " sudo apt-add-repository universe" + echo -e " Please run the following command as a user with sudo access, and re-run the installation" + echo -e " sudo apt-add-repository universe" fi fi } fn_deps_detector(){ - # Checks if dependency is missing + # Checks if dependency is missing. if [ "${tmuxcheck}" == "1" ]; then # Added for users compiling tmux from source to bypass check. depstatus=0 @@ -154,16 +155,16 @@ fn_deps_detector(){ elif [ "${deptocheck}" == "jq" ]&&[ "${distroversion}" == "6" ]; then jqstatus=1 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 + # #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 + # Mono >= 5.0.0 already installed. depstatus=0 else - # Mono not installed or installed Mono < 5.0.0 + # Mono not installed or installed Mono < 5.0.0. depstatus=1 monostatus=1 fi @@ -176,20 +177,20 @@ fn_deps_detector(){ fi if [ "${depstatus}" == "0" ]; then - # if dependency is found + # If dependency is found. missingdep=0 if [ "${function_selfname}" == "command_install.sh" ]; then echo -e "${green}${deptocheck}${default}" - sleep 0.2 + fn_sleep_time fi else - # if dependency is not found + # If dependency is not found. missingdep=1 if [ "${function_selfname}" == "command_install.sh" ]; then echo -e "${red}${deptocheck}${default}" - sleep 0.2 + fn_sleep_time fi - # Define required dependencies for SteamCMD + # Define required dependencies for SteamCMD. if [ -n "${appid}" ]; then if [ "${deptocheck}" == "glibc.i686" ]||[ "${deptocheck}" == "libstdc++64.i686" ]||[ "${deptocheck}" == "lib32gcc1" ]||[ "${deptocheck}" == "libstdc++6:i386" ]; then steamcmdfail=1 @@ -197,14 +198,14 @@ fn_deps_detector(){ fi fi - # Missing dependencies are added to array_deps_missing + # 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 + # 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 @@ -231,13 +232,13 @@ fn_found_missing_deps(){ fn_print_warning_nl "Missing dependencies: ${red}${array_deps_missing[@]}${default}" fn_script_log_warn "Missing dependencies: ${array_deps_missing[@]}" - sleep 0.5 + fn_sleep_time if [ -n "${monostatus}" ]; then fn_install_mono_repo fi if [ -n "${jqstatus}" ]; then fn_print_warning_nl "jq is not available in the ${distroname} repository" - echo " * https://docs.linuxgsm.com/requirements/jq" + echo -e " * https://docs.linuxgsm.com/requirements/jq" fi if [ "${autoinstall}" == "1" ]; then sudo -n true > /dev/null 2>&1 @@ -267,18 +268,18 @@ fn_found_missing_deps(){ if [ $? != 0 ]; then fn_print_failure_nl "Unable to install dependencies" fn_script_log_fatal "Unable to install dependencies" - echo "" + echo -e "" fn_print_warning_nl "Manually install dependencies." fn_script_log_warn "Manually install dependencies." if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then - echo " sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[@]}" + echo -e " sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[@]}" elif [ -n "$(command -v dnf 2>/dev/null)" ]; then - echo " sudo dnf install ${array_deps_missing[@]}" + echo -e " sudo dnf install ${array_deps_missing[@]}" elif [ -n "$(command -v yum 2>/dev/null)" ]; then - echo " sudo yum install ${array_deps_missing[@]}" + echo -e " sudo yum install ${array_deps_missing[@]}" fi if [ "${steamcmdfail}" ]; then - echo "" + echo -e "" fn_print_failure_nl "Missing dependencies required to run SteamCMD." fn_script_log_fatal "Missing dependencies required to run SteamCMD." core_exit.sh @@ -288,23 +289,23 @@ fn_found_missing_deps(){ fn_script_log_pass "Install dependencies completed" fi else - echo "" + echo -e "" 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." if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then - echo " sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[@]}" + echo -e " sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[@]}" elif [ -n "$(command -v dnf 2>/dev/null)" ]; then - echo " sudo dnf install ${array_deps_missing[@]}" + echo -e " sudo dnf install ${array_deps_missing[@]}" elif [ -n "$(command -v yum 2>/dev/null)" ]; then - echo " sudo yum install ${array_deps_missing[@]}" + echo -e " sudo yum install ${array_deps_missing[@]}" fi if [ "${steamcmdfail}" ]; then - echo "" + echo -e "" fn_print_failure_nl "Missing dependencies required to run SteamCMD." fn_script_log_fatal "Missing dependencies required to run SteamCMD." core_exit.sh fi - echo "" + echo -e "" fi if [ "${function_selfname}" == "command_install.sh" ]; then sleep 5 @@ -318,25 +319,25 @@ fn_found_missing_deps(){ } fn_check_loop(){ - # Loop though required depenencies + # Loop though required depenencies. for deptocheck in "${array_deps_required[@]}" do fn_deps_detector done - # user to be informed of any missing dependencies + # user to be informed of any missing dependencies. fn_found_missing_deps } -# Generate require dependencies for debian based systems +# Generate require dependencies for debian based systems. fn_deps_build_debian(){ - # Generate array of missing deps + # Generate array of missing deps. array_deps_missing=() - ## LinuxGSM requirements - array_deps_required=( curl wget ca-certificates file bsdmainutils util-linux python bzip2 gzip unzip binutils bc jq ) + # LinuxGSM requirements. + array_deps_required=( curl wget ca-certificates file bsdmainutils util-linux python3 tar bzip2 gzip unzip binutils bc jq ) - # All servers except ts3 require tmux + # All servers except ts3 require tmux. if [ "${shortname}" != "ts3" ]; then if [ "$(command -v tmux 2>/dev/null)" ]; then tmuxcheck=1 # Added for users compiling tmux from source to bypass check. @@ -345,7 +346,7 @@ fn_deps_build_debian(){ fi fi - # All servers except ts3, mumble, GTA and minecraft servers require libstdc++6 and lib32gcc1 + # 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 libstdc++6:i386 ) @@ -354,9 +355,9 @@ fn_deps_build_debian(){ fi fi - ## Game Specific requirements + # Game Specific requirements. - # Natural Selection 2 - x64 only + # Natural Selection 2 - x64 only. if [ "${shortname}" == "ns2" ]; then array_deps_required+=( speex libtbb2 ) # NS2: Combat @@ -394,14 +395,19 @@ fn_deps_build_debian(){ elif [ "${shortname}" == "mc" ]; then javaversion=$(java -version 2>&1 | grep "version") if [ "${javaversion}" ]; then - javacheck=1 # Added for users using Oracle JRE to bypass the check. + # Added for users using Oracle JRE to bypass the check. + javacheck=1 else array_deps_required+=( openjdk-8-jre-headless ) fi + # Medal of Honor: Allied Assault + elif [ "${shortname}" == "mohaa" ]; then + array_deps_required+=( libstdc++5:i386 ) # Project Zomboid elif [ "${shortname}" == "pz" ]; then if [ -n "$(java -version 2>&1 | grep "version")" ]; then - javacheck=1 # Added for users using Oracle JRE to bypass the check. + # 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 ) @@ -414,13 +420,13 @@ fn_deps_build_debian(){ array_deps_required+=( libxrandr2:i386 libglu1-mesa:i386 libxtst6:i386 libusb-1.0-0-dev:i386 libxxf86vm1:i386 libopenal1:i386 libssl1.0.0:i386 libgtk2.0-0:i386 libdbus-glib-1-2:i386 libnm-glib-dev:i386 ) # Sven Co-op elif [ "${shortname}" == "sven" ]; then - array_deps_required+=( libssl1.0.0:i386 zlib1g:i386 ) + array_deps_required+=( libssl1.1:i386 zlib1g:i386 ) # Unreal Engine elif [ "${executable}" == "./ucc-bin" ]; then - #UT2K4 + # UT2K4 if [ -f "${executabledir}/ut2004-bin" ]; then array_deps_required+=( libsdl1.2debian libstdc++5:i386 ) - #UT99 + # UT99 else array_deps_required+=( libsdl1.2debian ) fi @@ -433,39 +439,44 @@ fn_deps_build_debian(){ # 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 + # Generate array of missing deps. array_deps_missing=() - # LinuxGSM requirements - ## CentOS 6 + # LinuxGSM requirements. + # CentOS if [ "${distroversion}" == "6" ]; then - array_deps_required=( epel-release curl wget util-linux-ng python file gzip bzip2 unzip binutils bc jq ) + array_deps_required=( epel-release curl wget util-linux-ng python file tar gzip bzip2 unzip binutils bc jq ) elif [ "${distroversion}" == "7" ]; then - array_deps_required=( epel-release curl wget util-linux python file gzip bzip2 unzip binutils bc jq ) + array_deps_required=( epel-release curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq ) + elif [ "${distroversion}" == "8" ]; then + array_deps_required=( epel-release curl wget util-linux python36 file tar gzip bzip2 unzip binutils bc jq ) elif [ "${distroid}" == "fedora" ]; then - array_deps_required=( curl wget util-linux python2 file gzip bzip2 unzip binutils bc jq ) + array_deps_required=( curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq ) elif [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then - array_deps_required=( curl wget util-linux python27 file gzip bzip2 unzip binutils bc jq ) + array_deps_required=( curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq ) else - array_deps_required=( curl wget util-linux python file gzip bzip2 unzip binutils bc jq ) + array_deps_required=( curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq ) fi - # All servers except ts3 require tmux + # All servers except ts3 require tmux. if [ "${shortname}" != "ts3" ]; then if [ "$(command -v tmux 2>/dev/null)" ]; then - tmuxcheck=1 # Added for users compiling tmux from source to bypass check. + # Added for users compiling tmux from source to bypass check. + tmuxcheck=1 else array_deps_required+=( tmux ) fi fi - # All servers except ts3,mumble,multitheftauto and minecraft servers require glibc.i686 and libstdc++.i686 + # 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 ) @@ -474,7 +485,7 @@ fn_deps_build_redhat(){ fi fi - # Game Specific requirements + # Game Specific requirements. # Natural Selection 2 (x64 only) if [ "${shortname}" == "ns2" ]; then @@ -509,16 +520,18 @@ fn_deps_build_redhat(){ elif [ "${shortname}" == "mc" ]; then javaversion=$(java -version 2>&1 | grep "version") if [ "${javaversion}" ]; then - javacheck=1 # Added for users using Oracle JRE to bypass the check. + # Added for users using Oracle JRE to bypass the check. + javacheck=1 array_deps_required+=( rng-tools ) else array_deps_required+=( java-1.8.0-openjdk rng-tools ) fi - # Project Zomboid & Minecraft + # Project Zomboid elif [ "${shortname}" == "pz" ]; then javaversion=$(java -version 2>&1 | grep "version") if [ "${javaversion}" ]; then - javacheck=1 # Added for users using Oracle JRE to bypass the check. + # Added for users using Oracle JRE to bypass the check. + javacheck=1 array_deps_required+=( rng-tools ) else array_deps_required+=( java-1.8.0-openjdk rng-tools ) @@ -541,6 +554,13 @@ fn_deps_build_redhat(){ # Eco elif [ "${shortname}" == "eco" ]; then array_deps_required+=( mono-complete ) + # Unturned + elif [ "${shortname}" == "unt" ]; then + array_deps_required+=( mono-complete ) + 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 @@ -548,20 +568,20 @@ fn_deps_build_redhat(){ if [ "${function_selfname}" == "command_install.sh" ]; then if [ "$(whoami)" == "root" ]; then - echo "" - echo "Checking Dependencies as root" - echo "=================================" + 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." - sleep 2 + fn_sleep_time else - echo "" - echo "Checking Dependencies" - echo "=================================" + echo -e "" + echo -e "${lightyellow}Checking Dependencies${default}" + echo -e "=================================" fi fi -# Filter checking in to Debian or Red Hat Based +# Filter checking in to Debian or Red Hat Based. info_distro.sh if [ -f "/etc/debian_version" ]; then fn_deps_build_debian diff --git a/lgsm/functions/check_executable.sh b/lgsm/functions/check_executable.sh index f0f0a67b7..918043555 100644 --- a/lgsm/functions/check_executable.sh +++ b/lgsm/functions/check_executable.sh @@ -10,7 +10,7 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Check if executable exists if [ ! -f "${executabledir}/${execname}" ]; then fn_print_fail_nl "executable was not found" - echo "* ${executabledir}/${execname}" + echo -e "* ${executabledir}/${execname}" if [ -d "${lgsmlogdir}" ]; then fn_script_log_fatal "Executable was not found: ${executabledir}/${execname}" fi diff --git a/lgsm/functions/check_glibc.sh b/lgsm/functions/check_glibc.sh index d353ed8af..4ff80b84b 100644 --- a/lgsm/functions/check_glibc.sh +++ b/lgsm/functions/check_glibc.sh @@ -2,23 +2,27 @@ # LinuxGSM check_glibc.sh function # Author: Daniel Gibbs # Website: https://linuxgsm.com -# Description: Checks if the server has the correct Glibc version or a fix available. +# Description: Checks if the server has the correct Glibc version. local commandname="CHECK" -info_glibc.sh info_distro.sh -if [ "${glibcrequired}" == "NOT REQUIRED" ]; then +if [ "${glibc}" == "null" ]; then + # Glibc is not required. : -elif [ "$(printf '%s\n'${glibcrequired}'\n' "${glibcversion}" | sort -V | head -n 1)" != "${glibcrequired}" ]||[ "${glibcrequired}" == "UNKNOWN" ]; then - fn_print_dots "Glibc" - sleep 0.5 - fn_print_error_nl "glibc: ${red}glibc distro version ${glibcversion} too old${default}" +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: ${glibcrequired}" + echo -e " * glibc required: ${glibc}" echo -e " * glibc installed: ${red}${glibcversion}${default}" echo -en "\n" - fn_print_information "The game server will probably not work. A distro upgrade is required!" - sleep 2 -fi \ No newline at end of file + 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 index e96d88968..652e2e3dd 100644 --- a/lgsm/functions/check_ip.sh +++ b/lgsm/functions/check_ip.sh @@ -7,6 +7,7 @@ local commandname="CHECK" +# This doesn't need to be an if/else if [ -f /.dockerenv ]; then ip=0.0.0.0 else @@ -21,41 +22,29 @@ else 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" - sleep 0.2 - # Multiple interfaces - if [ "${getipwc}" -ge "2" ]; then - if [ "${function_selfname}" == "command_details.sh" ]; then - fn_print_warn "Check IP: Multiple IP addresses found." - else - fn_print_fail "Check IP: Multiple IP addresses found." - fi - sleep 0.2 + # 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 [ "${function_selfname}" == "command_details.sh" ]; 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" - # 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." - if [ "${legacymode}" == "1" ]; then - fn_script_log_fatal "Specify the IP you want to bind within the ${selfname} script." - else - fn_script_log_fatal "Specify the IP you want to bind within: ${configdirserver}." - fi - fi - echo -en "${getip}\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 "https://linuxgsm.com/network-interfaces\n" echo -en "" @@ -66,21 +55,13 @@ else else ip="NOT SET" fi - # Single interface - elif [ "${ipsetinconfig}" == "1" ]; then - fn_print_fail "Check IP: IP address not set in game config." - sleep 0.5 - 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}." + 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 [ "${function_selfname}" != "command_details.sh" ]||[ "${function_selfname}" != "command_postdetails.sh" ]; then fn_script_log_fatal "https://linuxgsm.com/network-interfaces\n" if [ "${function_selfname}" != "command_details.sh" ];then core_exit.sh @@ -91,6 +72,28 @@ else sleep 0.2 ip="${getip}" 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 [ "${function_selfname}" != "command_details.sh" ];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_logs.sh b/lgsm/functions/check_logs.sh index 717e53ada..9f3e87427 100644 --- a/lgsm/functions/check_logs.sh +++ b/lgsm/functions/check_logs.sh @@ -9,19 +9,18 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_check_logs(){ fn_print_dots "Checking for log files" - sleep 0.5 fn_print_info_nl "Checking for log files: Creating log files" checklogs=1 install_logs.sh } -# Create directories for the script and console logs +# Create directories for the script and console logs. if [ ! -d "${lgsmlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${shortname}" != "ts3" ]; then fn_check_logs fi -# Create gamelogdir -# If variable exists gamelogdir exists and log/server does not +# Create gamelogdir. +# If variable exists gamelogdir exists and log/server does not. if [ -n "${gamelogdir}" ]&&[ -d "${gamelogdir}" ]&&[ ! -d "${logdir}/server" ]; then fn_check_logs fi diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh index f1bca798d..cb0cc9d5c 100644 --- a/lgsm/functions/check_permissions.sh +++ b/lgsm/functions/check_permissions.sh @@ -9,17 +9,17 @@ local commandname="CHECK" fn_check_ownership(){ if [ -f "${rootdir}/${selfname}" ]; then - if [ "$(find "${rootdir}/${selfname}" -not -user $(whoami) | wc -l)" -ne "0" ]; 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 [ "$(find "${functionsdir}" -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 -user "$(whoami)" | wc -l)" -ne "0" ]; then filesownissue=1 fi fi @@ -41,7 +41,7 @@ fn_check_ownership(){ fi } | column -s $'\t' -t | tee -a "${lgsmlog}" - echo "" + echo -e "" fn_print_information_nl "please see https://docs.linuxgsm.com/support/faq#fail-starting-game-server-permission-issues-found" fn_script_log "For more information, please see https://docs.linuxgsm.com/support/faq#fail-starting-game-server-permission-issues-found" if [ "${monitorflag}" == 1 ]; then @@ -71,11 +71,11 @@ fn_check_permissions(){ fi fi - # Check rootdir permissions + # Check rootdir permissions. if [ -n "${rootdir}" ]; then - # Get permission numbers on directory under the form 775 + # Get permission numbers on directory under the form 775. rootdirperm="$(stat -c %a "${rootdir}")" - # Grab the first and second digit for user and group permission + # 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 @@ -92,20 +92,20 @@ fn_check_permissions(){ core_exit.sh fi fi - # Check if executable is executable and attempt to fix it - # First get executable name + # Check if executable is executable and attempt to fix it. + # First get executable name. execname="$(basename "${executable}")" if [ -f "${executabledir}/${execname}" ]; then - # Get permission numbers on file under the form 775 + # Get permission numbers on file under the form 775. execperm="$(stat -c %a "${executabledir}/${execname}")" - # Grab the first and second digit for user and group permission + # Grab the first and second digit for user and group permission. userexecperm="${execperm:0:1}" groupexecperm="${execperm:1:1}" - # Check for invalid user permission + # Check for invalid user permission. if [ "${userexecperm}" == "0" ]||[ "${userexecperm}" == "2" ]||[ "${userexecperm}" == "4" ]||[ "${userexecperm}" == "6" ]; then - # If user permission is invalid, then check for invalid group permissions + # If user permission is invalid, then check for invalid group permissions. if [ "${groupexecperm}" == "0" ]||[ "${groupexecperm}" == "2" ]||[ "${groupexecperm}" == "4" ]||[ "${groupexecperm}" == "6" ]; then - # If permission issues are found + # If permission issues are found. fn_print_warn_nl "Permissions issue found" fn_script_log_warn "Permissions issue found" fn_print_information_nl "The following file is not executable:" @@ -114,17 +114,17 @@ fn_check_permissions(){ fn_script_log_info "${executabledir}/${execname}" fn_print_information_nl "Applying chmod u+x,g+x ${executabledir}/${execname}" fn_script_log_info "Applying chmod u+x,g+x ${execperm}" - # Make the executable executable + # Make the executable executable. chmod u+x,g+x "${executabledir}/${execname}" - # Second check to see if it's been successfully applied - # Get permission numbers on file under the form 775 + # Second check to see if it's been successfully applied. + # Get permission numbers on file under the form 775. execperm="$(stat -c %a "${executabledir}/${execname}")" - # Grab the first and second digit for user and group permission + # 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 + # 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:" @@ -141,16 +141,16 @@ fn_check_permissions(){ fi } -## The following fn_sys_perm_* functions checks for permission errors in /sys directory +## The following fn_sys_perm_* functions checks for permission errors in /sys directory. -# Checks for permission errors in /sys directory +# Checks for permission errors in /sys directory. fn_sys_perm_errors_detect(){ - # Reset test variables + # Reset test variables. sysdirpermerror="0" classdirpermerror="0" netdirpermerror="0" - # Check permissions - # /sys, /sys/class and /sys/class/net should be readable & executable + # Check permissions. + # /sys, /sys/class and /sys/class/net should be readable & executable. if [ ! -r "/sys" ]||[ ! -x "/sys" ]; then sysdirpermerror="1" fi @@ -162,16 +162,16 @@ fn_sys_perm_errors_detect(){ fi } -# Display a message on how to fix the issue manually +# Display a message on how to fix the issue manually. fn_sys_perm_fix_manually_msg(){ - echo "" + 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." - echo " * To fix this issue, run the following command as root:" + echo -e " * To fix this issue, run the following command as root:" fn_script_log_info "To fix this issue, run the following command as root:" - echo " chmod a+rx /sys /sys/class /sys/class/net" + echo -e " chmod a+rx /sys /sys/class /sys/class/net" fn_script_log "chmod a+rx /sys /sys/class /sys/class/net" - sleep 0.5 + fn_sleep_time if [ "${monitorflag}" == 1 ]; then alert="permissions" alert.sh @@ -179,12 +179,11 @@ fn_sys_perm_fix_manually_msg(){ core_exit.sh } -# Attempt to fix /sys related permission errors if sudo is available, exits otherwise +# Attempt to fix /sys related permission errors if sudo is available, exits otherwise. fn_sys_perm_errors_fix(){ sudo -n true > /dev/null 2>&1 if [ $? -eq 0 ]; then fn_print_dots "Automatically fixing /sys permissions" - sleep 0.5 fn_script_log_info "Automatically fixing /sys permissions." if [ "${sysdirpermerror}" == "1" ]; then sudo chmod a+rx "/sys" @@ -195,41 +194,39 @@ fn_sys_perm_errors_fix(){ if [ "${netdirpermerror}" == "1" ]; then sudo chmod a+rx "/sys/class/net" fi - # Run check again to see if it's fixed + # Run check again to see if it's fixed. fn_sys_perm_errors_detect 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." - sleep 0.5 - # Show the user how to fix + 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_script_log_pass "Permissions in /sys fixed" - sleep 0.5 fi else - # Show the user how to fix + # Show the user how to fix. fn_sys_perm_fix_manually_msg fi } -# Processes to the /sys related permission errors check & fix/info +# Processes to the /sys related permission errors check & fix/info. fn_sys_perm_error_process(){ fn_sys_perm_errors_detect - # If any error was found + # 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" - sleep 0.5 # Run the fix fn_sys_perm_errors_fix fi } -# Run perm error detect & fix/alert functions on /sys directories +# Run perm error detect & fix/alert functions on /sys directories. -## Run checks +## Run checks. if [ "$(whoami)" != "root" ]; then fn_check_ownership fn_check_permissions diff --git a/lgsm/functions/check_steamcmd.sh b/lgsm/functions/check_steamcmd.sh index f47abf359..3f6cd90de 100644 --- a/lgsm/functions/check_steamcmd.sh +++ b/lgsm/functions/check_steamcmd.sh @@ -23,7 +23,7 @@ fn_check_steamcmd_user(){ else fn_print_fail_nl "Steam login not set. Update steamuser in ${configdirserver}" fi - echo " * Change steamuser=\"username\" to a valid steam login." + echo -e " * Change steamuser=\"username\" to a valid steam login." if [ -d "${lgsmlogdir}" ]; then if [ "${legacymode}" == "1" ]; then fn_script_log_fatal "Steam login not set. Update steamuser in ${selfname}" @@ -33,7 +33,7 @@ fn_check_steamcmd_user(){ fi core_exit.sh fi - # Anonymous user is set if steamuser is missing + # Anonymous user is set if steamuser is missing. if [ -z "${steamuser}" ]; then if [ -d "${lgsmlogdir}" ]; then fn_script_log_info "Using anonymous Steam login" @@ -52,7 +52,6 @@ fn_check_steamcmd_sh(){ else fn_print_error_nl "SteamCMD is missing" fn_script_log_error "SteamCMD is missing" - sleep 0.5 fn_install_steamcmd fi elif [ "${function_selfname}" == "command_install.sh" ]; then diff --git a/lgsm/functions/check_system_dir.sh b/lgsm/functions/check_system_dir.sh index 0a10b15ac..fd9ff3644 100644 --- a/lgsm/functions/check_system_dir.sh +++ b/lgsm/functions/check_system_dir.sh @@ -20,4 +20,3 @@ if [ ! -d "${checkdir}" ]; then fi core_exit.sh fi - diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/functions/check_system_requirements.sh index ce961548d..1493f6b85 100644 --- a/lgsm/functions/check_system_requirements.sh +++ b/lgsm/functions/check_system_requirements.sh @@ -15,6 +15,12 @@ info_distro.sh 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" @@ -39,11 +45,9 @@ fi if [ -n "${ramrequirementmb}" ]; then if [ "${physmemtotalmb}" -lt "${ramrequirementmb}" ]; then fn_print_dots "Check RAM" - sleep 0.5 - # Warn the user + # Warn the user. fn_print_warn_nl "Check RAM: ${ramrequirementgb}G required, ${physmemtotal} available" - sleep 0.5 echo " * ${gamename} server may fail to run or experience poor performance." - sleep 0.5 + fn_sleep_time fi fi diff --git a/lgsm/functions/check_tmuxception.sh b/lgsm/functions/check_tmuxception.sh index 1a13bef9c..7e83cf844 100644 --- a/lgsm/functions/check_tmuxception.sh +++ b/lgsm/functions/check_tmuxception.sh @@ -12,8 +12,8 @@ fn_check_is_in_tmux(){ 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_print_information_nl "LinuxGSM creates a tmux session when starting the server." - echo "It is not possible to run a tmux session inside another tmux session" - echo "https://docs.linuxgsm.com/requirements/tmux#tmuxception" + echo -e "It is not possible to run a tmux session inside another tmux session" + echo -e "https://docs.linuxgsm.com/requirements/tmux#tmuxception" core_exit.sh fi } @@ -23,8 +23,8 @@ fn_check_is_in_screen(){ 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_print_information_nl "LinuxGSM creates a tmux session when starting the server." - echo "It is not possible to run a tmux session inside screen session" - echo "https://docs.linuxgsm.com/requirements/tmux#tmuxception" + echo -e "It is not possible to run a tmux session inside screen session" + echo -e "https://docs.linuxgsm.com/requirements/tmux#tmuxception" core_exit.sh fi } diff --git a/lgsm/functions/command_backup.sh b/lgsm/functions/command_backup.sh index c5d48e202..91f856809 100644 --- a/lgsm/functions/command_backup.sh +++ b/lgsm/functions/command_backup.sh @@ -13,21 +13,20 @@ check.sh # Trap to remove lockfile on quit. fn_backup_trap(){ - echo "" + echo -e "" echo -en "backup ${backupname}.tar.gz..." fn_print_canceled_eol_nl fn_script_log_info "Backup ${backupname}.tar.gz: CANCELED" - sleep 0.5 rm -f "${backupdir}/${backupname}.tar.gz" | tee -a "${lgsmlog}" echo -en "backup ${backupname}.tar.gz..." fn_print_removed_eol_nl fn_script_log_info "Backup ${backupname}.tar.gz: REMOVED" - # Remove lock file + # Remove lock file. rm -f "${tmpdir}/.backup.lock" core_exit.sh } -# Check if a backup is pending or has been aborted using .backup.lock +# Check if a backup is pending or has been aborted using .backup.lock. fn_backup_check_lockfile(){ if [ -f "${tmpdir}/.backup.lock" ]; then fn_print_info_nl "Lock file found: Backup is currently running" @@ -36,18 +35,15 @@ fn_backup_check_lockfile(){ fi } -# Initialisation +# Initialisation. fn_backup_init(){ - # Backup file name with servicename and current date + # Backup file name with servicename and current date. backupname="${servicename}-$(date '+%Y-%m-%d-%H%M%S')" info_distro.sh fn_print_dots "Backup starting" fn_script_log_info "Backup starting" - sleep 0.5 - fn_print_ok "Backup starting" - sleep 0.5 - echo -en "\n" + fn_print_ok_nl "Backup starting" if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then fn_print_info_nl "There are no previous backups" else @@ -58,61 +54,83 @@ fn_backup_init(){ else daysago="${lastbackupdaysago} days ago" fi - echo " * Previous backup was created ${daysago}, total size ${lastbackupsize}" - sleep 0.5 + echo -e " * Previous backup was created ${daysago}, total size ${lastbackupsize}" fi } -# Check if server is started and whether to stop it +# Check if server is started and whether to stop it. fn_backup_stop_server(){ check_status.sh - # Server is stopped + # Server is stopped. if [ "${status}" == "0" ]; then serverstopped="no" - # Server is running and stoponbackup=off + # Server is running and stoponbackup=off. elif [ "${stoponbackup}" == "off" ]; then serverstopped="no" fn_print_warn_nl "${servicename} is currently running" - echo " * Although unlikely; creating a backup while ${servicename} is running might corrupt the backup." + echo -e " * Although unlikely; creating a backup while ${servicename} is running might corrupt the backup." fn_script_log_warn "${servicename} is currently running" fn_script_log_warn "Although unlikely; creating a backup while ${servicename} is running might corrupt the backup" - # Server is running and will be stopped if stoponbackup=on or unset + # Server is running and will be stopped if stoponbackup=on or unset. else fn_print_warn_nl "${servicename} will be stopped during the backup" fn_script_log_warn "${servicename} will be stopped during the backup" - sleep 5 serverstopped="yes" exitbypass=1 command_stop.sh fi } -# Create required folders +# Create required folders. fn_backup_dir(){ - # Create backupdir if it doesn't exist + # 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(){ - # Create lockfile - date > "${tmpdir}/.backup.lock" + # Create lockfile. + date '+%s' > "${tmpdir}/.backup.lock" fn_script_log_info "Lockfile generated" fn_script_log_info "${tmpdir}/.backup.lock" # trap to remove lockfile on quit. trap fn_backup_trap INT } -# Compressing files +# Compressing files. fn_backup_compression(){ - # Tells how much will be compressed using rootdirduexbackup value from info_distro and prompt for continue + # 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" - sleep 2 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) + excludedir=$(fn_backup_relpath) # Check that excludedir is a valid path. if [ ! -d "${excludedir}" ] ; then @@ -126,12 +144,11 @@ fn_backup_compression(){ if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol fn_script_log_fatal "Backup in progress: FAIL" - echo "${tarcmd}" | tee -a "${lgsmlog}" + echo -e "${tarcmd}" | tee -a "${lgsmlog}" fn_print_fail_nl "Starting backup" fn_script_log_fatal "Starting backup" else fn_print_ok_eol - sleep 0.5 fn_print_ok_nl "Completed: ${backupname}.tar.gz, 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}')" fi @@ -139,60 +156,55 @@ fn_backup_compression(){ rm -f "${tmpdir}/.backup.lock" } -# Clear old backups according to maxbackups and maxbackupdays variables +# Clear old backups according to maxbackups and maxbackupdays variables. fn_backup_prune(){ - # Clear if backup variables are set + # Clear if backup variables are set. if [ -n "${maxbackups}" ]&&[ -n "${maxbackupdays}" ]; then - # How many backups there are + # How many backups there are. info_distro.sh - # How many backups exceed maxbackups + # How many backups exceed maxbackups. backupquotadiff=$((backupcount-maxbackups)) - # How many backups exceed maxbackupdays + # How many backups exceed maxbackupdays. backupsoudatedcount=$(find "${backupdir}"/ -type f -name "*.tar.gz" -mtime +"${maxbackupdays}"|wc -l) - # If anything can be cleared + # If anything can be cleared. if [ "${backupquotadiff}" -gt "0" ]||[ "${backupsoudatedcount}" -gt "0" ]; then fn_print_dots "Pruning" fn_script_log_info "Backup pruning activated" - sleep 0.5 fn_print_ok_nl "Pruning" - sleep 0.5 - # If maxbackups greater or equal to backupsoutdatedcount, then it is over maxbackupdays + # If maxbackups greater or equal to backupsoutdatedcount, then it is over maxbackupdays. if [ "${backupquotadiff}" -ge "${backupsoudatedcount}" ]; then - # Display how many backups will be cleared - echo " * Pruning: ${backupquotadiff} backup(s) has exceeded the ${maxbackups} backups limit" + # 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" - sleep 0.5 + fn_sleep_time fn_print_dots "Pruning: Clearing ${backupquotadiff} backup(s)" fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)" - sleep 0.5 - # Clear backups over quota + # Clear backups over quota. find "${backupdir}"/ -type f -name "*.tar.gz" -printf '%T@ %p\n' | sort -rn | tail -${backupquotadiff} | cut -f2- -d" " | xargs rm fn_print_ok_nl "Pruning: Clearing ${backupquotadiff} backup(s)" fn_script_log_pass "Pruning: Cleared ${backupquotadiff} backup(s)" - # If maxbackupdays is used over maxbackups + # If maxbackupdays is used over maxbackups. elif [ "${backupquotadiff}" -lt "${backupsoudatedcount}" ]; then - # Display how many backups will be cleared - echo " * Pruning: ${backupsoudatedcount} backup(s) are older than ${maxbackupdays} days." + # 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." - sleep 0.5 + fn_sleep_time fn_print_dots "Pruning: Clearing ${backupquotadiff} backup(s)." fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)" - sleep 0.5 # Clear backups over quota find "${backupdir}"/ -type f -mtime +"${maxbackupdays}" -exec rm -f {} \; fn_print_ok_nl "Pruning: Clearing ${backupquotadiff} backup(s)" fn_script_log_pass "Pruning: Cleared ${backupquotadiff} backup(s)" fi - sleep 0.5 fi fi } fn_backup_relpath() { - # Written by CedarLUG as a "realpath --relative-to" alternative in bash + # 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")) + # Populate an array of tokens initialized from the rootdir components. + declare -a rdirtoks=($(readlink -f "${rootdir}" | sed "s/\// /g")) if [ ${#rdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing rootdir during relative path assessment" @@ -200,44 +212,44 @@ fn_backup_relpath() { core_exit.sh fi - # Populate an array of tokens initialized from the backupdir components: - declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g")) + # Populate an array of tokens initialized from the backupdir components. + declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g")) if [ ${#bdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing backupdir during relative path assessment" fn_script_log_fatal "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 + # 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 - [[ "${rdirtoks[$base]}" != "${bdirtoks[$base]}" ]] && break - done + 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 - echo -n "../" - done + # Next, climb out of the remaining rootdir location with updir references. + 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]}/" - done + 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 + # 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 "${bdirtoks[ $(( ${#bdirtoks[@]} - 1)) ]}" - else - echo - fi + if (( "$base" < "${#bdirtoks[@]}" )) ; then + echo -e "${bdirtoks[ $(( ${#bdirtoks[@]} - 1)) ]}" + else + echo + fi } -# Restart the server if it was stopped for the backup +# Restart the server if it was stopped for the backup. fn_backup_start_server(){ if [ "${serverstopped}" == "yes" ]; then exitbypass=1 @@ -245,12 +257,13 @@ fn_backup_start_server(){ fi } -# Run functions +# Run functions. fn_backup_check_lockfile fn_backup_create_lockfile fn_backup_init fn_backup_stop_server fn_backup_dir +fn_backup_migrate_olddir fn_backup_compression fn_backup_prune fn_backup_start_server diff --git a/lgsm/functions/command_console.sh b/lgsm/functions/command_console.sh index 8daf02105..f428ce56e 100644 --- a/lgsm/functions/command_console.sh +++ b/lgsm/functions/command_console.sh @@ -16,25 +16,22 @@ if [ "${shortname}" == "rust" ]||[ "${shortname}" == "hw" ]||[ "${shortname}" == 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 " * https://docs.linuxgsm.com/commands/console" -echo "" +echo -e " * https://docs.linuxgsm.com/commands/console" +echo -e "" if ! fn_prompt_yn "Continue?" Y; then echo Exiting; return fi fn_print_dots "Accessing console" -sleep 0.5 check_status.sh if [ "${status}" != "0" ]; then fn_print_ok_nl "Accessing console" fn_script_log_pass "Console accessed" - sleep 0.5 tmux attach-session -t "${servicename}" 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" - sleep 0.5 if fn_prompt_yn "Do you want to start the server?" Y; then exitbypass=1 command_start.sh diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh index 7664ff8be..9422bbad7 100644 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/functions/command_debug.sh @@ -10,7 +10,7 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Trap to remove lockfile on quit. fn_lockfile_trap(){ - # Remove lockfile + # Remove lockfile. rm -f "${rootdir}/${lockselfname}" # resets terminal. Servers can sometimes mess up the terminal on exit. reset @@ -23,80 +23,89 @@ 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 +# NOTE: Check if works with server without parms. Could be intergrated in to info_parms.sh. fn_parms fn_print_header -echo -e "${blue}Distro:\t${default}${distroname}" -echo -e "${blue}Arch:\t${default}${arch}" -echo -e "${blue}Kernel:\t${default}${kernel}" -echo -e "${blue}Hostname:\t${default}${HOSTNAME}" -echo -e "${blue}tmux:\t${default}${tmuxv}" -echo -e "${blue}Avg Load:\t${default}${load}" -echo -e "${blue}Free Memory:\t${default}${physmemfree}" -echo -e "${blue}Free Disk:\t${default}${availspace}" -# glibc required -if [ -n "${glibcrequired}" ]; then - if [ "${glibcrequired}" == "NOT REQUIRED" ]; then - : - elif [ "${glibcrequired}" == "UNKNOWN" ]; then - echo -e "${blue}glibc required:\t${red}${glibcrequired}" - elif [ "$(printf '%s\n'${glibcrequired}'\n' "${glibcversion}" | sort -V | head -n 1)" != "${glibcrequired}" ]; then - echo -e "${blue}glibc required:\t${red}${glibcrequired} ${default}(${red}glibc distro version ${glibcversion} too old${default})" +{ + echo -e "${lightblue}Distro:\t\t${default}${distroname}" + echo -e "${lightblue}Arch:\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}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 [ -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 "${blue}glibc required:\t${green}${glibcrequired}${default}" + echo -e "${lightblue}glibc required:\t${green}${glibc}${default}" fi fi -# Server ip + +# Server IP if [ "${multiple_ip}" == "1" ]; then - echo -e "${blue}Server IP:\t${default}NOT SET" + echo -e "${lightblue}Server IP:\t${default}NOT SET" else - echo -e "${blue}Server IP:\t${default}${ip}:${port}" + echo -e "${lightblue}Server IP:\t${default}${ip}:${port}" fi -# External server ip +# External server IP. if [ -n "${extip}" ]; then if [ "${ip}" != "${extip}" ]; then - echo -e "${blue}Internet IP:\t${default}${extip}:${port}" + echo -e "${lightblue}Internet IP:\t${default}${extip}:${port}" + fi +fi +# Listed on Master Server. +if [ "${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 -# Server password +# Server password. if [ -n "${serverpassword}" ]; then - echo -e "${blue}Server password:\t${default}${serverpassword}" + echo -e "${lightblue}Server password:\t${default}${serverpassword}" fi -echo "" -echo "Start parameters:" +echo -e "${lightblue}Start parameters:${default}" if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then - echo "${executable} ${parms} -debug" + echo -e "${executable} ${parms} -debug" else - echo "${executable} ${parms}" + echo -e "${executable} ${parms}" fi -echo "" +echo -e "" echo -e "Use for identifying server issues only!" echo -e "Press CTRL+c to drop out of debug mode." fn_print_warning_nl "If ${servicename} is already running it will be stopped." -echo "" +echo -e "" if ! fn_prompt_yn "Continue?" Y; then echo Exiting; return fi fn_print_info_nl "Stopping any running servers" fn_script_log_info "Stopping any running servers" -sleep 0.5 exitbypass=1 command_stop.sh fn_print_dots "Starting debug" fn_script_log_info "Starting debug" -sleep 0.5 fn_print_ok_nl "Starting debug" -# Create lockfile -date > "${rootdir}/${lockselfname}" +# Create lockfile. +date '+%s' > "${rootdir}/${lockselfname}" fn_script_log_info "Lockfile generated" fn_script_log_info "${rootdir}/${lockselfname}" # trap to remove lockfile on quit. trap fn_lockfile_trap INT cd "${executabledir}" || exit -# Note: do not add double quotes to ${executable} ${parms} +# Note: do not add double quotes to ${executable} ${parms}. if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then ${executable} ${parms} -debug elif [ "${engine}" == "realvirtuality" ]; then @@ -111,7 +120,6 @@ else fi fn_print_dots "Stopping debug" -sleep 1 fn_print_ok_nl "Stopping debug" # remove trap. trap - INT diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 4b11d0658..6e4e8fecc 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -14,12 +14,11 @@ check.sh info_config.sh info_parms.sh info_distro.sh -info_glibc.sh info_messages.sh query_gamedig.sh fn_info_message_distro -fn_info_message_performance -fn_info_message_disk +fn_info_message_server_resource +fn_info_message_gameserver_resource fn_info_message_gameserver fn_info_message_script fn_info_message_backup @@ -32,4 +31,3 @@ 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 index bf026ced5..95f54e842 100644 --- a/lgsm/functions/command_dev_clear_functions.sh +++ b/lgsm/functions/command_dev_clear_functions.sh @@ -4,12 +4,12 @@ # Website: https://linuxgsm.com # Description: Deletes the contents of the functions dir. -echo "=================================" -echo "Clear Functions" -echo "=================================" -echo "" +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:?}/"* fi -core_exit.sh \ No newline at end of file +core_exit.sh diff --git a/lgsm/functions/command_dev_debug.sh b/lgsm/functions/command_dev_debug.sh index 7c831681a..5229d068d 100644 --- a/lgsm/functions/command_dev_debug.sh +++ b/lgsm/functions/command_dev_debug.sh @@ -13,8 +13,8 @@ if [ -f "${rootdir}/.dev-debug" ]; then fn_print_ok_nl "Disabled dev-debug" fn_script_log_info "Disabled dev-debug" else - date > "${rootdir}/.dev-debug" + date '+%s' > "${rootdir}/.dev-debug" fn_print_ok_nl "Enabled dev-debug" fn_script_log_info "Enabled dev-debug" fi -core_exit.sh \ No newline at end of file +core_exit.sh diff --git a/lgsm/functions/command_dev_detect_deps.sh b/lgsm/functions/command_dev_detect_deps.sh index d0dae61b2..c3b29872e 100644 --- a/lgsm/functions/command_dev_detect_deps.sh +++ b/lgsm/functions/command_dev_detect_deps.sh @@ -8,17 +8,17 @@ local commandname="DETECT-DEPS" local commandaction="Detect-Deps" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -echo "=================================" -echo "Dependencies Checker" -echo "=================================" -echo "Checking directory: " -echo "${serverfiles}" +echo -e "=================================" +echo -e "Dependencies Checker" +echo -e "=================================" +echo -e "Checking directory: " +echo -e "${serverfiles}" if [ "$(command -v eu-readelf 2>/dev/null)" ]; then readelf=eu-readelf elif [ "$(command -v readelf 2>/dev/null)" ]; then readelf=readelf else - echo "readelf/eu-readelf not installed" + echo -e "readelf/eu-readelf not installed" fi files=$(find "${serverfiles}" | wc -l) find "${serverfiles}" -type f -print0 | @@ -35,14 +35,14 @@ done sort "${tmpdir}/.depdetect_readelf" |uniq >"${tmpdir}/.depdetect_readelf_uniq" while read -r lib; do - echo "${lib}" + echo -e "${lib}" local 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 "glibc.i686" >> "${tmpdir}/.depdetect_centos_list" - echo "lib32gcc1" >> "${tmpdir}/.depdetect_ubuntu_list" - echo "lib32gcc1" >> "${tmpdir}/.depdetect_debian_list" + echo -e "glibc.i686" >> "${tmpdir}/.depdetect_centos_list" + echo -e "lib32gcc1" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "lib32gcc1" >> "${tmpdir}/.depdetect_debian_list" libdetected=1 fi done @@ -51,9 +51,9 @@ while read -r lib; do for lib_file in "${libs_array[@]}" do if [ "${lib}" == "${lib_file}" ]; then - echo "java-1.8.0-openjdk" >> "${tmpdir}/.depdetect_centos_list" - echo "default-jre" >> "${tmpdir}/.depdetect_ubuntu_list" - echo "default-jre" >> "${tmpdir}/.depdetect_debian_list" + echo -e "java-1.8.0-openjdk" >> "${tmpdir}/.depdetect_centos_list" + echo -e "default-jre" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "default-jre" >> "${tmpdir}/.depdetect_debian_list" libdetected=1 fi done @@ -61,73 +61,78 @@ while read -r lib; do local 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 + # Known shared libs what dont requires dependencies. if [ "${lib}" == "${lib_file}" ]; then libdetected=1 fi done if [ "${lib}" == "libstdc++.so.6" ]; then - echo "libstdc++.i686" >> "${tmpdir}/.depdetect_centos_list" - echo "libstdc++6:i386" >> "${tmpdir}/.depdetect_ubuntu_list" - echo "libstdc++6:i386" >> "${tmpdir}/.depdetect_debian_list" + echo -e "libstdc++.i686" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libstdc++6:i386" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libstdc++6:i386" >> "${tmpdir}/.depdetect_debian_list" libdetected=1 elif [ "${lib}" == "libstdc++.so.5" ]; then - echo "compat-libstdc++-33.i686" >> "${tmpdir}/.depdetect_centos_list" - echo "libstdc++5:i386" >> "${tmpdir}/.depdetect_ubuntu_list" - echo "libstdc++5:i386" >> "${tmpdir}/.depdetect_debian_list" + echo -e "compat-libstdc++-33.i686" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libstdc++5:i386" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libstdc++5:i386" >> "${tmpdir}/.depdetect_debian_list" libdetected=1 elif [ "${lib}" == "libcurl-gnutls.so.4" ]; then - echo "libcurl.i686" >> "${tmpdir}/.depdetect_centos_list" - echo "libcurl4-gnutls-dev:i386" >> "${tmpdir}/.depdetect_ubuntu_list" - echo "libcurl4-gnutls-dev:i386" >> "${tmpdir}/.depdetect_debian_list" + echo -e "libcurl.i686" >> "${tmpdir}/.depdetect_centos_list" + 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 - echo "speex.i686" >> "${tmpdir}/.depdetect_centos_list" - echo "speex:i386" >> "${tmpdir}/.depdetect_ubuntu_list" - echo "speex:i386" >> "${tmpdir}/.depdetect_debian_list" + 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 - echo "SDL.i686" >> "${tmpdir}/.depdetect_centos_list" - echo "libsdl1.2debian" >> "${tmpdir}/.depdetect_ubuntu_list" - echo "libsdl1.2debian" >> "${tmpdir}/.depdetect_debian_list" + echo -e "SDL.i686" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libsdl1.2debian" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libsdl1.2debian" >> "${tmpdir}/.depdetect_debian_list" libdetected=1 elif [ "${lib}" == "libtbb.so.2" ]; then - echo "tbb.i686" >> "${tmpdir}/.depdetect_centos_list" - echo "libtbb2" >> "${tmpdir}/.depdetect_ubuntu_list" - echo "libtbb2" >> "${tmpdir}/.depdetect_debian_list" + echo -e "tbb.i686" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libtbb2" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libtbb2" >> "${tmpdir}/.depdetect_debian_list" libdetected=1 elif [ "${lib}" == "libXrandr.so.2" ]; then - echo "libXrandr" >> "${tmpdir}/.depdetect_centos_list" - echo "libxrandr2" >> "${tmpdir}/.depdetect_ubuntu_list" - echo "libxrandr2" >> "${tmpdir}/.depdetect_debian_list" + echo -e "libXrandr" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libxrandr2" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libxrandr2" >> "${tmpdir}/.depdetect_debian_list" libdetected=1 elif [ "${lib}" == "libXext.so.6" ]; then - echo "libXext" >> "${tmpdir}/.depdetect_centos_list" - echo "libxext6" >> "${tmpdir}/.depdetect_ubuntu_list" - echo "libxext6" >> "${tmpdir}/.depdetect_debian_list" + echo -e "libXext" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libxext6" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libxext6" >> "${tmpdir}/.depdetect_debian_list" libdetected=1 elif [ "${lib}" == "libXtst.so.6" ]; then - echo "libXtst" >> "${tmpdir}/.depdetect_centos_list" - echo "libxtst6" >> "${tmpdir}/.depdetect_ubuntu_list" - echo "libxtst6" >> "${tmpdir}/.depdetect_debian_list" + echo -e "libXtst" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libxtst6" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libxtst6" >> "${tmpdir}/.depdetect_debian_list" libdetected=1 elif [ "${lib}" == "libpulse.so.0" ]; then - echo "pulseaudio-libs" >> "${tmpdir}/.depdetect_centos_list" - echo "libpulse0" >> "${tmpdir}/.depdetect_ubuntu_list" - echo "libpulse0" >> "${tmpdir}/.depdetect_debian_list" + echo -e "pulseaudio-libs" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libpulse0" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libpulse0" >> "${tmpdir}/.depdetect_debian_list" libdetected=1 elif [ "${lib}" == "libopenal.so.1" ]; then - echo "" >> "${tmpdir}/.depdetect_centos_list" - echo "libopenal1" >> "${tmpdir}/.depdetect_ubuntu_list" - echo "libopenal1" >> "${tmpdir}/.depdetect_debian_list" + echo -e "" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libopenal1" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libopenal1" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libgconf-2.so.4" ]; then + echo -e "GConf2" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libgconf2-4" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libgconf2-4" >> "${tmpdir}/.depdetect_debian_list" libdetected=1 fi if [ "${libdetected}" != "1" ]; then unknownlib=1 - echo "${lib}" >> "${tmpdir}/.depdetect_unknown" + echo -e "${lib}" >> "${tmpdir}/.depdetect_unknown" fi unset libdetected done < "${tmpdir}/.depdetect_readelf_uniq" @@ -142,35 +147,35 @@ fi awk -vORS='' '{ print $1,$2 }' "${tmpdir}/.depdetect_centos_list_uniq" > "${tmpdir}/.depdetect_centos_line" awk -vORS='' '{ print $1,$2 }' "${tmpdir}/.depdetect_ubuntu_list_uniq" > "${tmpdir}/.depdetect_ubuntu_line" awk -vORS='' '{ print $1,$2 }' "${tmpdir}/.depdetect_debian_list_uniq" > "${tmpdir}/.depdetect_debian_line" -echo "" -echo "" -echo "Required Dependencies" -echo "=================================" -echo "${executable}" -echo "" -echo "CentOS" -echo "=================================" +echo -e "" +echo -e "" +echo -e "Required Dependencies" +echo -e "=================================" +echo -e "${executable}" +echo -e "" +echo -e "CentOS" +echo -e "=================================" cat "${tmpdir}/.depdetect_centos_line" -echo "" -echo "" -echo "Ubuntu" -echo "=================================" +echo -e "" +echo -e "" +echo -e "Ubuntu" +echo -e "=================================" cat "${tmpdir}/.depdetect_ubuntu_line" -echo "" -echo "" -echo "Debian" -echo "=================================" +echo -e "" +echo -e "" +echo -e "Debian" +echo -e "=================================" cat "${tmpdir}/.depdetect_debian_line" -echo "" +echo -e "" if [ "${unknownlib}" == "1" ]; then - echo "" - echo "Unknown shared Library" - echo "=================================" + echo -e "" + echo -e "Unknown shared Library" + echo -e "=================================" cat "${tmpdir}/.depdetect_unknown" fi -echo "" -echo "Required Librarys" -echo "=================================" +echo -e "" +echo -e "Required Librarys" +echo -e "=================================" sort "${tmpdir}/.depdetect_readelf" | uniq echo -en "\n" rm -f "${tmpdir}/.depdetect_centos_line" @@ -190,4 +195,4 @@ rm -f "${tmpdir}/.depdetect_readelf_uniq" rm -f "${tmpdir}/.depdetect_unknown" rm -f "${tmpdir}/.depdetect_unknown_uniq" -core_exit.sh \ No newline at end of file +core_exit.sh diff --git a/lgsm/functions/command_dev_detect_glibc.sh b/lgsm/functions/command_dev_detect_glibc.sh index 7f0fc409c..f8b858dff 100644 --- a/lgsm/functions/command_dev_detect_glibc.sh +++ b/lgsm/functions/command_dev_detect_glibc.sh @@ -9,9 +9,9 @@ local commandname="DETECT-GLIBC" local commandaction="Detect-Glibc" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -echo "=================================" -echo "glibc Requirements Checker" -echo "=================================" +echo -e "=================================" +echo -e "glibc Requirements Checker" +echo -e "=================================" if [ -z "$(command -v objdump)" ]; then fn_print_failure_nl "objdump is missing" @@ -24,13 +24,13 @@ if [ -z "${serverfiles}" ]; then fi if [ -d "${serverfiles}" ]; then - echo "Checking directory: " - echo "${serverfiles}" + echo -e "Checking directory: " + echo -e "${serverfiles}" elif [ -f "${serverfiles}" ]; then - echo "Checking file: " - echo "${serverfiles}" + echo -e "Checking file: " + echo -e "${serverfiles}" fi -echo "" +echo -e "" local glibc_check_dir_array=( steamcmddir serverfiles ) @@ -50,25 +50,25 @@ do while IFS= read -r -d $'\0' line; do glibcversion=$(objdump -T "${line}" 2>/dev/null | grep -oP "GLIBC[^ ]+" | grep -v GLIBCXX | sort | uniq | sort -r --version-sort | head -n 1) if [ "${glibcversion}" ]; then - echo "${glibcversion}: ${line}" >>"${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" + 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 "" - echo "" - echo "${glibc_check_name} glibc Requirements" - echo "=================================" + echo -e "" + echo -e "" + echo -e "${glibc_check_name} glibc Requirements" + echo -e "=================================" if [ -f "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" ]; then - echo "Required glibc" + 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" - echo "" - echo "Files requiring GLIBC" - echo "Highest verion required: filename" + echo -e "" + echo -e "Files requiring GLIBC" + echo -e "Highest verion required: filename" cat "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" - echo "" - echo "All required GLIBC versions" + echo -e "" + echo -e "All required GLIBC versions" cat "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" | sort | uniq | sort -r --version-sort rm "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" rm "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" @@ -79,9 +79,9 @@ do fn_print_information_nl "${glibc_check_name} is not installed" fi done -echo "" -echo "Final glibc Requirement" -echo "=================================" +echo -e "" +echo -e "Final glibc Requirement" +echo -e "=================================" if [ -f "${tmpdir}/detect_glibc_highest.tmp" ]; then cat "${tmpdir}/detect_glibc_highest.tmp" | sort | uniq | sort -r --version-sort | head -1 rm "${tmpdir}/detect_glibc_highest.tmp" diff --git a/lgsm/functions/command_dev_detect_ldd.sh b/lgsm/functions/command_dev_detect_ldd.sh index 95898c4e4..394f60db2 100644 --- a/lgsm/functions/command_dev_detect_ldd.sh +++ b/lgsm/functions/command_dev_detect_ldd.sh @@ -9,48 +9,48 @@ local commandname="DETECT-LDD" local commandaction="Detect-LDD" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -echo "=================================" -echo "Shared Object dependencies Checker" -echo "=================================" +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 "Checking directory: " - echo "${serverfiles}" + echo -e "Checking directory: " + echo -e "${serverfiles}" elif [ -f "${serverfiles}" ]; then - echo "Checking file: " - echo "${serverfiles}" + echo -e "Checking file: " + echo -e "${serverfiles}" fi -echo "" +echo -e "" 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 "${line}" >> "${tmpdir}/detect_ldd.tmp" + echo -e "${line}" >> "${tmpdir}/detect_ldd.tmp" ldd "${line}" 2>/dev/null | grep -v "not a dynamic executable" >> "${tmpdir}/detect_ldd.tmp" if ldd "${line}" 2>/dev/null | grep -v "not a dynamic executable" | grep "not found" then - echo "${line}" >> "${tmpdir}/detect_ldd_not_found.tmp" + echo -e "${line}" >> "${tmpdir}/detect_ldd_not_found.tmp" ldd "${line}" 2>/dev/null | grep -v "not a dynamic executable" | grep "not found" >> "${tmpdir}/detect_ldd_not_found.tmp" fi fi echo -n "$i / $files" $'\r' ((i++)) done -echo "" -echo "" -echo "All" -echo "=================================" +echo -e "" +echo -e "" +echo -e "All" +echo -e "=================================" cat "${tmpdir}/detect_ldd.tmp" -echo "" -echo "Not Found" -echo "=================================" +echo -e "" +echo -e "Not Found" +echo -e "=================================" cat "${tmpdir}/detect_ldd_not_found.tmp" rm "${tmpdir}/detect_ldd.tmp" diff --git a/lgsm/functions/command_dev_query_raw.sh b/lgsm/functions/command_dev_query_raw.sh index 4d57e8aca..d927cd61a 100644 --- a/lgsm/functions/command_dev_query_raw.sh +++ b/lgsm/functions/command_dev_query_raw.sh @@ -7,10 +7,12 @@ local commandname="QUERY-RAW" local commandaction="Query Raw" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -echo "=================================" -echo "Gamedig Raw Output" -echo "=================================" +echo -e "" +echo -e "Query Port" +echo -e "==================================================================" +echo -e "" +echo -e "Gamedig Raw Output" +echo -e "=================================" echo"" if [ ! "$(command -v gamedig 2>/dev/null)" ]; then fn_print_failure_nl "gamedig not installed" @@ -29,44 +31,70 @@ elif [ "${shortname}" == "kf2" ]; then fi query_gamedig.sh -echo "${gamedigcmd}" +echo -e "${gamedigcmd}" echo"" -echo "${gamedigraw}" | jq +echo -e "${gamedigraw}" | jq echo"" -echo "=================================" -echo "gsquery Raw Output" -echo "=================================" +echo -e "gsquery Raw Output" +echo -e "=================================" echo"" -echo "./query_gsquery.py -a \"${ip}\" -p \"${queryport}\" -e \"${engine}\"" +echo -e "./query_gsquery.py -a \"${ip}\" -p \"${queryport}\" -e \"${engine}\"" 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 "${engine}" echo"" -echo "=================================" -echo "tcp Raw Output" -echo "=================================" +echo -e "TCP Raw Output" +echo -e "=================================" echo"" -echo "bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}''" +echo -e "bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}''" bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}'' querystatus="$?" if [ "${querystatus}" == "0" ]; then - echo "tcp query PASS" + echo -e "TCP query PASS" else - echo "tcp query FAIL" + echo -e "TCP query FAIL" fi echo"" -echo "=================================" -echo "udp Raw Output" -echo "=================================" +echo -e "UDP Raw Output" +echo -e "=================================" echo"" -echo "bash -c 'exec 3<> /dev/udp/'${ip}'/'${queryport}''" +echo -e "bash -c 'exec 3<> /dev/udp/'${ip}'/'${queryport}''" bash -c 'exec 3<> /dev/udp/'${ip}'/'${queryport}'' querystatus="$?" if [ "${querystatus}" == "0" ]; then - echo "udp query PASS" + echo -e "UPD query PASS" +else + echo -e "UPD query FAIL" +fi +echo -e "" +echo -e "Game Port" +echo -e "==================================================================" +echo -e "" +echo"" +echo -e "TCP Raw Output" +echo -e "=================================" +echo"" +echo -e "bash -c 'exec 3<> /dev/tcp/'${ip}'/'${port}''" +bash -c 'exec 3<> /dev/tcp/'${ip}'/'${port}'' +querystatus="$?" +if [ "${querystatus}" == "0" ]; then + echo -e "TCP query PASS" +else + echo -e "TCP query FAIL" +fi + +echo"" +echo -e "UDP Raw Output" +echo -e "=================================" +echo"" +echo -e "bash -c 'exec 3<> /dev/udp/'${ip}'/'${port}''" +bash -c 'exec 3<> /dev/udp/'${ip}'/'${port}'' +querystatus="$?" +if [ "${querystatus}" == "0" ]; then + echo -e "UDP query PASS" else - echo "udp query FAIL" + echo -e "UDP query FAIL" fi diff --git a/lgsm/functions/command_donate.sh b/lgsm/functions/command_donate.sh index a277b87b6..036307051 100644 --- a/lgsm/functions/command_donate.sh +++ b/lgsm/functions/command_donate.sh @@ -3,16 +3,15 @@ # Author: Daniel Gibbs # Website: https://linuxgsm.com # Description: Shows ways to donate - -echo -e "" +fn_print_ascii_logo echo -e "${lightyellow}Support LinuxGSM${default}" echo -e "=================================" echo -e "" echo -e "Been using LinuxGSM?" echo -e "Consider donating to support development." echo -e "" -echo -e "* ${blue}Patreon:${default} https://linuxgsm.com/patreon" -echo -e "* ${blue}PayPal:${default} https://linuxgsm.com/paypal" -echo -e "* ${blue}Flattr:${default} https://linuxgsm.com/flattr" +echo -e "* ${lightblue}Patreon:${default} https://linuxgsm.com/patreon" +echo -e "* ${lightblue}PayPal:${default} https://linuxgsm.com/paypal" +echo -e "* ${lightblue}Ko-Fi:${default} https://linuxgsm.com/ko-fi" echo -e "" -echo -e "LinuxGSM has been going since 2012" \ No newline at end of file +echo -e "LinuxGSM est. 2012" diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 3c0d6b356..b8b43785c 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -11,18 +11,18 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh -# Directories +# Directories. if [ -z "${webdir}" ]; then webdir="${rootdir}/public_html" fi fastdldir="${webdir}/fastdl" addonsdir="${systemdir}/addons" -# Server lua autorun dir, used to autorun lua on client connect to the server +# Server lua autorun dir, used to autorun lua on client connect to the server. luasvautorundir="${systemdir}/lua/autorun/server" luafastdlfile="lgsm_cl_force_fastdl.lua" luafastdlfullpath="${luasvautorundir}/${luafastdlfile}" -# Check if bzip2 is installed +# Check if bzip2 is installed. if [ -z "$(command -v bzip2 2>/dev/null)" ]; then fn_print_fail "bzip2 is not installed" fn_script_log_fatal "bzip2 is not installed" @@ -31,18 +31,18 @@ fi # Header fn_print_header -echo "More info: https://docs.linuxgsm.com/commands/fastdl" -echo "" +echo -e "More info: https://docs.linuxgsm.com/commands/fastdl" +echo -e "" -# Prompts user for FastDL creation settings -echo "${commandaction} setup" -echo "=================================" +# Prompts user for FastDL creation settings. +echo -e "${commandaction} setup" +echo -e "=================================" -# Prompt for clearing old files if directory was already here +# Prompt for clearing old files if directory was already here. if [ -d "${fastdldir}" ]; then fn_print_warning_nl "FastDL directory already exists." - echo "${fastdldir}" - echo "" + echo -e "${fastdldir}" + echo -e "" if fn_prompt_yn "Overwrite existing directory?" Y; then fn_script_log_info "Overwrite existing directory: YES" else @@ -50,9 +50,9 @@ if [ -d "${fastdldir}" ]; then fi fi -# Garry's Mod Specific +# Garry's Mod Specific. if [ "${shortname}" == "gmod" ]; then - # Prompt for download enforcer, which is using a .lua addfile resource generator + # Prompt for download enforcer, which is using a .lua addfile resource generator. if fn_prompt_yn "Force clients to download files?" Y; then luaresource="on" fn_script_log_info "Force clients to download files: YES" @@ -62,9 +62,9 @@ if [ "${shortname}" == "gmod" ]; then fi fi -# Clears any fastdl directory content +# Clears any fastdl directory content. fn_clear_old_fastdl(){ - # Clearing old FastDL + # Clearing old FastDL. if [ -d "${fastdldir}" ]; then echo -en "clearing existing FastDL directory ${fastdldir}..." rm -R "${fastdldir:?}" @@ -77,12 +77,12 @@ fn_clear_old_fastdl(){ fn_print_ok_eol_nl fn_script_log_pass "Clearing existing FastDL directory ${fastdldir}" fi - sleep 0.5 + fn_sleep_time fi } fn_fastdl_dirs(){ - # Check and create directories + # Check and create directories. if [ ! -d "${webdir}" ]; then echo -en "creating web directory ${webdir}..." mkdir -p "${webdir}" @@ -95,7 +95,7 @@ fn_fastdl_dirs(){ fn_print_ok_eol_nl fn_script_log_pass "Creating web directory ${webdir}" fi - sleep 0.5 + fn_sleep_time fi if [ ! -d "${fastdldir}" ]; then echo -en "creating fastdl directory ${fastdldir}..." @@ -109,7 +109,7 @@ fn_fastdl_dirs(){ fn_print_ok_eol_nl fn_script_log_pass "Creating fastdl directory ${fastdldir}" fi - sleep 0.5 + fn_sleep_time fi } @@ -129,7 +129,7 @@ fn_human_readable_file_size(){ local precision="${2}" if [[ "${bytes}" == "1" ]]; then - echo "1 byte" + echo -e "1 byte" else for item in "${abbrevs[@]}"; do local factor="${item%:*}" @@ -143,9 +143,9 @@ fn_human_readable_file_size(){ fi } -# Provides info about the fastdl directory content and prompts for confirmation +# Provides info about the fastdl directory content and prompts for confirmation. fn_fastdl_preview(){ - # Remove any file list + # Remove any file list. if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then rm -f "${tmpdir}/fastdl_files_to_compress.txt" fi @@ -162,10 +162,12 @@ fn_fastdl_preview(){ ((fileswc++)) tput rc; tput el printf "gathering ${allowed_extention} : ${fileswc}..." - echo "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" + 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 fi done # Source engine @@ -191,22 +193,24 @@ fn_fastdl_preview(){ ((fileswc++)) tput rc; tput el printf "gathering ${directory} ${allowed_extention} : ${fileswc}..." - echo "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" + echo -e "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" done < <(find "${systemdir}/${directory}" -type f -iname ${allowed_extention}) tput rc; tput el - printf "gathering ${directory} ${allowed_extention} : ${fileswc}..." + echo -e "gathering ${directory} ${allowed_extention} : ${fileswc}..." if [ ${fileswc} != 0 ]; then fn_print_ok_eol_nl + else + fn_print_info_eol_nl fi done fi done fi if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then - echo "calculating total file size..." - sleep 0.5 + echo -e "calculating total file size..." + fn_sleep_time totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt") - # Calculates total file size + # Calculates total file size. while read -r dufile; do filesize=$(stat -c %s "${dufile}") filesizetotal=$(( ${filesizetotal} + ${filesize} )) @@ -222,7 +226,7 @@ fn_fastdl_preview(){ fn_script_log_fatal "Generating file list." core_exit.sh fi - echo "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" + 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)" rm "${tmpdir}/fastdl_files_to_compress.txt" if ! fn_prompt_yn "Continue?" Y; then @@ -231,7 +235,7 @@ fn_fastdl_preview(){ fi } -# Builds Garry's Mod fastdl directory content +# Builds Garry's Mod fastdl directory content. fn_fastdl_gmod(){ cd "${systemdir}" || exit for allowed_extention in "${allowed_extentions_array[@]}" @@ -241,7 +245,7 @@ fn_fastdl_gmod(){ while read -r fastdlfile; do ((fileswc++)) tput rc; tput el - printf "copying ${allowed_extention} : ${fileswc}..." + echo -e "copying ${allowed_extention} : ${fileswc}..." cp --parents "${fastdlfile}" "${fastdldir}" exitcode=$? if [ ${exitcode} -ne 0 ]; then @@ -251,12 +255,12 @@ fn_fastdl_gmod(){ else fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}" fi - done < <(find . -type f -iname ${allowed_extention}) + done < <(find . -type f -iname "${allowed_extention}") if [ ${fileswc} != 0 ]; then 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..." cp -Rf "${fastdldir}"/addons/*/* "${fastdldir}" @@ -269,9 +273,9 @@ fn_fastdl_gmod(){ fn_print_ok_eol_nl fn_script_log_pass "Updating addons file structure" fi - # Clear addons directory in fastdl + # Clear addons directory in fastdl. echo -en "clearing addons dir from fastdl dir..." - sleep 0.5 + fn_sleep_time rm -R "${fastdldir:?}/addons" exitcode=$? if [ ${exitcode} -ne 0 ]; then @@ -283,10 +287,10 @@ fn_fastdl_gmod(){ fn_script_log_pass "Clearing addons dir from fastdl dir" fi fi - # Correct content that may be into a lua directory by mistake like some darkrpmodification addons + # 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..." - sleep 1 + fn_sleep_time cp -Rf "${fastdldir}/lua/"* "${fastdldir}" exitcode=$? if [ ${exitcode} -ne 0 ]; then @@ -300,7 +304,7 @@ fn_fastdl_gmod(){ fi if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt") - # Calculates total file size + # Calculates total file size. while read dufile; do filesize=$(du -b "${dufile}" | awk '{ print $1 }') filesizetotal=$(( ${filesizetotal} + ${filesize} )) @@ -331,18 +335,22 @@ fn_fastdl_source(){ ((fileswc++)) tput rc; tput el printf "copying ${directory} ${allowed_extention} : ${fileswc}..." - sleep 0.01 - if [ ! -d "${fastdldir}/${directory}" ]; then - mkdir "${fastdldir}/${directory}" + fn_sleep_time + # get relative path of file in the dir + tmprelfilepath="${fastdlfile#"${systemdir}/"}" + copytodir="${tmprelfilepath%/*}" + # create relative path for fastdl + if [ ! -d "${fastdldir}/${copytodir}" ]; then + mkdir -p "${fastdldir}/${copytodir}" fi - cp "${fastdlfile}" "${fastdldir}/${directory}" + cp "${fastdlfile}" "${fastdldir}/${copytodir}" exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Copying ${fastdlfile} > ${fastdldir}/${directory}" + fn_script_log_fatal "Copying ${fastdlfile} > ${fastdldir}/${copytodir}" core_exit.sh else - fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}/${directory}" + fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}/${copytodir}" fi done < <(find "${systemdir}/${directory}" -type f -iname ${allowed_extention}) if [ ${fileswc} != 0 ]; then @@ -353,9 +361,9 @@ fn_fastdl_source(){ done } -# Builds the fastdl directory content +# Builds the fastdl directory content. fn_fastdl_build(){ - # Copy all needed files for FastDL + # Copy all needed files for FastDL. echo -e "copying files to ${fastdldir}" fn_script_log_info "Copying files to ${fastdldir}" if [ "${shortname}" == "gmod" ]; then @@ -366,9 +374,9 @@ fn_fastdl_build(){ fi } -# Generate lua file that will force download any file into the FastDL directory +# Generate lua file that will force download any file into the FastDL directory. fn_fastdl_gmod_dl_enforcer(){ - # Clear old lua file + # Clear old lua file. if [ -f "${luafastdlfullpath}" ]; then echo -en "removing existing download enforcer: ${luafastdlfile}..." rm "${luafastdlfullpath:?}" @@ -382,13 +390,13 @@ fn_fastdl_gmod_dl_enforcer(){ fn_script_log_pass "Removing existing download enforcer ${luafastdlfullpath}" fi fi - # Generate new one if user said yes + # Generate new one if user said yes. if [ "${luaresource}" == "on" ]; then echo -en "creating new download enforcer: ${luafastdlfile}..." touch "${luafastdlfullpath}" - # Read all filenames and put them into a lua file at the right path + # Read all filenames and put them into a lua file at the right path. while read -r line; do - echo "resource.AddFile( \"${line}\" )" >> "${luafastdlfullpath}" + echo -e "resource.AddFile( \"${line}\" )" >> "${luafastdlfullpath}" done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -printf '%P\n') exitcode=$? if [ ${exitcode} -ne 0 ]; then @@ -402,7 +410,7 @@ fn_fastdl_gmod_dl_enforcer(){ fi } -# Compresses FastDL files using bzip2 +# Compresses FastDL files using bzip2. fn_fastdl_bzip2(){ while read -r filetocompress; do echo -en "\r\033[Kcompressing ${filetocompress}..." @@ -419,15 +427,15 @@ fn_fastdl_bzip2(){ fn_print_ok_eol_nl } -# Run functions +# Run functions. fn_fastdl_preview fn_clear_old_fastdl fn_fastdl_dirs fn_fastdl_build fn_fastdl_bzip2 -# Finished message -echo "FastDL files are located in:" -echo "${fastdldir}" -echo "FastDL completed" +# Finished message. +echo -e "FastDL files are located in:" +echo -e "${fastdldir}" +echo -e "FastDL completed" fn_script_log_info "FastDL completed" core_exit.sh diff --git a/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh index 2d0a4aa30..2bc534d69 100644 --- a/lgsm/functions/command_install.sh +++ b/lgsm/functions/command_install.sh @@ -18,7 +18,7 @@ else install_logs.sh check_deps.sh installflag=1 - # Download and install + # Download and install. if [ "${shortname}" == "ut2k4" ]; then install_server_files.sh install_ut2k4_key.sh @@ -30,9 +30,9 @@ else install_server_files.sh fi - # Configuration + # Configuration. install_config.sh - if [ -v "${gslt}" ]; then + if [ -v gslt ]; then install_gslt.sh elif [ "${shortname}" == "dst" ]; then install_dst_token.sh diff --git a/lgsm/functions/command_install_resources_mta.sh b/lgsm/functions/command_install_resources_mta.sh index 7e7c4bb10..0eaa378bd 100644 --- a/lgsm/functions/command_install_resources_mta.sh +++ b/lgsm/functions/command_install_resources_mta.sh @@ -9,17 +9,22 @@ local commandaction="Default Resources" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_resources(){ - echo "" - echo "Installing Default Resources" - echo "=================================" + 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" fn_dl_extract "${tmpdir}" "mtasa-resources-latest.zip" "${resourcesdir}" - echo "Default Resources Installed." + echo -e "Default Resources Installed." } fn_print_header -fn_print_warning_nl "Installing the default resources with existing resources may cause issues." -if fn_prompt_yn "Do you want to install MTA default resources?" Y; then - fn_install_resources +if [ -z "${autoinstall}" ]; then + fn_print_warning_nl "Installing the default resources with existing resources may cause issues." + if fn_prompt_yn "Do you want to install MTA default resources?" Y; then + fn_install_resources + fi +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 diff --git a/lgsm/functions/command_mods_install.sh b/lgsm/functions/command_mods_install.sh index b26bb9e06..16ba9956f 100644 --- a/lgsm/functions/command_mods_install.sh +++ b/lgsm/functions/command_mods_install.sh @@ -14,43 +14,43 @@ mods_core.sh fn_print_header -# Displays a list of installed mods +# Displays a list of installed mods. fn_mods_installed_list if [ "${installedmodscount}" -gt "0" ]; then - echo "Installed addons/mods" - echo "=================================" - # Go through all available commands, get details and display them to the user + echo -e "Installed addons/mods" + echo -e "=================================" + # Go through all available commands, get details and display them to the user. for ((llindex=0; llindex < ${#installedmodslist[@]}; llindex++)); do - # Current mod is the "llindex" value of the array we're going through + # Current mod is the "llindex" value of the array we're going through. currentmod="${installedmodslist[llindex]}" fn_mod_get_info - # Display mod info to the user + # Display mod info to the user. echo -e " * ${green}${modcommand}${default}${default}" done - echo "" + echo -e "" fi -echo "Available addons/mods" -echo "=================================" -# Display available mods from mods_list.sh +echo -e "Available addons/mods" +echo -e "=================================" +# Display available mods from mods_list.sh. # Set and reset vars compatiblemodslistindex=0 -# As long as we're within index values +# As long as we're within index values. while [ "${compatiblemodslistindex}" -lt "${#compatiblemodslist[@]}" ]; do - # Set values for convenience + # Set values for convenience. displayedmodname="${compatiblemodslist[compatiblemodslistindex]}" displayedmodcommand="${compatiblemodslist[compatiblemodslistindex+1]}" displayedmodsite="${compatiblemodslist[compatiblemodslistindex+2]}" displayedmoddescription="${compatiblemodslist[compatiblemodslistindex+3]}" - # Output mods to the user + # Output mods to the user. echo -e "${displayedmodname} - ${displayedmoddescription} - ${displayedmodsite}" echo -e " * ${cyan}${displayedmodcommand}${default}" - # Increment index from the amount of values we just displayed + # Increment index from the amount of values we just displayed. let "compatiblemodslistindex+=4" ((totalmodsavailable++)) done -# If no mods are available for a specific game +# If no mods are available for a specific game. if [ -z "${compatiblemodslist}" ]; then fn_print_fail_nl "No mods are currently available for ${gamename}." fn_script_log_info "No mods are currently available for ${gamename}." @@ -58,35 +58,34 @@ if [ -z "${compatiblemodslist}" ]; then fi fn_script_log_info "${totalmodsavailable} addons/mods are available for install" -## User selects a mod -echo "" +## User selects a mod. +echo -e "" 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 + # Exit if user says exit or abort. if [ "${usermodselect}" == "exit" ]||[ "${usermodselect}" == "abort" ]; then core_exit.sh - # Supplementary output upon invalid user input + # Supplementary output upon invalid user input. elif [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; then fn_print_error2_nl "${usermodselect} is not a valid addon/mod." fi done -# Get mod info +# Get mod info. currentmod="${usermodselect}" fn_mod_get_info -echo "" -echo "Installing ${modprettyname}" -echo "=================================" +echo -e "" +echo -e "Installing ${modprettyname}" +echo -e "=================================" fn_script_log_info "${modprettyname} selected for install" -# Check if the mod is already installed and warn the user +# Check if the mod is already installed and warn the user. if [ -f "${modsinstalledlistfullpath}" ]; then if [ -n "$(sed -n "/^${modcommand}$/p" "${modsinstalledlistfullpath}")" ]; then fn_print_warning_nl "${modprettyname} is already installed" fn_script_log_warn "${modprettyname} is already installed" - sleep 0.5 - echo " * Any configs may be overwritten." + echo -e " * Any configs may be overwritten." if ! fn_prompt_yn "Continue?" Y; then echo Exiting; core_exit.sh fi @@ -94,7 +93,7 @@ if [ -f "${modsinstalledlistfullpath}" ]; then fi fi -## Installation +## Installation. fn_create_mods_dir fn_mods_clear_tmp_dir @@ -106,7 +105,7 @@ fn_mod_copy_destination fn_mod_add_list fn_mod_tidy_files_list fn_mods_clear_tmp_dir -echo "${modprettyname} installed" +echo -e "${modprettyname} installed" fn_script_log_pass "${modprettyname} installed." core_exit.sh diff --git a/lgsm/functions/command_mods_remove.sh b/lgsm/functions/command_mods_remove.sh index 7a0eb7dd2..3d2dae54b 100644 --- a/lgsm/functions/command_mods_remove.sh +++ b/lgsm/functions/command_mods_remove.sh @@ -14,37 +14,37 @@ mods_core.sh fn_mods_check_installed fn_print_header -echo "Remove addons/mods" -echo "=================================" +echo -e "Remove addons/mods" +echo -e "=================================" -## Displays list of installed mods -# Generates list to display to user +# Displays list of installed mods. +# Generates list to display to user. fn_mods_installed_list for ((mlindex=0; mlindex < ${#installedmodslist[@]}; mlindex++)); do - # Current mod is the "mlindex" value of the array we are going through + # Current mod is the "mlindex" value of the array we are going through. currentmod="${installedmodslist[mlindex]}" - # Get mod info + # Get mod info. fn_mod_get_info - # Display mod info to the user + # Display mod info to the user. echo -e "${red}${modcommand}${default} - ${modprettyname} - ${moddescription}" done -echo "" -# Keep prompting as long as the user input doesn't correspond to an available mod +echo -e "" +# Keep prompting as long as the user input doesn't correspond to an available mod. 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 + # Exit if user says exit or abort. if [ "${usermodselect}" == "exit" ]||[ "${usermodselect}" == "abort" ]; then core_exit.sh - # Supplementary output upon invalid user input + # Supplementary output upon invalid user input. elif [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; then fn_print_error2_nl "${usermodselect} is not a valid addon/mod." fi done fn_print_warning_nl "You are about to remove ${cyan}${usermodselect}${default}." -echo " * Any custom files/configuration will be removed." +echo -e " * Any custom files/configuration will be removed." if ! fn_prompt_yn "Continue?" Y; then echo Exiting; exit fi @@ -53,19 +53,19 @@ currentmod="${usermodselect}" fn_mod_get_info fn_check_mod_files_list -# Uninstall the mod +# Uninstall the mod. fn_script_log_info "Removing ${modsfilelistsize} files from ${modprettyname}" echo -e "removing ${modprettyname}" echo -e "* ${modsfilelistsize} files to be removed" echo -e "* location: ${modinstalldir}" -sleep 0.5 -# Go through every file and remove it +fn_sleep_time +# Go through every file and remove it. modfileline="1" tput sc while [ "${modfileline}" -le "${modsfilelistsize}" ]; do - # Current line defines current file to remove + # Current line defines current file to remove. currentfileremove="$(sed "${modfileline}q;d" "${modsdir}/${modcommand}-files.txt")" - # If file or directory exists, then remove it + # If file or directory exists, then remove it. if [ -f "${modinstalldir}/${currentfileremove}" ]||[ -d "${modinstalldir}/${currentfileremove}" ]; then rm -rf "${modinstalldir:?}/${currentfileremove}" @@ -78,7 +78,7 @@ while [ "${modfileline}" -le "${modsfilelistsize}" ]; do fi fi tput rc; tput el - echo "removing ${modprettyname} ${modfileline} / ${modsfilelistsize} : ${currentfileremove}..." + echo -e "removing ${modprettyname} ${modfileline} / ${modsfilelistsize} : ${currentfileremove}..." ((modfileline++)) done if [ ${exitcode} -ne 0 ]; then @@ -87,10 +87,10 @@ if [ ${exitcode} -ne 0 ]; then else fn_print_ok_eol_nl fi -sleep 0.5 -# Remove file list +fn_sleep_time +# Remove file list. echo -en "removing ${modcommand}-files.txt..." -sleep 0.5 +fn_sleep_time rm -rf "${modsdir}/${modcommand}-files.txt" local exitcode=$? if [ ${exitcode} -ne 0 ]; then @@ -102,9 +102,9 @@ else fn_print_ok_eol_nl fi -# Remove mods from installed mods list +# Remove mods from installed mods list. echo -en "removing ${modcommand} from ${modsinstalledlist}..." -sleep 0.5 +fn_sleep_time sed -i "/^${modcommand}$/d" "${modsinstalledlistfullpath}" local exitcode=$? @@ -118,7 +118,7 @@ else fi # Oxide fix -# Oxide replaces server files, so a validate is required after uninstall +# Oxide replaces server files, so a validate is required after uninstall. 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" @@ -126,7 +126,7 @@ if [ "${engine}" == "unity3d" ]&&[[ "${modprettyname}" == *"Oxide"* ]]; then command_validate.sh unset exitbypass fi -echo "${modprettyname} removed" +echo -e "${modprettyname} removed" fn_script_log "${modprettyname} removed" core_exit.sh diff --git a/lgsm/functions/command_mods_update.sh b/lgsm/functions/command_mods_update.sh index b80e4416e..5faa2f313 100644 --- a/lgsm/functions/command_mods_update.sh +++ b/lgsm/functions/command_mods_update.sh @@ -12,77 +12,75 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" 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 +# 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 echo -e "the following files/directories will be preserved:" - sleep 0.5 - # Count how many files there are to remove - filestopreserve="$(echo "${modkeepfiles}" | awk -F ';' '{ print NF }')" - # Test all subvalues of "modkeepfiles" using the ";" separator + fn_sleep_time + # 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 - # Put the current file we are looking for into a variable - filetopreserve="$(echo "${modkeepfiles}" | awk -F ';' -v x=${preservefilesindex} '{ print $x }' )" + # Put the current file we are looking for into a variable. + 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 it matches an existing file that have been extracted delete the file. if [ -f "${extractdir}/${filetopreserve}" ]||[ -d "${extractdir}/${filetopreserve}" ]; then rm -r "${extractdir:?}/${filetopreserve}" - # Write the file path in a tmp file, to rebuild a full file list as it is rebuilt upon update + # 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 "${filetopreserve}" >> "${modsdir}/.removedfiles.tmp" + echo -e "${filetopreserve}" >> "${modsdir}/.removedfiles.tmp" fi done fi } fn_print_dots "Update addons/mods" -sleep 0.5 fn_mods_check_installed fn_print_info_nl "Update addons/mods: ${installedmodscount} addons/mods will be updated" 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 +# Go through all available commands, get details and display them to the user. for ((ulindex=0; ulindex < ${#installedmodslist[@]}; ulindex++)); do - # Current mod is the "ulindex" value of the array we're going through + # Current mod is the "ulindex" value of the array we're going through. currentmod="${installedmodslist[ulindex]}" fn_mod_get_info - # Display installed mods and the update policy + # Display installed mods and the update policy. if [ -z "${modkeepfiles}" ]; then - # If modkeepfiles is not set for some reason, that's a problem + # If modkeepfiles is not set for some reason, that's a problem. fn_script_log_error "Could not find update policy for ${modprettyname}" fn_print_error_nl "Could not find update policy for ${modprettyname}" exitcode="1" core_exit.sh - # If the mod won't get updated + # If the mod won't get updated. elif [ "${modkeepfiles}" == "NOUPDATE" ]; then echo -e " * ${red}{modprettyname}${default} (won't be updated)" - # If the mode is just overwritten + # If the mode is just overwritten. elif [ "${modkeepfiles}" == "OVERWRITE" ]; then echo -e " * ${modprettyname} (overwrite)" else echo -e " * ${yellow}${modprettyname}${default} (retain common custom files)" fi done -sleep 0.5 ## Update -# List all installed mods and apply update -# Reset line value +# List all installed mods and apply update. +# Reset line value. installedmodsline="1" while [ "${installedmodsline}" -le "${installedmodscount}" ]; do currentmod="$(sed "${installedmodsline}q;d" "${modsinstalledlistfullpath}")" if [ -n "${currentmod}" ]; then fn_mod_get_info - # Don not update mod if the policy is set to "NOUPDATE" + # Don not update mod if the policy is set to "NOUPDATE". if [ "${modkeepfiles}" == "NOUPDATE" ]; then fn_print_info "${modprettyname} will not be updated to preserve custom files" fn_script_log_info "${modprettyname} will not be updated to preserve custom files" else - echo "" - echo "==> Updating ${modprettyname}" + echo -e "" + echo -e "==> Updating ${modprettyname}" fn_create_mods_dir fn_mods_clear_tmp_dir fn_mods_create_tmp_dir @@ -103,7 +101,7 @@ while [ "${installedmodsline}" -le "${installedmodscount}" ]; do core_exit.sh fi done -echo "" +echo -e "" fn_print_ok_nl "Mods update complete" fn_script_log_info "Mods update complete" diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index d231a122c..e25b9b142 100644 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -18,8 +18,14 @@ 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" - sleep 0.5 - if [ "${querymethod}" == "gamedig" ]; then + if [ "$(cat "${rootdir}/${lockselfname}")" -gt "$(date "+%s" -d "${querydelay} mins ago")" ]; then + fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_delay_eol + fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt} : DELAY" + fn_script_log_info "Query bypassed: ${gameservername} started less than ${querydelay} minute ago" + monitorpass=1 + core_exit.sh + elif [ "${querymethod}" == "gamedig" ]; then query_gamedig.sh elif [ "${querymethod}" == "gsquery" ]; then if [ ! -f "${functionsdir}/query_gsquery.py" ]; then @@ -53,7 +59,6 @@ for queryattempt in {1..5}; do if [ "${querystatus}" == "0" ]; then # Server query OK. - sleep 0.5 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" @@ -64,7 +69,6 @@ for queryattempt in {1..5}; do fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt}: FAIL" fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " fn_print_fail_eol - sleep 0.5 # Monitor try gamedig first then gsquery before restarting. if [ "${querymethod}" == "gsquery" ]; then if [ "${totalseconds}" -ge "59" ]; then @@ -72,7 +76,6 @@ for queryattempt in {1..5}; do fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " fn_print_fail_eol_nl fn_script_log_error "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt}: FAIL" - sleep 0.5 # Send alert if enabled. alert="restartquery" @@ -90,7 +93,6 @@ for queryattempt in {1..5}; do for seconds in {1..15}; do fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: WAIT" totalseconds=$((totalseconds + 1)) - sleep 1 if [ "${seconds}" == "15" ]; then break fi @@ -104,17 +106,16 @@ fn_monitor_check_lockfile(){ if [ ! -f "${rootdir}/${lockselfname}" ]; then fn_print_error_nl "Disabled: No lockfile found" fn_script_log_error "Disabled: No lockfile found" - echo " * To enable monitor run ./${selfname} start" + echo -e " * To enable monitor run ./${selfname} start" core_exit.sh fi } fn_monitor_check_update(){ - # Monitor will not check if update is running. - if [ "$(ps -ef | grep "${selfname} update" | grep -v grep | wc -l)" != "0" ]; then + # Monitor will check if update is already running. + if [ "$(pgrep "${selfname} update" | wc -l)" != "0" ]; then fn_print_error_nl "SteamCMD is currently checking for updates" fn_script_log_error "SteamCMD is currently checking for updates" - sleep 0.5 core_exit.sh fi } @@ -123,7 +124,6 @@ fn_monitor_check_session(){ fn_print_dots "Checking session: " fn_print_checking_eol fn_script_log_info "Checking session: CHECKING" - sleep 0.5 if [ "${status}" != "0" ]; then fn_print_ok "Checking session: " fn_print_ok_eol_nl @@ -141,17 +141,15 @@ fn_monitor_check_session(){ alert="restart" alert.sh fn_script_log_info "Monitor is starting ${servername}" - sleep 0.5 command_restart.sh core_exit.sh fi - sleep 0.5 } fn_monitor_query(){ fn_script_log_info "Querying port: query enabled" # Engines that work with query. - local allowed_engines_array=( avalanche2.0 avalanche3.0 goldsource idtech2 idtech3 idtech3_ql ioquake3 iw2.0 iw3.0 lwjgl2 madness quake refractor realvirtuality source spark starbound unity3d unreal unreal2 unreal4 wurm ) + local allowed_engines_array=( avalanche2.0 avalanche3.0 barotrauma goldsource idtech2 idtech3 idtech3_ql ioquake3 iw2.0 iw3.0 lwjgl2 madness quake qfusion refractor realvirtuality source spark starbound unity3d unreal unreal2 unreal4 wurm ) for allowed_engine in "${allowed_engines_array[@]}" do if [ "${allowed_engine}" == "${engine}" ]; then @@ -194,14 +192,13 @@ fn_monitor_query_tcp(){ fn_monitor_loop } -fn_monitor_query_upd(){ +fn_monitor_query_udp(){ querymethod="upd" fn_monitor_loop } monitorflag=1 fn_print_dots "${servername}" -sleep 0.5 check.sh logs.sh info_config.sh @@ -210,6 +207,17 @@ info_parms.sh fn_monitor_check_lockfile fn_monitor_check_update fn_monitor_check_session + +# Fix if lockfile is not unix time or contains letters +if [[ "$(cat "${rootdir}/${lockselfname}")" =~ [A-Za-z] ]]; then + date '+%s' > "${rootdir}/${lockselfname}" +fi + +# Add a query bypass if missing +if [ -z "${querydelay}" ]; then + querydelay="1" +fi + # Query has to be enabled in Starbound config. if [ "${shortname}" == "sb" ]; then if [ "${queryenabled}" == "true" ]; then @@ -217,7 +225,11 @@ if [ "${shortname}" == "sb" ]; then fi elif [ "${shortname}" == "ts3" ]||[ "${shortname}" == "eco" ]||[ "${shortname}" == "mumble" ]; then fn_monitor_query_tcp +elif [ "${shortname}" == "mohaa" ]; then + # prevent game from using query. Only used if specific game server cant query but engine can + : else fn_monitor_query fi + core_exit.sh diff --git a/lgsm/functions/command_postdetails.sh b/lgsm/functions/command_postdetails.sh index 660bb326f..9ce9920a4 100644 --- a/lgsm/functions/command_postdetails.sh +++ b/lgsm/functions/command_postdetails.sh @@ -31,10 +31,10 @@ posttarget=${posttarget="https://hastebin.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 +# 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 +# source all of the functions defined in the details command. info_messages.sh fn_bad_postdetailslog() { @@ -42,12 +42,12 @@ fn_bad_postdetailslog() { core_exit.sh } -# Remove any existing postdetails.log file +# 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 +# Rather than a one-pass sed parser, default to using a temporary directory. if [ -n "${alertflag}" ]; then postdetailslog="${alertlog}" else @@ -56,14 +56,13 @@ else info_config.sh info_parms.sh info_distro.sh - info_glibc.sh info_messages.sh query_gamedig.sh touch "${postdetailslog}" || fn_bad_postdetailslog { fn_info_message_distro - fn_info_message_performance - fn_info_message_disk + fn_info_message_server_resource + fn_info_message_gameserver_resource fn_info_message_gameserver fn_info_message_script fn_info_message_backup @@ -80,7 +79,6 @@ fi if [ "${posttarget}" == "http://pastebin.com" ] ; then fn_print_dots "Posting details to pastbin.com for ${postexpire}" - sleep 0.5 # grab the return from 'value' from an initial visit to pastebin. csrftoken=$(${curlpath} -s "${posttarget}" | sed -n 's/^.*input type="hidden" name="csrf_token_post" value="\(.*\)".*$/\1/p') @@ -97,17 +95,23 @@ if [ "${posttarget}" == "http://pastebin.com" ] ; then # Output the resulting link. fn_print_ok_nl "Posting details to pastbin.com for ${postexpire}" pdurl="${posttarget}${link}" - echo " Please share the following url for support: ${pdurl}" + echo -e " Please share the following url for support: ${pdurl}" elif [ "${posttarget}" == "https://hastebin.com" ] ; then fn_print_dots "Posting details to hastebin.com" - sleep 0.5 # 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=$(${curlpath} -H "HTTP_X_REQUESTED_WITH:XMLHttpRequest" -s -d "$(<${postdetailslog})" "${posttarget}/documents" | cut -d\" -f4) fn_print_ok_nl "Posting details to hastebin.com for ${postexpire}" pdurl="${posttarget}/${link}" - echo " Please share the following url for support: ${pdurl}" + echo -e "Please share the following url for support: ${pdurl}" +elif [ "${posttarget}" == "https://termbin.com" ] ; then + fn_print_dots "Posting details to termbin.com" + link=$(cat "${postdetailslog}" | nc termbin.com 9999 | tr -d '\n\0') + fn_print_ok_nl "Posting details to termbin.com" + pdurl="${link}" + echo -e "Please share the following url for support: " + echo -e "${pdurl}" else fn_print_warn_nl "Review output in: ${postdetailslog}" core_exit.sh @@ -117,4 +121,4 @@ if [ -z "${alertflag}" ]; then core_exit.sh else alerturl="${pdurl}" -fi \ No newline at end of file +fi diff --git a/lgsm/functions/command_restart.sh b/lgsm/functions/command_restart.sh index db8678bb5..2ece0810c 100644 --- a/lgsm/functions/command_restart.sh +++ b/lgsm/functions/command_restart.sh @@ -11,4 +11,4 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" info_config.sh exitbypass=1 command_stop.sh -command_start.sh \ No newline at end of file +command_start.sh diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index e502eeacf..2b510ee74 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -15,32 +15,33 @@ fn_start_teamspeak3(){ fn_script_log_warn "${servercfgfullpath} is missing" echo " * Creating blank ${servercfg}" fn_script_log_info "Creating blank ${servercfg}" - sleep 1 + fn_sleep_time echo " * ${servercfg} can remain blank by default." fn_script_log_info "${servercfgfullpath} can remain blank by default." - sleep 1 + fn_sleep_time echo " * ${servercfg} is located in ${servercfgfullpath}." fn_script_log_info "${servercfg} is located in ${servercfgfullpath}." sleep 5 touch "${servercfgfullpath}" fi - sleep 0.5 + fn_sleep_time if [ -f "${lgsmlog}" ]; then mv "${lgsmlog}" "${lgsmlogdate}" fi - # Create lockfile - date > "${rootdir}/${lockselfname}" - # Accept license + + # Create lockfile. + date '+%s' > "${rootdir}/${lockselfname}" + # Accept license. if [ ! -f "${executabledir}/.ts3server_license_accepted" ]; then install_eula.sh fi - cd "${executabledir}" + cd "${executabledir}" || exit if [ "${ts3serverpass}" == "1" ]; then ./ts3server_startscript.sh start serveradmin_password="${newpassword}" inifile="${servercfgfullpath}" > /dev/null 2>&1 else ./ts3server_startscript.sh start inifile="${servercfgfullpath}" > /dev/null 2>&1 fi - sleep 0.5 + fn_sleep_time check_status.sh if [ "${status}" == "0" ]; then fn_print_fail_nl "Unable to start ${servername}" @@ -59,7 +60,7 @@ fn_start_tmux(){ else fn_parms fi - # check for tmux size variables + # check for tmux size variables. if [[ "${servercfgtmuxwidth}" =~ ^[0-9]+$ ]]; then sessionwidth="${servercfgtmuxwidth}" else @@ -71,7 +72,7 @@ fn_start_tmux(){ sessionheight="23" fi - # Log rotation + # Log rotation. fn_script_log_info "Rotating log files" if [ "${engine}" == "unreal2" ]&&[ -f "${gamelog}" ]; then mv "${gamelog}" "${gamelogdate}" @@ -85,93 +86,92 @@ fn_start_tmux(){ # Create lockfile date > "${rootdir}/${lockselfname}" - cd "${executabledir}" + cd "${executabledir}" || exit tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${servicename}" "${executable} ${parms}" 2> "${lgsmlogdir}/.${servicename}-tmux-error.tmp" - # Create logfile + # Create logfile. touch "${consolelog}" - # Get tmux version + # Get tmux version. tmuxversion="$(tmux -V | sed "s/tmux //" | sed -n '1 p')" - # Tmux compiled from source will return "master", therefore ignore it + # 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 "Tmux version: master (user compiled)" >> "${consolelog}" + echo -e "Tmux version: master (user compiled)" >> "${consolelog}" if [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then tmux pipe-pane -o -t "${servicename}" "exec cat >> '${consolelog}'" fi elif [ -n "${tmuxversion}" ]; then - # Get the digit version of tmux + # 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 + # tmux pipe-pane not supported in tmux versions < 1.6. if [ "${tmuxversion}" -lt "16" ]; then - echo "Console logging disabled: Tmux => 1.6 required + 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 + # Console logging disabled: Bug in tmux 1.8 breaks logging. elif [ "${tmuxversion}" -eq "18" ]; then - echo "Console logging disabled: Bug in tmux 1.8 breaks logging + 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 + # Console logging enable or not set. elif [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then tmux pipe-pane -o -t "${servicename}" "exec cat >> '${consolelog}'" fi else - echo "Unable to detect tmux version" >> "${consolelog}" + echo -e "Unable to detect tmux version" >> "${consolelog}" fn_script_log_warn "Unable to detect tmux version" fi -# Console logging disabled +# Console logging disabled. if [ "${consolelogging}" == "off" ]; then - echo "Console logging disabled by user" >> "${consolelog}" + echo -e "Console logging disabled by user" >> "${consolelog}" fn_script_log_info "Console logging disabled by user" fi -sleep 0.5 +fn_sleep_time - # If the server fails to start + # 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}" - sleep 0.5 if [ -s "${lgsmlogdir}/.${servicename}-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 "" - echo "Command" - echo "=================================" - echo "tmux new-session -d -s \"${servicename}\" \"${executable} ${parms}\"" | tee -a "${lgsmlog}" - echo "" - echo "Error" - echo "=================================" + echo -e "" + echo -e "Command" + echo -e "=================================" + echo -e "tmux new-session -d -s \"${servicename}\" \"${executable} ${parms}\"" | tee -a "${lgsmlog}" + echo -e "" + echo -e "Error" + echo -e "=================================" cat "${lgsmlogdir}/.${servicename}-tmux-error.tmp" | tee -a "${lgsmlog}" # Detected error https://linuxgsm.com/support if grep -c "Operation not permitted" "${lgsmlogdir}/.${servicename}-tmux-error.tmp" then - echo "" - echo "Fix" - echo "=================================" - if [ ! $(grep "tty:" /etc/group|grep "$(whoami)") ]; then - echo "$(whoami) is not part of the tty group." + 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 "" - echo " ${group}" + echo -e "" + echo -e " ${group}" fn_script_log_info "${group}" - echo "" - echo "Run the following command with root privileges." - echo "" - echo " usermod -G tty $(whoami)" - echo "" - echo "https://linuxgsm.com/tmux-op-perm" + 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 "No known fix currently. Please log an issue." + echo -e "No known fix currently. Please log an issue." fn_script_log_info "No known fix currently. Please log an issue." - echo "https://linuxgsm.com/support" + echo -e "https://linuxgsm.com/support" fn_script_log_info "https://linuxgsm.com/support" fi fi @@ -193,10 +193,10 @@ if [ -f /.dockerenv ]; then install_config.sh fi -sleep 0.5 check.sh -# Is the server already started -if [ "${status}" != "0" ]; then # $status comes from check_status.sh, which is run by check.sh for this command +# 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_info_nl "${servername} is already running" fn_script_log_error "${servername} is already running" if [ -z "${exitbypass}" ]; then @@ -209,7 +209,7 @@ fi info_config.sh logs.sh -# Will check for updates is updateonstart is yes +# Will check for updates is updateonstart is yes. if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateonstart}" == "on" ]; then exitbypass=1 unset updateonstart diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index fc43476e6..01cce6a4a 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -9,13 +9,13 @@ local commandname="STOP" local commandaction="Stopping" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -# Attempts graceful shutdown by sending the 'CTRL+c'. +# Attempts graceful shutdown by sending 'CTRL+c'. fn_stop_graceful_ctrlc(){ fn_print_dots "Graceful: CTRL+c" fn_script_log_info "Graceful: CTRL+c" - # sends quit + # Sends quit. tmux send-keys -t "${servicename}" C-c > /dev/null 2>&1 - # waits up to 30 seconds giving the server time to shutdown gracefuly + # Waits up to 30 seconds giving the server time to shutdown gracefuly. for seconds in {1..30}; do check_status.sh if [ "${status}" == "0" ]; then @@ -33,18 +33,18 @@ fn_stop_graceful_ctrlc(){ fn_print_fail_eol_nl fn_script_log_error "Graceful: CTRL+c: FAIL" fi - sleep 0.5 + fn_sleep_time } # 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" +# e.g.: fn_stop_graceful_cmd "quit" "30" fn_stop_graceful_cmd(){ fn_print_dots "Graceful: sending \"${1}\"" fn_script_log_info "Graceful: sending \"${1}\"" - # sends specific stop command + # Sends specific stop command. tmux send -t "${servicename}" "${1}" ENTER > /dev/null 2>&1 - # waits up to given seconds giving the server time to shutdown gracefully + # Waits up to ${seconds} seconds giving the server time to shutdown gracefully. for ((seconds=1; seconds<=${2}; seconds++)); do check_status.sh if [ "${status}" == "0" ]; then @@ -62,19 +62,18 @@ fn_stop_graceful_cmd(){ fn_print_fail_eol_nl fn_script_log_error "Graceful: sending \"${1}\": FAIL" fi - sleep 0.5 + fn_sleep_time } -# Attempts graceful of goldsource using rcon 'quit' command. -# Goldsource 'quit' command restarts rather than shutdown -# this function will only wait 3 seconds then force a tmux shutdown. -# preventing the server from coming back online. +# Attempts graceful shutdown of goldsource using rcon 'quit' command. +# There is only a 3 second delay before a forced a tmux shutdown +# as Goldsource servers 'quit' command does a restart rather than shutdown. fn_stop_graceful_goldsource(){ fn_print_dots "Graceful: sending \"quit\"" fn_script_log_info "Graceful: sending \"quit\"" # sends quit tmux send -t "${servicename}" quit ENTER > /dev/null 2>&1 - # waits 3 seconds as goldsource servers restart with the quit command + # Waits 3 seconds as goldsource servers restart with the quit command. for seconds in {1..3}; do sleep 1 fn_print_dots "Graceful: sending \"quit\": ${seconds}" @@ -82,11 +81,10 @@ fn_stop_graceful_goldsource(){ fn_print_ok "Graceful: sending \"quit\": ${seconds}: " fn_print_ok_eol_nl fn_script_log_pass "Graceful: sending \"quit\": OK: ${seconds} seconds" - sleep 0.5 } -# Attempts graceful of 7 Days To Die using telnet. -fn_stop_telnet_sdtd(){ +# telnet command for sdtd graceful shutdown. +fn_stop_graceful_sdtd_telnet(){ if [ -z "${telnetpass}" ]||[ "${telnetpass}" == "NOT SET" ]; then sdtd_telnet_shutdown=$( expect -c ' proc abort {} { @@ -119,13 +117,13 @@ fn_stop_telnet_sdtd(){ expect { eof } puts "Completed.\n" ') - fi + fi } +# Attempts graceful shutdown of 7 Days To Die using telnet. fn_stop_graceful_sdtd(){ fn_print_dots "Graceful: telnet" fn_script_log_info "Graceful: telnet" - sleep 0.5 if [ "${telnetenabled}" == "false" ]; then fn_print_info_nl "Graceful: telnet: DISABLED: Enable in ${servercfg}" elif [ "$(command -v expect 2>/dev/null)" ]; then @@ -133,25 +131,23 @@ fn_stop_graceful_sdtd(){ for telnetip in 127.0.0.1 ${ip}; do fn_print_dots "Graceful: telnet: ${telnetip}:${telnetport}" fn_script_log_info "Graceful: telnet: ${telnetip}:${telnetport}" - sleep 0.5 - fn_stop_telnet_sdtd + 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") if [ -n "${refused}" ]; then fn_print_error "Graceful: telnet: ${telnetip}:${telnetport} : " fn_print_fail_eol_nl fn_script_log_error "Graceful: telnet: ${telnetip}:${telnetport} : FAIL" - sleep 1 elif [ -n "${completed}" ]; then break fi done - # If telnet was successful will use telnet again to check the connection has closed - # This confirms that the tmux session can now be killed. + # 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 [ -n "${completed}" ]; then for seconds in {1..30}; do - fn_stop_telnet_sdtd + fn_stop_graceful_sdtd_telnet refused=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Timeout or EOF") if [ -n "${refused}" ]; then fn_print_ok "Graceful: telnet: ${telnetip}:${telnetport} : " @@ -162,8 +158,7 @@ fn_stop_graceful_sdtd(){ sleep 1 fn_print_dots "Graceful: telnet: ${seconds}" done - # If telnet failed will go straight to tmux shutdown. - # If cannot shutdown correctly world save may be lost + # If telnet shutdown fails tmux shutdown will be used, this risks loss of world save. else if [ -n "${refused}" ]; then fn_print_error "Graceful: telnet: " @@ -183,77 +178,38 @@ fn_stop_graceful_sdtd(){ fn_print_fail_eol_nl fn_script_log_warn "Graceful: telnet: expect not installed: FAIL" fi - sleep 0.5 + fn_sleep_time } fn_stop_graceful_select(){ - if [ "${shortname}" == "sdtd" ]; then - fn_stop_graceful_sdtd - elif [ "${engine}" == "Spark" ]; then + if [ "${stopmode}" == "1" ]; then + fn_stop_tmux + elif [ "${stopmode}" == "2" ]; then + fn_stop_graceful_ctrlc + elif [ "${stopmode}" == "3" ]; then + fn_stop_graceful_cmd "quit" 30 + elif [ "${stopmode}" == "4" ]; then + fn_stop_graceful_cmd "quit" 120 + elif [ "${stopmode}" == "5" ]; then + fn_stop_graceful_cmd "stop" 30 + elif [ "${stopmode}" == "6" ]; then fn_stop_graceful_cmd "q" 30 - elif [ "${shortname}" == "terraria" ]; then + elif [ "${stopmode}" == "7" ]; then fn_stop_graceful_cmd "exit" 30 - elif [ "${shortname}" == "mc" ]; then - fn_stop_graceful_cmd "stop" 30 - elif [ "${shortname}" == "mta" ]; then - # we need a long wait time here as resources are stopped individually and process their own shutdowns - fn_stop_graceful_cmd "quit" 120 - elif [ "${engine}" == "goldsource" ]; then + elif [ "${stopmode}" == "8" ]; then + fn_stop_graceful_sdtd + elif [ "${stopmode}" == "9" ]; then fn_stop_graceful_goldsource - elif [ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal4" ]||[ "${engine}" == "unreal3" ]||[ "${engine}" == "unreal2" ]||[ "${engine}" == "unreal" ]||[ "${shortname}" == "fctr" ]||[ "${shortname}" == "mumble" ]||[ "${shortname}" == "wurm" ]||[ "${shortname}" == "jc2" ]||[ "${shortname}" == "jc3" ]; then - fn_stop_graceful_ctrlc - elif [ "${engine}" == "source" ]||[ "${engine}" == "quake" ]||[ "${engine}" == "idtech2" ]||[ "${engine}" == "idtech3" ]||[ "${engine}" == "idtech3_ql" ]||[ "${shortname}" == "jc2" ]||[ "${shortname}" == "pz" ]||[ "${shortname}" == "rw" ]; then - fn_stop_graceful_cmd "quit" 30 + elif [ "${stopmode}" == "10" ]; then + fn_stop_teamspeak3 fi } -fn_stop_ark(){ - maxpiditer=15 # The maximum number of times to check if the ark pid has closed gracefully. - info_config.sh - if [ -z "${queryport}" ]; then - fn_print_warn "No queryport found using info_config.sh" - fn_script_log_warn "No queryport found using info_config.sh" - userconfigfile="${serverfiles}" - userconfigfile+="/ShooterGame/Saved/Config/LinuxServer/GameUserSettings.ini" - queryport=$(grep ^QueryPort= ${userconfigfile} | cut -d= -f2 | sed "s/[^[:digit:].*].*//g") - fi - if [ -z "${queryport}" ]; then - fn_print_warn "No queryport found in the GameUsersettings.ini file" - fn_script_log_warn "No queryport found in the GameUsersettings.ini file" - return - fi - - if [ "${#queryport}" -gt 0 ] ; then - for (( pidcheck=0 ; pidcheck < ${maxpiditer} ; pidcheck++ )) ; do - pid=$(netstat -nap 2>/dev/null | grep "^udp[[:space:]]" | grep ":${queryport}[[:space:]]" | rev | awk '{print $1}' | rev | cut -d\/ -f1) - # - # check for a valid pid - pid=${pid//[!0-9]/} - let pid+=0 # turns an empty string into a valid number, '0', - # and a valid numeric pid remains unchanged. - if [ "${pid}" -gt 1 ]&&[ "${pid}" -le "$(cat "/proc/sys/kernel/pid_max")" ]; then - fn_print_dots "Process still bound. Awaiting graceful exit: ${pidcheck}" - sleep 0.5 - else - break # Our job is done here - fi # end if for pid range check - done - if [[ ${pidcheck} -eq ${maxpiditer} ]] ; then - # The process doesn't want to close after 20 seconds. - # kill it hard. - fn_print_error "Terminating reluctant Ark process: ${pid}" - kill -9 ${pid} - fi - fi # end if for port check -} # end of fn_stop_ark - fn_stop_teamspeak3(){ fn_print_dots "${servername}" - sleep 0.5 "${serverfiles}"/ts3server_startscript.sh stop > /dev/null 2>&1 check_status.sh if [ "${status}" == "0" ]; then - # Remove lockfile rm -f "${rootdir}/${lockselfname}" fn_print_ok_nl "${servername}" fn_script_log_pass "Stopped ${servername}" @@ -266,17 +222,11 @@ fn_stop_teamspeak3(){ fn_stop_tmux(){ fn_print_dots "${servername}" fn_script_log_info "tmux kill-session: ${servername}" - sleep 0.5 - # Kill tmux session + # Kill tmux session. tmux kill-session -t "${servicename}" > /dev/null 2>&1 - sleep 0.5 + fn_sleep_time check_status.sh if [ "${status}" == "0" ]; then - # ARK doesn't clean up immediately after tmux is killed. - # Make certain the ports are cleared before continuing. - if [ "${shortname}" == "ark" ]; then - fn_stop_ark - fi fn_print_ok_nl "${servername}" fn_script_log_pass "Stopped ${servername}" else @@ -285,18 +235,18 @@ fn_stop_tmux(){ fi } -# checks if the server is already stopped before trying to stop. +# Checks if the server is already stopped. fn_stop_pre_check(){ -# Is the server already stopped - if [ "${status}" == "0" ]; then # $status comes from check_status.sh, which is run by check.sh for this command + if [ "${status}" == "0" ]; then fn_print_info_nl "${servername} is already stopped" fn_script_log_error "${servername} is already stopped" elif [ "${shortname}" == "ts3" ]; then fn_stop_teamspeak3 else + # Select graceful shutdown. fn_stop_graceful_select fi - # Check status again, a stop tmux session if needed + # Check status again, a kill tmux session if graceful shutdown failed. check_status.sh if [ "${status}" != "0" ]; then fn_stop_tmux @@ -304,14 +254,13 @@ fn_stop_pre_check(){ } fn_print_dots "${servername}" -sleep 0.5 check.sh info_config.sh fn_stop_pre_check -# Remove lockfile +# Remove lockfile. if [ -f "${rootdir}/${lockselfname}" ]; then rm -f "${rootdir}/${lockselfname}" fi if [ -z "${exitbypass}" ]; then core_exit.sh -fi \ No newline at end of file +fi diff --git a/lgsm/functions/command_test_alert.sh b/lgsm/functions/command_test_alert.sh index ff5084696..014e082b2 100644 --- a/lgsm/functions/command_test_alert.sh +++ b/lgsm/functions/command_test_alert.sh @@ -9,7 +9,6 @@ local commandaction="Alert" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_dots "${servername}" -sleep 0.5 check.sh info_config.sh alert="test" diff --git a/lgsm/functions/command_ts3_server_pass.sh b/lgsm/functions/command_ts3_server_pass.sh index cbd3ad9ae..d05dfdfc5 100644 --- a/lgsm/functions/command_ts3_server_pass.sh +++ b/lgsm/functions/command_ts3_server_pass.sh @@ -11,10 +11,10 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_serveradmin_password_prompt(){ fn_print_header - echo "Press \"CTRL+b d\" to exit console." + echo -e "Press \"CTRL+b d\" to exit console." fn_print_information_nl "You are about to change the ${gamename} ServerAdmin password." fn_print_warning_nl "${gamename} will restart during this process." - echo "" + echo -e "" if ! fn_prompt_yn "Continue?" Y; then echo Exiting; exit fi @@ -25,22 +25,20 @@ fn_serveradmin_password_prompt(){ fn_serveradmin_password_set(){ fn_print_info_nl "Starting server with new password..." fn_script_log_info "Starting server with new password" - sleep 0.5 - # Start server in "new password mode" + # Start server in "new password mode". ts3serverpass="1" exitbypass="1" command_start.sh fn_print_ok_nl "Password applied" fn_script_log_pass "New ServerAdmin password applied" - sleep 0.5 } -# Running functions +# Running functions. check.sh fn_serveradmin_password_prompt check_status.sh if [ "${status}" != "0" ]; then - # Stop any running server + # Stop any running server. exitbypass="1" command_stop.sh fn_serveradmin_password_set diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh index 9c366ae61..c3c289d97 100644 --- a/lgsm/functions/command_update.sh +++ b/lgsm/functions/command_update.sh @@ -9,7 +9,6 @@ local commandaction="Update" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_dots "" -sleep 0.2 check.sh logs.sh diff --git a/lgsm/functions/command_update_functions.sh b/lgsm/functions/command_update_functions.sh index 33609b121..4825be027 100644 --- a/lgsm/functions/command_update_functions.sh +++ b/lgsm/functions/command_update_functions.sh @@ -10,4 +10,4 @@ functionfile="${FUNCNAME}" fn_fetch_function } -command_update_linuxgsm.sh \ No newline at end of file +command_update_linuxgsm.sh diff --git a/lgsm/functions/command_update_linuxgsm.sh b/lgsm/functions/command_update_linuxgsm.sh index c4c49aee5..4a70c7748 100644 --- a/lgsm/functions/command_update_linuxgsm.sh +++ b/lgsm/functions/command_update_linuxgsm.sh @@ -9,13 +9,12 @@ local commandaction="Update LinuxGSM" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_dots "Updating LinuxGSM" -sleep 0.5 check.sh fn_script_log_info "Updating LinuxGSM" echo -en "\n" if [ -z "${legacymode}" ]; then - # Check and update _default.cfg + # Check and update _default.cfg. echo -en " checking config _default.cfg...\c" config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(${curlpath} -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) if [ "${config_file_diff}" != "" ]; then @@ -72,7 +71,7 @@ if [ -z "${legacymode}" ]; then fi fi -# Check and update functions +# Check and update functions. if [ -n "${functionsdir}" ]; then if [ -d "${functionsdir}" ]; then cd "${functionsdir}" || exit diff --git a/lgsm/functions/command_validate.sh b/lgsm/functions/command_validate.sh index c324b93b8..78210ff4b 100644 --- a/lgsm/functions/command_validate.sh +++ b/lgsm/functions/command_validate.sh @@ -9,15 +9,12 @@ local commandaction="Validate" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_validation(){ - echo "" - echo -e " * Validating may overwrite some customised files." - echo -en " * https://developer.valvesoftware.com/wiki/SteamCMD#Validate" - sleep 3 - echo -en "\n" - + fn_print_info "Validating files: SteamCMD" + echo -e "" + echo -e "* Validating may overwrite some customised files." + echo -e "* https://docs.linuxgsm.com/commands/validate" fn_script_log_info "Validating files: SteamCMD" - sleep 0.5 - + sleep 3 cd "${steamcmddir}" || exit # Detects if unbuffer command is available for 32 bit distributions only. info_distro.sh @@ -26,11 +23,9 @@ fn_validation(){ fi if [ "${appid}" == "90" ]; then - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +app_update "${appid}" ${branch} validate +quit | tee -a "${lgsmlog}" - elif [ "${gamename}" == "Unturned" ]; then - ${unbuffer} ./steamcmd.sh +@sSteamCmdForcePlatformBitness 32 +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} validate +quit + ${unbuffer} ./steamcmd.sh +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} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} validate +quit | tee -a "${lgsmlog}" + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta ${branch} validate +quit | tee -a "${lgsmlog}" fi if [ $? != 0 ]; then fn_print_fail_nl "Validating files: SteamCMD" @@ -44,9 +39,7 @@ fn_validation(){ } fn_print_dots "Validating files:" -sleep 0.5 fn_print_dots "Validating files: SteamCMD" -sleep 0.5 check.sh check_status.sh if [ "${status}" != "0" ]; then diff --git a/lgsm/functions/command_wipe.sh b/lgsm/functions/command_wipe.sh index fdcbe424d..9c83d2897 100644 --- a/lgsm/functions/command_wipe.sh +++ b/lgsm/functions/command_wipe.sh @@ -13,7 +13,7 @@ check.sh fn_print_header fn_script_log "Entering ${gamename} ${commandaction}" -# Process to server wipe +# Process to server wipe. fn_wipe_server_process(){ check_status.sh if [ "${status}" != "0" ]; then @@ -25,11 +25,11 @@ fn_wipe_server_process(){ else fn_wipe_server_remove_files fi - echo "server data wiped" + echo -e "server data wiped" fn_script_log "server data wiped." } -# Provides an exit code upon error +# Provides an exit code upon error. fn_wipe_exit_code(){ ((exitcode=$?)) if [ ${exitcode} -ne 0 ]; then @@ -40,154 +40,147 @@ fn_wipe_exit_code(){ fi } -# Removes files to wipe server +# Removes files to wipe server. fn_wipe_server_remove_files(){ - # Rust Wipe + # Rust Wipe. if [ "${shortname}" == "rust" ]; then - # Wipe pocedural map + # Wipe pocedural map. if [ -n "$(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)..." - sleep 0.5 + fn_sleep_time fn_script_log "${currentaction}" find "${serveridentitydir:?}" -type f -name "proceduralmap.*.map" -delete fn_wipe_exit_code - sleep 0.5 + fn_sleep_time else fn_print_information_nl "No procedural map file to remove" fn_script_log_info "No procedural map file to remove." - sleep 0.5 fi - # Wipe procedural map save + # Wipe procedural map save. if [ -n "$(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)..." - sleep 0.5 + fn_sleep_time fn_script_log "${currentaction}" find "${serveridentitydir:?}" -type f -name "proceduralmap.*.sav" -delete fn_wipe_exit_code - sleep 0.5 + fn_sleep_time else fn_print_information_nl "No procedural map save to remove" fn_script_log_info "No procedural map save to remove." - sleep 0.5 fi - # Wipe Barren map + # Wipe Barren map. if [ -n "$(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)..." - sleep 0.5 + fn_sleep_time fn_script_log "${currentaction}" find "${serveridentitydir:?}" -type f -name "barren*.map" -delete fn_wipe_exit_code - sleep 0.5 + fn_sleep_time else fn_print_information_nl "No barren map file to remove" fn_script_log_info "No barren map file to remove." - sleep 0.5 fi - # Wipe barren map save + # Wipe barren map save. if [ -n "$(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)..." - sleep 0.5 + fn_sleep_time fn_script_log "${currentaction}" find "${serveridentitydir:?}" -type f -name "barren*.sav" -delete fn_wipe_exit_code - sleep 0.5 + fn_sleep_time else fn_print_information_nl "No barren map save to remove" fn_script_log_info "No barren map save to remove." - sleep 0.5 fi - # Wipe user dir, might be a legacy thing, maybe to be removed + # 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..." - sleep 0.5 + fn_sleep_time fn_script_log "${currentaction}" rm -rf "${serveridentitydir:?}/user" fn_wipe_exit_code - sleep 0.5 - # We do not print additional information if there is nothing to remove since this might be obsolete + 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 + # 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..." - sleep 0.5 + fn_sleep_time fn_script_log "${currentaction}" rm -rf "${serveridentitydir:?}/storage" fn_wipe_exit_code - sleep 0.5 - # We do not print additional information if there is nothing to remove since this might be obsolete + fn_sleep_time + # We do not print additional information if there is nothing to remove since this might be obsolete. fi - # Wipe sv.files + # Wipe sv.files. if [ -n "$(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)..." - sleep 0.5 + fn_sleep_time fn_script_log "${currentaction}" find "${serveridentitydir:?}" -type f -name "sv.files.*.d" -delete fn_wipe_exit_code - sleep 0.5 - # No further information if not found because it should I could not get this file showing up + 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 + # Wipe player death files. if [ -n "$(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)..." - sleep 0.5 + fn_sleep_time fn_script_log "${currentaction}" find "${serveridentitydir:?}" -type f -name "player.deaths.*.db" -delete fn_wipe_exit_code - sleep 0.5 + fn_sleep_time else fn_print_information_nl "No player death to remove" fn_script_log_info "No player death to remove." - sleep 0.5 fi - # Wipe blueprints only if wipeall command was used + # Wipe blueprints only if wipeall command was used. if [ "${wipeall}" == "1" ]; then if [ -n "$(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)..." - sleep 0.5 + fn_sleep_time fn_script_log "${currentaction}" find "${serveridentitydir:?}" -type f -name "player.blueprints.*.db" -delete fn_wipe_exit_code - sleep 0.5 + fn_sleep_time else fn_print_information_nl "No blueprint file to remove" fn_script_log_info "No blueprint file to remove." - sleep 0.5 fi elif [ -n "$(find "${serveridentitydir}" -type f -name "player.blueprints.*.db")" ]; then fn_print_information_nl "Keeping blueprints" fn_script_log_info "Keeping blueprints." - sleep 0.5 else fn_print_information_nl "No blueprints found" fn_script_log_info "No blueprints found." - sleep 0.5 + fn_sleep_time fi - # Wipe some logs that might be there + # Wipe some logs that might be there. if [ -n "$(find "${serveridentitydir}" -type f -name "Log.*.txt")" ]; then currentaction="Removing log files: ${serveridentitydir}/Log.*.txt" echo -en "Removing Log files..." - sleep 0.5 + fn_sleep_time fn_script_log "${currentaction}" find "${serveridentitydir:?}" -type f -name "Log.*.txt" -delete fn_wipe_exit_code - sleep 0.5 - # We do not print additional information if there are no logs to remove + 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 + # 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 +# 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." @@ -195,20 +188,18 @@ if [ "${shortname}" == "rust" ]; then echo Exiting; core_exit.sh fi fn_script_log_info "User selects to erase any user, storage, log and map data from ${serveridentitydir}" - sleep 0.5 + 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." - sleep 0.5 core_exit.sh fi -# You can add an "elif" here to add another game or engine +# You can add an "elif" here to add another game or engine. else - # Game not listed + # 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." - sleep 0.5 core_exit.sh fi diff --git a/lgsm/functions/compress_unreal2_maps.sh b/lgsm/functions/compress_unreal2_maps.sh index 856bc5086..e5868bfbb 100644 --- a/lgsm/functions/compress_unreal2_maps.sh +++ b/lgsm/functions/compress_unreal2_maps.sh @@ -9,14 +9,14 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh fn_print_header -echo "Will compress all maps in:" -echo "" +echo -e "Will compress all maps in:" +echo -e "" pwd -echo "" -echo "Compressed maps saved to:" -echo "" -echo "${compressedmapsdir}" -echo "" +echo -e "" +echo -e "Compressed maps saved to:" +echo -e "" +echo -e "${compressedmapsdir}" +echo -e "" if ! fn_prompt_yn "Start compression?" Y; then echo Exiting; return fi diff --git a/lgsm/functions/compress_ut99_maps.sh b/lgsm/functions/compress_ut99_maps.sh index 0832ae997..f3f5449a5 100644 --- a/lgsm/functions/compress_ut99_maps.sh +++ b/lgsm/functions/compress_ut99_maps.sh @@ -9,14 +9,14 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh fn_print_header -echo "Will compress all maps in:" -echo "" +echo -e "Will compress all maps in:" +echo -e "" pwd -echo "" -echo "Compressed maps saved to:" -echo "" -echo "${compressedmapsdir}" -echo "" +echo -e "" +echo -e "Compressed maps saved to:" +echo -e "" +echo -e "${compressedmapsdir}" +echo -e "" if ! fn_prompt_yn "Start compression?" Y; then echo Exiting; return fi diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 3018dcf13..162f66247 100644 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -34,19 +34,19 @@ fn_clear_tmp(){ fn_print_error_eol_nl fn_script_log_error "clearing LinuxGSM tmp directory" fi - fi + fi } fn_dl_md5(){ # Runs MD5 Check if available. if [ "${md5}" != "0" ]&&[ "${md5}" != "nomd5" ]; then echo -en "verifying ${local_filename} with MD5..." - sleep 0.5 + fn_sleep_time local md5sumcmd=$(md5sum "${local_filedir}/${local_filename}"|awk '{print $1;}') if [ "${md5sumcmd}" != "${md5}" ]; then fn_print_fail_eol_nl - echo "${local_filename} returned MD5 checksum: ${md5sumcmd}" - echo "expected MD5 checksum: ${md5}" + 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}" @@ -88,9 +88,9 @@ fn_dl_extract(){ fn_print_fail_eol_nl fn_script_log_fatal "Extracting download" if [ -f "${lgsmlog}" ]; then - echo "${extractcmd}" >> "${lgsmlog}" + echo -e "${extractcmd}" >> "${lgsmlog}" fi - echo "${extractcmd}" + echo -e "${extractcmd}" core_exit.sh else fn_print_ok_eol_nl @@ -100,11 +100,11 @@ fn_dl_extract(){ # Trap to remove file download if canceled before completed. fn_fetch_trap(){ - echo "" + echo -e "" echo -en "downloading ${local_filename}..." fn_print_canceled_eol_nl fn_script_log_info "Downloading ${local_filename}...CANCELED" - sleep 0.5 + fn_sleep_time rm -f "${local_filedir}/${local_filename}" echo -en "downloading ${local_filename}..." fn_print_removed_eol_nl @@ -131,7 +131,7 @@ fn_fetch_file(){ # 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}..." - sleep 0.5 + fn_sleep_time echo -en "\033[1K" curlcmd=$(${curlpath} --progress-bar --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}") echo -en "downloading ${local_filename}..." @@ -145,10 +145,10 @@ fn_fetch_file(){ if [ -f "${lgsmlog}" ]; then fn_script_log_fatal "Downloading ${local_filename}" echo -e "${remote_fileurl}" >> "${lgsmlog}" - echo "${curlcmd}" >> "${lgsmlog}" + echo -e "${curlcmd}" >> "${lgsmlog}" fi echo -e "${remote_fileurl}" - echo "${curlcmd}" + echo -e "${curlcmd}" core_exit.sh else fn_print_ok_eol_nl @@ -258,6 +258,6 @@ fn_update_function(){ curlpath=$(command -v curl 2>/dev/null) if [ "$(basename "${curlpath}")" != "curl" ]; then - echo "[ FAIL ] Curl is not installed" + echo -e "[ FAIL ] Curl is not installed" exit 1 -fi \ No newline at end of file +fi diff --git a/lgsm/functions/core_exit.sh b/lgsm/functions/core_exit.sh index f92d3b129..8c10d77e0 100644 --- a/lgsm/functions/core_exit.sh +++ b/lgsm/functions/core_exit.sh @@ -6,8 +6,8 @@ fn_exit_dev_debug(){ if [ -f "${rootdir}/.dev-debug" ]; then - echo "" - echo "${function_selfname} exiting with code: ${exitcode}" + echo -e "" + echo -e "${function_selfname} 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 diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index dd18e0d2c..f4c973800 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -51,7 +51,6 @@ fn_fetch_function # Commands - command_backup.sh(){ functionfile="${FUNCNAME}" fn_fetch_function @@ -352,6 +351,11 @@ functionfile="${FUNCNAME}" fn_fetch_function } +fix_sfc.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + fix_steamcmd.sh(){ functionfile="${FUNCNAME}" fn_fetch_function @@ -382,6 +386,11 @@ functionfile="${FUNCNAME}" fn_fetch_function } +fix_sof2.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + fix_ss3.sh(){ functionfile="${FUNCNAME}" fn_fetch_function @@ -412,6 +421,11 @@ functionfile="${FUNCNAME}" fn_fetch_function } +fix_zmr.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + # Info info_config.sh(){ @@ -429,15 +443,11 @@ functionfile="${FUNCNAME}" fn_fetch_function } -info_glibc.sh(){ -functionfile="${FUNCNAME}" -fn_fetch_function -} - info_messages.sh(){ functionfile="${FUNCNAME}" fn_fetch_function } + info_parms.sh(){ functionfile="${FUNCNAME}" fn_fetch_function @@ -485,6 +495,10 @@ functionfile="${FUNCNAME}" fn_fetch_function } +alert_slack.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} # Logs logs.sh(){ diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 4b69f104d..d45072862 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -6,9 +6,9 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -### Define all commands here ### +### Define all commands here. ## User commands | Trigger commands | Description -# Standard commands +# 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." ) @@ -21,19 +21,19 @@ cmd_update_linuxgsm=( "ul;update-lgsm;uf;update-functions" "command_update_linux 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 +# 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 +# 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 +# SteamCMD servers only. cmd_validate=( "v;validate" "command_validate.sh" "Validate server files with SteamCMD." ) -# Server with mods-install +# 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 +# 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." ) @@ -44,7 +44,7 @@ cmd_install_cdkey=( "cd;server-cd-key" "install_ut2k4_key.sh" "Add your server c 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 +# 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." ) @@ -53,48 +53,48 @@ cmd_dev_query_raw=( "qr;query-raw" "command_dev_query_raw.sh" "The raw output of cmd_dev_clear_functions=( "cf;clear-functions" "command_dev_clear_functions.sh" "Delete the contents of the functions dir." ) -### Set specific opt here ### +### Set specific opt here. currentopt=( "${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monitor[@]}" "${cmd_test_alert[@]}" "${cmd_details[@]}" "${cmd_postdetails[@]}" ) -# Update LGSM +# Update LGSM. currentopt+=( "${cmd_update_linuxgsm[@]}" ) -# Exclude noupdate games here +# 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 + # force update for SteamCMD only or MTA. if [ -n "${appid}" ]||[ "${shortname}" == "mta" ]; then currentopt+=( "${cmd_force_update[@]}" ) fi fi -# Validate command +# Validate command. if [ -n "${appid}" ]; then currentopt+=( "${cmd_validate[@]}" ) fi -#Backup +#Backup. currentopt+=( "${cmd_backup[@]}" ) -# Exclude games without a console +# Exclude games without a console. if [ "${shortname}" != "ts3" ]; then currentopt+=( "${cmd_console[@]}" "${cmd_debug[@]}" ) fi -## Game server exclusive commands +## Game server exclusive commands. -# FastDL command +# FastDL command. if [ "${engine}" == "source" ]; then currentopt+=( "${cmd_fastdl[@]}" ) fi -# TeamSpeak exclusive +# TeamSpeak exclusive. if [ "${shortname}" == "ts3" ]; then currentopt+=( "${cmd_change_password[@]}" ) fi -# Unreal exclusive +# Unreal exclusive. if [ "${shortname}" == "rust" ]; then currentopt+=( "${cmd_wipe[@]}" "${cmd_wipeall[@]}" ) fi @@ -109,83 +109,83 @@ if [ "${engine}" == "unreal" ]; then currentopt+=( "${cmd_map_compressor_u99[@]}" ) fi -# DST exclusive +# DST exclusive. if [ "${shortname}" == "dst" ]; then currentopt+=( "${cmd_install_dst_token[@]}" ) fi -# MTA exclusive +# MTA exclusive. if [ "${shortname}" == "mta" ]; then currentopt+=( "${cmd_install_default_resources[@]}" ) fi -# Squad license exclusive +# Squad license exclusive. if [ "${shortname}" == "squad" ]; then currentopt+=( "${cmd_install_squad_license[@]}" ) fi -## Mods commands +## Mods commands. if [ "${engine}" == "source" ]||[ "${shortname}" == "rust" ]||[ "${shortname}" == "hq" ]||[ "${shortname}" == "sdtd" ]; then currentopt+=( "${cmd_mods_install[@]}" "${cmd_mods_remove[@]}" "${cmd_mods_update[@]}" ) fi -## Installer +## Installer. currentopt+=( "${cmd_install[@]}" "${cmd_auto_install[@]}" ) -## Developer commands +## 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 +## Donate. currentopt+=( "${cmd_donate[@]}" ) -### Build list of available commands +### Build list of available commands. optcommands=() index="0" for ((index="0"; index < ${#currentopt[@]}; index+=3)); do - cmdamount="$(echo "${currentopt[index]}" | awk -F ';' '{ print NF }')" + cmdamount="$(echo -e "${currentopt[index]}" | awk -F ';' '{ print NF }')" for ((cmdindex=1; cmdindex <= ${cmdamount}; cmdindex++)); do - optcommands+=( "$(echo "${currentopt[index]}" | awk -F ';' -v x=${cmdindex} '{ print $x }')" ) + optcommands+=( "$(echo -e "${currentopt[index]}" | awk -F ';' -v x=${cmdindex} '{ print $x }')" ) done done -# Shows LinuxGSM usage +# Shows LinuxGSM usage. fn_opt_usage(){ - echo "Usage: $0 [option]" + echo -e "Usage: $0 [option]" echo -e "" - echo "LinuxGSM - ${gamename} - Version ${version}" - echo "https://linuxgsm.com/${gameservername}" + echo -e "LinuxGSM - ${gamename} - Version ${version}" + echo -e "https://linuxgsm.com/${gameservername}" echo -e "" echo -e "${lightyellow}Commands${default}" - # Display available commands + # Display available commands. index="0" { for ((index="0"; index < ${#currentopt[@]}; index+=3)); do - # Hide developer commands + # Hide developer commands. if [ "${currentopt[index+2]}" != "DEVCOMMAND" ]; then - echo -e "${cyan}$(echo "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t| ${currentopt[index+2]}" + 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 core_exit.sh } -### Check if user commands exist and run corresponding scripts, or display script usage +# Check if user commands exist and run corresponding scripts, or display script usage. if [ -z "${getopt}" ]; then fn_opt_usage fi -# Command exists +# Command exists. for i in "${optcommands[@]}"; do if [ "${i}" == "${getopt}" ] ; then - # Seek and run command + # Seek and run command. index="0" for ((index="0"; index < ${#currentopt[@]}; index+=3)); do - currcmdamount="$(echo "${currentopt[index]}" | awk -F ';' '{ print NF }')" + currcmdamount="$(echo -e "${currentopt[index]}" | awk -F ';' '{ print NF }')" for ((currcmdindex=1; currcmdindex <= ${currcmdamount}; currcmdindex++)); do - if [ "$(echo "${currentopt[index]}" | awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then - # Run command + if [ "$(echo -e "${currentopt[index]}" | awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then + # Run command. eval "${currentopt[index+1]}" core_exit.sh break @@ -195,7 +195,7 @@ for i in "${optcommands[@]}"; do fi done -# If we're executing this, it means command was not found +# If we're executing this, it means command was not found. echo -e "${red}Unknown command${default}: $0 ${getopt}" exitcode=2 fn_opt_usage diff --git a/lgsm/functions/core_legacy.sh b/lgsm/functions/core_legacy.sh index 137bfe08c..1b525b669 100644 --- a/lgsm/functions/core_legacy.sh +++ b/lgsm/functions/core_legacy.sh @@ -41,7 +41,7 @@ if [ -z "${alertlog}" ]; then alertlog="${emaillog}" fi -# Alternations to workshop variables +# Alternations to workshop variables. if [ -z "${wsapikey}" ]; then if [ "${workshopauth}" ]; then wsapikey="${workshopauth}" @@ -62,4 +62,4 @@ if [ -z "${wsstartmap}" ]; then if [ "${ws_start_map}" ]; then wscollectionid="${ws_start_map}" fi -fi \ No newline at end of file +fi diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh index 74ae8cf5d..e1d394834 100644 --- a/lgsm/functions/core_messages.sh +++ b/lgsm/functions/core_messages.sh @@ -5,12 +5,13 @@ # Website: https://linuxgsm.com # Description: Defines on-screen messages such as [ OK ] and how script logs look. -# nl: new line: message is following by a new line -# eol: end of line: message is placed at the end of the current line +# 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" @@ -23,11 +24,23 @@ fn_ansi_loader(){ 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 + # 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: @@ -110,6 +123,7 @@ fn_print_dots(){ else echo -en "${creeol}[ .... ] $@" fi + fn_sleep_time } fn_print_dots_nl(){ @@ -118,7 +132,7 @@ fn_print_dots_nl(){ else echo -e "${creeol}[ .... ] $@" fi - sleep 0.5 + fn_sleep_time echo -en "\n" } @@ -129,6 +143,7 @@ fn_print_ok(){ else echo -en "${creeol}[${green} OK ${default}] $@" fi + fn_sleep_time } fn_print_ok_nl(){ @@ -137,7 +152,7 @@ fn_print_ok_nl(){ else echo -en "${creeol}[${green} OK ${default}] $@" fi - sleep 0.5 + fn_sleep_time echo -en "\n" } @@ -148,6 +163,7 @@ fn_print_fail(){ else echo -en "${creeol}[${red} FAIL ${default}] $@" fi + fn_sleep_time } fn_print_fail_nl(){ @@ -156,7 +172,7 @@ fn_print_fail_nl(){ else echo -en "${creeol}[${red} FAIL ${default}] $@" fi - sleep 0.5 + fn_sleep_time echo -en "\n" } @@ -167,6 +183,7 @@ fn_print_error(){ else echo -en "${creeol}[${red}ERROR ${default}] $@" fi + fn_sleep_time } fn_print_error_nl(){ @@ -175,26 +192,27 @@ fn_print_error_nl(){ else echo -en "${creeol}[${red}ERROR ${default}] $@" fi - sleep 0.5 + fn_sleep_time echo -en "\n" } # [ WARN ] fn_print_warn(){ if [ -n "${commandaction}" ]; then - echo -en "${creeol}[${yellow} WARN ${default}] ${commandaction} ${servicename}: $@" + echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${servicename}: $@" else - echo -en "${creeol}[${yellow} WARN ${default}] $@" + echo -en "${creeol}[${lightyellow} WARN ${default}] $@" fi + fn_sleep_time } fn_print_warn_nl(){ if [ -n "${commandaction}" ]; then - echo -en "${creeol}[${yellow} WARN ${default}] ${commandaction} ${servicename}: $@" + echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${servicename}: $@" else - echo -en "${creeol}[${yellow} WARN ${default}] $@" + echo -en "${creeol}[${lightyellow} WARN ${default}] $@" fi - sleep 0.5 + fn_sleep_time echo -en "\n" } @@ -205,6 +223,7 @@ fn_print_info(){ else echo -en "${creeol}[${cyan} INFO ${default}] $@" fi + fn_sleep_time } fn_print_info_nl(){ @@ -213,7 +232,7 @@ fn_print_info_nl(){ else echo -en "${creeol}[${cyan} INFO ${default}] $@" fi - sleep 0.5 + fn_sleep_time echo -en "\n" } @@ -224,54 +243,63 @@ fn_print_info_nl(){ # ================================= fn_print_header(){ echo -e "" - echo -e "${gamename} ${commandaction}" + echo -e "${lightyellow}${gamename} ${commandaction}${default}" echo -e "=================================${default}" - echo -e "" } # 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 "${yellow}Warning!${default} $@" + echo -en "${lightyellow}Warning!${default} $@" + fn_sleep_time } fn_print_warning_nl(){ - echo -e "${yellow}Warning!${default} $@" + 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 @@ -292,7 +320,7 @@ fn_prompt_yn(){ case "${yn}" in [Yy]|[Yy][Ee][Ss]) return 0 ;; [Nn]|[Nn][Oo]) return 1 ;; - *) echo "Please answer yes or no." ;; + *) echo -e "Please answer yes or no." ;; esac done } @@ -325,11 +353,11 @@ fn_print_error_eol(){ # WARN fn_print_warn_eol(){ - echo -en "${red}WARN${default}" + echo -en "${lightyellow}WARN${default}" } fn_print_warn_eol_nl(){ - echo -e "${red}WARN${default}" + echo -e "${lightyellow}WARN${default}" } # INFO @@ -359,6 +387,15 @@ fn_print_checking_eol_nl(){ echo -e "${cyan}CHECKING${default}" } +# DELAY +fn_print_delay_eol(){ + echo -en "${green}DELAY${default}" +} + +fn_print_delay_eol_nl(){ + echo -e "${green}DELAY${default}" +} + # CANCELED fn_print_canceled_eol(){ echo -en "${yellow}CANCELED${default}" @@ -385,3 +422,39 @@ fn_print_update_eol(){ fn_print_update_eol_nl(){ echo -e "${cyan}UPDATE${default}" } + +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 index 57bec2aa7..4c9db3579 100644 --- a/lgsm/functions/core_trap.sh +++ b/lgsm/functions/core_trap.sh @@ -5,9 +5,9 @@ # Description: Handles CTRL-C trap to give an exit code. fn_exit_trap(){ - echo "" + echo -e "" core_exit.sh } # trap to give an exit code. -trap fn_exit_trap INT \ No newline at end of file +trap fn_exit_trap INT diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index da9c362e4..04d5c09b5 100644 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -8,21 +8,17 @@ local commandname="FIX" local commandaction="Fix" -# Messages that are displayed for some fixes +# Messages that are displayed for some fixes. fn_fix_msg_start(){ fn_print_dots "Applying ${fixname} fix: ${gamename}" - sleep 0.5 fn_print_info "Applying ${fixname} fix: ${gamename}" fn_script_log_info "Applying ${fixname} fix: ${gamename}" - sleep 0.5 } fn_fix_msg_start_nl(){ fn_print_dots "Applying ${fixname} fix: ${gamename}" - sleep 0.5 fn_print_info "Applying ${fixname} fix: ${gamename}" fn_script_log_info "Applying ${fixname} fix: ${gamename}" - sleep 0.5 } fn_fix_msg_end(){ @@ -35,7 +31,7 @@ fn_fix_msg_end(){ fi } -# Fixes that are run on start +# Fixes that are run on start. if [ "${function_selfname}" != "command_install.sh" ]&&[ -z "${fixbypass}" ]; then if [ -n "${appid}" ]; then fix_steamcmd.sh @@ -59,6 +55,10 @@ if [ "${function_selfname}" != "command_install.sh" ]&&[ -z "${fixbypass}" ]; th 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 @@ -73,16 +73,18 @@ if [ "${function_selfname}" != "command_install.sh" ]&&[ -z "${fixbypass}" ]; th 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 [ "${function_selfname}" == "command_install.sh" ]; then if [ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then - echo "" - echo "Applying Post-Install Fixes" - echo "=================================" - sleep 0.5 + echo -e "" + echo -e "Applying Post-Install Fixes" + echo -e "=================================" + fn_sleep_time if [ "${shortname}" == "kf" ]; then fix_kf.sh elif [ "${shortname}" == "kf2" ]; then diff --git a/lgsm/functions/fix_ark.sh b/lgsm/functions/fix_ark.sh index e9be8ecaf..ccb0a93cb 100644 --- a/lgsm/functions/fix_ark.sh +++ b/lgsm/functions/fix_ark.sh @@ -11,4 +11,4 @@ fi if [ ! -d "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ]; then ln -s "$HOME/Steam/steamapps/" "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" -fi \ No newline at end of file +fi diff --git a/lgsm/functions/fix_arma3.sh b/lgsm/functions/fix_arma3.sh index 06e54f7cd..ffa3d35e0 100644 --- a/lgsm/functions/fix_arma3.sh +++ b/lgsm/functions/fix_arma3.sh @@ -14,4 +14,4 @@ if [ ! -d "${HOME}/.local/share/Arma 3" ]||[ ! -d "${HOME}/.local/share/Arma 3 - fn_fix_msg_start mkdir -p "${HOME}/.local/share/Arma 3 - Other Profiles" fn_fix_msg_end -fi \ No newline at end of file +fi diff --git a/lgsm/functions/fix_coduo.sh b/lgsm/functions/fix_coduo.sh deleted file mode 100644 index 09530e99a..000000000 --- a/lgsm/functions/fix_coduo.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_coduo.sh function -# Author: Alexander Hurd -# Website: https://linuxgsm.com -# Description: Fixes for Call of Duty: United Offensive - -local commandname="FIX" -local commandaction="Fix" - -# Force glibc fix -fix_glibc.sh - diff --git a/lgsm/functions/fix_dst.sh b/lgsm/functions/fix_dst.sh index 832b81398..e2850c8b8 100644 --- a/lgsm/functions/fix_dst.sh +++ b/lgsm/functions/fix_dst.sh @@ -8,7 +8,7 @@ local commandname="FIX" local commandaction="Fix" local function_selfname="$(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) +# 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 fixname="libcurl-gnutls.so.4" diff --git a/lgsm/functions/fix_ges.sh b/lgsm/functions/fix_ges.sh index 977697cca..35e1411e3 100644 --- a/lgsm/functions/fix_ges.sh +++ b/lgsm/functions/fix_ges.sh @@ -8,4 +8,4 @@ local commandname="FIX" local commandaction="Fix" # Fixes: MALLOC_CHECK_ needing to be set to 0. -export MALLOC_CHECK_=0 \ No newline at end of file +export MALLOC_CHECK_=0 diff --git a/lgsm/functions/fix_kf.sh b/lgsm/functions/fix_kf.sh index dbb0c78c1..125252f06 100644 --- a/lgsm/functions/fix_kf.sh +++ b/lgsm/functions/fix_kf.sh @@ -8,19 +8,19 @@ local commandname="FIX" local commandaction="Fix" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -echo "Applying WebAdmin ROOst.css fix." -echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" +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" -sleep 0.5 -echo "Applying WebAdmin CharSet fix." -echo "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" +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" -sleep 0.5 -echo "applying server name fix." -sleep 0.5 -echo "forcing server restart..." -sleep 0.5 +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 @@ -30,4 +30,4 @@ exitbypass=1 command_start.sh sleep 5 exitbypass=1 -command_stop.sh \ No newline at end of file +command_stop.sh diff --git a/lgsm/functions/fix_kf2.sh b/lgsm/functions/fix_kf2.sh index 3e3e23080..e8f3440f0 100644 --- a/lgsm/functions/fix_kf2.sh +++ b/lgsm/functions/fix_kf2.sh @@ -13,9 +13,9 @@ parms="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\"" } fn_print_information "starting ${gamename} server to generate configs." -sleep 1 +fn_sleep_time exitbypass=1 command_start.sh sleep 10 exitbypass=1 -command_stop.sh \ No newline at end of file +command_stop.sh diff --git a/lgsm/functions/fix_mta.sh b/lgsm/functions/fix_mta.sh index e8943f5e1..4eb4ff900 100644 --- a/lgsm/functions/fix_mta.sh +++ b/lgsm/functions/fix_mta.sh @@ -11,7 +11,7 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -f "${lgsmdir}/lib/libmysqlclient.so.16" ]; then fixname="libmysqlclient16" fn_fix_msg_start_nl - sleep 0.5 + 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/functions/fix_ro.sh b/lgsm/functions/fix_ro.sh index b96ae582e..e354ce002 100644 --- a/lgsm/functions/fix_ro.sh +++ b/lgsm/functions/fix_ro.sh @@ -8,22 +8,22 @@ local commandname="FIX" local commandaction="Fix" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -echo "Applying WebAdmin ROOst.css fix." -echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" +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" -sleep 0.5 -echo "Applying WebAdmin CharSet fix." -echo "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" +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" -sleep 0.5 -echo "Applying Steam AppID fix." +fn_sleep_time +echo -e "Applying Steam AppID fix." sed -i 's/1210/1200/g' "${systemdir}/steam_appid.txt" -sleep 0.5 -echo "applying server name fix." -sleep 0.5 -echo "forcing server restart..." -sleep 0.5 +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 diff --git a/lgsm/functions/fix_rust.sh b/lgsm/functions/fix_rust.sh index f4eb5298d..854020873 100644 --- a/lgsm/functions/fix_rust.sh +++ b/lgsm/functions/fix_rust.sh @@ -7,5 +7,5 @@ local commandname="FIX" local commandaction="Fix" -# Fixes: [Raknet] Server Shutting Down (Shutting Down) +# 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 index 3ce85a699..da5fd8286 100644 --- a/lgsm/functions/fix_rw.sh +++ b/lgsm/functions/fix_rw.sh @@ -7,4 +7,4 @@ local commandname="FIX" local commandaction="Fix" -export LD_LIBRARY_PATH="${serverfiles}/linux64:${serverfiles}:$LD_LIBRARY_PATH" \ No newline at end of file +export LD_LIBRARY_PATH="${serverfiles}/linux64:${serverfiles}:$LD_LIBRARY_PATH" diff --git a/lgsm/functions/fix_sdtd.sh b/lgsm/functions/fix_sdtd.sh index 04ac7936d..ca0dc09a1 100644 --- a/lgsm/functions/fix_sdtd.sh +++ b/lgsm/functions/fix_sdtd.sh @@ -7,4 +7,4 @@ local commandname="FIX" local commandaction="Fix" -export LD_LIBRARY_PATH="${serverfiles}" \ No newline at end of file +export LD_LIBRARY_PATH="${serverfiles}" diff --git a/lgsm/functions/fix_sfc.sh b/lgsm/functions/fix_sfc.sh new file mode 100644 index 000000000..060ec4823 --- /dev/null +++ b/lgsm/functions/fix_sfc.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# LinuxGSM fix_sfc.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Resolves various issues with Source Forts Classic. + +local commandname="FIX" +local commandaction="Fix" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ ! -f "${serverfiles}/bin/datacache.so" ]; then + ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so" +fi + +if [ ! -f "${serverfiles}/bin/dedicated.so" ]; then + ln -s "${serverfiles}/bin/dedicated_srv.so" "${serverfiles}/bin/dedicated.so" +fi + +if [ ! -f "${serverfiles}/bin/engine.so" ]; then + ln -s "${serverfiles}/bin/engine_srv.so" "${serverfiles}/bin/engine.so" +fi + +if [ ! -f "${serverfiles}/bin/materialsystem.so" ]; then + ln -s "${serverfiles}/bin/materialsystem_srv.so" "${serverfiles}/bin/materialsystem.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/shaderapiempty.so" ]; then + ln -s "${serverfiles}/bin/shaderapiempty_srv.so" "${serverfiles}/bin/shaderapiempty.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/studiorender.so" ]; then + ln -s "${serverfiles}/bin/studiorender_srv.so" "${serverfiles}/bin/studiorender.so" +fi + +if [ ! -f "${serverfiles}/bin/vphysics.so" ]; then + ln -s "${serverfiles}/bin/vphysics_srv.so" "${serverfiles}/bin/vphysics.so" +fi + +if [ ! -f "${serverfiles}/bin/scenefilecache.so" ]; then + ln -s "${serverfiles}/bin/scenefilecache_srv.so" "${serverfiles}/bin/scenefilecache.so" +fi diff --git a/lgsm/functions/fix_sof2.sh b/lgsm/functions/fix_sof2.sh new file mode 100644 index 000000000..2715f7f8c --- /dev/null +++ b/lgsm/functions/fix_sof2.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# LinuxGSM fix_rust.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Resolves startup issue with Soldier of Fortune 2 + +local commandname="FIX" +local commandaction="Fix" + +# Fixes: error while loading shared libraries: libcxa.so.1 +export LD_LIBRARY_PATH=":$LD_LIBRARY_PATH" diff --git a/lgsm/functions/fix_steamcmd.sh b/lgsm/functions/fix_steamcmd.sh index a3f60e89c..eb1622978 100644 --- a/lgsm/functions/fix_steamcmd.sh +++ b/lgsm/functions/fix_steamcmd.sh @@ -17,7 +17,15 @@ if [ ! -f "${HOME}/.steam/sdk32/steamclient.so" ]; then fn_fix_msg_end fi -if [ "${shortname}" == "ss3" ]; then +if [ "${shortname}" == "bt" ]; then + # Fixes: [S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed. + if [ ! -L "${executabledir}/lib64/steamclient.so" ]; then + fixname="steamclient.so x86_64" + fn_fix_msg_start + cp -s -v "${steamcmddir}/linux64/steamclient.so" "${executabledir}/lib64/steamclient.so" >> "${lgsmlog}" + fn_fix_msg_end + fi +elif [ "${shortname}" == "ss3" ]; then # 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" diff --git a/lgsm/functions/fix_ts3.sh b/lgsm/functions/fix_ts3.sh index 0d27c316b..751b5dbd5 100644 --- a/lgsm/functions/fix_ts3.sh +++ b/lgsm/functions/fix_ts3.sh @@ -8,10 +8,10 @@ local commandname="FIX" local commandaction="Fix" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -# Fixes: makes libmariadb2 available #1924 +# 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 + fn_fix_msg_end fi diff --git a/lgsm/functions/fix_unt.sh b/lgsm/functions/fix_unt.sh index d89f69558..3c9c9335a 100644 --- a/lgsm/functions/fix_unt.sh +++ b/lgsm/functions/fix_unt.sh @@ -7,5 +7,5 @@ local commandname="FIX" local commandaction="Fix" -# Fixes: [Raknet] Server Shutting Down (Shutting Down) -export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${systemdir}/lib" +# steamclient.so: cannot open shared object file: No such file or directory +export LD_LIBRARY_PATH="${serverfiles}/linux64:${serverfiles}:$LD_LIBRARY_PATH" diff --git a/lgsm/functions/fix_ut.sh b/lgsm/functions/fix_ut.sh index aaaad40cb..4d1b96355 100644 --- a/lgsm/functions/fix_ut.sh +++ b/lgsm/functions/fix_ut.sh @@ -9,6 +9,6 @@ local commandaction="Fix" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" #Set Binary Executable -echo "chmod +x ${executabledir}/${executable}" +echo -e "chmod +x ${executabledir}/${executable}" chmod +x "${executabledir}/${executable}" -sleep 0.5 \ No newline at end of file +fn_sleep_time diff --git a/lgsm/functions/fix_ut2k4.sh b/lgsm/functions/fix_ut2k4.sh index b29b312c3..4f966d80b 100644 --- a/lgsm/functions/fix_ut2k4.sh +++ b/lgsm/functions/fix_ut2k4.sh @@ -8,19 +8,19 @@ local commandname="FIX" local commandaction="Fix" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -echo "applying WebAdmin ut2003.css fix." -echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" +echo -e "applying WebAdmin ut2003.css fix." +echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" sed -i 's/none}/none;/g' "${serverfiles}/Web/ServerAdmin/ut2003.css" sed -i 's/underline}/underline;/g' "${serverfiles}/Web/ServerAdmin/ut2003.css" -sleep 0.5 -echo "applying WebAdmin CharSet fix." -echo "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" +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" -sleep 0.5 -echo "applying server name fix." -sleep 0.5 -echo "forcing server restart." -sleep 0.5 +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 @@ -30,4 +30,4 @@ exitbypass=1 command_start.sh sleep 5 exitbypass=1 -command_stop.sh \ No newline at end of file +command_stop.sh diff --git a/lgsm/functions/fix_ut3.sh b/lgsm/functions/fix_ut3.sh index fa95052ac..53bde310f 100644 --- a/lgsm/functions/fix_ut3.sh +++ b/lgsm/functions/fix_ut3.sh @@ -13,9 +13,9 @@ parms="server VCTF-Suspense?Game=UTGameContent.UTVehicleCTFGame_Content?bIsDedic } fn_print_information "starting ${gamename} server to generate configs." -sleep 1 +fn_sleep_time exitbypass=1 command_start.sh sleep 10 exitbypass=1 -command_stop.sh \ No newline at end of file +command_stop.sh diff --git a/lgsm/functions/fix_wurm.sh b/lgsm/functions/fix_wurm.sh index 5c90dc402..756636cac 100644 --- a/lgsm/functions/fix_wurm.sh +++ b/lgsm/functions/fix_wurm.sh @@ -4,13 +4,13 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with ARK: Survival Evolved. -# Copies steamclient.so to correct location +# 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 +# First run requires start with no parms. +# After first run new dirs are created. if [ ! -d "${serverfiles}/Creative" ]; then parmsbypass=1 fixbypass=1 @@ -20,4 +20,4 @@ if [ ! -d "${serverfiles}/Creative" ]; then exitbypass=1 command_stop.sh unset parmsbypass -fi \ No newline at end of file +fi diff --git a/lgsm/functions/fix_zmr.sh b/lgsm/functions/fix_zmr.sh new file mode 100644 index 000000000..0edfee967 --- /dev/null +++ b/lgsm/functions/fix_zmr.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# LinuxGSM fix_sfc.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Resolves various issues with Zombie Master: Reborn. + +local commandname="FIX" +local commandaction="Fix" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ ! -f "${serverfiles}/bin/datacache.so" ]; then + ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so" +fi + +if [ ! -f "${serverfiles}/bin/dedicated.so" ]; then + ln -s "${serverfiles}/bin/dedicated_srv.so" "${serverfiles}/bin/dedicated.so" +fi + +if [ ! -f "${serverfiles}/bin/engine.so" ]; then + ln -s "${serverfiles}/bin/engine_srv.so" "${serverfiles}/bin/engine.so" +fi + +if [ ! -f "${serverfiles}/bin/materialsystem.so" ]; then + ln -s "${serverfiles}/bin/materialsystem_srv.so" "${serverfiles}/bin/materialsystem.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/shaderapiempty.so" ]; then + ln -s "${serverfiles}/bin/shaderapiempty_srv.so" "${serverfiles}/bin/shaderapiempty.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/studiorender.so" ]; then + ln -s "${serverfiles}/bin/studiorender_srv.so" "${serverfiles}/bin/studiorender.so" +fi + +if [ ! -f "${serverfiles}/bin/vphysics.so" ]; then + ln -s "${serverfiles}/bin/vphysics_srv.so" "${serverfiles}/bin/vphysics.so" +fi + +if [ ! -f "${serverfiles}/bin/scenefilecache.so" ]; then + ln -s "${serverfiles}/bin/scenefilecache_srv.so" "${serverfiles}/bin/scenefilecache.so" +fi diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 53b7637c6..9c12907f8 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -7,7 +7,7 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -## Examples of filtering to get info from config files +## 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 =\"; @@ -110,6 +110,29 @@ fn_info_config_ballistic_overkill(){ 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}" @@ -338,7 +361,10 @@ fn_info_config_minecraft(){ 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="${port}" + 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]*$//') @@ -353,23 +379,43 @@ fn_info_config_minecraft(){ rconport=${rconport:-"NOT SET"} maxplayers=${maxplayers:-"NOT SET"} port=${port:-"NOT SET"} - queryport="${queryport:-"NOT SET"}" + queryport=${queryport:-"NOT SET"} queryenabled="${queryenabled:-"NOT SET"}" gamemode=${gamemode:-"NOT SET"} gameworld=${gameworld:-"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}" - numreservedslots="${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:]')" - numreservedslots="$(grep "NumReservedSlots=" "${servercfgfullpath}" | tr -cd '[:digit:]')" + reservedslots="$(grep "NumReservedSlots=" "${servercfgfullpath}" | tr -cd '[:digit:]')" fi if [ ! -f "${servercfgdir}/Rcon.cfg" ]; then @@ -647,6 +693,26 @@ fn_info_config_sbots(){ 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}" @@ -889,6 +955,24 @@ fn_info_config_unreal3(){ 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}" @@ -1146,12 +1230,47 @@ fn_info_config_stationeers(){ 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_soldat(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + else + servername=$(grep "Server_Name" "${servercfgfullpath}" | awk -F '=' '{print $2}') + serverpassword=$(grep "Game_Password" "${servercfgfullpath}" | awk -F '=' '{print $2}') + adminpassword=$(grep "Admin_Password" "${servercfgfullpath}" | awk -F '=' '{print $2}') + fi +} + # ARK: Survival Evolved if [ "${shortname}" == "ark" ]; then fn_info_config_ark # 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 @@ -1191,6 +1310,9 @@ elif [ "${shortname}" == "jc3" ]; then # 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 @@ -1227,13 +1349,19 @@ elif [ "${shortname}" == "rw" ]; then # 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}" == "goldsource" ]; then fn_info_config_source # Starbound elif [ "${shortname}" == "sb" ]; then fn_info_config_starbound -# TeamSpeak 3 +# Teamspeak 3 elif [ "${shortname}" == "ts3" ]; then fn_info_config_teamspeak3 # Mumble @@ -1265,6 +1393,8 @@ 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 @@ -1276,4 +1406,6 @@ elif [ "${shortname}" == "squad" ]; then # 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 index 11ab3149d..c7bf38a28 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -7,6 +7,12 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +### Game Server pid +if [ "${status}" == "1" ]; then + if [ "${shortname}" != "ts3" ]; then + gameserverpid=$(tmux list-sessions -F "#{session_name} #{pane_pid}"| grep "^${servicename}"|awk '{print $2}') + fi +fi ### Distro information ## Distro @@ -19,7 +25,7 @@ kernel=$(uname -r) # Distro ID - ubuntu # Distro Codename - xenial -# Gathers distro info from various sources filling in missing gaps +# 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 @@ -92,23 +98,27 @@ load=$(uptime|awk -F 'load average: ' '{ print $2 }') ## CPU information cpumodel=$(awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//') cpucores=$(awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo) -cpufreuency=$(awk -F: ' /cpu MHz/ {freq=$2} END {print freq " MHz"}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//') +cpufreqency=$(awk -F: ' /cpu MHz/ {freq=$2} END {print freq " MHz"}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//') +# CPU usage of the game server pid +if [ "${status}" == "1" ]; then + cpuused=$(ps --forest -o pcpu -g "${gameserverpid}"|awk '{s+=$1} END {print s}') +fi ## Memory information # Available RAM and swap. -# Newer distros can use numfmt to give more accurate results +# Newer distros can use numfmt to give more accurate results. if [ -n "$(command -v numfmt 2>/dev/null)" ]; then - # Issue #2005 - Kernel 3.14+ contains MemAvailable which should be used. All others will be calculated + # Issue #2005 - Kernel 3.14+ contains MemAvailable which should be used. All others will be calculated. - # get the raw KB values of these fields + # 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 + # check if MemAvailable Exists. if grep -q ^MemAvailable /proc/meminfo; then physmemactualfreekb=$(grep ^MemAvailable /proc/meminfo | awk '{print $2}') else @@ -126,6 +136,13 @@ if [ -n "$(command -v numfmt 2>/dev/null)" ]; then 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 [ "${status}" == "1" ]; then + memused=$(ps --forest -o rss -g "${gameserverpid}" | awk '{s+=$1} END {print s}'| awk '{$1/=1024;printf "%.0fMB\t",$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. @@ -183,12 +200,12 @@ fi if [ -d "${backupdir}" ]; then # Used space in backups dir. backupdirdu=$(du -sh "${backupdir}" | awk '{print $1}') - # If no backup dir, size is 0M + # If no backup dir, size is 0M. if [ -z "${backupdirdu}" ]; then backupdirdu="0M" fi - # number of backups set to 0 by default + # number of backups set to 0 by default. backupcount=0 # If there are backups in backup dir. @@ -206,32 +223,55 @@ if [ -d "${backupdir}" ]; then 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=$(${curlpath} -4 -m 3 ifconfig.co 2>/dev/null) exitcode=$? - # Should ifconfig.co return an error will use last known IP + # Should ifconfig.co return an error will use last known IP. if [ ${exitcode} -eq 0 ]; then - echo "${extip}" > "${tmpdir}/extip.txt" + echo -e "${extip}" > "${tmpdir}/extip.txt" else if [ -f "${tmpdir}/extip.txt" ]; then extip=$(cat ${tmpdir}/extip.txt) else - echo "x.x.x.x" + echo -e "x.x.x.x" fi fi fi -# Steam Master Server - checks if detected by master server -if [ ! "$(command -v jq 2>/dev/null)" ]; then +# 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 [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]||[ "${shortname}" == "jc2" ]||[ "${shortname}" == "ql" ]; then - masterserver=$(${curlpath} -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${ip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l) - if [ "${steammaster}" == "1" ]; then - masterserver="true" + if [ "${steammaster}" == "true" ]; then + masterserver="$(${curlpath} -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${ip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l)" + if [ "${masterserver}" == "0" ]; then + masterserver="$(${curlpath} -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${extip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l)" + fi + if [ "${masterserver}" == "0" ]; then + displaymasterserver="false" else - masterserver="false" + displaymasterserver="true" fi fi fi fi + +# Sets the SteamCMD glibc requirement if the game server requirement is less or not required. +if [ -n "${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_glibc.sh b/lgsm/functions/info_glibc.sh deleted file mode 100644 index 63760c714..000000000 --- a/lgsm/functions/info_glibc.sh +++ /dev/null @@ -1,230 +0,0 @@ -#!/bin/bash -# LinuxGSM info_glibc.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Stores details on servers Glibc requirements. - -local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -if [ "${gamename}" == "ARK: Survival Evolved" ]; then - glibcrequired="2.15" - glibcfix="no" -elif [ "${gamename}" == "Ballistic Overkill" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "Base Defense" ]; then - glibcrequired="2.14" - glibcfix="no" -elif [ "${gamename}" == "Black Mesa: Deathmatch" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "Blade Symphony" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "BrainBread 2" ]; then - glibcrequired="2.17" - glibcfix="no" -elif [ "${gamename}" == "Call of Duty" ]; then - glibcrequired="2.1" - glibcfix="no" -elif [ "${gamename}" == "Call of Duty 2" ]; then - glibcrequired="2.1.3" - glibcfix="no" -elif [ "${gamename}" == "Call of Duty: United Offensive" ]; then - glibcrequired="2.1" - glibcfix="no" -elif [ "${gamename}" == "Call of Duty 4" ]; then - glibcrequired="2.3" - glibcfix="no" -elif [ "${gamename}" == "Call of Duty: World at War" ]; then - glibcrequired="2.3.2" - glibcfix="no" -elif [ "${gamename}" == "Codename CURE" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "Counter-Strike: Global Offensive" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "Day of Infamy" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "Double Action: Boogaloo" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "Dystopia" ]; then - glibcrequired="2.15" - glibcfix="no" -elif [ "${gamename}" == "Eco" ]; then - glibcrequired="NOT REQUIRED" - glibcfix="no" -elif [ "${gamename}" == "Empires Mod" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "Factorio" ]; then - glibcrequired="2.18" - glibcfix="yes" -elif [ "${gamename}" == "Fistful of Frags" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "Garry's Mod" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "GoldenEye: Source" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "Insurgency" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${shortname}" == "kf2" ]; then - glibcrequired="2.17" - glibcfix="no" -elif [ "${shortname}" == "tu" ]; then - glibcrequired="2.15" - glibcfix="no" -elif [ "${gamename}" == "Mumble" ]; then - glibcrequired="NOT REQUIRED" - glibcfix="no" -elif [ "${gamename}" == "No More Room in Hell" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "Project Cars" ]; then - glibcrequired="2.4" - glibcfix="no" -elif [ "${gamename}" == "Pirates, Vikings, and Knights II" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${shortname}" == "pstbs" ]; then - glibcrequired="2.17" - glibcfix="no" -elif [ "${gamename}" == "Quake 2" ]; then - glibcrequired="NOT REQUIRED" - glibcfix="no" -elif [ "${gamename}" == "Quake 3: Arena" ]; then - glibcrequired="2.1" - glibcfix="no" -elif [ "${gamename}" == "Quake Live" ]; then - glibcrequired="2.15" - glibcfix="no" -elif [ "${gamename}" == "Return to Castle Wolfenstein" ]; then - glibcrequired="2.1" - glibcfix="no" -elif [ "${shortname}" == "rw" ]; then - glibcrequired="2.14" - glibcfix="no" -elif [ "${gamename}" == "San Andreas Multiplayer" ]; then - glibcrequired="2.3" - glibcfix="no" -elif [ "${gamename}" == "Squad" ]; then - glibcrequired="2.17" - glibcfix="no" -elif [ "${gamename}" == "Sven Co-op" ]; then - glibcrequired="2.24" - glibcfix="no" -elif [ "${shortname}" == "sbots" ]; then - glibcrequired="2.17" - glibcfix="no" -elif [ "${gamename}" == "Team Fortress 2" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "TeamSpeak 3" ]; then - glibcrequired="NOT REQUIRED" - glibcfix="no" -elif [ "${gamename}" == "Teeworlds" ]; then - glibcrequired="2.14" - glibcfix="no" -elif [ "${gamename}" == "Just Cause 2" ]; then - glibcrequired="2.13" - glibcfix="yes" -elif [ "${gamename}" == "Just Cause 3" ]; then - glibcrequired="2.17" - glibcfix="no" -elif [ "${gamename}" == "Natural Selection 2" ]; then - glibcrequired="2.17" - glibcfix="no" -elif [ "${gamename}" == "NS2: Combat" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${gamename}" == "TeamSpeak 3" ]; then - glibcrequired="NOT REQUIRED" - glibcfix="no" -elif [ "${gamename}" == "Mumble" ]; then - glibcrequired="NOT REQUIRED" - glibcfix="no" -elif [ "${engine}" == "refractor" ]; then - glibcrequired="2.0" - glibcfix="no" -elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then - glibcrequired="2.2.4" - glibcfix="no" -elif [ "${gamename}" == "ET: Legacy" ]; then - glibcrequired="2.7" - glibcfix="no" -elif [ "${gamename}" == "Wurm Unlimited" ]; then - glibcrequired="2.14" - glibcfix="no" -elif [ "${gamename}" == "Multi Theft Auto" ]; then - glibcrequired="2.7" - glibcfix="no" -elif [ "${gamename}" == "Unturned" ]; then - glibcrequired="2.15" - glibcfix="no" -elif [ "${gamename}" == "Zombie Panic! Source" ]; then - glibcrequired="2.15" - glibcfix="yes" -elif [ "${engine}" == "starbound" ]; then - glibcrequired="2.17" - glibcfix="no" -elif [ "${engine}" == "quake" ]; then - glibcrequired="2.0" - glibcfix="no" -elif [ "${engine}" == "terraria" ]; then - glibcrequired="2.7" - glibcfix="no" -elif [ "${engine}" == "unreal" ]; then - glibcrequired="2.1" - glibcfix="no" -elif [ "${engine}" == "unreal2" ]; then - glibcrequired="2.4" - glibcfix="no" -elif [ "${engine}" == "unreal3" ]; then - glibcrequired="2.3.2" - glibcfix="no" -elif [ "${engine}" == "unreal4" ]; then - glibcrequired="2.17" - glibcfix="no" -elif [ "${engine}" == "unity3d" ]; then - glibcrequired="2.15" - glibcfix="no" -elif [ "${engine}" == "dontstarve" ]; then - glibcrequired="2.15" - glibcfix="no" -elif [ "${engine}" == "lwjgl2" ]; then - glibcrequired="NOT REQUIRED" - glibcfix="no" -elif [ "${engine}" == "projectzomboid" ]; then - glibcrequired="2.15" - glibcfix="no" -elif [ "${engine}" == "realvirtuality" ]; then - glibcrequired="2.13" - glibcfix="yes" -elif [ "${engine}" == "seriousengine35" ]; then - glibcrequired="2.13" - glibcfix="yes" -elif [ "${engine}" == "source" ]; then - glibcrequired="2.3.6" - glibcfix="no" -elif [ "${engine}" == "goldsource" ]; then - glibcrequired="2.3.4" - glibcfix="no" -else - glibcrequired="UNKNOWN" - glibcfix="no" -fi - -# Sets the SteamCMD glibc requirement if the game server requirement is less or not required. -if [ -n "${appid}" ]; then - if [ "${glibcrequired}" = "NOT REQUIRED" ]||[ -z "${glibcrequired}" ]||[ "$(printf '%s\n'${glibcrequired}'\n' "2.14" | sort -V | head -n 1)" != "2.14" ]; then - glibcrequired="2.14" - glibcfix="no" - fi -fi diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 701c6940e..63deff33f 100644 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -46,85 +46,127 @@ fn_info_message_distro(){ echo -e "${lightyellow}Distro Details${default}" fn_messages_separator { - echo -e "${blue}Distro:\t${default}${distroname}" - echo -e "${blue}Arch:\t${default}${arch}" - echo -e "${blue}Kernel:\t${default}${kernel}" - echo -e "${blue}Hostname:\t${default}${HOSTNAME}" - echo -e "${blue}tmux:\t${default}${tmuxv}" - echo -e "${blue}glibc:\t${default}${glibcversion}" + 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_performance(){ +fn_info_message_server_resource(){ # - # Performance - # ===================================== - # Uptime: 55d, 3h, 38m - # Avg Load: 1.00, 1.01, 0.78 + # 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 # - # Mem: total used free cached - # Physical: 741M 656M 85M 256M - # Swap: 0B 0B 0B + # Storage + # Filesystem: /dev/sda + # Total: 157G + # Used: 138G + # Available: 12G echo -e "" - echo -e "${lightyellow}Performance${default}" - + echo -e "${lightyellow}Server Resource${default}" + fn_messages_separator { - echo -e "${blue}Uptime:\t${default}${days}d, ${hours}h, ${minutes}m" - echo -e "${blue}Avg Load:\t${default}${load}" + 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}" + echo -e "${lightblue}Avg Load:\t${default}${load}" } | column -s $'\t' -t echo -e "" { - echo -e "${blue}CPU Model:\t${default}${cpumodel}" - echo -e "${blue}CPU Cores:\t${default}${cpucores}" - echo -e "${blue}CPU Frequency:\t${default}${cpufreuency}" + 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 "${blue}Mem:\t${blue}total\tused\tfree\tcached\tavailable${default}" - echo -e "${blue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}\t${physmemavailable}${default}" - echo -e "${blue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}" + 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 [ "${netint}" ]; then + echo -e "${lightblue}Interface:\t${default}${netint}" + fi + if [ "${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_disk(){ +fn_info_message_gameserver_resource(){ + # Game Server Resource Usage + # ========================================================================================================================================================================================================================================== + # CPU Used: 2.5% + # Mem Used: 2.1% 171MB # # Storage - # ===================================== - # Filesystem: /dev/disk/by-uuid/320c8edd-a2ce-4a23-8c9d-e00a7af2d6ff - # Total: 15G - # Used: 8.4G - # Available: 5.7G - # LinuxGSM Total: 1G - # Serverfiles: 961M - # Backups: 2G + # Total: 21G + # Serverfiles: 20G + # Backups: 20K echo -e "" - echo -e "${lightyellow}Storage${default}" + echo -e "${lightyellow}Game Server Resource Usage${default}" fn_messages_separator { - echo -e "${blue}Filesystem:\t${default}${filesystem}" - echo -e "${blue}Total:\t${default}${totalspace}" - echo -e "${blue}Used:\t${default}${usedspace}" - echo -e "${blue}Available:\t${default}${availspace}" - echo -e "${blue}LinuxGSM Total:\t${default}${rootdirdu}" - echo -e "${blue}Serverfiles:\t${default}${serverfilesdu}" + if [ "${status}" == "1" ]; then + echo -e "${lightblue}CPU Used:\t${default}${cpuused}%${default}" + echo -e "${lightblue}Mem Used:\t${default}${pmemused}%\t${memused}${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 "${blue}Backups:\t${default}${backupdirdu}" + echo -e "${lightblue}Backups:\t${default}${backupdirdu}" fi } | column -s $'\t' -t } fn_info_message_gameserver(){ - # - # Quake Live Server Details - # ===================================== - # Server name: ql-server - # Server IP: 1.2.3.4:27960 - # RCON password: CHANGE_ME + # Counter-Strike: Global Offensive Server Details + # ========================================================================================================================================================================================================================================== + # Server name: LinuxGSM + # Server IP: 80.70.189.230:27015 # Server password: NOT SET - # Maxplayers: 16 - # Status: OFFLINE + # 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}" @@ -133,210 +175,215 @@ fn_info_message_gameserver(){ { # Server name if [ -n "${gdname}" ]; then - echo -e "${blue}Server name:\t${default}${gdname}" + echo -e "${lightblue}Server name:\t${default}${gdname}" elif [ -n "${servername}" ]; then - echo -e "${blue}Server name:\t${default}${servername}" + echo -e "${lightblue}Server name:\t${default}${servername}" fi # Server description if [ -n "${serverdescription}" ]; then - echo -e "${blue}Server Description:\t${default}${serverdescription}" + echo -e "${lightblue}Server Description:\t${default}${serverdescription}" fi # Branch if [ -n "${branch}" ]; then - echo -e "${blue}Branch:\t${default}${branch}" + echo -e "${lightblue}Branch:\t${default}${branch}" fi # Server ip if [ "${multiple_ip}" == "1" ]; then - echo -e "${blue}Server IP:\t${default}NOT SET" + echo -e "${lightblue}Server IP:\t${default}NOT SET" else - echo -e "${blue}Server IP:\t${default}${ip}:${port}" + echo -e "${lightblue}Server IP:\t${default}${ip}:${port}" fi - # External server ip + # Internet ip if [ -n "${extip}" ]; then if [ "${ip}" != "${extip}" ]; then - echo -e "${blue}Internet IP:\t${default}${extip}:${port}" + 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 "${blue}Server password:\t${default}${serverpassword}" + echo -e "${lightblue}Server password:\t${default}${serverpassword}" fi # Query enabled (Starbound) if [ -n "${queryenabled}" ]; then - echo -e "${blue}Query enabled:\t${default}${queryenabled}" + echo -e "${lightblue}Query enabled:\t${default}${queryenabled}" fi # RCON enabled (Starbound) if [ -n "${rconenabled}" ]; then - echo -e "${blue}RCON enabled:\t${default}${rconpassword}" + echo -e "${lightblue}RCON enabled:\t${default}${rconpassword}" fi # RCON password if [ -n "${rconpassword}" ]; then - echo -e "${blue}RCON password:\t${default}${rconpassword}" + echo -e "${lightblue}RCON password:\t${default}${rconpassword}" fi # RCON web (Rust) if [ -n "${rconweb}" ]; then - echo -e "${blue}RCON web:\t${default}${rconweb}" + echo -e "${lightblue}RCON web:\t${default}${rconweb}" fi # Admin password if [ -n "${adminpassword}" ]; then - echo -e "${blue}Admin password:\t${default}${adminpassword}" + echo -e "${lightblue}Admin password:\t${default}${adminpassword}" fi # Stats password (Quake Live) if [ -n "${statspassword}" ]; then - echo -e "${blue}Stats password:\t${default}${statspassword}" + echo -e "${lightblue}Stats password:\t${default}${statspassword}" fi # Players if [ "${querystatus}" != "0" ]; then if [ -n "${maxplayers}" ]; then - echo -e "${blue}Maxplayers:\t${default}${maxplayers}" + echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}" fi else if [ -n "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then - echo -e "${blue}Players:\t${default}${gdplayers}/${gdmaxplayers}" + echo -e "${lightblue}Players:\t${default}${gdplayers}/${gdmaxplayers}" elif [ -n "${gdplayers}" ]&&[ -n "${maxplayers}" ]; then - echo -e "${blue}Players:\t${default}${gdplayers}/${maxplayers}" + echo -e "${lightblue}Players:\t${default}${gdplayers}/${maxplayers}" elif [ -z "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then - echo -e "${blue}Players:\t${default}0/${gdmaxplayers}" + echo -e "${lightblue}Players:\t${default}0/${gdmaxplayers}" elif [ -n "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]; then - echo -e "${blue}Players:\t${default}${gdplayers}|∞" + echo -e "${lightblue}Players:\t${default}${gdplayers}|∞" elif [ -z "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]&&[ -n "${maxplayers}" ]; then - echo -e "${blue}Maxplayers:\t${default}${maxplayers}" + echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}" fi fi # Bots if [ -n "${gdbots}" ]; then - echo -e "${blue}Bots:\t${default}${gdbots}" + echo -e "${lightblue}Bots:\t${default}${gdbots}" fi # Current Map if [ -n "${gdmap}" ]; then - echo -e "${blue}Current Map:\t${default}${gdmap}" + echo -e "${lightblue}Current Map:\t${default}${gdmap}" fi if [ -n "${defaultscenario}" ]; then # Current Scenario if [ -n "${gdgamemode}" ]; then - echo -e "${blue}Current Scenario:\t${default}${gdgamemode}" + echo -e "${lightblue}Current Scenario:\t${default}${gdgamemode}" fi else # Current Scenario if [ -n "${gdgamemode}" ]; then - echo -e "${blue}Current Game Mode:\t${default}${gdgamemode}" + echo -e "${lightblue}Current Game Mode:\t${default}${gdgamemode}" fi fi # Default Map if [ -n "${defaultmap}" ]; then - echo -e "${blue}Default Map:\t${default}${defaultmap}" + echo -e "${lightblue}Default Map:\t${default}${defaultmap}" fi # Default Scenario if [ -n "${defaultscenario}" ]; then - echo -e "${blue}Default Scenario:\t${default}${defaultscenario}" + echo -e "${lightblue}Default Scenario:\t${default}${defaultscenario}" fi # Game type if [ -n "${gametype}" ]; then - echo -e "${blue}Game type:\t${default}${gametype}" + echo -e "${lightblue}Game type:\t${default}${gametype}" fi # Game mode if [ -n "${gamemode}" ]; then - echo -e "${blue}Game mode:\t${default}${gamemode}" + echo -e "${lightblue}Game mode:\t${default}${gamemode}" fi # Game world if [ -n "${gameworld}" ]; then - echo -e "${blue}Game world:\t${default}${gameworld}" + echo -e "${lightblue}Game world:\t${default}${gameworld}" fi # Tick rate if [ -n "${tickrate}" ]; then - echo -e "${blue}Tick rate:\t${default}${tickrate}" + echo -e "${lightblue}Tick rate:\t${default}${tickrate}" fi # Sharding (Don't Starve Together) if [ -n "${sharding}" ]; then - echo -e "${blue}Sharding:\t${default}${sharding}" + echo -e "${lightblue}Sharding:\t${default}${sharding}" fi # Master (Don't Starve Together) if [ -n "${master}" ]; then - echo -e "${blue}Master:\t${default}${master}" + echo -e "${lightblue}Master:\t${default}${master}" fi # Shard (Don't Starve Together) if [ -n "${shard}" ]; then - echo -e "${blue}Shard:\t${default}${shard}" + echo -e "${lightblue}Shard:\t${default}${shard}" fi # Cluster (Don't Starve Together) if [ -n "${cluster}" ]; then - echo -e "${blue}Cluster:\t${default}${cluster}" + echo -e "${lightblue}Cluster:\t${default}${cluster}" fi # Cave (Don't Starve Together) if [ -n "${cave}" ]; then - echo -e "${blue}Cave:\t${default}${cave}" + echo -e "${lightblue}Cave:\t${default}${cave}" fi # Creativemode (Hurtworld) if [ -n "${creativemode}" ]; then - echo -e "${blue}Creativemode:\t${default}${creativemode}" + echo -e "${lightblue}Creativemode:\t${default}${creativemode}" fi # TeamSpeak dbplugin if [ -n "${dbplugin}" ]; then - echo -e "${blue}dbplugin:\t${default}${dbplugin}" + echo -e "${lightblue}dbplugin:\t${default}${dbplugin}" fi # ASE (Multi Theft Auto) if [ -n "${ase}" ]; then - echo -e "${blue}ASE:\t${default}${ase}" + echo -e "${lightblue}ASE:\t${default}${ase}" fi # Save interval (Rust) if [ -n "${saveinterval}" ]; then - echo -e "${blue}ASE:\t${default}${saveinterval} s" + echo -e "${lightblue}ASE:\t${default}${saveinterval} s" fi # Random map rotation mode (Squad and Post Scriptum) if [ -n "${randommap}" ]; then - echo -e "${blue}Map rotation:\t${default}${randommap}" + echo -e "${lightblue}Map rotation:\t${default}${randommap}" fi # Listed on Master Server - if [ "${masterserver}" ];then - if [ "${masterserver}" == "true" ];then - echo -e "${blue}Master Server:\t${green}${masterserver}${default}" + if [ "${displaymasterserver}" ];then + if [ "${displaymasterserver}" == "true" ];then + echo -e "${lightblue}Master Server:\t${green}${displaymasterserver}${default}" else - echo -e "${blue}Master Server:\t${red}${masterserver}${default}" + echo -e "${lightblue}Master Server:\t${red}${displaymasterserver}${default}" fi fi # Online status if [ "${status}" == "0" ]; then - echo -e "${blue}Status:\t${red}OFFLINE${default}" + echo -e "${lightblue}Status:\t${red}OFFLINE${default}" else - echo -e "${blue}Status:\t${green}ONLINE${default}" + echo -e "${lightblue}Status:\t${green}ONLINE${default}" fi } | column -s $'\t' -t echo -e "" @@ -344,79 +391,91 @@ fn_info_message_gameserver(){ fn_info_message_script(){ # - # qlserver Script Details - # ===================================== - # Service name: ql-server - # qlserver version: 150316 - # User: lgsm - # Email alert: off - # Update on start: off - # Location: /home/lgsm/qlserver - # Config file: /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg + # 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 { - # Service name - echo -e "${blue}Service name:\t${default}${servicename}" + # Script name + echo -e "${lightblue}Script name:\t${default}${servicename}" - # Script version + # LinuxGSM version if [ -n "${version}" ]; then - echo -e "${blue}${selfname} version:\t${default}${version}" + echo -e "${lightblue}LinuxGSM version:\t${default}${version}" fi - # User - echo -e "${blue}User:\t${default}$(whoami)" - # glibc required - if [ -n "${glibcrequired}" ]; then - if [ "${glibcrequired}" == "NOT REQUIRED" ]; then - : - elif [ "${glibcrequired}" == "UNKNOWN" ]; then - echo -e "${blue}glibc required:\t${red}${glibcrequired}" - elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then - echo -e "${blue}glibc required:\t${red}${glibcrequired} ${default}(${red}glibc distro version ${glibcversion} too old${default})" + 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 "${blue}glibc required:\t${green}${glibcrequired}${default}" + echo -e "${lightblue}glibc required:\t${green}${glibc}${default}" fi fi # Discord alert - echo -e "${blue}Discord alert:\t${default}${discordalert}" + echo -e "${lightblue}Discord alert:\t${default}${discordalert}" + # Slack alert + echo -e "${lightblue}Slack alert:\t${default}${slackalert}" # Email alert - echo -e "${blue}Email alert:\t${default}${emailalert}" + echo -e "${lightblue}Email alert:\t${default}${emailalert}" # Pushbullet alert - echo -e "${blue}Pushbullet alert:\t${default}${pushbulletalert}" + echo -e "${lightblue}Pushbullet alert:\t${default}${pushbulletalert}" # IFTTT alert - echo -e "${blue}IFTTT alert:\t${default}${iftttalert}" + echo -e "${lightblue}IFTTT alert:\t${default}${iftttalert}" # Mailgun alert - echo -e "${blue}Mailgun (email) alert:\t${default}${mailgunalert}" + echo -e "${lightblue}Mailgun (email) alert:\t${default}${mailgunalert}" # Pushover alert - echo -e "${blue}Pushover alert:\t${default}${pushoveralert}" + echo -e "${lightblue}Pushover alert:\t${default}${pushoveralert}" # Telegram alert - echo -e "${blue}Telegram alert:\t${default}${telegramalert}" + echo -e "${lightblue}Telegram alert:\t${default}${telegramalert}" # Update on start if [ -n "${updateonstart}" ]; then - echo -e "${blue}Update on start:\t${default}${updateonstart}" + echo -e "${lightblue}Update on start:\t${default}${updateonstart}" fi + # User + echo -e "${lightblue}User:\t${default}$(whoami)" + # Script location - echo -e "${blue}Location:\t${default}${rootdir}" + echo -e "${lightblue}Location:\t${default}${rootdir}" # Config file location if [ -n "${servercfgfullpath}" ]; then if [ -f "${servercfgfullpath}" ]; then - echo -e "${blue}Config file:\t${default}${servercfgfullpath}" + echo -e "${lightblue}Config file:\t${default}${servercfgfullpath}" elif [ -d "${servercfgfullpath}" ]; then - echo -e "${blue}Config dir:\t${default}${servercfgfullpath}" + echo -e "${lightblue}Config dir:\t${default}${servercfgfullpath}" else - echo -e "${blue}Config file:\t${default}${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})" + 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 "${blue}Network config file:\t${default}${networkcfgfullpath}" + echo -e "${lightblue}Network config file:\t${default}${networkcfgfullpath}" fi } | column -s $'\t' -t } @@ -438,17 +497,17 @@ fn_info_message_backup(){ echo -e "No Backups created" else { - echo -e "${blue}No. of backups:\t${default}${backupcount}" - echo -e "${blue}Latest backup:${default}" + echo -e "${lightblue}No. of backups:\t${default}${backupcount}" + echo -e "${lightblue}Latest backup:${default}" if [ "${lastbackupdaysago}" == "0" ]; then - echo -e "${blue} date:\t${default}${lastbackupdate} (less than 1 day ago)" + echo -e "${lightblue} date:\t${default}${lastbackupdate} (less than 1 day ago)" elif [ "${lastbackupdaysago}" == "1" ]; then - echo -e "${blue} date:\t${default}${lastbackupdate} (1 day ago)" + echo -e "${lightblue} date:\t${default}${lastbackupdate} (1 day ago)" else - echo -e "${blue} date:\t${default}${lastbackupdate} (${lastbackupdaysago} days ago)" + echo -e "${lightblue} date:\t${default}${lastbackupdate} (${lastbackupdaysago} days ago)" fi - echo -e "${blue} file:\t${default}${lastbackup}" - echo -e "${blue} size:\t${default}${lastbackupsize}" + echo -e "${lightblue} file:\t${default}${lastbackup}" + echo -e "${lightblue} size:\t${default}${lastbackupsize}" } | column -s $'\t' -t fi } @@ -479,11 +538,11 @@ fn_info_message_ports(){ echo -e "" echo -e "${lightgreen}Ports${default}" fn_messages_separator - echo -e "Change ports by editing the parameters in:" + 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" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "seriousengine35" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" "wurm" ) + local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "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 @@ -495,7 +554,7 @@ fn_info_message_ports(){ fi done # engines/games that require editing the parms - local ports_edit_array=( "goldsource" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "Rust" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned") + local ports_edit_array=( "goldsource" "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 @@ -504,15 +563,15 @@ fn_info_message_ports(){ done echo -e "${parmslocation}" echo -e "" - echo -e "Useful port diagnostic command:" + echo -e "${lightblue}Useful port diagnostic command:${default}" } fn_info_message_statusbottom(){ echo -e "" if [ "${status}" == "0" ]; then - echo -e "${blue}Status:\t${red}OFFLINE${default}" + echo -e "${lightblue}Status:\t${red}OFFLINE${default}" else - echo -e "${blue}Status:\t${green}ONLINE${default}" + echo -e "${lightblue}Status:\t${green}ONLINE${default}" fi echo -e "" } @@ -525,39 +584,39 @@ fn_info_logs(){ if [ -n "${lgsmlog}" ]; then echo -e "\nScript log\n===================" if [ ! "$(ls -A "${lgsmlogdir}")" ]; then - echo "${lgsmlogdir} (NO LOG FILES)" + echo -e "${lgsmlogdir} (NO LOG FILES)" elif [ ! -s "${lgsmlog}" ]; then - echo "${lgsmlog} (LOG FILE IS EMPTY)" + echo -e "${lgsmlog} (LOG FILE IS EMPTY)" else - echo "${lgsmlog}" + echo -e "${lgsmlog}" tail -25 "${lgsmlog}" fi - echo "" + echo -e "" fi if [ -n "${consolelog}" ]; then echo -e "\nConsole log\n====================" if [ ! "$(ls -A "${consolelogdir}")" ]; then - echo "${consolelogdir} (NO LOG FILES)" + echo -e "${consolelogdir} (NO LOG FILES)" elif [ ! -s "${consolelog}" ]; then - echo "${consolelog} (LOG FILE IS EMPTY)" + echo -e "${consolelog} (LOG FILE IS EMPTY)" else - echo "${consolelog}" + echo -e "${consolelog}" tail -25 "${consolelog}" | awk '{ sub("\r$", ""); print }' fi - echo "" + echo -e "" fi if [ -n "${gamelogdir}" ]; then echo -e "\nServer log\n===================" if [ ! "$(ls -A "${gamelogdir}")" ]; then - echo "${gamelogdir} (NO LOG FILES)" + echo -e "${gamelogdir} (NO LOG FILES)" else - echo "${gamelogdir}" + echo -e "${gamelogdir}" # dos2unix sed 's/\r//' tail "${gamelogdir}"/* 2>/dev/null | grep -v "==>" | sed '/^$/d' | sed 's/\r//' | tail -25 fi - echo "" + echo -e "" fi } @@ -567,7 +626,7 @@ fn_info_message_ark(){ echo -e "netstat -atunp | grep ShooterGame" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 @@ -582,7 +641,7 @@ fn_info_message_ballisticoverkill(){ echo -e "netstat -atunp | grep BODS.x86" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 @@ -592,7 +651,7 @@ fn_info_message_battalion1944(){ echo -e "netstat -atunp | grep BattalionServ" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 @@ -608,7 +667,7 @@ fn_info_message_cod(){ echo -e "netstat -atunp | grep cod_lnxded" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game\tINBOUND\t${port}\tudp" } | column -s $'\t' -t } @@ -617,7 +676,7 @@ fn_info_message_coduo(){ echo -e "netstat -atunp | grep coduo_lnxded" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game\tINBOUND\t${port}\tudp" } | column -s $'\t' -t } @@ -626,7 +685,7 @@ fn_info_message_cod2(){ echo -e "netstat -atunp | grep cod2_lnxded" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game\tINBOUND\t${port}\tudp" } | column -s $'\t' -t } @@ -635,7 +694,7 @@ fn_info_message_cod4(){ echo -e "netstat -atunp" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game\tINBOUND\t${port}\tudp" } | column -s $'\t' -t } @@ -644,7 +703,7 @@ fn_info_message_codwaw(){ echo -e "netstat -atunp | grep codwaw_lnxded" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game\tINBOUND\t${port}\tudp" } | column -s $'\t' -t } @@ -653,7 +712,7 @@ fn_info_message_dontstarve(){ echo -e "netstat -atunp | grep dontstarve" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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" @@ -665,17 +724,27 @@ fn_info_message_eco(){ echo -e "netstat -atunp | grep mono" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game\tINBOUND\t${port}\ttcp" } | column -s $'\t' -t } @@ -684,7 +753,7 @@ fn_info_message_goldsource(){ echo -e "netstat -atunp | grep hlds_linux" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 @@ -694,7 +763,7 @@ fn_info_message_hurtworld(){ echo -e "netstat -atunp | grep Hurtworld" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 @@ -704,7 +773,7 @@ fn_info_message_inss(){ echo -e "netstat -atunp | grep Insurgency" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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" @@ -715,7 +784,7 @@ fn_info_message_justcause2(){ echo -e "netstat -atunp | grep Jcmp-Server" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game\tINBOUND\t${port}\tudp" } | column -s $'\t' -t } @@ -724,7 +793,7 @@ fn_info_message_justcause3(){ echo -e "netstat -atunp | grep Server" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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" @@ -735,18 +804,27 @@ fn_info_message_minecraft(){ echo -e "netstat -atunp | grep java" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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_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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 @@ -755,7 +833,7 @@ fn_info_message_pstbs(){ echo -e "netstat -atunp | grep PostScriptum" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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" @@ -766,7 +844,7 @@ fn_info_message_projectcars(){ echo -e "netstat -atunp | grep DedicatedS" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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" @@ -777,7 +855,7 @@ fn_info_message_projectzomboid(){ echo -e "netstat -atunp | grep java" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game\tINBOUND\t${port}\tudp" } | column -s $'\t' -t } @@ -786,7 +864,7 @@ fn_info_message_quake(){ echo -e "netstat -atunp | grep mvdsv" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game\tINBOUND\t${port}\tudp" } | column -s $'\t' -t } @@ -795,7 +873,7 @@ fn_info_message_quake2(){ echo -e "netstat -atunp | grep quake2" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game\tINBOUND\t${port}\tudp" } | column -s $'\t' -t } @@ -804,7 +882,7 @@ fn_info_message_quake3(){ echo -e "netstat -atunp | grep q3ded" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game\tINBOUND\t${port}\tudp" } | column -s $'\t' -t } @@ -817,7 +895,7 @@ fn_info_message_quakelive(){ echo -e "" fi { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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" @@ -832,7 +910,7 @@ fn_info_message_realvirtuality(){ port="2302" fi { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 @@ -847,7 +925,7 @@ fn_info_message_refractor(){ echo -e "netstat -atunp | grep bf1942_lnxd" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game/Query\tINBOUND\t${port}\tudp" echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp" } | column -s $'\t' -t @@ -857,7 +935,7 @@ fn_info_message_risingworld(){ echo -e "netstat -atunp | grep java" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp" echo -e "> http query\tINBOUND\t${httpqueryport}\ttcp" echo -e "> RCON\tINBOUND\t${rconport}\ttcp" @@ -868,7 +946,7 @@ fn_info_message_rtcw(){ echo -e "netstat -atunp | grep iowolfded" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game\tINBOUND\t${port}\tudp" } | column -s $'\t' -t } @@ -877,7 +955,7 @@ fn_info_message_rust(){ echo -e "netstat -atunp | grep Rust" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp" echo -e "> RCON\tINBOUND\t${rconport}\ttcp" } | column -s $'\t' -t @@ -887,7 +965,7 @@ fn_info_message_samp(){ echo -e "netstat -atunp | grep samp03svr" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp" } | column -s $'\t' -t } @@ -897,7 +975,7 @@ fn_info_message_seriousengine35(){ echo -e "netstat -atunp | grep Sam3_Dedicate" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 @@ -907,7 +985,7 @@ fn_info_message_sbots(){ echo -e "netstat -atunp | grep blank1" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 @@ -918,7 +996,7 @@ fn_info_message_sdtd(){ echo -e "netstat -atunp | grep 7DaysToDie" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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" @@ -928,17 +1006,26 @@ fn_info_message_sdtd(){ echo -e "${lightgreen}${servername} WebAdmin${default}" fn_messages_separator { - echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}" - echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}" - echo -e "${blue}WebAdmin password:\t${default}${webadminpass}" + 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 "${blue}Telnet enabled:\t${default}${telnetenabled}" - echo -e "${blue}Telnet address:\t${default}${ip} ${telnetport}" - echo -e "${blue}Telnet password:\t${default}${telnetpass}" + 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 } @@ -946,7 +1033,7 @@ fn_info_message_source(){ echo -e "netstat -atunp | grep srcds_linux" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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" @@ -958,7 +1045,7 @@ fn_info_message_spark(){ echo -e "netstat -atunp | grep server_linux" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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" @@ -967,9 +1054,9 @@ fn_info_message_spark(){ echo -e "${lightgreen}${servername} WebAdmin${default}" fn_messages_separator { - echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}/index.html" - echo -e "${blue}WebAdmin username:\t${default}${webadminuser}" - echo -e "${blue}WebAdmin password:\t${default}${webadminpass}" + 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 } @@ -977,7 +1064,7 @@ fn_info_message_squad(){ echo -e "netstat -atunp | grep SquadServer" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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" @@ -988,7 +1075,7 @@ fn_info_message_starbound(){ echo -e "netstat -atunp | grep starbound" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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" @@ -999,7 +1086,7 @@ fn_info_message_stationeers(){ echo -e "netstat -atunp | grep rocketstation" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 @@ -1009,7 +1096,7 @@ fn_info_message_teamspeak3(){ echo -e "netstat -atunp | grep ts3server" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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" @@ -1020,7 +1107,7 @@ fn_info_message_teeworlds(){ echo -e "netstat -atunp | grep teeworlds_srv" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game\tINBOUND\t${port}\ttcp" } | column -s $'\t' -t } @@ -1029,7 +1116,7 @@ fn_info_message_terraria(){ echo -e "netstat -atunp | grep TerrariaServer" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game\tINBOUND\t${port}\ttcp" } | column -s $'\t' -t } @@ -1038,7 +1125,7 @@ fn_info_message_towerunite(){ echo -e "netstat -atunp | grep TowerServer" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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 @@ -1080,18 +1167,19 @@ fn_info_message_unreal(){ echo -e "${lightgreen}${servername} WebAdmin${default}" fn_messages_separator { - echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}" - echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}" - echo -e "${blue}WebAdmin username:\t${default}${webadminuser}" - echo -e "${blue}WebAdmin password:\t${default}${webadminpass}" + 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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}" @@ -1100,10 +1188,10 @@ fn_info_message_unreal3(){ echo -e "${lightgreen}${servername} WebAdmin${default}" fn_messages_separator { - echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}" - echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}" - echo -e "${blue}WebAdmin username:\t${default}${webadminuser}" - echo -e "${blue}WebAdmin password:\t${default}${webadminpass}" + 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 } @@ -1111,17 +1199,20 @@ fn_info_message_unturned(){ echo -e "netstat -atunp | grep Unturned" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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_kf2(){ + fn_info_message_password_strip echo -e "netstat -atunp | grep KFGame" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + 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" @@ -1131,10 +1222,10 @@ fn_info_message_kf2(){ echo -e "${lightgreen}${servername} WebAdmin${default}" fn_messages_separator { - echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}" - echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}" - echo -e "${blue}WebAdmin username:\t${default}${webadminuser}" - echo -e "${blue}WebAdmin password:\t${default}${webadminpass}" + 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 } @@ -1142,25 +1233,17 @@ fn_info_message_wolfensteinenemyterritory(){ echo -e "netstat -atunp | grep etded" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game/Query\tINBOUND\t${port}\tudp" } | column -s $'\t' -t } -fn_info_message_etlegacy(){ - echo -e "netstat -atunp | grep etlded" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - 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 "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game\tINBOUND\t${port}\ttcp" echo -e "> Game/Query\tINBOUND\t${queryport}\tudp" } | column -s $'\t' -t @@ -1170,7 +1253,7 @@ fn_info_message_mta(){ echo -e "netstat -atunp | grep mta-server64" echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game\tOUTBOUND\t${port}\tudp" echo -e "> HTTP Server\tINBOUND\t${httpport}\ttcp" if [ "${ase}" == "Enabled" ]; then @@ -1179,81 +1262,135 @@ fn_info_message_mta(){ } | 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 "> RCON\tINBOUND\t${port}\ttcp" + 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 [ "${gamename}" == "7 Days To Die" ]; then + if [ "${shortname}" == "sdtd" ]; then fn_info_message_sdtd - elif [ "${gamename}" == "ARK: Survival Evolved" ]; then + elif [ "${shortname}" == "ark" ]; then fn_info_message_ark - elif [ "${gamename}" == "Ballistic Overkill" ]; then + elif [ "${shortname}" == "bo" ]; then fn_info_message_ballisticoverkill - elif [ "${gamename}" == "Battalion 1944" ]; then + elif [ "${shortname}" == "bt" ]; then + fn_info_message_barotrauma + elif [ "${shortname}" == "bt1944" ]; then fn_info_message_battalion1944 - elif [ "${gamename}" == "Call of Duty" ]; then + elif [ "${shortname}" == "cod" ]; then fn_info_message_cod - elif [ "${gamename}" == "Call of Duty: United Offensive" ]; then + elif [ "${shortname}" == "coduo" ]; then fn_info_message_coduo - elif [ "${gamename}" == "Call of Duty 2" ]; then + elif [ "${shortname}" == "cod2" ]; then fn_info_message_cod2 - elif [ "${gamename}" == "Call of Duty 4" ]; then + elif [ "${shortname}" == "cod4" ]; then fn_info_message_cod4 - elif [ "${gamename}" == "Call of Duty: World at War" ]; then + elif [ "${shortname}" == "codwaw" ]; then fn_info_message_codwaw - elif [ "${gamename}" == "Eco" ]; then + elif [ "${shortname}" == "eco" ]; then fn_info_message_eco - elif [ "${gamename}" == "ET: Legacy" ]; then + elif [ "${shortname}" == "etl" ]; then fn_info_message_etlegacy - elif [ "${gamename}" == "Factorio" ]; then + elif [ "${shortname}" == "fctr" ]; then fn_info_message_factorio - elif [ "${gamename}" == "Hurtworld" ]; then + elif [ "${shortname}" == "hw" ]; then fn_info_message_hurtworld elif [ "${shortname}" == "inss" ]; then fn_info_message_inss - elif [ "${gamename}" == "Just Cause 2" ]; then + elif [ "${shortname}" == "jc2" ]; then fn_info_message_justcause2 - elif [ "${gamename}" == "Just Cause 3" ]; then + elif [ "${shortname}" == "jc3" ]; then fn_info_message_justcause3 elif [ "${shortname}" == "kf2" ]; then fn_info_message_kf2 elif [ "${shortname}" == "pstbs" ]; then fn_info_message_pstbs - elif [ "${gamename}" == "Project Cars" ]; then + elif [ "${shortname}" == "pc" ]; then fn_info_message_projectcars - elif [ "${gamename}" == "QuakeWorld" ]; then + elif [ "${shortname}" == "qw" ]; then fn_info_message_quake - elif [ "${gamename}" == "Quake 2" ]; then + elif [ "${shortname}" == "q2" ]; then fn_info_message_quake2 - elif [ "${gamename}" == "Quake 3: Arena" ]; then + elif [ "${shortname}" == "q3" ]; then fn_info_message_quake3 - elif [ "${gamename}" == "Quake Live" ]; then + elif [ "${shortname}" == "ql" ]; then fn_info_message_quakelive - elif [ "${gamename}" == "San Andreas Multiplayer" ]; then + elif [ "${shortname}" == "samp" ]; then fn_info_message_samp - elif [ "${gamename}" == "Squad" ]; then + elif [ "${shortname}" == "squad" ]; then fn_info_message_squad - elif [ "${gamename}" == "Stationeers" ]; then + 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}" == "sbots" ]; then fn_info_message_sbots - elif [ "${gamename}" == "TeamSpeak 3" ]; then + elif [ "${shortname}" == "ts3" ]; then fn_info_message_teamspeak3 - elif [ "${gamename}" == "Tower Unite" ]; then + elif [ "${shortname}" == "tu" ]; then fn_info_message_towerunite elif [ "${shortname}" == "unt" ]; then fn_info_message_unturned - elif [ "${gamename}" == "Multi Theft Auto" ]; then + elif [ "${shortname}" == "mohaa" ]; then + fn_info_message_mohaa + elif [ "${shortname}" == "mh" ]; then + fn_info_message_mordhau + elif [ "${shortname}" == "mta" ]; then fn_info_message_mta - elif [ "${gamename}" == "Mumble" ]; then + elif [ "${shortname}" == "mumble" ]; then fn_info_message_mumble - elif [ "${gamename}" == "Return to Castle Wolfenstein" ]; then + elif [ "${shortname}" == "rtcw" ]; then fn_info_message_rtcw - elif [ "${gamename}" == "Rust" ]; then + elif [ "${shortname}" == "rust" ]; then fn_info_message_rust - elif [ "${gamename}" == "Wurm Unlimited" ]; then + 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 [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then + elif [ "${shortname}" == "wet" ]; then fn_info_message_wolfensteinenemyterritory elif [ "${engine}" == "refractor" ]; then fn_info_message_refractor diff --git a/lgsm/functions/info_parms.sh b/lgsm/functions/info_parms.sh index dd289543e..bcc5a0d9d 100644 --- a/lgsm/functions/info_parms.sh +++ b/lgsm/functions/info_parms.sh @@ -22,9 +22,9 @@ fn_info_parms_ark(){ maxplayers=${maxplayers:-"0"} } -fn_info_parms_realvirtuality(){ +fn_info_parms_barotrauma(){ port=${port:-"0"} - queryport=$((port + 1)) + queryport=${queryport:-"0"} } fn_info_parms_cod(){ @@ -52,6 +52,15 @@ fn_info_parms_factorio(){ 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"} @@ -62,13 +71,22 @@ fn_info_parms_inss(){ maxplayers=${maxplayers:-"0"} } -fn_info_parms_hurtworld(){ - servername=${servername:-"NOT SET"} +fn_info_parms_kf2(){ + queryport=${queryport:-"0"} + defaultmap=${defaultmap:-"NOT SET"} +} + + +fn_info_parms_mordhau(){ port=${port:-"0"} queryport=${queryport:-"0"} - maxplayers=${maxplayers:-"0"} + beaconport=${beaconport:-"0"} +} + +fn_info_parms_mohaa(){ + port=${port:-"0"} + queryport=${port:-"0"} defaultmap=${defaultmap:-"NOT SET"} - creativemode=${creativemode:-"NOT SET"} } fn_info_parms_projectzomboid(){ @@ -82,15 +100,20 @@ fn_info_parms_quakeworld(){ fn_info_parms_quake2(){ port=${port:-"0"} + queryport=${port} 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"} queryport=${port} httpqueryport=$((port - 1)) - } fn_info_parms_rtcw(){ @@ -111,6 +134,11 @@ fn_info_parms_rust(){ tickrate=${tickrate:-"0"} } +fn_info_parms_sof2(){ + port=${port:-"0"} + defaultmap=${defaultmap:-"NOT SET"} +} + fn_info_parms_source(){ defaultmap=${defaultmap:-"NOT SET"} maxplayers=${maxplayers:-"0"} @@ -141,7 +169,22 @@ fn_info_parms_stickybots(){ maxplayers=${maxplayers:-"0"} } -fn_info_config_towerunite(){ +fn_info_parms_sof2(){ + port=${port:-"0"} + queryport=${port} + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_parms_soldat(){ + port=${port:-"0"} + queryport=${port} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} +} + +fn_info_parms_towerunite(){ port=${port:-"0"} queryport=${queryport:-"0"} } @@ -169,9 +212,11 @@ fn_info_parms_unturned(){ port=${port:-"0"} queryport=$((port + 1)) } -fn_info_parms_kf2(){ - queryport=${queryport:-"0"} - defaultmap=${defaultmap:-"NOT SET"} + +fn_info_parms_wf(){ + port=${port:-"0"} + queryport="${port}" + webadminport=${webadminport:-"0"} } # ARK: Survival Evolved @@ -180,6 +225,9 @@ if [ "${shortname}" == "ark" ]; then # 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 @@ -193,6 +241,8 @@ 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 @@ -208,19 +258,26 @@ elif [ "${shortname}" == "rust" ]; then # 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 +elif [ "${shortname}" == "sol" ]; then + fn_info_parms_soldat # Serious Sam elif [ "${shortname}" == "ss3" ]; then - fn_info_config_seriousengine35 + fn_info_parms_seriousengine35 elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then fn_info_parms_source # Spark elif [ "${engine}" == "spark" ]; then fn_info_parms_spark elif [ "${shortname}" == "tu" ]; then - fn_info_config_towerunite + fn_info_parms_towerunite +elif [ "${shortname}" == "mh" ]; then + fn_info_parms_mordhau # Unreal/Unreal 2 engine elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then fn_info_parms_unreal @@ -229,4 +286,7 @@ elif [ "${engine}" == "unreal3" ]; then fn_info_parms_unreal3 elif [ "${shortname}" == "unt" ]; then fn_info_parms_unturned +# Warfork +elif [ "${shortname}" == "wf" ]; then + fn_info_parms_wf fi diff --git a/lgsm/functions/install_complete.sh b/lgsm/functions/install_complete.sh index 18cfc16e5..63ba28d4f 100644 --- a/lgsm/functions/install_complete.sh +++ b/lgsm/functions/install_complete.sh @@ -8,12 +8,12 @@ local commandname="INSTALL" local commandaction="Install" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -echo "" -echo "=================================" -echo "Install Complete!" +echo -e "" +echo -e "=================================" +echo -e "Install Complete!" fn_script_log_info "Install Complete!" -echo "" -echo "To start server type:" -echo "./${selfname} start" -echo "" +echo -e "" +echo -e "To start server type:" +echo -e "./${selfname} start" +echo -e "" core_exit.sh diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index b332afefb..ac327b2de 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -8,22 +8,22 @@ local commandname="INSTALL" local commandaction="Install" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -# Checks if server cfg dir exists, creates it if it doesn't +# Checks if server cfg dir exists, creates it if it doesn't. fn_check_cfgdir(){ if [ ! -d "${servercfgdir}" ]; then - echo "creating ${servercfgdir} config directory." + echo -e "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 +# Downloads default configs from Game-Server-Configs repo to lgsm/config-default. fn_fetch_default_config(){ - echo "" - echo "Downloading ${gamename} Configs" - echo "=================================" - echo "default configs from https://github.com/GameServerManagers/Game-Server-Configs" - sleep 0.5 + 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" # When running inside Docker we want to use a local copy of these files. @@ -40,43 +40,42 @@ fn_fetch_default_config(){ done } -# Copys default configs from Game-Server-Configs repo to server config location +# Copys default configs from Game-Server-Configs repo to server config location. fn_default_config_remote(){ for config in "${array_configs[@]}"; do # every config is copied - echo "copying ${config} config file." + echo -e "copying ${config} config file." fn_script_log_info "copying ${servercfg} config file." if [ "${config}" == "${servercfgdefault}" ]; then mkdir -p "${servercfgdir}" cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}" - # Allows gomplate templating if [ -f /.dockerenv ]; then if [ -f "${lgsmdir}/config-default/config-game/${config}.tmpl" ]; then cp -nv "${lgsmdir}/config-default/config-game/${config}.tmpl" "${servercfgfullpath}.tmpl" fi fi - elif [ "${gamename}" == "ARMA 3" ]&&[ "${config}" == "${networkcfgdefault}" ]; then + elif [ "${shortname}" == "arma3" ]&&[ "${config}" == "${networkcfgdefault}" ]; then mkdir -p "${servercfgdir}" cp -nv "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}" - elif [ "${gamename}" == "Don't Starve Together" ]&&[ "${config}" == "${clustercfgdefault}" ]; then + elif [ "${shortname}" == "dst" ]&&[ "${config}" == "${clustercfgdefault}" ]; then cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}" else mkdir -p "${servercfgdir}" cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgdir}/${config}" fi done - sleep 0.5 + fn_sleep_time } -# Copys local default config to server config location +# Copys local default config to server config location. fn_default_config_local(){ - echo "copying ${servercfgdefault} config file." + echo -e "copying ${servercfgdefault} config file." cp -nv "${servercfgfullpathdefault}" "${servercfgfullpath}" - sleep 0.5 + fn_sleep_time } -# Changes some variables within the default configs +# Changes some variables within the default configs. # SERVERNAME to LinuxGSM # PASSWORD to random password fn_set_config_vars(){ @@ -94,10 +93,10 @@ fn_set_config_vars(){ random=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) servername="LinuxGSM" rconpass="admin${random}" - echo "changing hostname." + echo -e "changing hostname." fn_script_log_info "changing hostname." - sleep 0.5 - # prevents var from being overwritten with the servername + 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 @@ -105,45 +104,45 @@ fn_set_config_vars(){ else sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}" fi - echo "changing rcon/admin password." + echo -e "changing rcon/admin password." fn_script_log_info "changing rcon/admin password." if [ "${shortname}" == "squad" ]; then sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgdir}/Rcon.cfg" else sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgfullpath}" fi - sleep 0.5 + fn_sleep_time else fn_script_log_warn "Config file not found, cannot alter it." - echo "Config file not found, cannot alter it." - sleep 0.5 + echo -e "Config file not found, cannot alter it." + fn_sleep_time fi } -# Changes some variables within the default Don't Starve Together configs +# Changes some variables within the default Don't Starve Together configs. fn_set_dst_config_vars(){ ## cluster.ini if grep -Fq "SERVERNAME" "${clustercfgfullpath}"; then - echo "changing server name." + echo -e "changing server name." fn_script_log_info "changing server name." sed -i "s/SERVERNAME/LinuxGSM/g" "${clustercfgfullpath}" - sleep 0.5 - echo "changing shard mode." + fn_sleep_time + echo -e "changing shard mode." fn_script_log_info "changing shard mode." sed -i "s/USESHARDING/${sharding}/g" "${clustercfgfullpath}" - sleep 0.5 - echo "randomizing cluster key." + 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}" - sleep 0.5 + fn_sleep_time else - echo "${clustercfg} is already configured." + echo -e "${clustercfg} is already configured." fn_script_log_info "${clustercfg} is already configured." fi ## server.ini - # removing unnecessary options (dependent on sharding & shard type) + # removing unnecessary options (dependent on sharding & shard type). if [ "${sharding}" == "false" ]; then sed -i "s/ISMASTER//g" "${servercfgfullpath}" sed -i "/SHARDNAME/d" "${servercfgfullpath}" @@ -151,483 +150,533 @@ fn_set_dst_config_vars(){ sed -i "/SHARDNAME/d" "${servercfgfullpath}" fi - echo "changing shard name." + echo -e "changing shard name." fn_script_log_info "changing shard name." sed -i "s/SHARDNAME/${shard}/g" "${servercfgfullpath}" - sleep 0.5 - echo "changing master setting." + fn_sleep_time + echo -e "changing master setting." fn_script_log_info "changing master setting." sed -i "s/ISMASTER/${master}/g" "${servercfgfullpath}" - sleep 0.5 + fn_sleep_time ## worldgenoverride.lua if [ "${cave}" == "true" ]; then - echo "defining ${shard} as cave in ${servercfgdir}/worldgenoverride.lua." + echo -e "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 - sleep 0.5 - echo "" + fn_sleep_time + echo -e "" } -if [ "${gamename}" == "7 Days To Die" ]; then +if [ "${shortname}" == "sdtd" ]; then gamedirname="7DaysToDie" fn_default_config_local -elif [ "${gamename}" == "ARK: Survival Evolved" ]; then +elif [ "${shortname}" == "ahl" ]; then + gamedirname="ActionHalfLife" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${shortname}" == "ahl2" ]; then + gamedirname="ActionSource" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${shortname}" == "ark" ]; then gamedirname="ARKSurvivalEvolved" fn_check_cfgdir array_configs+=( GameUserSettings.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "ARMA 3" ]; then +elif [ "${shortname}" == "arma3" ]; then gamedirname="Arma3" fn_check_cfgdir array_configs+=( server.cfg network.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Ballistic Overkill" ]; then +elif [ "${shortname}" == "bo" ]; then gamedirname="BallisticOverkill" array_configs+=( config.txt ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Base Defense" ]; then +elif [ "${shortname}" == "bo" ]; then gamedirname="BaseDefense" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Battalion 1944" ]; then +elif [ "${shortname}" == "bt" ]; then + gamedirname="Barotrauma" + fn_check_cfgdir + array_configs+=( serversettings.xml ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${shortname}" == "bt1944" ]; then gamedirname="Battalion1944" fn_check_cfgdir array_configs+=( DefaultGame.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Battlefield: 1942" ]; then +elif [ "${shortname}" == "bf1942" ]; then gamedirname="Battlefield1942" array_configs+=( serversettings.con ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Blade Symphony" ]; then +elif [ "${shortname}" == "bs" ]; then gamedirname="BladeSymphony" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "BrainBread" ]; then +elif [ "${shortname}" == "bb" ]; then gamedirname="BrainBread" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "BrainBread 2" ]; then +elif [ "${shortname}" == "bb2" ]; then gamedirname="BrainBread2" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Black Mesa: Deathmatch" ]; then +elif [ "${shortname}" == "bmdm" ]; then gamedirname="BlackMesa" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Call of Duty" ]; then +elif [ "${shortname}" == "cod" ]; then gamedirname="CallOfDuty" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Call of Duty: United Offensive" ]; then +elif [ "${shortname}" == "coduo" ]; then gamedirname="CallOfDutyUnitedOffensive" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Call of Duty 2" ]; then +elif [ "${shortname}" == "cod2" ]; then gamedirname="CallOfDuty2" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Call of Duty 4" ]; then +elif [ "${shortname}" == "cod4" ]; then gamedirname="CallOfDuty4" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Call of Duty: World at War" ]; then +elif [ "${shortname}" == "codwaw" ]; then gamedirname="CallOfDutyWorldAtWar" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Codename CURE" ]; then +elif [ "${shortname}" == "cc" ]; then gamedirname="CodenameCURE" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Counter-Strike 1.6" ]; then +elif [ "${shortname}" == "cs" ]; then gamedirname="CounterStrike" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Counter-Strike: Condition Zero" ]; then +elif [ "${shortname}" == "cscz" ]; then gamedirname="CounterStrikeConditionZero" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Counter-Strike: Global Offensive" ]; then +elif [ "${shortname}" == "csgo" ]; then gamedirname="CounterStrikeGlobalOffensive" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Classic Offensive" ]; then - gamedirname="ClassicOffensive" - array_configs+=( server.cfg ) - fn_fetch_default_config - fn_default_config_remote - fn_set_config_vars -elif [ "${gamename}" == "Counter-Strike: Source" ]; then +elif [ "${shortname}" == "css" ]; then gamedirname="CounterStrikeSource" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Day of Defeat" ]; then +elif [ "${shortname}" == "dod" ]; then gamedirname="DayOfDefeat" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Day of Defeat: Source" ]; then +elif [ "${shortname}" == "dods" ]; then gamedirname="DayOfDefeatSource" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Day of Infamy" ]; then +elif [ "${shortname}" == "doi" ]; then gamedirname="DayOfInfamy" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Deathmatch Classic" ]; then +elif [ "${shortname}" == "dmc" ]; then gamedirname="DeathmatchClassic" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Don't Starve Together" ]; then +elif [ "${shortname}" == "dst" ]; then gamedirname="DontStarveTogether" fn_check_cfgdir array_configs+=( cluster.ini server.ini ) fn_fetch_default_config fn_default_config_remote fn_set_dst_config_vars -elif [ "${gamename}" == "Double Action: Boogaloo" ]; then +elif [ "${shortname}" == "dab" ]; then gamedirname="DoubleActionBoogaloo" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Dystopia" ]; then +elif [ "${shortname}" == "dys" ]; then gamedirname="Dystopia" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "ET: Legacy" ]; then +elif [ "${shortname}" == "eco" ]; then + gamedirname="Eco" + array_configs+=( Network.eco ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${shortname}" == "etl" ]; then gamedirname="ETLegacy" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Factorio" ]; then +elif [ "${shortname}" == "fctr" ]; then gamedirname="Factorio" array_configs+=( server-settings.json ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Fistful of Frags" ]; then +elif [ "${shortname}" == "fof" ]; then gamedirname="FistfulofFrags" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Garry's Mod" ]; then +elif [ "${shortname}" == "gmod" ]; then gamedirname="GarrysMod" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "GoldenEye: Source" ]; then +elif [ "${shortname}" == "ges" ]; then gamedirname="GoldenEyeSource" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Half Life: Deathmatch" ]; then +elif [ "${shortname}" == "hldm" ]; then gamedirname="HalfLifeDeathmatch" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Half-Life Deathmatch: Source" ]; then +elif [ "${shortname}" == "hldms" ]; then gamedirname="HalfLifeDeathmatchSource" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Half-Life: Opposing Force" ]; then +elif [ "${shortname}" == "opfor" ]; then gamedirname="OpposingForce" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Half Life 2: Deathmatch" ]; then +elif [ "${shortname}" == "hl2dm" ]; then gamedirname="HalfLife2Deathmatch" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Insurgency" ]; then +elif [ "${shortname}" == "ins" ]; then gamedirname="Insurgency" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "IOSoccer" ]; then +elif [ "${shortname}" == "ios" ]; then gamedirname="IOSoccer" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Just Cause 2" ]; then +elif [ "${shortname}" == "jc2" ]; then gamedirname="JustCause2" array_configs+=( config.lua ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Just Cause 3" ]; then +elif [ "${shortname}" == "jc3" ]; then gamedirname="JustCause3" array_configs+=( config.json ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Killing Floor" ]; then +elif [ "${shortname}" == "kf" ]; then gamedirname="KillingFloor" array_configs+=( Default.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Left 4 Dead" ]; then +elif [ "${shortname}" == "l4d" ]; then gamedirname="Left4Dead" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Left 4 Dead" ]; then - gamedirname="Left4Dead" +elif [ "${shortname}" == "l4d2" ]; then + gamedirname="Left4Dead2" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Left 4 Dead 2" ]; then - gamedirname="Left4Dead2" +elif [ "${shortname}" == "mc" ]; then + gamedirname="Minecraft" + array_configs+=( server.properties ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${shortname}" == "mohaa" ]; then + gamedirname="MedalOfHonorAlliedAssault" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Minecraft" ]; then - gamedirname="Minecraft" - array_configs+=( server.properties ) +elif [ "${shortname}" == "mh" ]; then + gamedirname="Mordhau" + fn_check_cfgdir + array_configs+=( Game.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Natural Selection" ]; then +elif [ "${shortname}" == "ns" ]; then gamedirname="NaturalSelection" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "No More Room in Hell" ]; then +elif [ "${shortname}" == "nmrih" ]; then gamedirname="NoMoreRoominHell" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Nuclear Dawn" ]; then +elif [ "${shortname}" == "nd" ]; then gamedirname="NuclearDawn" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Multi Theft Auto" ]; then +elif [ "${shortname}" == "mta" ]; then gamedirname="MultiTheftAuto" fn_check_cfgdir array_configs+=( acl.xml mtaserver.conf vehiclecolors.conf ) fn_fetch_default_config fn_default_config_remote -elif [ "${gamename}" == "Mumble" ]; then +elif [ "${shortname}" == "mumble" ]; then gamedirname="Mumble" array_configs+=( murmur.ini ) fn_fetch_default_config fn_default_config_remote -elif [ "${gamename}" == "Pirates, Vikings, and Knights II" ]; then +elif [ "${shortname}" == "pvkii" ]; then gamedirname="PiratesVikingandKnightsII" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Project Zomboid" ]; then +elif [ "${shortname}" == "pz" ]; then gamedirname="ProjectZomboid" fn_check_cfgdir array_configs+=( server.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Project Cars" ]; then +elif [ "${shortname}" == "pc" ]; then gamedirname="ProjectCars" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Quake 2" ]; then +elif [ "${shortname}" == "q2" ]; then gamedirname="Quake2" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Quake 3: Arena" ]; then +elif [ "${shortname}" == "q3" ]; then gamedirname="Quake3Arena" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Quake Live" ]; then +elif [ "${shortname}" == "ql" ]; then gamedirname="QuakeLive" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "QuakeWorld" ]; then +elif [ "${shortname}" == "qw" ]; then gamedirname="QuakeWorld" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Ricochet" ]; then +elif [ "${shortname}" == "ricochet" ]; then gamedirname="Ricochet" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Return to Castle Wolfenstein" ]; then +elif [ "${shortname}" == "rtcw" ]; then gamedirname="ReturnToCastleWolfenstein" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Rust" ]; then +elif [ "${shortname}" == "rust" ]; then gamedirname="Rust" fn_check_cfgdir array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote -elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then +elif [ "${shortname}" == "samp" ]; then + gamedirname="SanAndreasMultiplayer" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${shortname}" == "ss3" ]; then gamedirname="SeriousSam3BFE" array_configs+=( server.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Squad" ]; then +elif [ "${shortname}" == "sol" ]; then + gamedirname="Soldat" + array_configs+=( soldat.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${shortname}" == "sof2" ]; then + gamedirname="SoldierOfFortune2Gold" + array_configs+=( server.cfg mapcycle.txt) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${shortname}" == "sfc" ]; then + gamedirname="SourceFortsClassic" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${shortname}" == "squad" ]; then gamedirname="Squad" - array_configs+=( Server.cfg Rcon.cfg ) + array_configs+=( Admins.cfg Bans.cfg License.cfg Server.cfg Rcon.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Starbound" ]; then +elif [ "${shortname}" == "sb" ]; then gamedirname="Starbound" array_configs+=( starbound_server.config ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Stationeers" ]; then +elif [ "${shortname}" == "st" ]; then gamedirname="Stationeers" array_configs+=( default.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "San Andreas Multiplayer" ]; then - gamedirname="SanAndreasMultiplayer" +elif [ "${shortname}" == "sven" ]; then + gamedirname="SvenCoop" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Sven Co-op" ]; then - gamedirname="SvenCoop" +elif [ "${shortname}" == "tf2" ]; then + gamedirname="TeamFortress2" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Team Fortress 2" ]; then - gamedirname="TeamFortress2" +elif [ "${shortname}" == "tfc" ]; then + gamedirname="TeamFortressClassic" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Team Fortress Classic" ]; then - gamedirname="TeamFortressClassic" +elif [ "${shortname}" == "ts" ]; then + gamedirname="TheSpecialists" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "TeamSpeak 3" ]; then +elif [ "${shortname}" == "ts3" ]; then gamedirname="TeamSpeak3" array_configs+=( ts3server.ini ) fn_fetch_default_config fn_default_config_remote -elif [ "${gamename}" == "Teeworlds" ]; then +elif [ "${shortname}" == "tw" ]; then gamedirname="Teeworlds" array_configs+=( server.cfg ctf.cfg dm.cfg duel.cfg tdm.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Terraria" ]; then +elif [ "${shortname}" == "terraria" ]; then gamedirname="Terraria" array_configs+=( serverconfig.txt ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Tower Unite" ]; then +elif [ "${shortname}" == "tu" ]; then gamedirname="TowerUnite" fn_check_cfgdir array_configs+=( TowerServer.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Unreal Tournament" ]; then +elif [ "${shortname}" == "ut" ]; then gamedirname="UnrealTournament" array_configs+=( Game.ini Engine.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Unreal Tournament 2004" ]; then +elif [ "${shortname}" == "ut2k4" ]; then gamedirname="UnrealTournament2004" array_configs+=( UT2004.ini ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Unreal Tournament 99" ]; then +elif [ "${shortname}" == "ut99" ]; then gamedirname="UnrealTournament99" array_configs+=( Default.ini ) fn_fetch_default_config @@ -639,25 +688,37 @@ elif [ "${shortname}" == "unt" ]; then fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Vampire Slayer" ]; then +elif [ "${shortname}" == "vs" ]; then gamedirname="VampireSlayer" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then +elif [ "${shortname}" == "wet" ]; then gamedirname="WolfensteinEnemyTerritory" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Wurm Unlimited" ]; then +elif [ "${shortname}" == "wf" ]; then + gamedirname="Warfork" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${shortname}" == "wurm" ]; then gamedirname="WurmUnlimited" array_configs+=( server.cfg ) fn_fetch_default_config fn_default_config_remote fn_set_config_vars -elif [ "${gamename}" == "Zombie Panic! Source" ]; then +elif [ "${shortname}" == "zmr" ]; then + gamedirname="ZombieMasterReborn" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${shortname}" == "zps" ]; then gamedirname="ZombiePanicSource" array_configs+=( server.cfg ) fn_fetch_default_config diff --git a/lgsm/functions/install_dst_token.sh b/lgsm/functions/install_dst_token.sh index 11a4c3679..55e83ffe4 100644 --- a/lgsm/functions/install_dst_token.sh +++ b/lgsm/functions/install_dst_token.sh @@ -8,18 +8,18 @@ local commandname="INSTALL" local commandaction="Install" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -echo "" -echo "Enter ${gamename} Cluster Token" -echo "=================================" -sleep 0.5 -echo "A cluster token is required to run this server!" -echo "Follow the instructions in this link to obtain this key:" -echo "https://linuxgsm.com/dst-auth-token" -echo "" +echo -e "" +echo -e "${lightyellow}Enter ${gamename} Cluster Token${default}" +echo -e "=================================" +fn_sleep_time +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 "" if [ -z "${autoinstall}" ]; then overwritetoken="true" if [ -s "${clustercfgdir}/cluster_token.txt" ]; then - echo "The cluster token is already set. Do you want to overwrite it?" + echo -e "The cluster token is already set. Do you want to overwrite it?" fn_script_log_info "Don't Starve Together cluster token is already set" if fn_prompt_yn "Continue?" N; then overwritetoken="true" @@ -28,19 +28,19 @@ if [ -z "${autoinstall}" ]; then fi fi if [ "${overwritetoken}" == "true" ]; then - echo "Once you have the cluster token, enter it below" + echo -e "Once you have the cluster token, enter it below" echo -n "Cluster Token: " read -r token mkdir -pv "${clustercfgdir}" - echo "${token}" > "${clustercfgdir}/cluster_token.txt" + echo -e "${token}" > "${clustercfgdir}/cluster_token.txt" if [ -f "${clustercfgdir}/cluster_token.txt" ]; then - echo "Don't Starve Together cluster token created" + echo -e "Don't Starve Together cluster token created" fn_script_log_info "Don't Starve Together cluster token created" fi unset overwritetoken fi else - echo "You can add your cluster token using the following command" - echo "./${selfname} cluster-token" + echo -e "You can add your cluster token using the following command" + echo -e "./${selfname} cluster-token" fi -echo "" +echo -e "" diff --git a/lgsm/functions/install_eula.sh b/lgsm/functions/install_eula.sh index cc676f0dc..d7893b16c 100644 --- a/lgsm/functions/install_eula.sh +++ b/lgsm/functions/install_eula.sh @@ -12,26 +12,26 @@ elif [ "${shortname}" == "ut" ]; then eulaurl="https://www.epicgames.com/unrealtournament/unreal-tournament-pre-alpha-test-development-build-eula" fi -echo "" -echo "Accept ${gamename} EULA" -echo "=================================" -sleep 0.5 -echo "You are required to accept the EULA:" -echo "${eulaurl}" -echo "" +echo -e "" +echo -e "${lightyellow}Accept ${gamename} EULA${default}" +echo -e "=================================" +fn_sleep_time +echo -e "You are required to accept the EULA:" +echo -e "${eulaurl}" +echo -e "" if [ -z "${autoinstall}" ]; then - echo "By continuing you are indicating your agreement to the EULA." - echo "" + echo -e "By continuing you are indicating your agreement to the EULA." + echo -e "" if ! fn_prompt_yn "Continue?" Y; then core_exit.sh fi elif [ "${function_selfname}" == "command_start.sh" ]; then fn_print_info "By continuing you are indicating your agreement to the EULA." - echo "" + echo -e "" sleep 5 else - echo "By using auto-install you are indicating your agreement to the EULA." - echo "" + echo -e "By using auto-install you are indicating your agreement to the EULA." + echo -e "" sleep 5 fi @@ -39,7 +39,7 @@ if [ "${shortname}" == "ts3" ]; then touch "${executabledir}/.ts3server_license_accepted" elif [ "${shortname}" == "mc" ]; then touch "${serverfiles}/eula.txt" - echo "eula=true" > "${serverfiles}/eula.txt" + echo -e "eula=true" > "${serverfiles}/eula.txt" elif [ "${shortname}" == "ut" ]; then : fi diff --git a/lgsm/functions/install_factorio_save.sh b/lgsm/functions/install_factorio_save.sh index 3b243c9d4..fd9e634a1 100644 --- a/lgsm/functions/install_factorio_save.sh +++ b/lgsm/functions/install_factorio_save.sh @@ -7,9 +7,9 @@ local commandname="INSTALL" local commandaction="Install" -echo "" -echo "Creating initial Factorio savefile" -echo "=================================" -sleep 0.5 +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 index 2c8c0e9f3..425fcb2b9 100644 --- a/lgsm/functions/install_gslt.sh +++ b/lgsm/functions/install_gslt.sh @@ -8,26 +8,26 @@ local commandname="INSTALL" local commandaction="Install" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -echo "" -echo "Game Server Login Token" -echo "=================================" -sleep 0.5 +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 "GSLT is required to run a public ${gamename} server" + echo -e "GSLT is required to run a public ${gamename} server" fn_script_log_info "GSLT is required to run a public ${gamename} server" else - echo "GSLT is an optional feature for ${gamename} server" + echo -e "GSLT is an optional feature for ${gamename} server" fn_script_log_info "GSLT is an optional feature for ${gamename} server" fi -echo "Get more info and a token here:" -echo "https://linuxgsm.com/gslt" +echo -e "Get more info and a token here:" +echo -e "https://linuxgsm.com/gslt" fn_script_log_info "Get more info and a token here:" fn_script_log_info "https://linuxgsm.com/gslt" -echo "" +echo -e "" if [ -z "${autoinstall}" ]; then if [ "${shortname}" != "tu" ]; then - echo "Enter token below (Can be blank)." + echo -e "Enter token below (Can be blank)." echo -n "GSLT TOKEN: " read -r token if ! grep -q "^gslt=" "${configdirserver}/${servicename}.cfg" > /dev/null 2>&1; then @@ -37,12 +37,12 @@ if [ -z "${autoinstall}" ]; then fi fi fi -sleep 0.5 +fn_sleep_time if [ "${shortname}" == "tu" ]; then - echo "The GSLT can be changed by editing ${servercfgdir}/${servercfg}." + 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 "The GSLT can be changed by editing ${configdirserver}/${servicename}.cfg." + echo -e "The GSLT can be changed by editing ${configdirserver}/${servicename}.cfg." fn_script_log_info "The GSLT can be changed by editing ${configdirserver}/${servicename}.cfg." fi -echo "" +echo -e "" diff --git a/lgsm/functions/install_header.sh b/lgsm/functions/install_header.sh index 40c2845fc..0b5febae1 100644 --- a/lgsm/functions/install_header.sh +++ b/lgsm/functions/install_header.sh @@ -9,10 +9,14 @@ local commandaction="Install" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" clear -echo "=================================" -echo "LinuxGSM - ${gamename}" -echo "by Daniel Gibbs" -echo "Website: https://linuxgsm.com" -echo "Contributors: https://linuxgsm.com/contrib" -echo "Donate: https://linuxgsm.com/donate" -echo "=================================" +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 index bc8184839..996e05f93 100644 --- a/lgsm/functions/install_logs.sh +++ b/lgsm/functions/install_logs.sh @@ -9,12 +9,12 @@ local commandaction="Install" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "${checklogs}" != "1" ]; then - echo "" - echo "Creating log directories" - echo "=================================" + echo -e "" + echo -e "${lightyellow}Creating log directories${default}" + echo -e "=================================" fi -sleep 0.5 -# Create LinuxGSM logs +fn_sleep_time +# Create LinuxGSM logs. echo -en "installing log dir: ${logdir}..." mkdir -p "${logdir}" if [ $? -ne 0 ]; then @@ -40,7 +40,7 @@ if [ $? -ne 0 ]; then else fn_print_ok_eol_nl fi -# Create Console logs +# Create Console logs. if [ -n "${consolelogdir}" ]; then echo -en "installing console log dir: ${consolelogdir}..." mkdir -p "${consolelogdir}" @@ -60,7 +60,7 @@ if [ -n "${consolelogdir}" ]; then fi fi -# Create Game logs +# Create Game logs. if [ -n "${gamelogdir}" ]&&[ ! -d "${gamelogdir}" ]; then echo -en "installing game log dir: ${gamelogdir}..." mkdir -p "${gamelogdir}" @@ -73,7 +73,7 @@ if [ -n "${gamelogdir}" ]&&[ ! -d "${gamelogdir}" ]; then fi # Symlink to gamelogdir -# unless gamelogdir is within logdir +# 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}" ]; then @@ -89,7 +89,7 @@ if [ -n "${gamelogdir}" ]; then fi fi -# If server uses SteamCMD create a symbolic link to the Steam logs +# 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..." @@ -102,5 +102,5 @@ if [ -d "${rootdir}/Steam/logs" ]; then fi fi fi -sleep 0.5 +fn_sleep_time fn_script_log_info "Logs installed" diff --git a/lgsm/functions/install_mta_resources.sh b/lgsm/functions/install_mta_resources.sh index b4ff2bece..d21de7f9c 100644 --- a/lgsm/functions/install_mta_resources.sh +++ b/lgsm/functions/install_mta_resources.sh @@ -10,5 +10,5 @@ local commandaction="Install" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_information_nl "${gamename} will not function without resources!" -echo " * install default resources using ./${selfname} install-default-resources" -echo " * download resources from https://community.multitheftauto.com" +echo -e " * install default resources using ./${selfname} install-default-resources" +echo -e " * download resources from https://community.multitheftauto.com" diff --git a/lgsm/functions/install_server_dir.sh b/lgsm/functions/install_server_dir.sh index abb8f6fb0..ee918c0e5 100644 --- a/lgsm/functions/install_server_dir.sh +++ b/lgsm/functions/install_server_dir.sh @@ -8,15 +8,15 @@ local commandname="INSTALL" local commandaction="Install" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -echo "" -echo "Server Directory" -echo "=================================" -sleep 0.5 +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 "" +echo -e "" if [ -z "${autoinstall}" ]; then if ! fn_prompt_yn "Continue?" Y; then exit @@ -24,4 +24,4 @@ if [ -z "${autoinstall}" ]; then fi if [ ! -d "${serverfiles}" ]; then mkdir -v "${serverfiles}" -fi \ No newline at end of file +fi diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index 1ac39200d..73c375fbb 100644 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -9,7 +9,9 @@ local commandaction="Install" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_server_files(){ - if [ "${shortname}" == "bf1942" ]; then + if [ "${shortname}" == "ahl" ]; then + remote_fileurl="https://files.linuxgsm.com/ActionHalfLife/action_halflife-1.0.tar.bz2"; local_filedir="${tmpdir}"; local_filename="action_halflife-1.0.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="31430e670692b2eeaa0d1217db4dcb73" + elif [ "${shortname}" == "bf1942" ]; then remote_fileurl="https://files.linuxgsm.com/BattleField1942/bf1942_lnxded-1.61-hacked-to-1.612.full.tar.bz2"; local_filedir="${tmpdir}"; local_filename="bf1942_lnxded-1.61-hacked-to-1.612.full.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="a86a5d3cd64ca59abcc9bb9f777c2e5d" elif [ "${shortname}" == "bb" ]; then remote_fileurl="https://files.linuxgsm.com/BrainBread/brainbread-v1.2-linuxserver.tar.bz2"; local_filedir="${tmpdir}"; local_filename="brainbread-v1.2-linuxserver.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="5c729a7e9eecfa81b71a6a1f7267f0fd" @@ -27,6 +29,8 @@ fn_install_server_files(){ remote_fileurl="https://files.linuxgsm.com/WolfensteinEnemyTerritory/etlegacy-v2.75-i386-et-260b.tar.bz2"; local_filedir="${tmpdir}"; local_filename="etlegacy-v2.75-i386-et-260b.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="92d7d4c26e0a295daed78cef623eeabb" elif [ "${shortname}" == "ges" ]; then remote_fileurl="https://files.linuxgsm.com/GoldenEyeSource/GoldenEye_Source_v5.0.6_full_server.tar.bz2"; local_filedir="${tmpdir}"; local_filename="GoldenEye_Source_v5.0.6_full_server.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="c45c16293096706e8b5e2cd64a6f2931" + elif [ "${shortname}" == "mohaa" ]; then + remote_fileurl="https://files.linuxgsm.com/MedalofHonorAlliedAssault/moh_revival_v1.12_RC3.5.1.tar.bz2"; local_filedir="${tmpdir}"; local_filename="moh_revival_v1.12_RC3.5.1.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="9d5924486a0cf5e46dd063216aad05c1" elif [ "${shortname}" == "ns" ]; then remote_fileurl="https://files.linuxgsm.com/NaturalSelection/ns_dedicated_server_v32.tar.bz2"; local_filedir="${tmpdir}"; local_filename="ns_dedicated_server_v32.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="499cf63324b76925ada6baf5f2eacd67" elif [ "${shortname}" == "q2" ]; then @@ -34,9 +38,15 @@ fn_install_server_files(){ elif [ "${shortname}" == "q3" ]; then remote_fileurl="https://files.linuxgsm.com/Quake3/quake3-1.32c-x86-full-linux.tar.bz2"; local_filedir="${tmpdir}"; local_filename="quake3-1.32c-x86-full-linux.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="fd7258d827474f67663dda297bff4306" elif [ "${shortname}" == "qw" ]; then - remote_fileurl="https://files.linuxgsm.com/QuakeWorld/nquake.server.linux.083116.full.tar.bz2"; local_filedir="${tmpdir}"; local_filename="nquake.server.linux.083116.full.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="75a409cf08d808f075e4dacdc7b21b78" + remote_fileurl="https://files.linuxgsm.com/QuakeWorld/nquake.server.linux.190506.full.tar.bz2"; local_filedir="${tmpdir}"; local_filename="nquake.server.linux.190506.full.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="74405ec030463c5e1175e776ab572d32" elif [ "${shortname}" == "rtcw" ]; then - remote_fileurl="https://files.linuxgsm.com/ReturnToCastleWolfenstein/iortcw-1.51b-x86_64-server-linux-20190208.tar.bz2"; local_filedir="${tmpdir}"; local_filename="iortcw-1.51b-x86_64-server-linux-20190208.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="7e555481a3b98e168dfb5e6ddc2fb879" + remote_fileurl="https://files.linuxgsm.com/ReturnToCastleWolfenstein/iortcw-1.51c-x86_64-server-linux-20190507.tar.bz2"; local_filedir="${tmpdir}"; local_filename="iortcw-1.51c-x86_64-server-linux-20190507.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="6a3be9700372b228d1187422464e4212" + elif [ "${shortname}" == "sfc" ]; then + remote_fileurl="https://files.linuxgsm.com/SourceFortsClassic/SFClassic-1.0-RC7-fix.tar.bz2"; local_filedir="${tmpdir}"; local_filename="SFClassic-1.0-RC7-fix.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="e0d4cfd298a8a356053f92b1fa7d1002" + elif [ "${shortname}" == "sof2" ]; then + remote_fileurl="https://files.linuxgsm.com/SoldierOfFortune2/sof2gold-1.03.tar.bz2"; local_filedir="${tmpdir}"; local_filename="sof2gold-1.03.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="871b1dc0dafeeace65b198119e8fa200" + elif [ "${shortname}" == "ts" ]; then + remote_fileurl="https://files.linuxgsm.com/TheSpecialists/ts-3-linux-final.tar.bz2"; local_filedir="${tmpdir}"; local_filename="ts-3-linux-final.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="38e8a8325339f85a7745117802f940b7" elif [ "${shortname}" == "ut2k4" ]; then remote_fileurl="https://files.linuxgsm.com/UnrealTournament2004/ut2004-server-3369-2-ultimate-linux.tar.bz2"; local_filedir="${tmpdir}"; local_filename="ut2004-server-3369-2-ultimate-linux.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="67c5e2cd9c2a4b04f163962ee41eff54" elif [ "${shortname}" == "ut99" ]; then @@ -51,6 +61,10 @@ fn_install_server_files(){ remote_fileurl="https://files.linuxgsm.com/WolfensteinEnemyTerritory/enemy-territory.260b.tar.bz2"; local_filedir="${tmpdir}"; local_filename="enemy-territory.260b.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="f833f514bfcdd46b42c111f83350c5a7" 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}" == "sol" ]; then + remote_fileurl="https://static.soldat.pl/downloads/soldatserver2.8.1_1.7.1.zip"; local_filedir="${tmpdir}"; local_filename="soldatserver2.8.1_1.7.1.zip"; chmodx="nochmodx" run="norun"; force="noforce"; md5="994409c28520425965dec5c71ccb55e1" + elif [ "${shortname}" == "zmr" ]; then + remote_fileurl="https://files.linuxgsm.com/ZombieMasterReborn/zombie_master_reborn_b4_fix5.1.tar.bz2"; local_filedir="${tmpdir}"; local_filename="zombie_master_reborn_b4_fix5.1.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="73472bd84dfa6d203f3b5f48f760773e" fi fn_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" fn_dl_extract "${local_filedir}" "${local_filename}" "${serverfiles}" @@ -60,13 +74,13 @@ fn_install_server_files_steamcmd(){ counter="0" while [ "${counter}" == "0" ]||[ "${exitcode}" != "0" ]; do counter=$((counter+1)) - cd "${steamcmddir}" + cd "${steamcmddir}" || exit 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 + # 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}" @@ -74,7 +88,7 @@ fn_install_server_files_steamcmd(){ fi if [ "${counter}" -ge "7" ]; then - echo "Removing $(find "${serverfiles}" -type d -print0 | grep -Ez '[^/]{30}$')" + 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 @@ -90,21 +104,18 @@ fn_install_server_files_steamcmd(){ if [ "${counter}" -le "4" ]; then if [ "${appid}" == "90" ]; then - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +quit - local exitcode=$? - elif [ "${shortname}" == "unt" ]; then - ${unbuffer} ./steamcmd.sh +@sSteamCmdForcePlatformBitness 32 +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} validate +quit + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta ${branch} +quit local exitcode=$? else - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} +quit + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta ${branch} +quit local exitcode=$? fi elif [ "${counter}" -ge "5" ]; then if [ "${engine}" == "goldsource" ]; then - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} validate +quit + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta ${branch} validate +quit local exitcode=$? else - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} validate +quit + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta ${branch} validate +quit local exitcode=$? fi fi @@ -128,10 +139,10 @@ fn_install_server_files_steamcmd(){ fi } -echo "" -echo "Installing ${gamename} Server" -echo "=================================" -sleep 0.5 +echo -e "" +echo -e "${lightyellow}Installing ${gamename} Server${default}" +echo -e "=================================" +fn_sleep_time if [ -n "${appid}" ]; then fn_install_server_files_steamcmd @@ -149,7 +160,7 @@ elif [ "${shortname}" == "mta" ]; then elif [ "${shortname}" == "fctr" ]; then update_factorio.sh install_factorio_save.sh -elif [ -z "${appid}" ]||[ "${shortname}" == "ges" ]||[ "${shortname}" == "bd" ]||[ "${shortname}" == "bb" ]||[ "${shortname}" == "ns" ]||[ "${shortname}" == "vs" ]; then +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 @@ -157,8 +168,8 @@ elif [ -z "${appid}" ]||[ "${shortname}" == "ges" ]||[ "${shortname}" == "bd" ]| fi if [ -z "${autoinstall}" ]; then - echo "" - echo "=================================" + echo -e "" + echo -e "=================================" if ! fn_prompt_yn "Was the install successful?" Y; then install_retry.sh fi diff --git a/lgsm/functions/install_squad_license.sh b/lgsm/functions/install_squad_license.sh index 3b0711309..b1e15e419 100644 --- a/lgsm/functions/install_squad_license.sh +++ b/lgsm/functions/install_squad_license.sh @@ -8,19 +8,19 @@ local commandname="INSTALL" local commandaction="Install" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -echo "" -echo "Squad Server License" -echo "=================================" -sleep 0.5 -echo "Server license is an optional feature for ${gamename} server" +echo -e "" +echo -e "${lightyellow}Squad Server License${default}" +echo -e "=================================" +fn_sleep_time +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 "Get more info and a server license here:" -echo "http://forums.joinsquad.com/topic/16519-server-licensing-general-info/" +echo -e "Get more info and a server license here:" +echo -e "http://forums.joinsquad.com/topic/16519-server-licensing-general-info/" 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/" -echo "" -sleep 0.5 -echo "The Squad server license can be changed by editing ${servercfgdir}/License.cfg." +echo -e "" +fn_sleep_time +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 "" \ No newline at end of file +echo -e "" diff --git a/lgsm/functions/install_steamcmd.sh b/lgsm/functions/install_steamcmd.sh index 10d095423..e56c9b8aa 100644 --- a/lgsm/functions/install_steamcmd.sh +++ b/lgsm/functions/install_steamcmd.sh @@ -7,8 +7,8 @@ local commandname="INSTALL" local commandaction="Install" -echo "" -echo "Installing SteamCMD" -echo "=================================" -sleep 0.5 +echo -e "" +echo -e "${lightyellow}Installing SteamCMD${default}" +echo -e "=================================" +fn_sleep_time check_steamcmd.sh diff --git a/lgsm/functions/install_ts3db.sh b/lgsm/functions/install_ts3db.sh index 77dea1bae..cd2ef8653 100644 --- a/lgsm/functions/install_ts3db.sh +++ b/lgsm/functions/install_ts3db.sh @@ -24,10 +24,10 @@ fn_install_ts3db_mariadb(){ fi fi - echo "" - echo "Configure ${gamename} Server for MariaDB" - echo "=================================" - sleep 0.5 + echo -e "" + echo -e "${lightyellow}Configure ${gamename} Server for MariaDB${default}" + echo -e "=================================" + fn_sleep_time read -rp "Enter MariaDB hostname: " mariahostname read -rp "Enter MariaDB port: " mariaport read -rp "Enter MariaDB username: " mariausername @@ -36,25 +36,25 @@ fn_install_ts3db_mariadb(){ read -rp "Enter MariaDB socket path: " mariadbsocket { - echo "[config]" - echo "host='${mariahostname}'" - echo "port='${mariaport}'" - echo "username='${mariausername}'" - echo "password='${mariapassword}'" - echo "database='${mariadbname}'" - echo "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 "updating ts3db_mariadb.ini." - sleep 0.5 + echo -e "updating ts3db_mariadb.ini." + fn_sleep_time } -echo "" -echo "Select Database" -echo "=================================" -sleep 0.5 +echo -e "" +echo -e "${lightyellow}Select Database${default}" +echo -e "=================================" +fn_sleep_time 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 @@ -65,13 +65,11 @@ fi install_eula.sh -## Get privilege key -echo "" -echo "Getting privilege key" -echo "=================================" -sleep 0.5 +echo -e "" +echo -e "${lightyellow}Getting privilege key${default}" +echo -e "=================================" +fn_sleep_time fn_print_information_nl "Save these details for later." -sleep 0.5 cd "${executabledir}" || exit ${executable} start inifile=ts3-server.ini sleep 5 diff --git a/lgsm/functions/install_ut2k4_key.sh b/lgsm/functions/install_ut2k4_key.sh index f1e840462..ea9f0ac82 100644 --- a/lgsm/functions/install_ut2k4_key.sh +++ b/lgsm/functions/install_ut2k4_key.sh @@ -8,24 +8,24 @@ local commandname="INSTALL" local commandaction="Install" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -echo "" -echo "Enter ${gamename} CD Key" -echo "=================================" -sleep 0.5 -echo "To get your server listed on the Master Server list" -echo "you must get a free CD key. Get a key here:" -echo "https://forums.unrealtournament.com/utserver/cdkey.php?2004" -echo "" +echo -e "" +echo -e "${lightyellow}Enter ${gamename} CD Key${default}" +echo -e "=================================" +fn_sleep_time +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 "" if [ -z "${autoinstall}" ]; then - echo "Once you have the key enter it below" + echo -e "Once you have the key enter it below" echo -n "KEY: " read -r CODE - echo ""\""CDKey"\""="\""${CODE}"\""" > "${systemdir}/cdkey" + echo -e ""\""CDKey"\""="\""${CODE}"\""" > "${systemdir}/cdkey" if [ -f "${systemdir}/cdkey" ]; then fn_script_log_info "UT2K4 Server CD Key created" fi else - echo "You can add your key using the following command" - echo "./${selfname} server-cd-key" + echo -e "You can add your key using the following command" + echo -e "./${selfname} server-cd-key" fi -echo "" \ No newline at end of file +echo -e "" diff --git a/lgsm/functions/logs.sh b/lgsm/functions/logs.sh index 69dbc7deb..280b50a92 100644 --- a/lgsm/functions/logs.sh +++ b/lgsm/functions/logs.sh @@ -8,27 +8,27 @@ local commandname="LOGS" local commandaction="Log-Manager" -# Check if logfile variable and file exist, create logfile if it doesn't exist +# Check if logfile variable and file exist, create logfile if it doesn't exist. if [ -n "${consolelog}" ]; then if [ ! -e "${consolelog}" ]; then touch "${consolelog}" fi fi -# For games not displaying a console, and having logs into their game directory +# For games not displaying a console, and having logs into their game directory. check_status.sh if [ "${status}" != "0" ]&&[ "${function_selfname}" == "command_start.sh" ]&&[ -n "${gamelogfile}" ]; then if [ -n "$(find "${systemdir}" -name "gamelog*.log")" ]; then fn_print_info "Moving game logs to ${gamelogdir}" fn_script_log_info "Moving game logs to ${gamelogdir}" echo -en "\n" - sleep 0.5 + fn_sleep_time mv "${systemdir}"/gamelog*.log "${gamelogdir}" fi fi -# Log manager will start the cleanup if it finds logs older than "${logdays}" -if [ $(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l) -ne "0" ]; then +# Log manager will start the cleanup if it finds logs older than "${logdays}". +if [ "$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l)" -ne "0" ]; then fn_print_dots "Starting" # Set common logs directories commonlogs="${systemdir}/logs" @@ -40,28 +40,28 @@ if [ $(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l) -ne "0" ]; th legacyserverlogdir="${logdir}/server" # Setting up counting variables scriptcount="0" ; consolecount="0" ; gamecount="0" ; srcdscount="0" ; smcount="0" ; ulxcount="0" ; darkrpcount="0" ; legacycount="0" - sleep 0.5 + fn_sleep_time fn_print_ok_nl "Starting" fn_print_info_nl "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 - # Script logfiles + # Logging logfiles to be removed according to "${logdays}", counting and removing them. + # Script logfiles. find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" scriptcount=$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l) find "${lgsmlogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; - # SRCDS and unreal logfiles + # SRCDS and unreal logfiles. 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 {} \; fi - # Console logfiles + # Console logfiles. if [ -n "${consolelog}" ]; then find "${consolelogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" consolecount=$(find "${consolelogdir}"/ -type f -mtime +"${logdays}" | wc -l) find "${consolelogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; fi - # Common logfiles + # Common logfiles. if [ -d "${commonlogs}" ]; then find "${commonlogs}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" smcount=$(find "${commonlogs}"/ -type f -mtime +"${logdays}" | wc -l) @@ -72,23 +72,23 @@ if [ $(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l) -ne "0" ]; th smcount=$(find "${commonsourcelogs}"/* -type f -mtime +"${logdays}" | wc -l) find "${commonsourcelogs}"/* -mtime +"${logdays}" -type f -exec rm -f {} \; fi - # Source addons logfiles + # Source addons logfiles. if [ "${engine}" == "source" ]; then - # SourceMod logfiles + # SourceMod logfiles. if [ -d "${sourcemodlogdir}" ]; then find "${sourcemodlogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" smcount=$(find "${sourcemodlogdir}"/ -type f -mtime +"${logdays}" | wc -l) find "${sourcemodlogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; fi - # Garry's Mod logfiles - if [ "${gamename}" == "Garry's Mod" ]; then - # ULX logfiles + # Garry's Mod logfiles. + if [ "${shortname}" == "gmod" ]; then + # ULX logfiles. if [ -d "${ulxlogdir}" ]; then find "${ulxlogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" ulxcount=$(find "${ulxlogdir}"/ -type f -mtime +"${logdays}" | wc -l) find "${ulxlogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; fi - # DarkRP logfiles + # DarkRP logfiles. if [ -d "${darkrplogdir}" ]; then find "${darkrplogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" darkrpcount=$(find "${darkrplogdir}"/ -type f -mtime +"${logdays}" | wc -l) @@ -97,9 +97,9 @@ if [ $(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l) -ne "0" ]; th fi fi - # Count total amount of files removed + # Count total amount of files removed. countlogs=$((${scriptcount} + ${consolecount} + ${gamecount} + ${srcdscount} + ${smcount} + ${ulxcount} + ${darkrpcount})) - # Job done + # Job done. fn_print_ok_nl "Removed ${countlogs} log files" fn_script_log "Removed ${countlogs} log files" fi diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh index cf2178b3c..f0b056b28 100644 --- a/lgsm/functions/mods_core.sh +++ b/lgsm/functions/mods_core.sh @@ -9,19 +9,19 @@ local commandname="MODS" local commandaction="Mods" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -# Files and Directories +# Files and Directories. modsdir="${lgsmdir}/mods" modstmpdir="${modsdir}/tmp" extractdir="${modstmpdir}/extract" modsinstalledlist="installed-mods.txt" modsinstalledlistfullpath="${modsdir}/${modsinstalledlist}" -## Installation +## Installation. -# Download management +# Download management. fn_mod_install_files(){ fn_fetch_file "${modurl}" "${modstmpdir}" "${modfilename}" - # Check if variable is valid checking if file has been downloaded and exists + # 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}" @@ -33,20 +33,20 @@ fn_mod_install_files(){ fn_dl_extract "${modstmpdir}" "${modfilename}" "${extractdir}" } -# Convert mod files to lowercase if needed +# Convert mod files to lowercase if needed. fn_mod_lowercase(){ if [ "${modlowercase}" == "LowercaseOn" ]; then echo -en "converting ${modprettyname} files to lowercase..." - sleep 0.5 + fn_sleep_time fn_script_log_info "Converting ${modprettyname} files to lowercase" fileswc=$(find "${extractdir}" -depth | wc -l) echo -en "\r" while read -r src; do - dst=$(dirname "${src}"$(/)basename "${src}" | tr 'A-Z' 'a-z') + dst="$(dirname "${src}$(/)basename" "${src}" | tr 'A-Z' 'a-z')" if [ "${src}" != "${dst}" ] then - [ ! -e "${dst}" ] && mv -T "${src}" "${dst}" || echo "${src} was not renamed" + [ ! -e "${dst}" ] && mv -T "${src}" "${dst}" || echo -e "${src} was not renamed" local exitcode=$? ((renamedwc++)) fi @@ -61,15 +61,15 @@ fn_mod_lowercase(){ else fn_print_ok_eol_nl fi - sleep 0.5 + fn_sleep_time fi } -# Create ${modcommand}-files.txt containing the full extracted file/directory list +# Create ${modcommand}-files.txt containing the full extracted file/directory list. fn_mod_create_filelist(){ echo -en "building ${modcommand}-files.txt..." - sleep 0.5 - # ${modsdir}/${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 @@ -80,17 +80,17 @@ fn_mod_create_filelist(){ fn_print_ok_eol_nl fn_script_log_pass "Building ${modsdir}/${modcommand}-files.txt" fi - # Adding removed files if needed + # Adding removed files if needed. if [ -f "${modsdir}/.removedfiles.tmp" ]; then cat "${modsdir}/.removedfiles.tmp" >> "${modsdir}/${modcommand}-files.txt" fi - sleep 0.5 + fn_sleep_time } -# Copy the mod into serverfiles +# Copy the mod into serverfiles. fn_mod_copy_destination(){ echo -en "copying ${modprettyname} to ${modinstalldir}..." - sleep 0.5 + fn_sleep_time cp -Rf "${extractdir}/." "${modinstalldir}/" local exitcode=$? if [ ${exitcode} -ne 0 ]; then @@ -102,34 +102,34 @@ fn_mod_copy_destination(){ fi } -# Add the mod to the installed-mods.txt +# Add the mod to the installed-mods.txt. fn_mod_add_list(){ if [ ! -n "$(sed -n "/^${modcommand}$/p" "${modsinstalledlistfullpath}")" ]; then - echo "${modcommand}" >> "${modsinstalledlistfullpath}" + echo -e "${modcommand}" >> "${modsinstalledlistfullpath}" fn_script_log_info "${modcommand} added to ${modsinstalledlist}" fi } -# Prevent sensitive directories from being erased upon uninstall by removing them from: ${modcommand}-files.txt +# Prevent sensitive directories from being erased upon uninstall by removing them from: ${modcommand}-files.txt. fn_mod_tidy_files_list(){ - # Check file list validity + # Check file list validity. fn_check_mod_files_list # Output to the user echo -en "tidy up ${modcommand}-files.txt..." - sleep 0.5 + fn_sleep_time fn_script_log_info "Tidy up ${modcommand}-files.txt" - # Lines/files to remove from file list (end with ";" separator) + # Lines/files to remove from file list (end with ";" separator). removefromlist="cfg;addons;RustDedicated_Data;RustDedicated_Data\/Managed;RustDedicated_Data\/Managed\/x86;RustDedicated_Data\/Managed\/x64;" # Loop through files to remove from file list, - # generate elements to remove from list - removefromlistamount="$(echo "${removefromlist}" | awk -F ';' '{ print NF }')" - # Test all subvalue of "removefromlist" using the ";" separator + # 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 - # Put current file into test variable - removefilevar="$(echo "${removefromlist}" | awk -F ';' -v x=${filesindex} '{ print $x }')" - # Delete line(s) matching exactly + # 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 + # Exit on error. local exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol_nl @@ -140,42 +140,82 @@ fn_mod_tidy_files_list(){ done fn_print_ok_eol_nl # Sourcemod fix - # Remove metamod from sourcemod fileslist + # Remove metamod from sourcemod fileslist. if [ "${modcommand}" == "sourcemod" ]; then - # Remove addons/metamod & addons/metamod/sourcemod.vdf from ${modcommand}-files.txt + # Remove addons/metamod & addons/metamod/sourcemod.vdf from ${modcommand}-files.txt. sed -i "/^addons\/metamod$/d" "${modsdir}/${modcommand}-files.txt" sed -i "/^addons\/metamod\/sourcemod.vdf$/d" "${modsdir}/${modcommand}-files.txt" fi + + # Remove common paths from deletion list (Add your sourcemod mod here) + if [ "${modcommand}" == "gokz" ] || [ "${modcommand}" == "ttt" ] || [ "${modcommand}" == "steamworks" ] || [ "${modcommand}" == "get5" ]; then + sed -i "/^addons\/sourcemod$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/configs$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/extensions$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/logs$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/plugins$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/plugins\/disabled$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/translations$/d" "${modsdir}/${modcommand}-files.txt" + # Don't delete directories of translations like 'fr', 'sv', 'de', etc + sed -i "/^addons\/sourcemod\/translations\/[A-Za-z0-9_]*$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^cfg\/sourcemod$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^maps$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^materialss$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^materials\/models$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^materials\/models\/weapons$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^materials\/darkness$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^materials\/decals$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^materials\/overlays$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^models$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^models\/weapons$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^sound$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^sound\/weapons$/d" "${modsdir}/${modcommand}-files.txt" + fi + + # Remove paths of specific mods from deletion list + if [ "${modcommand}" == "gokz" ]; then + sed -i "/^addons\/sourcemod\/scripting\/include\/smjansson.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/GlobalAPI-Core.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/sourcebanspp.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/autoexecconfig.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/colorvariables.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/movementapi.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/movement.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/dhooks.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/updater.inc$/d" "${modsdir}/${modcommand}-files.txt" + fi } -## Information Gathering +## Information Gathering. -# Get details of a mod any (relevant and unique, such as full mod name or install command) value +# Get details of a mod any (relevant and unique, such as full mod name or install command) value. fn_mod_get_info(){ - # Variable to know when job is done + # Variable to know when job is done. modinfocommand="0" - # Find entry in global array + # Find entry in global array. for ((index=0; index <= ${#mods_global_array[@]}; index++)); do - # When entry is found + # When entry is found. if [ "${mods_global_array[index]}" == "${currentmod}" ]; then - # Go back to the previous "MOD" separator + # Go back to the previous "MOD" separator. for ((index=index; index <= ${#mods_global_array[@]}; index--)); do - # When "MOD" is found + # When "MOD" is found. if [ "${mods_global_array[index]}" == "MOD" ]; then - # Get info + # Get info. fn_mods_define modinfocommand="1" break fi done fi - # Exit the loop if job is done + # Exit the loop if job is done. if [ "${modinfocommand}" == "1" ]; then break fi done - # What happens if mod is not found + # What happens if mod is not found. if [ "${modinfocommand}" == "0" ]; then fn_script_log_error "Could not find information for ${currentmod}" fn_print_error_nl "Could not find information for ${currentmod}" @@ -183,12 +223,12 @@ fn_mod_get_info(){ fi } -# Define all variables for a mod at once when index is set to a separator +# 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 "* https://github.com/GameServerManagers/LinuxGSM/issues" + echo -e "* https://github.com/GameServerManagers/LinuxGSM/issues" core_exit.sh fi modcommand="${mods_global_array[index+1]}" @@ -206,25 +246,25 @@ fi moddescription="${mods_global_array[index+13]}" } -# Builds list of installed mods -# using installed-mods.txt grabing mod info from mods_list.sh +# Builds list of installed mods. +# using installed-mods.txt grabing mod info from mods_list.sh. fn_mods_installed_list(){ fn_mods_count_installed - # Set/reset variables + # Set/reset variables. installedmodsline="1" installedmodslist=() modprettynamemaxlength="0" modsitemaxlength="0" moddescriptionmaxlength="0" modcommandmaxlength="0" - # Loop through every line of the installed mods list ${modsinstalledlistfullpath} + # Loop through every line of the installed mods list ${modsinstalledlistfullpath}. while [ "${installedmodsline}" -le "${installedmodscount}" ]; do currentmod="$(sed "${installedmodsline}q;d" "${modsinstalledlistfullpath}")" - # Get mod info to make sure mod exists + # Get mod info to make sure mod exists. fn_mod_get_info - # Add the mod to available commands + # Add the mod to available commands. installedmodslist+=( "${modcommand}" ) - # Increment line check + # Increment line check. ((installedmodsline++)) done if [ -n "${installedmodscount}" ]; then @@ -232,99 +272,99 @@ fn_mods_installed_list(){ fi } -# Loops through mods_global_array to define available mods & provide available commands for mods installation +# Loops through mods_global_array to define available mods & provide available commands for mods installation. fn_mods_available(){ - # First, reset variables + # First, reset variables. compatiblemodslist=() availablemodscommands=() - # Find compatible games - # Find separators through the global array + # Find compatible games. + # Find separators through the global array. for ((index="0"; index <= ${#mods_global_array[@]}; index++)); do - # If current value is a separator; then + # If current value is a separator; then. if [ "${mods_global_array[index]}" == "${modseparator}" ]; then - # Set mod variables + # Set mod variables. fn_mods_define - # Test if game is compatible + # Test if game is compatible. fn_mod_compatible_test - # If game is compatible + # If game is compatible. if [ "${modcompatibility}" == "1" ]; then - # Put it into an array to prepare user output + # Put it into an array to prepare user output. compatiblemodslist+=( "${modprettyname}" "${modcommand}" "${modsite}" "${moddescription}" ) - # Keep available commands in an array to make life easier + # Keep available commands in an array to make life easier. availablemodscommands+=( "${modcommand}" ) fi fi done } -## Mod compatibility check +## Mod compatibility check. -# Find out if a game is compatible with a mod from a modgames (list of games supported by a mod) variable +# 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(){ - # Reset test value + # Reset test value. modcompatiblegame="0" - # If value is set to GAMES (ignore) + # If value is set to GAMES (ignore). if [ "${modgames}" != "GAMES" ]; then - # How many games we need to test - gamesamount="$(echo "${modgames}" | awk -F ';' '{ print NF }')" - # Test all subvalue of "modgames" using the ";" separator + # 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 - # Put current game name into modtest variable - gamemodtest="$( echo "${modgames}" | awk -F ';' -v x=${gamevarindex} '{ print $x }' )" - # If game name matches + # Put current game name into modtest variable. + gamemodtest="$( echo -e "${modgames}" | awk -F ';' -v x=${gamevarindex} '{ print $x }' )" + # If game name matches. if [ "${gamemodtest}" == "${gamename}" ]; then - # Mod is compatible ! + # Mod is compatible. modcompatiblegame="1" fi done fi } -# Find out if an engine is compatible with a mod from a modengines (list of engines supported by a mod) variable +# 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(){ - # Reset test value + # Reset test value. modcompatibleengine="0" - # If value is set to ENGINES (ignore) + # If value is set to ENGINES (ignore). if [ "${modengines}" != "ENGINES" ]; then - # How many engines we need to test - enginesamount="$(echo "${modengines}" | awk -F ';' '{ print NF }')" - # Test all subvalue of "modengines" using the ";" separator + # 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 - # Put current engine name into modtest variable - enginemodtest="$( echo "${modengines}" | awk -F ';' -v x=${gamevarindex} '{ print $x }' )" - # If engine name matches + # Put current engine name into modtest variable. + enginemodtest="$( echo -e "${modengines}" | awk -F ';' -v x=${gamevarindex} '{ print $x }' )" + # If engine name matches. if [ "${enginemodtest}" == "${engine}" ]; then - # Mod is compatible! + # Mod is compatible. modcompatibleengine="1" fi done fi } -# Find out if a game is not compatible with a mod from a modnotgames (list of games not supported by a mod) variable +# 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(){ - # Reset test value + # Reset test value. modeincompatiblegame="0" - # If value is set to NOTGAMES (ignore) + # If value is set to NOTGAMES (ignore). if [ "${modexcludegames}" != "NOTGAMES" ]; then - # How many engines we need to test - excludegamesamount="$(echo "${modexcludegames}" | awk -F ';' '{ print NF }')" - # Test all subvalue of "modexcludegames" using the ";" separator + # 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 - # Put current engine name into modtest variable - excludegamemodtest="$( echo "${modexcludegames}" | awk -F ';' -v x=${gamevarindex} '{ print $x }' )" - # If engine name matches + # Put current engine name into modtest variable. + excludegamemodtest="$( echo -e "${modexcludegames}" | awk -F ';' -v x=${gamevarindex} '{ print $x }' )" + # If engine name matches. if [ "${excludegamemodtest}" == "${gamename}" ]; then - # Mod is compatible! + # Mod is compatible. modeincompatiblegame="1" fi done fi } -# Sums up if a mod is compatible or not with modcompatibility=0/1 +# Sums up if a mod is compatible or not with modcompatibility=0/1. fn_mod_compatible_test(){ - # Test game and engine compatibility + # Test game and engine compatibility. fn_compatible_mod_games fn_compatible_mod_engines fn_not_compatible_mod_games @@ -337,11 +377,11 @@ fn_mod_compatible_test(){ fi } -## Directory management +## Directory management. -# Create mods files and directories if it doesn't exist +# Create mods files and directories if it doesn't exist. fn_create_mods_dir(){ - # Create lgsm data modsdir + # Create lgsm data modsdir. if [ ! -d "${modsdir}" ]; then echo -en "creating LinuxGSM mods data directory ${modsdir}..." mkdir -p "${modsdir}" @@ -354,9 +394,9 @@ fn_create_mods_dir(){ fn_print_ok_eol_nl fn_script_log_pass "Creating mod download dir ${modsdir}" fi - sleep 0.5 + fn_sleep_time fi - # Create mod install directory + # Create mod install directory. if [ ! -d "${modinstalldir}" ]; then echo -en "creating mods install directory ${modinstalldir}..." mkdir -p "${modinstalldir}" @@ -369,17 +409,17 @@ fn_create_mods_dir(){ fn_print_ok_eol_nl fn_script_log_pass "Creating mod install directory ${modinstalldir}" fi - sleep 0.5 + fn_sleep_time fi - # Create lgsm/data/${modsinstalledlist} + # Create lgsm/data/${modsinstalledlist}. if [ ! -f "${modsinstalledlistfullpath}" ]; then touch "${modsinstalledlistfullpath}" fn_script_log_info "Created ${modsinstalledlistfullpath}" fi } -# Create tmp download mod directory +# Create tmp download mod directory. fn_mods_create_tmp_dir(){ if [ ! -d "${modstmpdir}" ]; then mkdir -p "${modstmpdir}" @@ -396,7 +436,7 @@ fn_mods_create_tmp_dir(){ fi } -# Remove the tmp mod download directory when finished +# Remove the tmp mod download directory when finished. fn_mods_clear_tmp_dir(){ if [ -d "${modstmpdir}" ]; then echo -en "clearing mod download directory ${modstmpdir}..." @@ -412,13 +452,13 @@ fn_mods_clear_tmp_dir(){ fi fi - # Clear temp file list as well + # Clear temp file list as well. if [ -f "${modsdir}/.removedfiles.tmp" ]; then rm "${modsdir}/.removedfiles.tmp" fi } -# Counts how many mods were installed +# Counts how many mods were installed. fn_mods_count_installed(){ if [ -f "${modsinstalledlistfullpath}" ]; then installedmodscount="$(wc -l < "${modsinstalledlistfullpath}")" @@ -427,30 +467,30 @@ fn_mods_count_installed(){ fi } -# Exits if no mods were installed +# Exits if no mods were installed. fn_mods_check_installed(){ - # Count installed mods + # Count installed mods. fn_mods_count_installed - # If no mods are found + # If no mods are found. if [ ${installedmodscount} -eq 0 ]; then - echo "" + echo -e "" fn_print_failure_nl "No installed mods or addons were found" - echo " * Install mods using LinuxGSM first with: ./${selfname} mods-install" + echo -e " * Install mods using LinuxGSM first with: ./${selfname} mods-install" fn_script_log_error "No installed mods or addons were found." core_exit.sh fi } -# Checks that mod files list exists and isn't empty +# Checks that mod files list exists and isn't empty. fn_check_mod_files_list(){ - # File list must exist and be valid before any operation on it + # 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 file list is empty. if [ "${modsfilelistsize}" -eq 0 ]; then fn_print_failure "${modcommand}-files.txt is empty" - echo "* Unable to remove ${modprettyname}" + echo -e "* Unable to remove ${modprettyname}" fn_script_log_fatal "${modcommand}-files.txt is empty: Unable to remove ${modprettyname}." core_exit.sh fi @@ -461,7 +501,7 @@ fn_check_mod_files_list(){ fi } -## Database initialisation +## Database initialisation. mods_list.sh fn_mods_available diff --git a/lgsm/functions/mods_list.sh b/lgsm/functions/mods_list.sh index eb1e2f8bf..19ce5abb0 100644 --- a/lgsm/functions/mods_list.sh +++ b/lgsm/functions/mods_list.sh @@ -26,8 +26,18 @@ sourcemodscrapeurl="https://sm.alliedmods.net/smdrop/${sourcemodmversion}/source 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="$(curl -sL https://api.github.com/repos/theumod/umod.rust/releases/latest | grep browser_download_url | cut -d '"' -f 4)" +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 | grep browser_download_url | cut -d '"' -f 4)" @@ -59,10 +69,12 @@ modseparator="MOD" # 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_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" ) @@ -80,9 +92,9 @@ mod_info_darkrpmodification=( MOD "darkrpmodification" "DarkRP Modification" "ht # Oxidemod -mod_info_rustoxide=( MOD "rustoxide" "Oxide for Rust" "${oxiderustlatestlink}" "Oxide.Rust.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Rust;" "NOTGAMES" "http://oxidemod.org/downloads/oxide-for-rust.1659/" "Allows for the use of plugins" ) +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_gokz[@]}" "${mod_info_ttt[@]}" "${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[@]}" ) +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 ba5c45f33..0a256bcab 100644 --- a/lgsm/functions/query_gamedig.sh +++ b/lgsm/functions/query_gamedig.sh @@ -5,16 +5,16 @@ # Description: Querys a gameserver using node-gamedig. # https://github.com/sonicsnes/node-gamedig -#Check if gamedig and jq are installed +# Check if gamedig and jq are installed. if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; then if [ "${engine}" == "idtech3_ql" ]; then local engine="quakelive" - elif [ "${gamename}" == "Killing Floor 2" ]; then + elif [ "${shortname}" == "kf2" ]; then local engine="unreal4" fi - local engine_query_array=( avalanche3.0 madness quakelive realvirtuality refractor source goldsource spark starbound unity3d unreal4 wurm ) + local engine_query_array=( avalanche3.0 barotrauma madness quakelive realvirtuality refractor source goldsource spark starbound unity3d unreal4 wurm ) for engine_query in "${engine_query_array[@]}" do if [ "${engine_query}" == "${engine}" ]; then @@ -46,7 +46,7 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; fi done - local engine_query_array=( idtech3 iw3.0 ioquake3 ) + local engine_query_array=( idtech3 iw3.0 ioquake3 qfusion ) for engine_query in "${engine_query_array[@]}" do if [ "${engine_query}" == "${engine}" ]; then @@ -78,56 +78,60 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; fi done - # will bypass query if server offline + # will bypass query if server offline. check_status.sh if [ "${status}" != "0" ]; then - # checks if query is working null = pass - gamedigcmd=$(echo "gamedig --type \"${gamedigengine}\" --host \"${ip}\" --query_port \"${queryport}\"|jq") + # checks if query is working null = pass. + gamedigcmd=$(echo -e "gamedig --type \"${gamedigengine}\" --host \"${ip}\" --query_port \"${queryport}\"|jq") gamedigraw=$(gamedig --type "${gamedigengine}" --host "${ip}" --query_port "${queryport}") - querystatus=$(echo "${gamedigraw}" | jq '.error|length') - + querystatus=$(echo -e "${gamedigraw}" | jq '.error|length') + if [ "${querystatus}" != "null" ]; then - gamedigcmd=$(echo "gamedig --type \"${gamedigengine}\" --host \"${ip}\" --port \"${queryport}\"|jq") + gamedigcmd=$(echo -e "gamedig --type \"${gamedigengine}\" --host \"${ip}\" --port \"${queryport}\"|jq") gamedigraw=$(gamedig --type "${gamedigengine}" --host "${ip}" --port "${queryport}") - querystatus=$(echo "${gamedigraw}" | jq '.error|length') - - fi - + querystatus=$(echo -e "${gamedigraw}" | jq '.error|length') + + fi + - # server name - gdname=$(echo "${gamedigraw}" | jq -re '.name') + # server name. + gdname=$(echo -e "${gamedigraw}" | jq -re '.name') if [ "${gdname}" == "null" ]; then unset gdname fi - # numplayers - gdplayers=$(echo "${gamedigraw}" | jq -re '.players|length') + # numplayers. + gdplayers=$(echo -e "${gamedigraw}" | jq -re '.players') if [ "${gdplayers}" == "null" ]; then unset gdplayers + elif [ "${gdplayers}" == "[]" ]; then + gdplayers=0 fi - # maxplayers - gdmaxplayers=$(echo "${gamedigraw}" | jq -re '.maxplayers|length') + # maxplayers. + gdmaxplayers=$(echo -e "${gamedigraw}" | jq -re '.maxplayers') if [ "${gdmaxplayers}" == "null" ]; then unset maxplayers + elif [ "${gdmaxplayers}" == "[]" ]; then + gdmaxplayers=0 fi - # current map - gdmap=$(echo "${gamedigraw}" | jq -re '.map') + # current map. + gdmap=$(echo -e "${gamedigraw}" | jq -re '.map') if [ "${gdmap}" == "null" ]; then unset gdmap fi - # current gamemode - gdgamemode=$(echo "${gamedigraw}" | jq -re '.raw.rules.GameMode_s') + # current gamemode. + gdgamemode=$(echo -e "${gamedigraw}" | jq -re '.raw.rules.GameMode_s') if [ "${gdgamemode}" == "null" ]; then unset gdgamemode fi - # numbots - gdbots=$(echo "${gamedigraw}" | jq -re '.raw.numbots') + # numbots. + gdbots=$(echo -e "${gamedigraw}" | jq -re '.raw.numbots') if [ "${gdbots}" == "null" ]||[ "${gdbots}" == "0" ]; then unset gdbots fi fi -fi \ No newline at end of file +fi diff --git a/lgsm/functions/query_gsquery.py b/lgsm/functions/query_gsquery.py index fe809be15..fcfd4edc3 100644 --- a/lgsm/functions/query_gsquery.py +++ b/lgsm/functions/query_gsquery.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 # -*- coding: utf-8 -*- # query_gsquery.py # Author: Anonymous & Daniel Gibbs @@ -17,8 +17,8 @@ class gsquery: self.server_response_timeout = 5 self.default_buffer_length = 1024 # - sourcequery=[ 'avalanche3.0','madness','quakelive','realvirtuality','refractor','source','goldsource','spark','starbound','unity3d', 'unreal4', 'wurm' ] - idtech3query=['idtech3','iw3.0','ioquake3'] + sourcequery=[ 'avalanche3.0','barotrauma''madness','quakelive','realvirtuality','refractor','source','goldsource','spark','starbound','unity3d', 'unreal4', 'wurm' ] + idtech3query=['idtech3','iw3.0','ioquake3','qfusion'] idtech2query=['idtech2','quake','iw2.0'] minecraftquery=['minecraft','lwjgl2'] if self.option.engine in sourcequery: @@ -82,7 +82,7 @@ class gsquery: if __name__ == '__main__': parser = optparse.OptionParser( - usage='usage: python %prog [options]', + usage='usage: python3 %prog [options]', version='%prog 0.0.1' ) parser.add_option( diff --git a/lgsm/functions/update_factorio.sh b/lgsm/functions/update_factorio.sh index 6efd56024..fc79cde2d 100644 --- a/lgsm/functions/update_factorio.sh +++ b/lgsm/functions/update_factorio.sh @@ -28,7 +28,6 @@ fn_update_factorio_dl(){ fn_update_factorio_localbuild(){ # Gets local build info. fn_print_dots "Checking for update: ${remotelocation}: checking local build" - sleep 0.5 # Uses executable to find local build. cd "${executabledir}" || exit if [ -f "${executable}" ]; then @@ -40,7 +39,6 @@ fn_update_factorio_localbuild(){ fn_print_error "Checking for update: ${remotelocation}: checking local build" fn_script_log_error "Checking local build" fi - sleep 0.5 } fn_update_factorio_remotebuild(){ @@ -48,7 +46,6 @@ fn_update_factorio_remotebuild(){ remotebuild=$(${curlpath} -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 for update: ${remotelocation}: checking remote build" - sleep 0.5 # Checks if remotebuild variable has been set. if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then fn_print_fail "Checking for update: ${remotelocation}: checking remote build" @@ -57,7 +54,6 @@ fn_update_factorio_remotebuild(){ else fn_print_ok "Checking for update: ${remotelocation}: checking remote build" fn_script_log_pass "Checking remote build" - sleep 0.5 fi else # Checks if remotebuild variable has been set. @@ -66,18 +62,16 @@ fn_update_factorio_remotebuild(){ fn_script_log_fatal "Unable to get remote build" core_exit.sh fi - fi + fi } fn_update_factorio_compare(){ fn_print_dots "Checking for update: ${remotelocation}" - sleep 0.5 # Removes dots so if statement can compare version numbers. - localbuilddigit=$(echo "${localbuild}" | tr -cd '[:digit:]') - remotebuilddigit=$(echo "${remotebuild}" | tr -cd '[:digit:]') + 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}" - sleep 0.5 echo -en "\n" echo -e "Update available" echo -e "* Local build: ${red}${localbuild} ${factorioarch}${default}" @@ -92,7 +86,7 @@ fn_update_factorio_compare(){ fn_script_log_info "Branch: ${branch}" fi fn_script_log_info "${localbuild} > ${remotebuild}" - sleep 0.5 + fn_sleep_time echo -en "\n" echo -en "applying update.\r" sleep 1 @@ -126,7 +120,6 @@ fn_update_factorio_compare(){ alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - sleep 0.5 echo -en "\n" echo -e "No update available" echo -e "* Local build: ${green}${localbuild} ${factorioarch}${default}" @@ -163,7 +156,6 @@ if [ "${installer}" == "1" ]; then else fn_print_dots "Checking for update: ${remotelocation}" fn_script_log_info "Checking for update: ${remotelocation}" - sleep 0.5 fn_update_factorio_localbuild fn_update_factorio_remotebuild fn_update_factorio_compare diff --git a/lgsm/functions/update_minecraft.sh b/lgsm/functions/update_minecraft.sh index 7bdcf3e48..e75a38dcc 100644 --- a/lgsm/functions/update_minecraft.sh +++ b/lgsm/functions/update_minecraft.sh @@ -30,18 +30,14 @@ fn_update_minecraft_dl(){ fn_update_minecraft_localbuild(){ # Gets local build info. fn_print_dots "Checking for update: ${remotelocation}: checking local build" - sleep 0.5 # Uses log file to gather info. # Gives time for log file to generate. if [ ! -f "${serverfiles}/logs/latest.log" ]; then fn_print_error "Checking for update: ${remotelocation}: checking local build" - sleep 0.5 fn_print_error_nl "Checking for update: ${remotelocation}: checking local build: no log files" fn_script_log_error "No log file found" - sleep 0.5 fn_print_info_nl "Checking for update: ${remotelocation}: checking local build: forcing server restart" fn_script_log_info "Forcing server restart" - sleep 0.5 exitbypass=1 command_stop.sh exitbypass=1 @@ -61,7 +57,6 @@ fn_update_minecraft_localbuild(){ fn_print_error "Checking for update: ${remotelocation}: waiting for log file: missing log file" fn_script_log_error "Missing log file" fn_script_log_error "Set localbuild to 0" - sleep 0.5 fi totalseconds=$((totalseconds + 1)) @@ -81,7 +76,7 @@ fn_update_minecraft_localbuild(){ 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}' | 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}") + localbuild=$(cat "${serverfiles}/logs/latest.log" 2> /dev/null | grep version | grep -Eo '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}') if [ "${localbuild}" ]||[ "${seconds}" == "120" ]; then break fi @@ -99,7 +94,6 @@ fn_update_minecraft_localbuild(){ fn_print_ok "Checking for update: ${remotelocation}: checking local build" fn_script_log_pass "Checking local build" fi - sleep 0.5 } fn_update_minecraft_remotebuild(){ @@ -107,7 +101,6 @@ fn_update_minecraft_remotebuild(){ remotebuild=$(${curlpath} -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.latest.release') if [ "${installer}" != "1" ]; then fn_print_dots "Checking for update: ${remotelocation}: checking remote build" - sleep 0.5 # Checks if remotebuild variable has been set. if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then fn_print_fail "Checking for update: ${remotelocation}: checking remote build" @@ -116,7 +109,6 @@ fn_update_minecraft_remotebuild(){ else fn_print_ok "Checking for update: ${remotelocation}: checking remote build" fn_script_log_pass "Checking remote build" - sleep 0.5 fi else # Checks if remotebuild variable has been set. @@ -131,12 +123,10 @@ fn_update_minecraft_remotebuild(){ fn_update_minecraft_compare(){ # Removes dots so if statement can compare version numbers. fn_print_dots "Checking for update: ${remotelocation}" - sleep 0.5 - localbuilddigit=$(echo "${localbuild}" | tr -cd '[:digit:]') - remotebuilddigit=$(echo "${remotebuild}" | tr -cd '[:digit:]') + 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}" - sleep 0.5 echo -en "\n" echo -e "Update available" echo -e "* Local build: ${red}${localbuild}${default}" @@ -145,7 +135,7 @@ fn_update_minecraft_compare(){ fn_script_log_info "Local build: ${localbuild}" fn_script_log_info "Remote build: ${remotebuild}" fn_script_log_info "${localbuild} > ${remotebuild}" - sleep 0.5 + fn_sleep_time echo -en "\n" echo -en "applying update.\r" sleep 1 @@ -179,7 +169,6 @@ fn_update_minecraft_compare(){ alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - sleep 0.5 echo -en "\n" echo -e "No update available" echo -e "* Local build: ${green}${localbuild}${default}" @@ -199,7 +188,6 @@ if [ "${installer}" == "1" ]; then else fn_print_dots "Checking for update: ${remotelocation}" fn_script_log_info "Checking for update: ${remotelocation}" - sleep 0.5 fn_update_minecraft_localbuild fn_update_minecraft_remotebuild fn_update_minecraft_compare diff --git a/lgsm/functions/update_mta.sh b/lgsm/functions/update_mta.sh index a2536f0b7..95461ab04 100644 --- a/lgsm/functions/update_mta.sh +++ b/lgsm/functions/update_mta.sh @@ -18,7 +18,7 @@ fn_update_mta_dl(){ if [ "${exitcode}" == "0" ]; then fn_print_ok_eol_nl fn_script_log_pass "Copying to ${serverfiles}" - chmod u+x "${serverfiles}/minecraft_server.jar" + chmod u+x "${serverfiles}/mta-server64" fn_clear_tmp else fn_print_fail_eol_nl @@ -30,18 +30,14 @@ fn_update_mta_dl(){ fn_update_mta_localbuild(){ # Gets local build info. fn_print_dots "Checking for update: ${remotelocation}: checking local build" - sleep 0.5 # 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 for update: ${remotelocation}: checking local build" - sleep 0.5 fn_print_error_nl "Checking for update: ${remotelocation}: checking local build: no log files" fn_script_log_error "No log file found" - sleep 0.5 fn_print_info_nl "Checking for update: ${remotelocation}: checking local build: forcing server restart" fn_script_log_info "Forcing server restart" - sleep 0.5 exitbypass=1 command_stop.sh exitbypass=1 @@ -61,9 +57,8 @@ fn_update_mta_localbuild(){ fn_print_error "Checking for update: ${remotelocation}: waiting for log file: missing log file" fn_script_log_error "Missing log file" fn_script_log_error "Set localbuild to 0" - sleep 0.5 fi - + totalseconds=$((totalseconds + 1)) done fi @@ -81,7 +76,7 @@ fn_update_mta_localbuild(){ if [ -z "${loopignore}" ]; then loopignore=1 fn_script_log_info "Waiting for local build to generate" - fi + 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 @@ -90,7 +85,7 @@ fn_update_mta_localbuild(){ totalseconds=$((totalseconds + 1)) done fi - + if [ -z "${localbuild}" ]; then localbuild="0" fn_print_error "Checking for update: ${remotelocation}: waiting for local build: missing local build info" @@ -100,7 +95,6 @@ fn_update_mta_localbuild(){ fn_print_ok "Checking for update: ${remotelocation}: checking local build" fn_script_log_pass "Checking local build" fi - sleep 0.5 } fn_update_mta_remotebuild(){ @@ -111,7 +105,6 @@ fn_update_mta_remotebuild(){ remotebuild="${majorversion}.${minorversion}.${maintenanceversion}" if [ "${installer}" != "1" ]; then fn_print_dots "Checking for update: ${remotelocation}: checking remote build" - sleep 0.5 # Checks if remotebuild variable has been set. if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then fn_print_fail "Checking for update: ${remotelocation}: checking remote build" @@ -120,7 +113,6 @@ fn_update_mta_remotebuild(){ else fn_print_ok "Checking for update: ${remotelocation}: checking remote build" fn_script_log_pass "Checking remote build" - sleep 0.5 fi else # Checks if remotebuild variable has been set. @@ -129,15 +121,14 @@ fn_update_mta_remotebuild(){ fn_script_log_fatal "Unable to get remote build" core_exit.sh fi - fi + fi } fn_update_mta_compare(){ # Removes dots so if statement can compare version numbers. fn_print_dots "Checking for update: ${remotelocation}" - sleep 0.5 - localbuilddigit=$(echo "${localbuild}" | tr -cd '[:digit:]') - remotebuilddigit=$(echo "${remotebuild}" | tr -cd '[:digit:]') + 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 @@ -146,7 +137,6 @@ fn_update_mta_compare(){ else mtaupdatestatus="available" fi - sleep 0.5 echo -en "\n" echo -e "Update ${mtaupdatestatus}:" echo -e "* Local build: ${red}${localbuild}${default}" @@ -155,7 +145,7 @@ fn_update_mta_compare(){ fn_script_log_info "Local build: ${localbuild}" fn_script_log_info "Remote build: ${remotebuild}" fn_script_log_info "${localbuild} > ${remotebuild}" - sleep 0.5 + fn_sleep_time echo -en "\n" echo -en "applying update.\r" sleep 1 @@ -189,7 +179,6 @@ fn_update_mta_compare(){ alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - sleep 0.5 echo -en "\n" echo -e "No update available" echo -e "* Local build: ${green}${localbuild}${default}" @@ -209,7 +198,6 @@ if [ "${installer}" == "1" ]; then else fn_print_dots "Checking for update: ${remotelocation}" fn_script_log_info "Checking for update: ${remotelocation}" - sleep 0.5 fn_update_mta_localbuild fn_update_mta_remotebuild fn_update_mta_compare diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh index ba98449e2..9dd504ad0 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -28,7 +28,6 @@ fn_update_mumble_dl(){ fn_update_mumble_localbuild(){ # Gets local build info. fn_print_dots "Checking for update: ${remotelocation}: checking local build" - sleep 0.5 # Uses executable to find local build. cd "${executabledir}" || exit if [ -f "${executable}" ]; then @@ -40,7 +39,6 @@ fn_update_mumble_localbuild(){ fn_print_error "Checking for update: ${remotelocation}: checking local build" fn_script_log_error "Checking local build" fi - sleep 0.5 } fn_update_mumble_remotebuild(){ @@ -48,7 +46,6 @@ fn_update_mumble_remotebuild(){ remotebuild=$(${curlpath} -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 for update: ${remotelocation}: checking remote build" - sleep 0.5 # Checks if remotebuild variable has been set. if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then fn_print_fail "Checking for update: ${remotelocation}: checking remote build" @@ -57,7 +54,6 @@ fn_update_mumble_remotebuild(){ else fn_print_ok "Checking for update: ${remotelocation}: checking remote build" fn_script_log_pass "Checking remote build" - sleep 0.5 fi else # Checks if remotebuild variable has been set. @@ -66,18 +62,16 @@ fn_update_mumble_remotebuild(){ fn_script_log_fatal "Unable to get remote build" core_exit.sh fi - fi + fi } fn_update_mumble_compare(){ # Removes dots so if statement can compare version numbers. fn_print_dots "Checking for update: ${remotelocation}" - sleep 0.5 - localbuilddigit=$(echo "${localbuild}" | tr -cd '[:digit:]') - remotebuilddigit=$(echo "${remotebuild}" | tr -cd '[:digit:]') + 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}" - sleep 0.5 echo -en "\n" echo -e "Update available" echo -e "* Local build: ${red}${localbuild} ${mumblearch}${default}" @@ -86,7 +80,7 @@ fn_update_mumble_compare(){ fn_script_log_info "Local build: ${localbuild} ${mumblearch}" fn_script_log_info "Remote build: ${remotebuild} ${mumblearch}" fn_script_log_info "${localbuild} > ${remotebuild}" - sleep 0.5 + fn_sleep_time echo -en "\n" echo -en "applying update.\r" sleep 1 @@ -120,7 +114,6 @@ fn_update_mumble_compare(){ alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - sleep 0.5 echo -en "\n" echo -e "No update available" echo -e "* Local build: ${green}${localbuild} ${mumblearch}${default}" @@ -143,7 +136,6 @@ if [ "${installer}" == "1" ]; then else fn_print_dots "Checking for update: ${remotelocation}" fn_script_log_info "Checking for update: ${remotelocation}" - sleep 0.5 fn_update_mumble_localbuild fn_update_mumble_remotebuild fn_update_mumble_compare diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh index 9fd29eff7..b27884513 100644 --- a/lgsm/functions/update_steamcmd.sh +++ b/lgsm/functions/update_steamcmd.sh @@ -19,11 +19,9 @@ fn_update_steamcmd_dl(){ cd "${steamcmddir}" || exit if [ "${appid}" == "90" ]; then - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${branch} +quit | tee -a "${lgsmlog}" - elif [ "${shortname}" == "unt" ]; then - ${unbuffer} ./steamcmd.sh +@sSteamCmdForcePlatformBitness 32 +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} validate +quit + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta ${branch} +quit | tee -a "${lgsmlog}" else - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${branch} +quit | tee -a "${lgsmlog}" + ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta ${branch} +quit | tee -a "${lgsmlog}" fi fix.sh } @@ -31,7 +29,6 @@ fn_update_steamcmd_dl(){ fn_update_steamcmd_localbuild(){ # Gets local build info. fn_print_dots "Checking for update: ${remotelocation}: checking local build" - sleep 0.5 fn_appmanifest_check # Uses appmanifest to find local build. localbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) @@ -48,7 +45,7 @@ fn_update_steamcmd_localbuild(){ else branchname="public" fi - sleep 0.5 + fn_sleep_time } fn_update_steamcmd_remotebuild(){ @@ -57,7 +54,6 @@ fn_update_steamcmd_remotebuild(){ remotebuild=$(./steamcmd.sh +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 for update: ${remotelocation}: checking remote build" - sleep 0.5 # Checks if remotebuild variable has been set. if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then fn_print_fail "Checking for update: ${remotelocation}: checking remote build" @@ -66,7 +62,6 @@ fn_update_steamcmd_remotebuild(){ else fn_print_ok "Checking for update: ${remotelocation}: checking remote build" fn_script_log_pass "Checking remote build" - sleep 0.5 fi else # Checks if remotebuild variable has been set. @@ -80,10 +75,8 @@ fn_update_steamcmd_remotebuild(){ fn_update_steamcmd_compare(){ fn_print_dots "Checking for update: ${remotelocation}" - sleep 0.5 if [ "${localbuild}" != "${remotebuild}" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" - sleep 0.5 echo -en "\n" echo -e "Update available" echo -e "* Local build: ${red}${localbuild}${default}" @@ -99,7 +92,7 @@ fn_update_steamcmd_compare(){ fn_script_log_info "Branch: ${branch}" fi fn_script_log_info "${localbuild} > ${remotebuild}" - sleep 0.5 + fn_sleep_time echo -en "\n" echo -en "applying update.\r" sleep 1 @@ -128,7 +121,6 @@ fn_update_steamcmd_compare(){ alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - sleep 0.5 echo -en "\n" echo -e "No update available" echo -e "* Local build: ${green}${localbuild}${default}" @@ -156,43 +148,35 @@ fn_appmanifest_check(){ # Multiple or no matching appmanifest files may sometimes be present. # This error is corrected if required. if [ "${appmanifestfilewc}" -ge "2" ]; then - sleep 0.5 + fn_sleep_time fn_print_error "Multiple appmanifest_${appid}.acf files found" fn_script_log_error "Multiple appmanifest_${appid}.acf files found" - sleep 2 fn_print_dots "Removing x${appmanifestfilewc} appmanifest_${appid}.acf files" - sleep 0.5 for appfile in ${appmanifestfile}; do rm "${appfile}" done - sleep 0.5 appmanifestfilewc1="${appmanifestfilewc}" fn_appmanifest_info 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" - sleep 0.5 - echo " * Check user permissions" + echo -e " * Check user permissions" for appfile in ${appmanifestfile}; do - echo " ${appfile}" + 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" - sleep 0.5 fn_print_info_nl "Forcing update to correct issue" fn_script_log_info "Forcing update to correct issue" - sleep 0.5 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" - sleep 0.5 fn_print_info_nl "Forcing update to correct issue" fn_script_log_info "Forcing update to correct issue" - sleep 0.5 fn_update_steamcmd_dl fn_appmanifest_info if [ "${appmanifestfilewc}" -eq "0" ]; then diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh index e64bd8f3a..18768997c 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/functions/update_ts3.sh @@ -33,18 +33,15 @@ fn_update_ts3_dl(){ fn_update_ts3_localbuild(){ # Gets local build info. fn_print_dots "Checking for update: ${remotelocation}: checking local build" - sleep 0.5 + fn_sleep_time # 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 for update: ${remotelocation}: checking local build" - sleep 0.5 fn_print_error_nl "Checking for update: ${remotelocation}: checking local build: no log files" fn_script_log_error "No log file found" - sleep 0.5 fn_print_info_nl "Checking for update: ${remotelocation}: checking local build: forcing server restart" fn_script_log_info "Forcing server restart" - sleep 0.5 exitbypass=1 command_stop.sh exitbypass=1 @@ -64,9 +61,8 @@ fn_update_ts3_localbuild(){ fn_print_error "Checking for update: ${remotelocation}: waiting for log file: missing log file" fn_script_log_error "Missing log file" fn_script_log_error "Set localbuild to 0" - sleep 0.5 fi - + totalseconds=$((totalseconds + 1)) done fi @@ -84,7 +80,7 @@ fn_update_ts3_localbuild(){ if [ -z "${loopignore}" ]; then loopignore=1 fn_script_log_info "Waiting for local build to generate" - fi + 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}") if [ "${localbuild}" ]; then break @@ -93,7 +89,7 @@ fn_update_ts3_localbuild(){ totalseconds=$((totalseconds + 1)) done fi - + if [ -z "${localbuild}" ]; then localbuild="0" fn_print_error "Checking for update: ${remotelocation}: waiting for local build: missing local build info" @@ -103,7 +99,6 @@ fn_update_ts3_localbuild(){ fn_print_ok "Checking for update: ${remotelocation}: checking local build" fn_script_log_pass "Checking local build" fi - sleep 0.5 } fn_update_ts3_remotebuild(){ @@ -115,7 +110,6 @@ fn_update_ts3_remotebuild(){ fi if [ "${installer}" != "1" ]; then fn_print_dots "Checking for update: ${remotelocation}: checking remote build" - sleep 0.5 # Checks if remotebuild variable has been set. if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then fn_print_fail "Checking for update: ${remotelocation}: checking remote build" @@ -124,7 +118,6 @@ fn_update_ts3_remotebuild(){ else fn_print_ok "Checking for update: ${remotelocation}: checking remote build" fn_script_log_pass "Checking remote build" - sleep 0.5 fi else # Checks if remotebuild variable has been set. @@ -133,18 +126,16 @@ fn_update_ts3_remotebuild(){ fn_script_log_fatal "Unable to get remote build" core_exit.sh fi - fi + fi } fn_update_ts3_compare(){ # Removes dots so if statement can compare version numbers. fn_print_dots "Checking for update: ${remotelocation}" - sleep 0.5 - localbuilddigit=$(echo "${localbuild}" | tr -cd '[:digit:]') - remotebuilddigit=$(echo "${remotebuild}" | tr -cd '[:digit:]') + 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}" - sleep 0.5 echo -en "\n" echo -e "Update available" echo -e "* Local build: ${red}${localbuild}${default}" @@ -153,7 +144,7 @@ fn_update_ts3_compare(){ fn_script_log_info "Local build: ${localbuild}" fn_script_log_info "Remote build: ${remotebuild}" fn_script_log_info "${localbuild} > ${remotebuild}" - sleep 0.5 + fn_sleep_time echo -en "\n" echo -en "applying update.\r" sleep 1 @@ -187,7 +178,6 @@ fn_update_ts3_compare(){ alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" - sleep 0.5 echo -en "\n" echo -e "No update available" echo -e "* Local build: ${green}${localbuild}${default}" @@ -219,7 +209,6 @@ if [ "${installer}" == "1" ]; then else fn_print_dots "Checking for update: ${remotelocation}" fn_script_log_info "Checking for update: ${remotelocation}" - sleep 0.5 fn_update_ts3_localbuild fn_update_ts3_remotebuild fn_update_ts3_compare diff --git a/lgsm/lib/ubuntu12.04/amd64/libc.so.6 b/lgsm/lib/ubuntu12.04/amd64/libc.so.6 deleted file mode 100644 index c83c7057c..000000000 Binary files a/lgsm/lib/ubuntu12.04/amd64/libc.so.6 and /dev/null differ diff --git a/lgsm/lib/ubuntu12.04/amd64/libm.so.6 b/lgsm/lib/ubuntu12.04/amd64/libm.so.6 deleted file mode 100644 index 3ec2d3420..000000000 Binary files a/lgsm/lib/ubuntu12.04/amd64/libm.so.6 and /dev/null differ diff --git a/lgsm/lib/ubuntu12.04/i386/libc.so.6 b/lgsm/lib/ubuntu12.04/i386/libc.so.6 deleted file mode 100644 index 916329be7..000000000 Binary files a/lgsm/lib/ubuntu12.04/i386/libc.so.6 and /dev/null differ diff --git a/lgsm/lib/ubuntu12.04/i386/libm.so.6 b/lgsm/lib/ubuntu12.04/i386/libm.so.6 deleted file mode 100644 index 23c73207a..000000000 Binary files a/lgsm/lib/ubuntu12.04/i386/libm.so.6 and /dev/null differ diff --git a/lgsm/lib/ubuntu12.04/i386/libpthread.so.0 b/lgsm/lib/ubuntu12.04/i386/libpthread.so.0 deleted file mode 100644 index a2353e112..000000000 Binary files a/lgsm/lib/ubuntu12.04/i386/libpthread.so.0 and /dev/null differ diff --git a/lgsm/lib/ubuntu12.04/i386/libstdc++.so.6 b/lgsm/lib/ubuntu12.04/i386/libstdc++.so.6 deleted file mode 100644 index 614f0ec23..000000000 Binary files a/lgsm/lib/ubuntu12.04/i386/libstdc++.so.6 and /dev/null differ diff --git a/linuxgsm.sh b/linuxgsm.sh index e5c22af3b..d3e762851 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="190503" +version="v19.11.0" shortname="core" gameservername="core" rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" @@ -35,6 +35,9 @@ serverfiles="${rootdir}/serverfiles" functionsdir="${lgsmdir}/functions" libdir="${lgsmdir}/lib" tmpdir="${lgsmdir}/tmp" +datadir="${lgsmdir}/data" +serverlist="${datadir}/serverlist.csv" +serverlistmenu="${datadir}/serverlistmenu.csv" configdir="${lgsmdir}/config-lgsm" configdirserver="${configdir}/${gameservername}" configdirdefault="${lgsmdir}/config-default" @@ -47,16 +50,14 @@ githubuser="GameServerManagers" githubrepo="LinuxGSM" githubbranch="master" -# Core Function that is required first +# Core function that is required first. core_functions.sh(){ functionfile="${FUNCNAME}" 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 - -# Fetches core functions +# Fetches the core functions required before passed off to core_dl.sh. fn_bootstrap_fetch_file(){ remote_fileurl="${1}" local_filedir="${2}" @@ -65,17 +66,17 @@ fn_bootstrap_fetch_file(){ run="${5:-0}" forcedl="${6:-0}" md5="${7:-0}" - # download file if missing or download forced + # Download file if missing or download forced. if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then if [ ! -d "${local_filedir}" ]; then mkdir -p "${local_filedir}" fi - # Defines curl path + # Defines curl path. curlpath=$(command -v curl 2>/dev/null) - # If curl exists download file + # If curl exists download file. if [ "$(basename "${curlpath}")" == "curl" ]; then - # trap to remove part downloaded files + # Trap to remove part downloaded files. echo -en " fetching ${local_filename}...\c" curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1) local exitcode=$? @@ -83,24 +84,24 @@ fn_bootstrap_fetch_file(){ echo -e "FAIL" if [ -f "${lgsmlog}" ]; then echo -e "${remote_fileurl}" | tee -a "${lgsmlog}" - echo "${curlcmd}" | tee -a "${lgsmlog}" + echo -e "${curlcmd}" | tee -a "${lgsmlog}" fi exit 1 else echo -e "OK" fi else - echo "[ FAIL ] Curl is not installed" + echo -e "[ FAIL ] Curl is not installed" exit 1 fi - # make file chmodx if chmodx is set + # Make file chmodx if chmodx is set. if [ "${chmodx}" == "chmodx" ]; then chmod +x "${local_filedir}/${local_filename}" fi fi if [ -f "${local_filedir}/${local_filename}" ]; then - # run file if run is set + # Run file if run is set. if [ "${run}" == "run" ]; then source "${local_filedir}/${local_filename}" fi @@ -119,11 +120,11 @@ 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 function. fn_bootstrap_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } -# Installer menu +# Installer menu. fn_print_center() { columns="$(tput cols)" @@ -136,7 +137,7 @@ fn_print_horizontal(){ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "${char}" } -# Bash Menu +# Bash menu. fn_install_menu_bash() { local resultvar=$1 title=$2 @@ -148,9 +149,9 @@ fn_install_menu_bash() { fn_print_horizontal menu_options=() while read -r line || [[ -n "${line}" ]]; do - var=$(echo "${line}" | awk -F "," '{print $2 " - " $3}') + var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') menu_options+=( "${var}" ) - done < ${options} + done < "${options}" menu_options+=( "Cancel" ) select option in "${menu_options[@]}"; do if [ -n "${option}" ]&&[ "${option}" != "Cancel" ]; then @@ -160,7 +161,7 @@ fn_install_menu_bash() { done } -# Whiptail/Dialog Menu +# Whiptail/Dialog menu. fn_install_menu_whiptail() { local menucmd=$1 local resultvar=$2 @@ -173,9 +174,9 @@ fn_install_menu_whiptail() { IFS="," menu_options=() while read -r line; do - key=$(echo "${line}" | awk -F "," '{print $3}') - val=$(echo "${line}" | awk -F "," '{print $2}') - menu_options+=( ${val//\"} "${key//\"}" ) + 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 @@ -185,14 +186,14 @@ fn_install_menu_whiptail() { fi } -# Menu selector +# Menu selector. fn_install_menu() { local resultvar=$1 local selection="" title=$2 caption=$3 options=$4 - # Get menu command + # Get menu command. for menucmd in whiptail dialog bash; do if [ -x "$(command -v "${menucmd}")" ]; then menucmd=$(command -v "${menucmd}") @@ -208,7 +209,7 @@ fn_install_menu() { eval "$resultvar=\"${selection}\"" } -# Gets server info from serverlist.csv and puts in to array +# Gets server info from serverlist.csv and puts in to array. fn_server_info(){ IFS="," server_info_array=($(grep -aw "${userinput}" "${serverlist}")) @@ -219,14 +220,14 @@ fn_server_info(){ fn_install_getopt(){ userinput="empty" - echo "Usage: $0 [option]" + echo -e "Usage: $0 [option]" echo -e "" - echo "Installer - Linux Game Server Managers - Version ${version}" - echo "https://linuxgsm.com" + 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| e.g $0 csgoserver. Enter name of server/game 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 } @@ -243,15 +244,15 @@ fn_install_file(){ 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 "Installed ${gamename} server as ${local_filename}" - echo "" + echo -e "Installed ${gamename} server as ${local_filename}" + echo -e "" if [ ! -d "${serverfiles}" ]; then - echo "./${local_filename} install" + echo -e "./${local_filename} install" else - echo "Remember to check server ports" - echo "./${local_filename} details" + echo -e "Remember to check server ports" + echo -e "./${local_filename} details" fi - echo "" + echo -e "" exit } @@ -259,11 +260,11 @@ fn_install_file(){ if [ "$(whoami)" == "root" ]; then if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then if [ "${shortname}" == "core" ]; then - echo "[ FAIL ] Do NOT run this script as root!" + 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 "[ FAIL ] Do NOT run this script as root!" + echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 else core_functions.sh @@ -271,52 +272,50 @@ if [ "$(whoami)" == "root" ]; then fi fi -# LinuxGSM installer mode +# LinuxGSM installer mode. if [ "${shortname}" == "core" ]; then - datadir="${tmpdir}/data" - serverlist="${datadir}/serverlist.csv" - # 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 "[ FAIL ] serverlist.csv could not be loaded." + echo -e "[ FAIL ] serverlist.csv could not be loaded." exit 1 fi - if [ "${userinput}" == "list" ]; then + if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then { - awk -F "," '{print $2 "\t" $3}' "${serverlist}" + tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' } | column -s $'\t' -t | more exit elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then - fn_install_menu result "LinuxGSM" "Select game to install" "${serverlist}" + 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 "Install canceled" + echo -e "Install canceled" else - echo "[ FAIL ] menu result does not match gameservername" - echo "result: ${result}" - echo "gameservername: ${gameservername}" + echo -e "[ FAIL ] menu result does not match gameservername" + echo -e "result: ${result}" + echo -e "gameservername: ${gameservername}" fi elif [ -n "${userinput}" ]; then fn_server_info if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo "[ FAIL ] unknown game server" + echo -e "[ FAIL ] unknown game server" fi else fn_install_getopt fi -# LinuxGSM Server Mode +# LinuxGSM server mode. else core_functions.sh if [ "${shortname}" != "core-dep" ]; then - # Load LinuxGSM configs + # 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 @@ -350,14 +349,14 @@ else fi fi source "${configdirserver}/_default.cfg" - # Load the common.cfg config. If missing download it + # 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 source "${configdirserver}/common.cfg" fi - # Load the instance.cfg config. If missing download it + # Load the instance.cfg config. If missing download it. if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" source "${configdirserver}/${servicename}.cfg" @@ -365,14 +364,14 @@ else source "${configdirserver}/${servicename}.cfg" fi - # Load the linuxgsm.sh in to tmpdir. If missing download it + # 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 + # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. fn_ansi_loader - # Prevents running of core_exit.sh for Travis. + # Prevents running of core_exit.sh for Travis-CI. if [ "${travistest}" != "1" ]; then getopt=$1 core_getopt.sh diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 330742abb..2496cbcda 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -3,17 +3,29 @@ # Author: Daniel Gibbs # License: MIT License, Copyright (c) 2019 Daniel Gibbs # Purpose: Travis CI Tests: Factorio | Linux Game Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://docs.linuxgsm.com/ +# Contributors: https://linuxgsm.com/contrib +# Documentation: https://docs.linuxgsm.com # Website: https://linuxgsm.com -travistest="1" -version="180409" +# 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="v19.9.0" shortname="fctr" gameservername="fctrserver" rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -servicename="${gameservername}" +servicename="${selfname}" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" logdir="${rootdir}/log" @@ -23,14 +35,21 @@ serverfiles="${rootdir}/serverfiles" functionsdir="${lgsmdir}/functions" libdir="${lgsmdir}/lib" tmpdir="${lgsmdir}/tmp" +datadir="${lgsmdir}/data" +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 [ ! -v TRAVIS ]; then TRAVIS_BRANCH="develop" TRAVIS_BUILD_DIR="${rootdir}" +else + servicename="travis" + travistest="1" fi ## GitHub Branch Select @@ -40,16 +59,16 @@ githubuser="GameServerManagers" githubrepo="LinuxGSM" githubbranch="${TRAVIS_BRANCH}" -# Core Function that is required first +# Core function that is required first. core_functions.sh(){ functionfile="${FUNCNAME}" 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 +# Fetches the core functions required before passed off to core_dl.sh. -# Fetches core functions +# Fetches core functions. fn_bootstrap_fetch_file(){ remote_fileurl="${1}" local_filedir="${2}" @@ -58,42 +77,42 @@ fn_bootstrap_fetch_file(){ run="${5:-0}" forcedl="${6:-0}" md5="${7:-0}" - # download file if missing or download forced + # Download file if missing or download forced. if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then if [ ! -d "${local_filedir}" ]; then mkdir -p "${local_filedir}" fi - # Defines curl path + # Defines curl path. curlpath=$(command -v curl 2>/dev/null) - # If curl exists download file + # If curl exists download file. if [ "$(basename "${curlpath}")" == "curl" ]; then - # trap to remove part downloaded files + # Trap to remove part downloaded files. echo -en " fetching ${local_filename}...\c" curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1) local exitcode=$? if [ ${exitcode} -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" + echo -e "FAIL" if [ -f "${lgsmlog}" ]; then echo -e "${remote_fileurl}" | tee -a "${lgsmlog}" - echo "${curlcmd}" | tee -a "${lgsmlog}" + echo -e "${curlcmd}" | tee -a "${lgsmlog}" fi exit 1 else - echo -e "\e[0;32mOK\e[0m" + echo -e "OK" fi else - echo "[ FAIL ] Curl is not installed" + echo -e "[ FAIL ] Curl is not installed" exit 1 fi - # make file chmodx if chmodx is set + # Make file chmodx if chmodx is set. if [ "${chmodx}" == "chmodx" ]; then chmod +x "${local_filedir}/${local_filename}" fi fi if [ -f "${local_filedir}/${local_filename}" ]; then - # run file if run is set + # Run file if run is set. if [ "${run}" == "run" ]; then source "${local_filedir}/${local_filename}" fi @@ -112,11 +131,11 @@ 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 function. fn_bootstrap_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } -# Installer menu +# Installer menu. fn_print_center() { columns="$(tput cols)" @@ -129,7 +148,7 @@ fn_print_horizontal(){ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "${char}" } -# Bash Menu +# Bash menu. fn_install_menu_bash() { local resultvar=$1 title=$2 @@ -141,9 +160,9 @@ fn_install_menu_bash() { fn_print_horizontal menu_options=() while read -r line || [[ -n "${line}" ]]; do - var=$(echo "${line}" | awk -F "," '{print $2 " - " $3}') + var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') menu_options+=( "${var}" ) - done < ${options} + done < "${options}" menu_options+=( "Cancel" ) select option in "${menu_options[@]}"; do if [ -n "${option}" ]&&[ "${option}" != "Cancel" ]; then @@ -153,7 +172,7 @@ fn_install_menu_bash() { done } -# Whiptail/Dialog Menu +# Whiptail/Dialog menu. fn_install_menu_whiptail() { local menucmd=$1 local resultvar=$2 @@ -166,9 +185,9 @@ fn_install_menu_whiptail() { IFS="," menu_options=() while read -r line; do - key=$(echo "${line}" | awk -F "," '{print $3}') - val=$(echo "${line}" | awk -F "," '{print $2}') - menu_options+=( ${val//\"} "${key//\"}" ) + 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 @@ -178,14 +197,14 @@ fn_install_menu_whiptail() { fi } -# Menu selector +# Menu selector. fn_install_menu() { local resultvar=$1 local selection="" title=$2 caption=$3 options=$4 - # Get menu command + # Get menu command. for menucmd in whiptail dialog bash; do if [ -x "$(command -v "${menucmd}")" ]; then menucmd=$(command -v "${menucmd}") @@ -201,7 +220,7 @@ fn_install_menu() { eval "$resultvar=\"${selection}\"" } -# Gets server info from serverlist.csv and puts in to array +# Gets server info from serverlist.csv and puts in to array. fn_server_info(){ IFS="," server_info_array=($(grep -aw "${userinput}" "${serverlist}")) @@ -212,14 +231,14 @@ fn_server_info(){ fn_install_getopt(){ userinput="empty" - echo "Usage: $0 [option]" + echo -e "Usage: $0 [option]" echo -e "" - echo "Installer - Linux Game Server Managers - Version ${version}" - echo "https://linuxgsm.com" + 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| e.g $0 csgoserver. Enter name of server/game 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 } @@ -236,22 +255,27 @@ fn_install_file(){ 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 "Installed ${gamename} server as ${local_filename}" - echo "" + echo -e "Installed ${gamename} server as ${local_filename}" + echo -e "" if [ ! -d "${serverfiles}" ]; then - echo "./${local_filename} install" + echo -e "./${local_filename} install" else - echo "Remember to check server ports" - echo "./${local_filename} details" + echo -e "Remember to check server ports" + echo -e "./${local_filename} details" fi - echo "" + echo -e "" exit } -# Prevent from running this script as root. +# Prevent LinuxGSM from running as root. Except if doing a dependency install. if [ "$(whoami)" == "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" + 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 @@ -259,107 +283,107 @@ if [ "$(whoami)" == "root" ]; then fi fi -# LinuxGSM installer mode -if [ "${shortname}" == "core" ]; then - userinput=$1 - datadir="${tmpdir}/data" - serverlist="${datadir}/serverlist.csv" - - # 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 "[ FAIL ] serverlist.csv could not be loaded." - exit 1 - fi +# 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" ]; then +# LinuxGSM installer mode. +if [ "${shortname}" == "core" ]; then + if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then { - awk -F "," '{print $2 "\t" $3}' "${serverlist}" + tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' } | column -s $'\t' -t | more exit elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then - fn_install_menu result "LinuxGSM" "Select game to install" "${serverlist}" + 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 "Install canceled" + echo -e "Install canceled" else - echo "[ FAIL ] menu result does not match gameservername" - echo "result: ${result}" - echo "gameservername: ${gameservername}" + echo -e "[ FAIL ] menu result does not match gameservername" + echo -e "result: ${result}" + echo -e "gameservername: ${gameservername}" fi elif [ -n "${userinput}" ]; then fn_server_info if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo "[ FAIL ] unknown game server" + echo -e "[ FAIL ] unknown game server" fi else fn_install_getopt fi -# LinuxGSM Server Mode +# LinuxGSM server mode. else core_functions.sh - - # 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 "\e[0;31mFAIL\e[0m\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" + 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 - 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." + 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 "\e[0;31mFAIL\e[0m\n" + echo -e "FAIL" exit 1 else - echo -e "\e[0;32mOK\e[0m" + 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 - fi - 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 - source "${configdirserver}/common.cfg" - fi - # Load the instance.cfg config. If missing download it - if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then - fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" - source "${configdirserver}/${servicename}.cfg" - else - source "${configdirserver}/${servicename}.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 + 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 + source "${configdirserver}/common.cfg" + fi + # Load the instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + source "${configdirserver}/${servicename}.cfg" + else + source "${configdirserver}/${servicename}.cfg" + fi - # Prevents running of core_exit.sh for Travis. - if [ -z "${travistest}" ]; then + # 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 [ -z "${travistest}" ]; then getopt=$1 core_getopt.sh fi @@ -386,9 +410,9 @@ fn_currentstatus_ts3(){ fn_setstatus(){ fn_currentstatus_tmux echo"" - echo "Required status: ${requiredstatus}" + echo -e "Required status: ${requiredstatus}" counter=0 - echo "Current status: ${currentstatus}" + echo -e "Current status: ${currentstatus}" while [ "${requiredstatus}" != "${currentstatus}" ]; do counter=$((counter+1)) fn_currentstatus_tmux @@ -401,17 +425,16 @@ fn_setstatus(){ fi if [ "${counter}" -gt "5" ]; then currentstatus="FAIL" - echo "Current status: ${currentstatus}" - echo "" - echo "Unable to start or stop server." + 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 "Test starting:" - echo "" - sleep 0.5 + echo -e "Test starting:" + echo -e "" } # End of every test will expect the result to either pass or fail @@ -419,88 +442,88 @@ fn_setstatus(){ # if expecting a pass fn_test_result_pass(){ if [ $? != 0 ]; then - echo "=================================" - echo "Expected result: PASS" - echo "Actual result: FAIL" + 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 "=================================" - echo "Expected result: PASS" - echo "Actual result: PASS" + echo -e "=================================" + echo -e "Expected result: PASS" + echo -e "Actual result: PASS" fn_print_ok_nl "TEST PASSED" - echo "" + echo -e "" fi } # if expecting a fail fn_test_result_fail(){ if [ $? == 0 ]; then - echo "=================================" - echo "Expected result: FAIL" - echo "Actual result: PASS" + 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 "=================================" - echo "Expected result: FAIL" - echo "Actual result: FAIL" + echo -e "=================================" + echo -e "Expected result: FAIL" + echo -e "Actual result: FAIL" fn_print_ok_nl "TEST PASSED" - echo "" + echo -e "" fi } # test result n/a fn_test_result_na(){ - echo "=================================" - echo "Expected result: N/A" - echo "Actual result: N/A" + echo -e "=================================" + echo -e "Expected result: N/A" + echo -e "Actual result: N/A" fn_print_fail_nl "TEST N/A" } -echo "=================================" -echo "Travis CI Tests" -echo "Linux Game Server Manager" -echo "by Daniel Gibbs" -echo "Contributors: http://goo.gl/qLmitD" -echo "https://linuxgsm.com" -echo "=================================" -echo "" -echo "=================================" -echo "Server Tests" -echo "Using: ${gamename}" -echo "Testing Branch: $TRAVIS_BRANCH" -echo "=================================" - -echo "" -echo "0.0 - Pre-test Tasks" -echo "==================================================================" -echo "Description:" -echo "Create log dir's" -echo "" - -echo "" -echo "0.1 - Create log dir's" -echo "=================================" -echo "" +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 "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 "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "0.2 - Enable dev-debug" -echo "=================================" -echo "Description:" -echo "Enable dev-debug" -echo "" +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" @@ -508,21 +531,21 @@ echo "" command_dev_debug.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "1.0 - Pre-install tests" -echo "==================================================================" -echo "" - -echo "1.1 - start - no files" -echo "=================================" -echo "Description:" -echo "test script reaction to missing server files." -echo "Command: ./${gameservername} start" -echo "" +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 [ ! -v TRAVIS ]; then ( @@ -533,20 +556,20 @@ if [ ! -v TRAVIS ]; then ) fn_test_result_fail else - echo "Test bypassed" + echo -e "Test bypassed" fi -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "1.2 - getopt" -echo "=================================" -echo "Description:" -echo "displaying options messages." -echo "Command: ./${gameservername}" -echo "" +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" @@ -554,17 +577,17 @@ echo "" core_getopt.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "1.3 - getopt with incorrect args" -echo "=================================" -echo "Description:" -echo "displaying options messages." -echo "Command: ./${gameservername} abc123" -echo "" +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" @@ -573,20 +596,20 @@ getopt="abc123" core_getopt.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "2.0 - Installation" -echo "==================================================================" +echo -e "" +echo -e "2.0 - Installation" +echo -e "==================================================================" -echo "" -echo "2.0 - install" -echo "=================================" -echo "Description:" -echo "install ${gamename} server." -echo "Command: ./${gameservername} auto-install" +echo -e "" +echo -e "2.0 - 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" @@ -594,20 +617,20 @@ echo "Command: ./${gameservername} auto-install" fn_autoinstall ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.0 - Start/Stop/Restart Tests" -echo "==================================================================" +echo -e "" +echo -e "3.0 - Start/Stop/Restart Tests" +echo -e "==================================================================" -echo "" -echo "3.1 - start" -echo "=================================" -echo "Description:" -echo "start ${gamename} server." -echo "Command: ./${gameservername} start" +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 ( @@ -617,16 +640,16 @@ fn_setstatus command_start.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.2 - start - online" -echo "=================================" -echo "Description:" -echo "start ${gamename} server while already running." -echo "Command: ./${gameservername} start" +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 ( @@ -636,16 +659,16 @@ fn_setstatus command_start.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.3 - start - updateonstart" -echo "=================================" -echo "Description:" -echo "will update server on start." -echo "Command: ./${gameservername} start" +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 ( @@ -655,16 +678,16 @@ fn_setstatus updateonstart="on";command_start.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.4 - stop" -echo "=================================" -echo "Description:" -echo "stop ${gamename} server." -echo "Command: ./${gameservername} stop" +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 ( @@ -674,16 +697,16 @@ fn_setstatus command_stop.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.5 - stop - offline" -echo "=================================" -echo "Description:" -echo "stop ${gamename} server while already stopped." -echo "Command: ./${gameservername} stop" +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 ( @@ -693,16 +716,16 @@ fn_setstatus command_stop.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.6 - restart" -echo "=================================" -echo "Description:" -echo "restart ${gamename}." -echo "Command: ./${gameservername} restart" +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 ( @@ -712,16 +735,16 @@ fn_setstatus command_restart.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.7 - restart - offline" -echo "=================================" -echo "Description:" -echo "restart ${gamename} while already stopped." -echo "Command: ./${gameservername} restart" +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 ( @@ -731,20 +754,20 @@ fn_setstatus command_restart.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "4.0 - Update Tests" -echo "==================================================================" +echo -e "" +echo -e "4.0 - Update Tests" +echo -e "==================================================================" -echo "" -echo "4.1 - update" -echo "=================================" -echo "Description:" -echo "check for updates." -echo "Command: ./${gameservername} update" +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 ( @@ -754,24 +777,23 @@ fn_setstatus command_update.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "5.0 - Monitor Tests" -echo "==================================================================" - -echo "" -echo "Server IP - Port: ${ip}:${port}" -echo "Server IP - Query Port: ${ip}:${queryport}" - -echo "" -echo "5.1 - monitor - online" -echo "=================================" -echo "Description:" -echo "run monitor server while already running." -echo "Command: ./${gameservername} monitor" +echo -e "" +echo -e "5.0 - Monitor Tests" +echo -e "==================================================================" +echo -e "" +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 ( @@ -781,20 +803,20 @@ fn_setstatus command_monitor.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "5.2 - monitor - offline - with lockfile" -echo "=================================" -echo "Description:" -echo "run monitor while server is offline with lockfile." -echo "Command: ./${gameservername} monitor" +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 > "${rootdir}/${lockselfname}" +date '+%s' > "${rootdir}/${lockselfname}" ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" @@ -802,16 +824,16 @@ date > "${rootdir}/${lockselfname}" command_monitor.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "5.3 - monitor - offline - no lockfile" -echo "=================================" -echo "Description:" -echo "run monitor while server is offline with no lockfile." -echo "Command: ./${gameservername} monitor" +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 ( @@ -821,16 +843,16 @@ fn_setstatus command_monitor.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "5.4 - test-alert" -echo "=================================" -echo "Description:" -echo "run monitor while server is offline with no lockfile." -echo "Command: ./${gameservername} test-alert" +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 ( @@ -840,20 +862,20 @@ fn_setstatus command_test_alert.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "6.0 - Details Tests" -echo "==================================================================" +echo -e "" +echo -e "6.0 - Details Tests" +echo -e "==================================================================" -echo "" -echo "6.1 - details" -echo "=================================" -echo "Description:" -echo "display details." -echo "Command: ./${gameservername} details" +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 ( @@ -863,16 +885,16 @@ fn_setstatus command_details.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "6.2 - postdetails" -echo "=================================" -echo "Description:" -echo "post details." -echo "Command: ./${gameservername} postdetails" +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 ( @@ -882,39 +904,39 @@ fn_setstatus command_postdetails.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "7.0 - Backup Tests" -echo "==================================================================" +echo -e "" +echo -e "7.0 - Backup Tests" +echo -e "==================================================================" -echo "" -echo "7.1 - backup" -echo "=================================" -echo "Description:" -echo "run a backup." -echo "Command: ./${gameservername} backup" +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 "test de-activated until issue #1839 fixed" +echo -e "test de-activated until issue #1839 fixed" #(command_backup.sh) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "8.0 - Development Tools Tests" -echo "==================================================================" +echo -e "" +echo -e "8.0 - Development Tools Tests" +echo -e "==================================================================" -echo "" -echo "8.1 - dev - detect glibc" -echo "=================================" -echo "Description:" -echo "detect glibc." -echo "Command: ./${gameservername} detect-glibc" +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 ( @@ -924,16 +946,16 @@ fn_setstatus command_dev_detect_glibc.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "8.2 - dev - detect ldd" -echo "=================================" -echo "Description:" -echo "detect ldd." -echo "Command: ./${gameservername} detect-ldd" +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 ( @@ -943,16 +965,16 @@ fn_setstatus command_dev_detect_ldd.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "8.3 - dev - detect deps" -echo "=================================" -echo "Description:" -echo "detect dependencies." -echo "Command: ./${gameservername} detect-deps" +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 ( @@ -962,16 +984,16 @@ fn_setstatus command_dev_detect_deps.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "8.4 - dev - query-raw" -echo "=================================" -echo "Description:" -echo "raw query output." -echo "Command: ./${gameservername} query-raw" +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 ( @@ -981,15 +1003,15 @@ fn_setstatus command_dev_query_raw.sh ) fn_test_result_na -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "=================================" -echo "Server Tests - Complete!" -echo "Using: ${gamename}" -echo "=================================" +echo -e "" +echo -e "=================================" +echo -e "Server Tests - Complete!" +echo -e "Using: ${gamename}" +echo -e "=================================" requiredstatus="OFFLINE" fn_setstatus fn_print_info "Tidying up directories." diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index f71d5a669..973ab7eb2 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -3,17 +3,29 @@ # Author: Daniel Gibbs # License: MIT License, Copyright (c) 2019 Daniel Gibbs # Purpose: Travis CI Tests: Just Cause 2 | Linux Game Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://docs.linuxgsm.com/ +# Contributors: https://linuxgsm.com/contrib +# Documentation: https://docs.linuxgsm.com # Website: https://linuxgsm.com -travistest="1" -version="180409" +# 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="v19.9.0" shortname="jc2" gameservername="jc2server" rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -servicename="${gameservername}" +servicename="${selfname}" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" logdir="${rootdir}/log" @@ -23,14 +35,21 @@ serverfiles="${rootdir}/serverfiles" functionsdir="${lgsmdir}/functions" libdir="${lgsmdir}/lib" tmpdir="${lgsmdir}/tmp" +datadir="${lgsmdir}/data" +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 [ ! -v TRAVIS ]; then TRAVIS_BRANCH="develop" TRAVIS_BUILD_DIR="${rootdir}" +else + servicename="travis" + travistest="1" fi ## GitHub Branch Select @@ -40,16 +59,14 @@ githubuser="GameServerManagers" githubrepo="LinuxGSM" githubbranch="${TRAVIS_BRANCH}" -# Core Function that is required first +# Core function that is required first. core_functions.sh(){ functionfile="${FUNCNAME}" 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 - -# Fetches core functions +# Fetches the core functions required before passed off to core_dl.sh. fn_bootstrap_fetch_file(){ remote_fileurl="${1}" local_filedir="${2}" @@ -58,42 +75,42 @@ fn_bootstrap_fetch_file(){ run="${5:-0}" forcedl="${6:-0}" md5="${7:-0}" - # download file if missing or download forced + # Download file if missing or download forced. if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then if [ ! -d "${local_filedir}" ]; then mkdir -p "${local_filedir}" fi - # Defines curl path + # Defines curl path. curlpath=$(command -v curl 2>/dev/null) - # If curl exists download file + # If curl exists download file. if [ "$(basename "${curlpath}")" == "curl" ]; then - # trap to remove part downloaded files + # Trap to remove part downloaded files. echo -en " fetching ${local_filename}...\c" curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1) local exitcode=$? if [ ${exitcode} -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" + echo -e "FAIL" if [ -f "${lgsmlog}" ]; then echo -e "${remote_fileurl}" | tee -a "${lgsmlog}" - echo "${curlcmd}" | tee -a "${lgsmlog}" + echo -e "${curlcmd}" | tee -a "${lgsmlog}" fi exit 1 else - echo -e "\e[0;32mOK\e[0m" + echo -e "OK" fi else - echo "[ FAIL ] Curl is not installed" + echo -e "[ FAIL ] Curl is not installed" exit 1 fi - # make file chmodx if chmodx is set + # Make file chmodx if chmodx is set. if [ "${chmodx}" == "chmodx" ]; then chmod +x "${local_filedir}/${local_filename}" fi fi if [ -f "${local_filedir}/${local_filename}" ]; then - # run file if run is set + # Run file if run is set. if [ "${run}" == "run" ]; then source "${local_filedir}/${local_filename}" fi @@ -112,11 +129,11 @@ 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 function. fn_bootstrap_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } -# Installer menu +# Installer menu. fn_print_center() { columns="$(tput cols)" @@ -129,7 +146,7 @@ fn_print_horizontal(){ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "${char}" } -# Bash Menu +# Bash menu. fn_install_menu_bash() { local resultvar=$1 title=$2 @@ -141,9 +158,9 @@ fn_install_menu_bash() { fn_print_horizontal menu_options=() while read -r line || [[ -n "${line}" ]]; do - var=$(echo "${line}" | awk -F "," '{print $2 " - " $3}') + var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') menu_options+=( "${var}" ) - done < ${options} + done < "${options}" menu_options+=( "Cancel" ) select option in "${menu_options[@]}"; do if [ -n "${option}" ]&&[ "${option}" != "Cancel" ]; then @@ -153,7 +170,7 @@ fn_install_menu_bash() { done } -# Whiptail/Dialog Menu +# Whiptail/Dialog menu. fn_install_menu_whiptail() { local menucmd=$1 local resultvar=$2 @@ -166,9 +183,9 @@ fn_install_menu_whiptail() { IFS="," menu_options=() while read -r line; do - key=$(echo "${line}" | awk -F "," '{print $3}') - val=$(echo "${line}" | awk -F "," '{print $2}') - menu_options+=( ${val//\"} "${key//\"}" ) + 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 @@ -178,14 +195,14 @@ fn_install_menu_whiptail() { fi } -# Menu selector +# Menu selector. fn_install_menu() { local resultvar=$1 local selection="" title=$2 caption=$3 options=$4 - # Get menu command + # Get menu command. for menucmd in whiptail dialog bash; do if [ -x "$(command -v "${menucmd}")" ]; then menucmd=$(command -v "${menucmd}") @@ -201,7 +218,7 @@ fn_install_menu() { eval "$resultvar=\"${selection}\"" } -# Gets server info from serverlist.csv and puts in to array +# Gets server info from serverlist.csv and puts in to array. fn_server_info(){ IFS="," server_info_array=($(grep -aw "${userinput}" "${serverlist}")) @@ -212,14 +229,14 @@ fn_server_info(){ fn_install_getopt(){ userinput="empty" - echo "Usage: $0 [option]" + echo -e "Usage: $0 [option]" echo -e "" - echo "Installer - Linux Game Server Managers - Version ${version}" - echo "https://linuxgsm.com" + 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| e.g $0 csgoserver. Enter name of server/game 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 } @@ -236,22 +253,27 @@ fn_install_file(){ 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 "Installed ${gamename} server as ${local_filename}" - echo "" + echo -e "Installed ${gamename} server as ${local_filename}" + echo -e "" if [ ! -d "${serverfiles}" ]; then - echo "./${local_filename} install" + echo -e "./${local_filename} install" else - echo "Remember to check server ports" - echo "./${local_filename} details" + echo -e "Remember to check server ports" + echo -e "./${local_filename} details" fi - echo "" + echo -e "" exit } -# Prevent from running this script as root. +# Prevent LinuxGSM from running as root. Except if doing a dependency install. if [ "$(whoami)" == "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" + 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 @@ -259,106 +281,106 @@ if [ "$(whoami)" == "root" ]; then fi fi -# LinuxGSM installer mode +# LinuxGSM installer mode. if [ "${shortname}" == "core" ]; then - userinput=$1 - datadir="${tmpdir}/data" - serverlist="${datadir}/serverlist.csv" - # 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 "[ FAIL ] serverlist.csv could not be loaded." + echo -e "[ FAIL ] serverlist.csv could not be loaded." exit 1 fi - if [ "${userinput}" == "list" ]; then + if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then { - awk -F "," '{print $2 "\t" $3}' "${serverlist}" + tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' } | column -s $'\t' -t | more exit elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then - fn_install_menu result "LinuxGSM" "Select game to install" "${serverlist}" + 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 "Install canceled" + echo -e "Install canceled" else - echo "[ FAIL ] menu result does not match gameservername" - echo "result: ${result}" - echo "gameservername: ${gameservername}" + echo -e "[ FAIL ] menu result does not match gameservername" + echo -e "result: ${result}" + echo -e "gameservername: ${gameservername}" fi elif [ -n "${userinput}" ]; then fn_server_info if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo "[ FAIL ] unknown game server" + echo -e "[ FAIL ] unknown game server" fi else fn_install_getopt fi -# LinuxGSM Server Mode +# LinuxGSM server mode. else core_functions.sh - - # 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 "\e[0;31mFAIL\e[0m\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" + 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 - 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." + 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 "\e[0;31mFAIL\e[0m\n" + echo -e "FAIL" exit 1 else - echo -e "\e[0;32mOK\e[0m" + 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 - fi - 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 - source "${configdirserver}/common.cfg" - fi - # Load the instance.cfg config. If missing download it - if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then - fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" - source "${configdirserver}/${servicename}.cfg" - else - source "${configdirserver}/${servicename}.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 + 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 + source "${configdirserver}/common.cfg" + fi + # Load the instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + source "${configdirserver}/${servicename}.cfg" + else + source "${configdirserver}/${servicename}.cfg" + fi - # Prevents running of core_exit.sh for Travis. + # 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 [ -z "${travistest}" ]; then getopt=$1 core_getopt.sh @@ -386,9 +408,9 @@ fn_currentstatus_ts3(){ fn_setstatus(){ fn_currentstatus_tmux echo"" - echo "Required status: ${requiredstatus}" + echo -e "Required status: ${requiredstatus}" counter=0 - echo "Current status: ${currentstatus}" + echo -e "Current status: ${currentstatus}" while [ "${requiredstatus}" != "${currentstatus}" ]; do counter=$((counter+1)) fn_currentstatus_tmux @@ -401,17 +423,16 @@ fn_setstatus(){ fi if [ "${counter}" -gt "5" ]; then currentstatus="FAIL" - echo "Current status: ${currentstatus}" - echo "" - echo "Unable to start or stop server." + 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 "Test starting:" - echo "" - sleep 0.5 + echo -e "Test starting:" + echo -e "" } # End of every test will expect the result to either pass or fail @@ -419,88 +440,88 @@ fn_setstatus(){ # if expecting a pass fn_test_result_pass(){ if [ $? != 0 ]; then - echo "=================================" - echo "Expected result: PASS" - echo "Actual result: FAIL" + 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 "=================================" - echo "Expected result: PASS" - echo "Actual result: PASS" + echo -e "=================================" + echo -e "Expected result: PASS" + echo -e "Actual result: PASS" fn_print_ok_nl "TEST PASSED" - echo "" + echo -e "" fi } # if expecting a fail fn_test_result_fail(){ if [ $? == 0 ]; then - echo "=================================" - echo "Expected result: FAIL" - echo "Actual result: PASS" + 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 "=================================" - echo "Expected result: FAIL" - echo "Actual result: FAIL" + echo -e "=================================" + echo -e "Expected result: FAIL" + echo -e "Actual result: FAIL" fn_print_ok_nl "TEST PASSED" - echo "" + echo -e "" fi } # test result n/a fn_test_result_na(){ - echo "=================================" - echo "Expected result: N/A" - echo "Actual result: N/A" + echo -e "=================================" + echo -e "Expected result: N/A" + echo -e "Actual result: N/A" fn_print_fail_nl "TEST N/A" } -echo "=================================" -echo "Travis CI Tests" -echo "Linux Game Server Manager" -echo "by Daniel Gibbs" -echo "Contributors: http://goo.gl/qLmitD" -echo "https://linuxgsm.com" -echo "=================================" -echo "" -echo "=================================" -echo "Server Tests" -echo "Using: ${gamename}" -echo "Testing Branch: $TRAVIS_BRANCH" -echo "=================================" - -echo "" -echo "0.0 - Pre-test Tasks" -echo "==================================================================" -echo "Description:" -echo "Create log dir's" -echo "" - -echo "" -echo "0.1 - Create log dir's" -echo "=================================" -echo "" +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 "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 "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "0.2 - Enable dev-debug" -echo "=================================" -echo "Description:" -echo "Enable dev-debug" -echo "" +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" @@ -508,21 +529,21 @@ echo "" command_dev_debug.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "1.0 - Pre-install tests" -echo "==================================================================" -echo "" - -echo "1.1 - start - no files" -echo "=================================" -echo "Description:" -echo "test script reaction to missing server files." -echo "Command: ./${gameservername} start" -echo "" +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 [ ! -v TRAVIS ]; then ( @@ -533,20 +554,20 @@ if [ ! -v TRAVIS ]; then ) fn_test_result_fail else - echo "Test bypassed" + echo -e "Test bypassed" fi -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "1.2 - getopt" -echo "=================================" -echo "Description:" -echo "displaying options messages." -echo "Command: ./${gameservername}" -echo "" +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" @@ -554,17 +575,17 @@ echo "" core_getopt.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "1.3 - getopt with incorrect args" -echo "=================================" -echo "Description:" -echo "displaying options messages." -echo "Command: ./${gameservername} abc123" -echo "" +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" @@ -573,20 +594,20 @@ getopt="abc123" core_getopt.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "2.0 - Installation" -echo "==================================================================" +echo -e "" +echo -e "2.0 - Installation" +echo -e "==================================================================" -echo "" -echo "2.0 - install" -echo "=================================" -echo "Description:" -echo "install ${gamename} server." -echo "Command: ./${gameservername} auto-install" +echo -e "" +echo -e "2.0 - 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" @@ -594,20 +615,20 @@ echo "Command: ./${gameservername} auto-install" fn_autoinstall ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.0 - Start/Stop/Restart Tests" -echo "==================================================================" +echo -e "" +echo -e "3.0 - Start/Stop/Restart Tests" +echo -e "==================================================================" -echo "" -echo "3.1 - start" -echo "=================================" -echo "Description:" -echo "start ${gamename} server." -echo "Command: ./${gameservername} start" +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 ( @@ -617,16 +638,16 @@ fn_setstatus command_start.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.2 - start - online" -echo "=================================" -echo "Description:" -echo "start ${gamename} server while already running." -echo "Command: ./${gameservername} start" +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 ( @@ -636,16 +657,16 @@ fn_setstatus command_start.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.3 - start - updateonstart" -echo "=================================" -echo "Description:" -echo "will update server on start." -echo "Command: ./${gameservername} start" +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 ( @@ -655,16 +676,16 @@ fn_setstatus updateonstart="on";command_start.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.4 - stop" -echo "=================================" -echo "Description:" -echo "stop ${gamename} server." -echo "Command: ./${gameservername} stop" +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 ( @@ -674,16 +695,16 @@ fn_setstatus command_stop.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.5 - stop - offline" -echo "=================================" -echo "Description:" -echo "stop ${gamename} server while already stopped." -echo "Command: ./${gameservername} stop" +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 ( @@ -693,16 +714,16 @@ fn_setstatus command_stop.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.6 - restart" -echo "=================================" -echo "Description:" -echo "restart ${gamename}." -echo "Command: ./${gameservername} restart" +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 ( @@ -712,16 +733,16 @@ fn_setstatus command_restart.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.7 - restart - offline" -echo "=================================" -echo "Description:" -echo "restart ${gamename} while already stopped." -echo "Command: ./${gameservername} restart" +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 ( @@ -731,20 +752,20 @@ fn_setstatus command_restart.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "4.0 - Update Tests" -echo "==================================================================" +echo -e "" +echo -e "4.0 - Update Tests" +echo -e "==================================================================" -echo "" -echo "4.1 - update" -echo "=================================" -echo "Description:" -echo "check for updates." -echo "Command: ./${gameservername} update" +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 ( @@ -754,16 +775,16 @@ fn_setstatus command_update.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "4.2 - update - change buildid" -echo "=================================" -echo "Description:" -echo "change the buildid tricking SteamCMD to update." -echo "Command: ./jc2server update" +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." @@ -775,16 +796,16 @@ sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf" command_update.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "4.3 - update - change buildid - online" -echo "=================================" -echo "Description:" -echo "change the buildid tricking SteamCMD to update server while already running." -echo "Command: ./jc2server update" +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." @@ -796,16 +817,16 @@ sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf" command_update.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "4.4 - update - remove appmanifest file" -echo "=================================" -echo "Description:" -echo "removing appmanifest file will cause script to repair." -echo "Command: ./jc2server update" +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." @@ -817,16 +838,16 @@ rm --verbose "${serverfiles}/steamapps/appmanifest_${appid}.acf" command_update.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "4.5 - force-update" -echo "=================================" -echo "Description:" -echo "force-update bypassing update check." -echo "Command: ./jc2server force-update" +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 ( @@ -836,16 +857,16 @@ fn_setstatus forceupdate=1;command_update.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "4.6 - force-update - online" -echo "=================================" -echo "Description:" -echo "force-update bypassing update check server while already running." -echo "Command: ./jc2server force-update" +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 ( @@ -855,16 +876,16 @@ fn_setstatus forceupdate=1;command_update.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "4.7 - validate" -echo "=================================" -echo "Description:" -echo "validate server files." -echo "Command: ./jc2server validate" +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 ( @@ -874,17 +895,17 @@ fn_setstatus command_validate.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "4.8 - validate - online" -echo "=================================" -echo "Description:" -echo "validate server files while server already running." -echo "" -echo "Command: ./jc2server validate" +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 ( @@ -894,38 +915,37 @@ fn_setstatus command_validate.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "Inserting IP address" -echo "=================================" -echo "Description:" -echo "Inserting Travis IP in to config." -echo "Allows monitor to work" +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 "IP: ${travisip}" - -echo "" -echo "5.0 - Monitor Tests" -echo "==================================================================" -info_config.sh -echo "" -echo "Server IP - Port: ${ip}:${port}" -echo "Server IP - Query Port: ${ip}:${queryport}" - -echo "" -echo "5.1 - monitor - online" -echo "=================================" -echo "Description:" -echo "run monitor server while already running." -echo "Command: ./${gameservername} monitor" +echo -e "IP: ${travisip}" + +echo -e "" +echo -e "5.0 - Monitor Tests" +echo -e "==================================================================" +echo -e "" +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 ( @@ -935,20 +955,20 @@ fn_setstatus command_monitor.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "5.2 - monitor - offline - with lockfile" -echo "=================================" -echo "Description:" -echo "run monitor while server is offline with lockfile." -echo "Command: ./${gameservername} monitor" +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 > "${rootdir}/${lockselfname}" +date '+%s' > "${rootdir}/${lockselfname}" ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" @@ -956,16 +976,16 @@ date > "${rootdir}/${lockselfname}" command_monitor.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "5.3 - monitor - offline - no lockfile" -echo "=================================" -echo "Description:" -echo "run monitor while server is offline with no lockfile." -echo "Command: ./${gameservername} monitor" +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 ( @@ -975,16 +995,16 @@ fn_setstatus command_monitor.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "5.4 - test-alert" -echo "=================================" -echo "Description:" -echo "run monitor while server is offline with no lockfile." -echo "Command: ./${gameservername} test-alert" +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" @@ -996,25 +1016,25 @@ sed -i 's/[0-9]\+/0/' "${servercfgfullpath}" command_test_alert.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" +echo -e "" fn_print_info_nl "Re-generating ${servercfg}." cp -v "config.lua" "${servercfgfullpath}" -echo "=================================" - -echo "" -echo "6.0 - Details Tests" -echo "==================================================================" - -echo "" -echo "6.1 - details" -echo "=================================" -echo "Description:" -echo "display details." -echo "Command: ./${gameservername} details" +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 ( @@ -1024,16 +1044,16 @@ fn_setstatus command_details.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "6.2 - postdetails" -echo "=================================" -echo "Description:" -echo "post details." -echo "Command: ./${gameservername} postdetails" +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 ( @@ -1043,39 +1063,39 @@ fn_setstatus command_postdetails.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "7.0 - Backup Tests" -echo "==================================================================" +echo -e "" +echo -e "7.0 - Backup Tests" +echo -e "==================================================================" -echo "" -echo "7.1 - backup" -echo "=================================" -echo "Description:" -echo "run a backup." -echo "Command: ./${gameservername} backup" +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 "test de-activated until issue #1839 fixed" +echo -e "test de-activated until issue #1839 fixed" #(command_backup.sh) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "8.0 - Development Tools Tests" -echo "==================================================================" +echo -e "" +echo -e "8.0 - Development Tools Tests" +echo -e "==================================================================" -echo "" -echo "8.1 - dev - detect glibc" -echo "=================================" -echo "Description:" -echo "detect glibc." -echo "Command: ./${gameservername} detect-glibc" +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 ( @@ -1085,16 +1105,16 @@ fn_setstatus command_dev_detect_glibc.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "8.2 - dev - detect ldd" -echo "=================================" -echo "Description:" -echo "detect ldd." -echo "Command: ./${gameservername} detect-ldd" +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 ( @@ -1104,16 +1124,16 @@ fn_setstatus command_dev_detect_ldd.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "8.3 - dev - detect deps" -echo "=================================" -echo "Description:" -echo "detect dependencies." -echo "Command: ./${gameservername} detect-deps" +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 ( @@ -1123,16 +1143,16 @@ fn_setstatus command_dev_detect_deps.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "8.4 - dev - query-raw" -echo "=================================" -echo "Description:" -echo "raw query output." -echo "Command: ./${gameservername} query-raw" +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 ( @@ -1142,15 +1162,15 @@ fn_setstatus command_dev_query_raw.sh ) fn_test_result_na -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "=================================" -echo "Server Tests - Complete!" -echo "Using: ${gamename}" -echo "=================================" +echo -e "" +echo -e "=================================" +echo -e "Server Tests - Complete!" +echo -e "Using: ${gamename}" +echo -e "=================================" requiredstatus="OFFLINE" fn_setstatus fn_print_info "Tidying up directories." diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 9e5eb5442..0ddb2143b 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -3,17 +3,29 @@ # Author: Daniel Gibbs # License: MIT License, Copyright (c) 2019 Daniel Gibbs # Purpose: Travis CI Tests: Minecraft | Linux Game Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://docs.linuxgsm.com/ +# Contributors: https://linuxgsm.com/contrib +# Documentation: https://docs.linuxgsm.com # Website: https://linuxgsm.com -travistest="1" -version="190401" +# 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="v19.9.0" shortname="mc" gameservername="mcserver" rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -servicename="${gameservername}" +servicename="${selfname}" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" logdir="${rootdir}/log" @@ -23,14 +35,21 @@ serverfiles="${rootdir}/serverfiles" functionsdir="${lgsmdir}/functions" libdir="${lgsmdir}/lib" tmpdir="${lgsmdir}/tmp" +datadir="${lgsmdir}/data" +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 [ ! -v TRAVIS ]; then TRAVIS_BRANCH="develop" TRAVIS_BUILD_DIR="${rootdir}" +else + servicename="travis" + travistest="1" fi ## GitHub Branch Select @@ -40,16 +59,14 @@ githubuser="GameServerManagers" githubrepo="LinuxGSM" githubbranch="${TRAVIS_BRANCH}" -# Core Function that is required first +# Core function that is required first. core_functions.sh(){ functionfile="${FUNCNAME}" 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 - -# Fetches core functions +# Fetches the core functions required before passed off to core_dl.sh. fn_bootstrap_fetch_file(){ remote_fileurl="${1}" local_filedir="${2}" @@ -58,42 +75,42 @@ fn_bootstrap_fetch_file(){ run="${5:-0}" forcedl="${6:-0}" md5="${7:-0}" - # download file if missing or download forced + # Download file if missing or download forced. if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then if [ ! -d "${local_filedir}" ]; then mkdir -p "${local_filedir}" fi - # Defines curl path + # Defines curl path. curlpath=$(command -v curl 2>/dev/null) - # If curl exists download file + # If curl exists download file. if [ "$(basename "${curlpath}")" == "curl" ]; then - # trap to remove part downloaded files + # Trap to remove part downloaded files. echo -en " fetching ${local_filename}...\c" curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1) local exitcode=$? if [ ${exitcode} -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" + echo -e "FAIL" if [ -f "${lgsmlog}" ]; then echo -e "${remote_fileurl}" | tee -a "${lgsmlog}" - echo "${curlcmd}" | tee -a "${lgsmlog}" + echo -e "${curlcmd}" | tee -a "${lgsmlog}" fi exit 1 else - echo -e "\e[0;32mOK\e[0m" + echo -e "OK" fi else - echo "[ FAIL ] Curl is not installed" + echo -e "[ FAIL ] Curl is not installed" exit 1 fi - # make file chmodx if chmodx is set + # Make file chmodx if chmodx is set. if [ "${chmodx}" == "chmodx" ]; then chmod +x "${local_filedir}/${local_filename}" fi fi if [ -f "${local_filedir}/${local_filename}" ]; then - # run file if run is set + # Run file if run is set. if [ "${run}" == "run" ]; then source "${local_filedir}/${local_filename}" fi @@ -112,11 +129,11 @@ 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 function. fn_bootstrap_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } -# Installer menu +# Installer menu. fn_print_center() { columns="$(tput cols)" @@ -129,7 +146,7 @@ fn_print_horizontal(){ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "${char}" } -# Bash Menu +# Bash menu. fn_install_menu_bash() { local resultvar=$1 title=$2 @@ -141,9 +158,9 @@ fn_install_menu_bash() { fn_print_horizontal menu_options=() while read -r line || [[ -n "${line}" ]]; do - var=$(echo "${line}" | awk -F "," '{print $2 " - " $3}') + var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') menu_options+=( "${var}" ) - done < ${options} + done < "${options}" menu_options+=( "Cancel" ) select option in "${menu_options[@]}"; do if [ -n "${option}" ]&&[ "${option}" != "Cancel" ]; then @@ -153,7 +170,7 @@ fn_install_menu_bash() { done } -# Whiptail/Dialog Menu +# Whiptail/Dialog menu. fn_install_menu_whiptail() { local menucmd=$1 local resultvar=$2 @@ -166,9 +183,9 @@ fn_install_menu_whiptail() { IFS="," menu_options=() while read -r line; do - key=$(echo "${line}" | awk -F "," '{print $3}') - val=$(echo "${line}" | awk -F "," '{print $2}') - menu_options+=( ${val//\"} "${key//\"}" ) + 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 @@ -178,14 +195,14 @@ fn_install_menu_whiptail() { fi } -# Menu selector +# Menu selector. fn_install_menu() { local resultvar=$1 local selection="" title=$2 caption=$3 options=$4 - # Get menu command + # Get menu command. for menucmd in whiptail dialog bash; do if [ -x "$(command -v "${menucmd}")" ]; then menucmd=$(command -v "${menucmd}") @@ -201,7 +218,7 @@ fn_install_menu() { eval "$resultvar=\"${selection}\"" } -# Gets server info from serverlist.csv and puts in to array +# Gets server info from serverlist.csv and puts in to array. fn_server_info(){ IFS="," server_info_array=($(grep -aw "${userinput}" "${serverlist}")) @@ -212,14 +229,14 @@ fn_server_info(){ fn_install_getopt(){ userinput="empty" - echo "Usage: $0 [option]" + echo -e "Usage: $0 [option]" echo -e "" - echo "Installer - Linux Game Server Managers - Version ${version}" - echo "https://linuxgsm.com" + 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| e.g $0 csgoserver. Enter name of server/game 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 } @@ -236,22 +253,27 @@ fn_install_file(){ 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 "Installed ${gamename} server as ${local_filename}" - echo "" + echo -e "Installed ${gamename} server as ${local_filename}" + echo -e "" if [ ! -d "${serverfiles}" ]; then - echo "./${local_filename} install" + echo -e "./${local_filename} install" else - echo "Remember to check server ports" - echo "./${local_filename} details" + echo -e "Remember to check server ports" + echo -e "./${local_filename} details" fi - echo "" + echo -e "" exit } -# Prevent from running this script as root. +# Prevent LinuxGSM from running as root. Except if doing a dependency install. if [ "$(whoami)" == "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" + 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 @@ -259,106 +281,106 @@ if [ "$(whoami)" == "root" ]; then fi fi -# LinuxGSM installer mode +# LinuxGSM installer mode. if [ "${shortname}" == "core" ]; then - userinput=$1 - datadir="${tmpdir}/data" - serverlist="${datadir}/serverlist.csv" - # 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 "[ FAIL ] serverlist.csv could not be loaded." + echo -e "[ FAIL ] serverlist.csv could not be loaded." exit 1 fi - if [ "${userinput}" == "list" ]; then + if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then { - awk -F "," '{print $2 "\t" $3}' "${serverlist}" + tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' } | column -s $'\t' -t | more exit elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then - fn_install_menu result "LinuxGSM" "Select game to install" "${serverlist}" + 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 "Install canceled" + echo -e "Install canceled" else - echo "[ FAIL ] menu result does not match gameservername" - echo "result: ${result}" - echo "gameservername: ${gameservername}" + echo -e "[ FAIL ] menu result does not match gameservername" + echo -e "result: ${result}" + echo -e "gameservername: ${gameservername}" fi elif [ -n "${userinput}" ]; then fn_server_info if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo "[ FAIL ] unknown game server" + echo -e "[ FAIL ] unknown game server" fi else fn_install_getopt fi -# LinuxGSM Server Mode +# LinuxGSM server mode. else core_functions.sh - - # 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 "\e[0;31mFAIL\e[0m\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" + 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 - 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." + 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 "\e[0;31mFAIL\e[0m\n" + echo -e "FAIL" exit 1 else - echo -e "\e[0;32mOK\e[0m" + 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 - fi - 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 - source "${configdirserver}/common.cfg" - fi - # Load the instance.cfg config. If missing download it - if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then - fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" - source "${configdirserver}/${servicename}.cfg" - else - source "${configdirserver}/${servicename}.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 + 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 + source "${configdirserver}/common.cfg" + fi + # Load the instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + source "${configdirserver}/${servicename}.cfg" + else + source "${configdirserver}/${servicename}.cfg" + fi - # Prevents running of core_exit.sh for Travis. + # 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 [ -z "${travistest}" ]; then getopt=$1 core_getopt.sh @@ -386,9 +408,9 @@ fn_currentstatus_ts3(){ fn_setstatus(){ fn_currentstatus_tmux echo"" - echo "Required status: ${requiredstatus}" + echo -e "Required status: ${requiredstatus}" counter=0 - echo "Current status: ${currentstatus}" + echo -e "Current status: ${currentstatus}" while [ "${requiredstatus}" != "${currentstatus}" ]; do counter=$((counter+1)) fn_currentstatus_tmux @@ -401,17 +423,16 @@ fn_setstatus(){ fi if [ "${counter}" -gt "5" ]; then currentstatus="FAIL" - echo "Current status: ${currentstatus}" - echo "" - echo "Unable to start or stop server." + 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 "Test starting:" - echo "" - sleep 0.5 + echo -e "Test starting:" + echo -e "" } # End of every test will expect the result to either pass or fail @@ -419,88 +440,88 @@ fn_setstatus(){ # if expecting a pass fn_test_result_pass(){ if [ $? != 0 ]; then - echo "=================================" - echo "Expected result: PASS" - echo "Actual result: FAIL" + 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 "=================================" - echo "Expected result: PASS" - echo "Actual result: PASS" + echo -e "=================================" + echo -e "Expected result: PASS" + echo -e "Actual result: PASS" fn_print_ok_nl "TEST PASSED" - echo "" + echo -e "" fi } # if expecting a fail fn_test_result_fail(){ if [ $? == 0 ]; then - echo "=================================" - echo "Expected result: FAIL" - echo "Actual result: PASS" + 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 "=================================" - echo "Expected result: FAIL" - echo "Actual result: FAIL" + echo -e "=================================" + echo -e "Expected result: FAIL" + echo -e "Actual result: FAIL" fn_print_ok_nl "TEST PASSED" - echo "" + echo -e "" fi } # test result n/a fn_test_result_na(){ - echo "=================================" - echo "Expected result: N/A" - echo "Actual result: N/A" + echo -e "=================================" + echo -e "Expected result: N/A" + echo -e "Actual result: N/A" fn_print_fail_nl "TEST N/A" } -echo "=================================" -echo "Travis CI Tests" -echo "Linux Game Server Manager" -echo "by Daniel Gibbs" -echo "Contributors: http://goo.gl/qLmitD" -echo "https://linuxgsm.com" -echo "=================================" -echo "" -echo "=================================" -echo "Server Tests" -echo "Using: ${gamename}" -echo "Testing Branch: $TRAVIS_BRANCH" -echo "=================================" - -echo "" -echo "0.0 - Pre-test Tasks" -echo "==================================================================" -echo "Description:" -echo "Create log dir's" -echo "" - -echo "" -echo "0.1 - Create log dir's" -echo "=================================" -echo "" +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 "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 "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "0.2 - Enable dev-debug" -echo "=================================" -echo "Description:" -echo "Enable dev-debug" -echo "" +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" @@ -508,21 +529,21 @@ echo "" command_dev_debug.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "1.0 - Pre-install tests" -echo "==================================================================" -echo "" - -echo "1.1 - start - no files" -echo "=================================" -echo "Description:" -echo "test script reaction to missing server files." -echo "Command: ./${gameservername} start" -echo "" +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 [ ! -v TRAVIS ]; then ( @@ -533,20 +554,20 @@ if [ ! -v TRAVIS ]; then ) fn_test_result_fail else - echo "Test bypassed" + echo -e "Test bypassed" fi -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "1.2 - getopt" -echo "=================================" -echo "Description:" -echo "displaying options messages." -echo "Command: ./${gameservername}" -echo "" +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" @@ -554,17 +575,17 @@ echo "" core_getopt.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "1.3 - getopt with incorrect args" -echo "=================================" -echo "Description:" -echo "displaying options messages." -echo "Command: ./${gameservername} abc123" -echo "" +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" @@ -573,20 +594,20 @@ getopt="abc123" core_getopt.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "2.0 - Installation" -echo "==================================================================" +echo -e "" +echo -e "2.0 - Installation" +echo -e "==================================================================" -echo "" -echo "2.0 - install" -echo "=================================" -echo "Description:" -echo "install ${gamename} server." -echo "Command: ./${gameservername} auto-install" +echo -e "" +echo -e "2.0 - 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" @@ -594,20 +615,20 @@ echo "Command: ./${gameservername} auto-install" fn_autoinstall ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.0 - Start/Stop/Restart Tests" -echo "==================================================================" +echo -e "" +echo -e "3.0 - Start/Stop/Restart Tests" +echo -e "==================================================================" -echo "" -echo "3.1 - start" -echo "=================================" -echo "Description:" -echo "start ${gamename} server." -echo "Command: ./${gameservername} start" +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 ( @@ -617,16 +638,16 @@ fn_setstatus command_start.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.2 - start - online" -echo "=================================" -echo "Description:" -echo "start ${gamename} server while already running." -echo "Command: ./${gameservername} start" +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 ( @@ -636,16 +657,16 @@ fn_setstatus command_start.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.3 - start - updateonstart" -echo "=================================" -echo "Description:" -echo "will update server on start." -echo "Command: ./${gameservername} start" +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 ( @@ -655,25 +676,25 @@ fn_setstatus updateonstart="on";command_start.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "30s Pause" -echo "=================================" -echo "Description:" -echo "give time for server to fully start." -echo "Command: sleep 30" +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 "" -echo "3.4 - stop" -echo "=================================" -echo "Description:" -echo "stop ${gamename} server." -echo "Command: ./${gameservername} stop" +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 ( @@ -683,16 +704,16 @@ fn_setstatus command_stop.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.5 - stop - offline" -echo "=================================" -echo "Description:" -echo "stop ${gamename} server while already stopped." -echo "Command: ./${gameservername} stop" +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 ( @@ -702,16 +723,16 @@ fn_setstatus command_stop.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.6 - restart" -echo "=================================" -echo "Description:" -echo "restart ${gamename}." -echo "Command: ./${gameservername} restart" +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 ( @@ -721,16 +742,16 @@ fn_setstatus command_restart.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.7 - restart - offline" -echo "=================================" -echo "Description:" -echo "restart ${gamename} while already stopped." -echo "Command: ./${gameservername} restart" +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 ( @@ -740,20 +761,20 @@ fn_setstatus command_restart.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "4.0 - Update Tests" -echo "==================================================================" +echo -e "" +echo -e "4.0 - Update Tests" +echo -e "==================================================================" -echo "" -echo "4.1 - update" -echo "=================================" -echo "Description:" -echo "check for updates." -echo "Command: ./${gameservername} update" +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 ( @@ -763,48 +784,47 @@ fn_setstatus command_update.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "Inserting IP address" -echo "=================================" -echo "Description:" -echo "Inserting Travis IP in to config." -echo "Allows monitor to work" +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 "IP: ${travisip}" - -echo "" -echo "5.0 - Monitor Tests" -echo "==================================================================" -info_config.sh -echo "" -echo "Server IP - Port: ${ip}:${port}" -echo "Server IP - Query Port: ${ip}:${queryport}" - -echo "" -echo "30s Pause" -echo "=================================" -echo "Description:" -echo "give time for server to fully start." -echo "Command: sleep 30" +echo -e "IP: ${travisip}" + +echo -e "" +echo -e "5.0 - Monitor Tests" +echo -e "==================================================================" +echo -e "" +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 60 - -echo "" -echo "5.1 - monitor - online" -echo "=================================" -echo "Description:" -echo "run monitor server while already running." -echo "Command: ./${gameservername} monitor" +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 ( @@ -814,20 +834,20 @@ fn_setstatus command_monitor.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "5.2 - monitor - offline - with lockfile" -echo "=================================" -echo "Description:" -echo "run monitor while server is offline with lockfile." -echo "Command: ./${gameservername} monitor" +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 > "${rootdir}/${lockselfname}" +date '+%s' > "${rootdir}/${lockselfname}" ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" @@ -835,16 +855,16 @@ date > "${rootdir}/${lockselfname}" command_monitor.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "5.3 - monitor - offline - no lockfile" -echo "=================================" -echo "Description:" -echo "run monitor while server is offline with no lockfile." -echo "Command: ./${gameservername} monitor" +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 ( @@ -854,16 +874,16 @@ fn_setstatus command_monitor.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "5.4 - test-alert" -echo "=================================" -echo "Description:" -echo "run monitor while server is offline with no lockfile." -echo "Command: ./${gameservername} test-alert" +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 ( @@ -873,20 +893,20 @@ fn_setstatus command_test_alert.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "6.0 - Details Tests" -echo "==================================================================" +echo -e "" +echo -e "6.0 - Details Tests" +echo -e "==================================================================" -echo "" -echo "6.1 - details" -echo "=================================" -echo "Description:" -echo "display details." -echo "Command: ./${gameservername} details" +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 ( @@ -896,16 +916,16 @@ fn_setstatus command_details.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "6.2 - postdetails" -echo "=================================" -echo "Description:" -echo "post details." -echo "Command: ./${gameservername} postdetails" +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 ( @@ -915,39 +935,39 @@ fn_setstatus command_postdetails.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "7.0 - Backup Tests" -echo "==================================================================" +echo -e "" +echo -e "7.0 - Backup Tests" +echo -e "==================================================================" -echo "" -echo "7.1 - backup" -echo "=================================" -echo "Description:" -echo "run a backup." -echo "Command: ./${gameservername} backup" +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 "test de-activated until issue #1839 fixed" +echo -e "test de-activated until issue #1839 fixed" #(command_backup.sh) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "8.0 - Development Tools Tests" -echo "==================================================================" +echo -e "" +echo -e "8.0 - Development Tools Tests" +echo -e "==================================================================" -echo "" -echo "8.1 - dev - detect glibc" -echo "=================================" -echo "Description:" -echo "detect glibc." -echo "Command: ./${gameservername} detect-glibc" +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 ( @@ -957,16 +977,16 @@ fn_setstatus command_dev_detect_glibc.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "8.2 - dev - detect ldd" -echo "=================================" -echo "Description:" -echo "detect ldd." -echo "Command: ./${gameservername} detect-ldd" +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 ( @@ -976,16 +996,16 @@ fn_setstatus command_dev_detect_ldd.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "8.3 - dev - detect deps" -echo "=================================" -echo "Description:" -echo "detect dependencies." -echo "Command: ./${gameservername} detect-deps" +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 ( @@ -995,30 +1015,30 @@ fn_setstatus command_dev_detect_deps.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "Inserting IP address" -echo "=================================" -echo "Description:" -echo "Inserting Travis IP in to config." -echo "Allows monitor to work" +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 "IP: ${travisip}" - -echo "" -echo "8.4 - dev - query-raw" -echo "=================================" -echo "Description:" -echo "raw query output." -echo "Command: ./${gameservername} query-raw" +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 ( @@ -1028,15 +1048,15 @@ fn_setstatus command_dev_query_raw.sh ) fn_test_result_na -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "=================================" -echo "Server Tests - Complete!" -echo "Using: ${gamename}" -echo "=================================" +echo -e "" +echo -e "=================================" +echo -e "Server Tests - Complete!" +echo -e "Using: ${gamename}" +echo -e "=================================" requiredstatus="OFFLINE" fn_setstatus fn_print_info "Tidying up directories." diff --git a/tests/tests_shellcheck.sh b/tests/tests_shellcheck.sh index 6d33507e6..51784906c 100644 --- a/tests/tests_shellcheck.sh +++ b/tests/tests_shellcheck.sh @@ -7,26 +7,26 @@ # Documentation: https://docs.linuxgsm.com/ # Website: https://linuxgsm.com -echo "=================================" -echo "Travis CI Tests" -echo "Linux Game Server Manager" -echo "by Daniel Gibbs" -echo "Contributors: http://goo.gl/qLmitD" -echo "https://linuxgsm.com" -echo "=================================" -echo "" -echo "=================================" -echo "Bash Analysis Tests" -echo "Using: Shellcheck" -echo "Testing Branch: $TRAVIS_BRANCH" -echo "=================================" -echo "" +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 "Found issues: ${scissues}" -echo "=================================" +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 "" -echo "=================================" -echo "Bash Analysis Tests - Complete!" -echo "Using: Shellcheck" -echo "=================================" +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 index 809bc2d2a..3df1b4a96 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -3,17 +3,29 @@ # Author: Daniel Gibbs # License: MIT License, Copyright (c) 2019 Daniel Gibbs # Purpose: Travis CI Tests: Teamspeak 3 | Linux Game Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://docs.linuxgsm.com/ +# Contributors: https://linuxgsm.com/contrib +# Documentation: https://docs.linuxgsm.com # Website: https://linuxgsm.com -travistest="1" -version="180409" +# 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="v19.9.0" shortname="ts3" gameservername="ts3server" rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -servicename="${gameservername}" +servicename="${selfname}" lockselfname=".${servicename}.lock" lgsmdir="${rootdir}/lgsm" logdir="${rootdir}/log" @@ -23,14 +35,21 @@ serverfiles="${rootdir}/serverfiles" functionsdir="${lgsmdir}/functions" libdir="${lgsmdir}/lib" tmpdir="${lgsmdir}/tmp" +datadir="${lgsmdir}/data" +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 [ ! -v TRAVIS ]; then TRAVIS_BRANCH="develop" TRAVIS_BUILD_DIR="${rootdir}" +else + servicename="travis" + travistest="1" fi ## GitHub Branch Select @@ -40,16 +59,14 @@ githubuser="GameServerManagers" githubrepo="LinuxGSM" githubbranch="${TRAVIS_BRANCH}" -# Core Function that is required first +# Core function that is required first. core_functions.sh(){ functionfile="${FUNCNAME}" 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 - -# Fetches core functions +# Fetches the core functions required before passed off to core_dl.sh. fn_bootstrap_fetch_file(){ remote_fileurl="${1}" local_filedir="${2}" @@ -58,42 +75,42 @@ fn_bootstrap_fetch_file(){ run="${5:-0}" forcedl="${6:-0}" md5="${7:-0}" - # download file if missing or download forced + # Download file if missing or download forced. if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then if [ ! -d "${local_filedir}" ]; then mkdir -p "${local_filedir}" fi - # Defines curl path + # Defines curl path. curlpath=$(command -v curl 2>/dev/null) - # If curl exists download file + # If curl exists download file. if [ "$(basename "${curlpath}")" == "curl" ]; then - # trap to remove part downloaded files + # Trap to remove part downloaded files. echo -en " fetching ${local_filename}...\c" curlcmd=$(${curlpath} -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1) local exitcode=$? if [ ${exitcode} -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" + echo -e "FAIL" if [ -f "${lgsmlog}" ]; then echo -e "${remote_fileurl}" | tee -a "${lgsmlog}" - echo "${curlcmd}" | tee -a "${lgsmlog}" + echo -e "${curlcmd}" | tee -a "${lgsmlog}" fi exit 1 else - echo -e "\e[0;32mOK\e[0m" + echo -e "OK" fi else - echo "[ FAIL ] Curl is not installed" + echo -e "[ FAIL ] Curl is not installed" exit 1 fi - # make file chmodx if chmodx is set + # Make file chmodx if chmodx is set. if [ "${chmodx}" == "chmodx" ]; then chmod +x "${local_filedir}/${local_filename}" fi fi if [ -f "${local_filedir}/${local_filename}" ]; then - # run file if run is set + # Run file if run is set. if [ "${run}" == "run" ]; then source "${local_filedir}/${local_filename}" fi @@ -112,11 +129,11 @@ 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 function. fn_bootstrap_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } -# Installer menu +# Installer menu. fn_print_center() { columns="$(tput cols)" @@ -129,7 +146,7 @@ fn_print_horizontal(){ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "${char}" } -# Bash Menu +# Bash menu. fn_install_menu_bash() { local resultvar=$1 title=$2 @@ -141,9 +158,9 @@ fn_install_menu_bash() { fn_print_horizontal menu_options=() while read -r line || [[ -n "${line}" ]]; do - var=$(echo "${line}" | awk -F "," '{print $2 " - " $3}') + var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') menu_options+=( "${var}" ) - done < ${options} + done < "${options}" menu_options+=( "Cancel" ) select option in "${menu_options[@]}"; do if [ -n "${option}" ]&&[ "${option}" != "Cancel" ]; then @@ -153,7 +170,7 @@ fn_install_menu_bash() { done } -# Whiptail/Dialog Menu +# Whiptail/Dialog menu. fn_install_menu_whiptail() { local menucmd=$1 local resultvar=$2 @@ -166,9 +183,9 @@ fn_install_menu_whiptail() { IFS="," menu_options=() while read -r line; do - key=$(echo "${line}" | awk -F "," '{print $3}') - val=$(echo "${line}" | awk -F "," '{print $2}') - menu_options+=( ${val//\"} "${key//\"}" ) + 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 @@ -178,14 +195,14 @@ fn_install_menu_whiptail() { fi } -# Menu selector +# Menu selector. fn_install_menu() { local resultvar=$1 local selection="" title=$2 caption=$3 options=$4 - # Get menu command + # Get menu command. for menucmd in whiptail dialog bash; do if [ -x "$(command -v "${menucmd}")" ]; then menucmd=$(command -v "${menucmd}") @@ -201,7 +218,7 @@ fn_install_menu() { eval "$resultvar=\"${selection}\"" } -# Gets server info from serverlist.csv and puts in to array +# Gets server info from serverlist.csv and puts in to array. fn_server_info(){ IFS="," server_info_array=($(grep -aw "${userinput}" "${serverlist}")) @@ -212,14 +229,14 @@ fn_server_info(){ fn_install_getopt(){ userinput="empty" - echo "Usage: $0 [option]" + echo -e "Usage: $0 [option]" echo -e "" - echo "Installer - Linux Game Server Managers - Version ${version}" - echo "https://linuxgsm.com" + 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| e.g $0 csgoserver. Enter name of server/game 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 } @@ -236,22 +253,27 @@ fn_install_file(){ 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 "Installed ${gamename} server as ${local_filename}" - echo "" + echo -e "Installed ${gamename} server as ${local_filename}" + echo -e "" if [ ! -d "${serverfiles}" ]; then - echo "./${local_filename} install" + echo -e "./${local_filename} install" else - echo "Remember to check server ports" - echo "./${local_filename} details" + echo -e "Remember to check server ports" + echo -e "./${local_filename} details" fi - echo "" + echo -e "" exit } -# Prevent from running this script as root. +# Prevent LinuxGSM from running as root. Except if doing a dependency install. if [ "$(whoami)" == "root" ]; then - if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then - echo "[ FAIL ] Do NOT run this script as root!" + 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 @@ -259,106 +281,106 @@ if [ "$(whoami)" == "root" ]; then fi fi -# LinuxGSM installer mode +# LinuxGSM installer mode. if [ "${shortname}" == "core" ]; then - userinput=$1 - datadir="${tmpdir}/data" - serverlist="${datadir}/serverlist.csv" - # 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 "[ FAIL ] serverlist.csv could not be loaded." + echo -e "[ FAIL ] serverlist.csv could not be loaded." exit 1 fi - if [ "${userinput}" == "list" ]; then + if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then { - awk -F "," '{print $2 "\t" $3}' "${serverlist}" + tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' } | column -s $'\t' -t | more exit elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then - fn_install_menu result "LinuxGSM" "Select game to install" "${serverlist}" + 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 "Install canceled" + echo -e "Install canceled" else - echo "[ FAIL ] menu result does not match gameservername" - echo "result: ${result}" - echo "gameservername: ${gameservername}" + echo -e "[ FAIL ] menu result does not match gameservername" + echo -e "result: ${result}" + echo -e "gameservername: ${gameservername}" fi elif [ -n "${userinput}" ]; then fn_server_info if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo "[ FAIL ] unknown game server" + echo -e "[ FAIL ] unknown game server" fi else fn_install_getopt fi -# LinuxGSM Server Mode +# LinuxGSM server mode. else core_functions.sh - - # 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 "\e[0;31mFAIL\e[0m\n" - exit 1 - else - echo -e "\e[0;32mOK\e[0m" + 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 - 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." + 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 "\e[0;31mFAIL\e[0m\n" + echo -e "FAIL" exit 1 else - echo -e "\e[0;32mOK\e[0m" + 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 - fi - 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 - source "${configdirserver}/common.cfg" - fi - # Load the instance.cfg config. If missing download it - if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then - fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" - source "${configdirserver}/${servicename}.cfg" - else - source "${configdirserver}/${servicename}.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 + 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 + source "${configdirserver}/common.cfg" + fi + # Load the instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/${servicename}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${servicename}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + source "${configdirserver}/${servicename}.cfg" + else + source "${configdirserver}/${servicename}.cfg" + fi - # Prevents running of core_exit.sh for Travis. + # 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 [ -z "${travistest}" ]; then getopt=$1 core_getopt.sh @@ -386,9 +408,9 @@ fn_currentstatus_ts3(){ fn_setstatus(){ fn_currentstatus_ts3 echo"" - echo "Required status: ${requiredstatus}" + echo -e "Required status: ${requiredstatus}" counter=0 - echo "Current status: ${currentstatus}" + echo -e "Current status: ${currentstatus}" while [ "${requiredstatus}" != "${currentstatus}" ]; do counter=$((counter+1)) fn_currentstatus_ts3 @@ -401,17 +423,16 @@ fn_setstatus(){ fi if [ "${counter}" -gt "5" ]; then currentstatus="FAIL" - echo "Current status: ${currentstatus}" - echo "" - echo "Unable to start or stop server." + 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 "Test starting:" - echo "" - sleep 0.5 + echo -e "Test starting:" + echo -e "" } # End of every test will expect the result to either pass or fail @@ -419,88 +440,88 @@ fn_setstatus(){ # if expecting a pass fn_test_result_pass(){ if [ $? != 0 ]; then - echo "=================================" - echo "Expected result: PASS" - echo "Actual result: FAIL" + 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 "=================================" - echo "Expected result: PASS" - echo "Actual result: PASS" + echo -e "=================================" + echo -e "Expected result: PASS" + echo -e "Actual result: PASS" fn_print_ok_nl "TEST PASSED" - echo "" + echo -e "" fi } # if expecting a fail fn_test_result_fail(){ if [ $? == 0 ]; then - echo "=================================" - echo "Expected result: FAIL" - echo "Actual result: PASS" + 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 "=================================" - echo "Expected result: FAIL" - echo "Actual result: FAIL" + echo -e "=================================" + echo -e "Expected result: FAIL" + echo -e "Actual result: FAIL" fn_print_ok_nl "TEST PASSED" - echo "" + echo -e "" fi } # test result n/a fn_test_result_na(){ - echo "=================================" - echo "Expected result: N/A" - echo "Actual result: N/A" + echo -e "=================================" + echo -e "Expected result: N/A" + echo -e "Actual result: N/A" fn_print_fail_nl "TEST N/A" } -echo "=================================" -echo "Travis CI Tests" -echo "Linux Game Server Manager" -echo "by Daniel Gibbs" -echo "Contributors: http://goo.gl/qLmitD" -echo "https://linuxgsm.com" -echo "=================================" -echo "" -echo "=================================" -echo "Server Tests" -echo "Using: ${gamename}" -echo "Testing Branch: $TRAVIS_BRANCH" -echo "=================================" - -echo "" -echo "0.0 - Pre-test Tasks" -echo "==================================================================" -echo "Description:" -echo "Create log dir's" -echo "" - -echo "" -echo "0.1 - Create log dir's" -echo "=================================" -echo "" +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 "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 "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "0.2 - Enable dev-debug" -echo "=================================" -echo "Description:" -echo "Enable dev-debug" -echo "" +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" @@ -508,21 +529,21 @@ echo "" command_dev_debug.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "1.0 - Pre-install tests" -echo "==================================================================" -echo "" - -echo "1.1 - start - no files" -echo "=================================" -echo "Description:" -echo "test script reaction to missing server files." -echo "Command: ./${gameservername} start" -echo "" +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 [ ! -v TRAVIS ]; then ( @@ -533,20 +554,20 @@ if [ ! -v TRAVIS ]; then ) fn_test_result_fail else - echo "Test bypassed" + echo -e "Test bypassed" fi -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "1.2 - getopt" -echo "=================================" -echo "Description:" -echo "displaying options messages." -echo "Command: ./${gameservername}" -echo "" +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" @@ -554,17 +575,17 @@ echo "" core_getopt.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "1.3 - getopt with incorrect args" -echo "=================================" -echo "Description:" -echo "displaying options messages." -echo "Command: ./${gameservername} abc123" -echo "" +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" @@ -573,20 +594,20 @@ getopt="abc123" core_getopt.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "2.0 - Installation" -echo "==================================================================" +echo -e "" +echo -e "2.0 - Installation" +echo -e "==================================================================" -echo "" -echo "2.0 - install" -echo "=================================" -echo "Description:" -echo "install ${gamename} server." -echo "Command: ./${gameservername} auto-install" +echo -e "" +echo -e "2.0 - 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" @@ -594,20 +615,20 @@ echo "Command: ./${gameservername} auto-install" fn_autoinstall ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.0 - Start/Stop/Restart Tests" -echo "==================================================================" +echo -e "" +echo -e "3.0 - Start/Stop/Restart Tests" +echo -e "==================================================================" -echo "" -echo "3.1 - start" -echo "=================================" -echo "Description:" -echo "start ${gamename} server." -echo "Command: ./${gameservername} start" +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 ( @@ -617,16 +638,16 @@ fn_setstatus command_start.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.2 - start - online" -echo "=================================" -echo "Description:" -echo "start ${gamename} server while already running." -echo "Command: ./${gameservername} start" +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 ( @@ -636,16 +657,16 @@ fn_setstatus command_start.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.3 - start - updateonstart" -echo "=================================" -echo "Description:" -echo "will update server on start." -echo "Command: ./${gameservername} start" +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 ( @@ -655,16 +676,16 @@ fn_setstatus updateonstart="on";command_start.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.4 - stop" -echo "=================================" -echo "Description:" -echo "stop ${gamename} server." -echo "Command: ./${gameservername} stop" +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 ( @@ -674,16 +695,16 @@ fn_setstatus command_stop.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.5 - stop - offline" -echo "=================================" -echo "Description:" -echo "stop ${gamename} server while already stopped." -echo "Command: ./${gameservername} stop" +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 ( @@ -693,16 +714,16 @@ fn_setstatus command_stop.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.6 - restart" -echo "=================================" -echo "Description:" -echo "restart ${gamename}." -echo "Command: ./${gameservername} restart" +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 ( @@ -712,16 +733,16 @@ fn_setstatus command_restart.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "3.7 - restart - offline" -echo "=================================" -echo "Description:" -echo "restart ${gamename} while already stopped." -echo "Command: ./${gameservername} restart" +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 ( @@ -731,20 +752,20 @@ fn_setstatus command_restart.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "4.0 - Update Tests" -echo "==================================================================" +echo -e "" +echo -e "4.0 - Update Tests" +echo -e "==================================================================" -echo "" -echo "4.1 - update" -echo "=================================" -echo "Description:" -echo "check for updates." -echo "Command: ./${gameservername} update" +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 ( @@ -754,24 +775,23 @@ fn_setstatus command_update.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "5.0 - Monitor Tests" -echo "==================================================================" - -echo "" -echo "Server IP - Port: ${ip}:${port}" -echo "Server IP - Query Port: ${ip}:${queryport}" - -echo "" -echo "5.1 - monitor - online" -echo "=================================" -echo "Description:" -echo "run monitor server while already running." -echo "Command: ./${gameservername} monitor" +echo -e "" +echo -e "5.0 - Monitor Tests" +echo -e "==================================================================" +echo -e "" +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 ( @@ -781,20 +801,20 @@ fn_setstatus command_monitor.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "5.2 - monitor - offline - with lockfile" -echo "=================================" -echo "Description:" -echo "run monitor while server is offline with lockfile." -echo "Command: ./${gameservername} monitor" +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 > "${rootdir}/${lockselfname}" +date '+%s' > "${rootdir}/${lockselfname}" ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" @@ -802,16 +822,16 @@ date > "${rootdir}/${lockselfname}" command_monitor.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "5.3 - monitor - offline - no lockfile" -echo "=================================" -echo "Description:" -echo "run monitor while server is offline with no lockfile." -echo "Command: ./${gameservername} monitor" +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 ( @@ -821,16 +841,16 @@ fn_setstatus command_monitor.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "5.4 - test-alert" -echo "=================================" -echo "Description:" -echo "run monitor while server is offline with no lockfile." -echo "Command: ./${gameservername} test-alert" +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 ( @@ -840,20 +860,20 @@ fn_setstatus command_test_alert.sh ) fn_test_result_fail -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "6.0 - Details Tests" -echo "==================================================================" +echo -e "" +echo -e "6.0 - Details Tests" +echo -e "==================================================================" -echo "" -echo "6.1 - details" -echo "=================================" -echo "Description:" -echo "display details." -echo "Command: ./${gameservername} details" +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 ( @@ -863,16 +883,16 @@ fn_setstatus command_details.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "6.2 - postdetails" -echo "=================================" -echo "Description:" -echo "post details." -echo "Command: ./${gameservername} postdetails" +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 ( @@ -882,39 +902,39 @@ fn_setstatus command_postdetails.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "7.0 - Backup Tests" -echo "==================================================================" +echo -e "" +echo -e "7.0 - Backup Tests" +echo -e "==================================================================" -echo "" -echo "7.1 - backup" -echo "=================================" -echo "Description:" -echo "run a backup." -echo "Command: ./${gameservername} backup" +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 "test de-activated until issue #1839 fixed" +echo -e "test de-activated until issue #1839 fixed" #(command_backup.sh) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "8.0 - Development Tools Tests" -echo "==================================================================" +echo -e "" +echo -e "8.0 - Development Tools Tests" +echo -e "==================================================================" -echo "" -echo "8.1 - dev - detect glibc" -echo "=================================" -echo "Description:" -echo "detect glibc." -echo "Command: ./${gameservername} detect-glibc" +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 ( @@ -924,16 +944,16 @@ fn_setstatus command_dev_detect_glibc.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "8.2 - dev - detect ldd" -echo "=================================" -echo "Description:" -echo "detect ldd." -echo "Command: ./${gameservername} detect-ldd" +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 ( @@ -943,16 +963,16 @@ fn_setstatus command_dev_detect_ldd.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "8.3 - dev - detect deps" -echo "=================================" -echo "Description:" -echo "detect dependencies." -echo "Command: ./${gameservername} detect-deps" +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 ( @@ -962,16 +982,16 @@ fn_setstatus command_dev_detect_deps.sh ) fn_test_result_pass -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "8.4 - dev - query-raw" -echo "=================================" -echo "Description:" -echo "raw query output." -echo "Command: ./${gameservername} query-raw" +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 ( @@ -981,15 +1001,15 @@ fn_setstatus command_dev_query_raw.sh ) fn_test_result_na -echo "run order" -echo "=================" +echo -e "run order" +echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "" -echo "=================================" -echo "Server Tests - Complete!" -echo "Using: ${gamename}" -echo "=================================" +echo -e "" +echo -e "=================================" +echo -e "Server Tests - Complete!" +echo -e "Using: ${gamename}" +echo -e "=================================" requiredstatus="OFFLINE" fn_setstatus fn_print_info "Tidying up directories."