diff --git a/.github/workflows/git-sync.yml b/.github/workflows/git-sync.yml index a5a827096..4467acde2 100644 --- a/.github/workflows/git-sync.yml +++ b/.github/workflows/git-sync.yml @@ -12,12 +12,12 @@ jobs: runs-on: ubuntu-latest steps: - name: webfactory/ssh-agent - uses: webfactory/ssh-agent@v0.4.1 + uses: webfactory/ssh-agent@v0.5.3 with: ssh-private-key: ${{ secrets.BITBUCKET_SECRET }} - name: repo-sync - uses: wei/git-sync@v2.1.0 + uses: wei/git-sync@v3.0.0 with: ssh_private_key: ${{ secrets.BITBUCKET_SECRET }} source_repo: "https://github.com/GameServerManagers/LinuxGSM" diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 248598e23..316f08b98 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,9 +1,9 @@ name: "Set Issue Label and Assignee" on: issues: - types: [opened] + types: [opened, edited] pull_request: - typed: [opened] + types: [opened, edited] jobs: test: @@ -12,5 +12,5 @@ jobs: - uses: Naturalclar/issue-action@v2.0.2 with: title-or-body: "both" - parameters: '[ {"keywords": ["backup"], "labels": ["command: backup"]}, {"keywords": ["console"], "labels": ["command: console"]}, {"keywords": ["command: debug"], "labels": ["command: debug"]}, {"keywords": ["command: details"], "labels": ["command: details"]}, {"keywords": ["fast-dl"], "labels": ["command: fast-dl"]}, {"keywords": ["command: install"], "labels": ["command: install"]}, {"keywords": ["command: mods"], "labels": ["command: mods"]}, {"keywords": ["monitor"], "labels": ["command: monitor"]}, {"keywords": ["command: start"], "labels": ["command: start"]}, {"keywords": ["command: stop"], "labels": ["command: stop"]}, {"keywords": ["command: update-lgsm"], "labels": ["command: update-lgsm"]}, {"keywords": ["update"], "labels": ["command: update"]}, {"keywords": ["validate"], "labels": ["command: validate"]}, {"keywords": ["wipe"], "labels": ["command: wipe"]}, {"keywords": ["CentOS"], "labels": ["distro: CentOS"]}, {"keywords": ["Debian"], "labels": ["distro: Debian"]}, {"keywords": ["Fedora"], "labels": ["distro: Fedora"]}, {"keywords": ["Ubuntu"], "labels": ["distro: Ubuntu"]} ]' + parameters: '[ {"keywords": ["Server Request"], "labels": ["type: game server request"]}, {"keywords": ["backup"], "labels": ["command: backup"]}, {"keywords": ["console"], "labels": ["command: console"]}, {"keywords": ["command: debug"], "labels": ["command: debug"]}, {"keywords": ["command: details"], "labels": ["command: details"]}, {"keywords": ["fast-dl"], "labels": ["command: fast-dl"]}, {"keywords": ["command: install"], "labels": ["command: install"]}, {"keywords": ["command: mods"], "labels": ["command: mods"]}, {"keywords": ["monitor"], "labels": ["command: monitor"]}, {"keywords": ["command: start"], "labels": ["command: start"]}, {"keywords": ["command: stop"], "labels": ["command: stop"]}, {"keywords": ["command: update-lgsm"], "labels": ["command: update-lgsm"]}, {"keywords": ["update"], "labels": ["command: update"]}, {"keywords": ["validate"], "labels": ["command: validate"]}, {"keywords": ["wipe"], "labels": ["command: wipe"]}, {"keywords": ["CentOS"], "labels": ["distro: CentOS"]}, {"keywords": ["Debian"], "labels": ["distro: Debian"]}, {"keywords": ["Fedora"], "labels": ["distro: Fedora"]}, {"keywords": ["Ubuntu"], "labels": ["distro: Ubuntu"]}, {"keywords": ["alert"], "labels": ["info: alerts"]}, {"keywords": ["dependency"], "labels": ["info: dependency"]}, {"keywords": ["docker"], "labels": ["info: docker"]}, {"keywords": ["steamcmd"], "labels": ["info: steamcmd"]}, {"keywords": ["systemd"], "labels": ["info: systemd"]}, {"keywords": ["tmux"], "labels": ["info: tmux"]}, {"keywords": ["bug"], "labels": ["type: bug"]}, {"keywords": ["feature"], "labels": ["type: feature request"]}, {"keywords": ["refactor"], "labels": ["type: refactor"]}, {"keywords": ["Ark"], "labels": ["game: Ark: Survival Evolved"]}, {"keywords": ["Arma 3"], "labels": ["game: Arma 3"]}, {"keywords": ["Counter-Strike: Global Offensive"], "labels": ["game: Counter-Strike: Global Offensive"]}, {"keywords": ["Minecraft"], "labels": ["game: Minecraft"]}, {"keywords": ["Rust"], "labels": ["game: Rust"]}, {"keywords": ["Valheim"], "labels": ["game: Valheim"]}, {"keywords": ["7 Days to Die"], "labels": ["game: 7 Days to Die"]}]' github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 63f0cf2db..bef7c74c6 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -8,7 +8,7 @@ jobs: lock: runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@v2 + - uses: dessant/lock-threads@v2.0.3 with: github-token: ${{ secrets.GITHUB_TOKEN }} issue-lock-comment: > diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bcb1caf7f..4a114d2fc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,8 +48,7 @@ Before creating bug reports, please check [this list](https://github.com/GameSer #### Before Submitting A Bug Report * **Check the [documentation](https://docs.linuxgsm.com).** You might be able to find the cause of the problem and fix things yourself. -* **Check that the problem is not related to** [**support page**](https://linuxgsm/com/support) for links to other support options. -* **Check the** [**support page**](https://linuxgsm/com/support) for links to other support options. +* **Check the** [**support page**](https://linuxgsm.com/support) for links to other support options. * **Perform a** [**cursory search**](https://github.com/search?q=org:GameServerManagers%20type:issues&type=Issues) to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue and give it a thumbs up instead of opening a new one. #### How Do I Submit A (Good) Bug Report? diff --git a/LICENSE b/LICENSE index 6fa6c795f..bda7cb6ee 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2012-2020 Daniel Gibbs +Copyright (c) 2012-2021 Daniel Gibbs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 6f6f41c6f..baed33db1 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ 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://app.codacy.com/project/badge/Grade/d19c5234dc3743d8a8a14093711ca52d)](https://www.codacy.com/gh/GameServerManagers/LinuxGSM/dashboard?utm_source=github.com&utm_medium=referral&utm_content=GameServerManagers/LinuxGSM&utm_campaign=Badge_Grade) [![Backup Repo](https://github.com/GameServerManagers/LinuxGSM/workflows/Backup%20Repo/badge.svg)](https://bitbucket.org/GameServerManagers/linuxgsm) [![Discord](https://discordapp.com/api/guilds/127498813903601664/widget.png?style=shield)](https://linuxgsm.com/discord) [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/GameServerManagers/LinuxGSM/blob/master/LICENSE) [![made-with-bash](https://img.shields.io/badge/-Made%20with%20Bash-1f425f.svg?logo=image%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw%2FeHBhY2tldCBiZWdpbj0i77u%2FIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8%2BIDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkE3MDg2QTAyQUZCMzExRTVBMkQxRDMzMkJDMUQ4RDk3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkE3MDg2QTAzQUZCMzExRTVBMkQxRDMzMkJDMUQ4RDk3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTcwODZBMDBBRkIzMTFFNUEyRDFEMzMyQkMxRDhEOTciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTcwODZBMDFBRkIzMTFFNUEyRDFEMzMyQkMxRDhEOTciLz4gPC9yZGY6RGVzY3JpcHRpb24%2BIDwvcmRmOlJERj4gPC94OnhtcG1ldGE%2BIDw%2FeHBhY2tldCBlbmQ9InIiPz6lm45hAAADkklEQVR42qyVa0yTVxzGn7d9Wy03MS2ii8s%2BeokYNQSVhCzOjXZOFNF4jx%2BMRmPUMEUEqVG36jo2thizLSQSMd4N8ZoQ8RKjJtooaCpK6ZoCtRXKpRempbTv5ey83bhkAUphz8fznvP8znn%2B%2F3NeEEJgNBoRRSmz0ub%2FfuxEacBg%2FDmYtiCjgo5NG2mBXq%2BH5I1ogMRk9Zbd%2BQU2e1ML6VPLOyf5tvBQ8yT1lG10imxsABm7SLs898GTpyYynEzP60hO3trHDKvMigUwdeaceacqzp7nOI4n0SSIIjl36ao4Z356OV07fSQAk6xJ3XGg%2BLCr1d1OYlVHp4eUHPnerU79ZA%2F1kuv1JQMAg%2BE4O2P23EumF3VkvHprsZKMzKwbRUXFEyTvSIEmTVbrysp%2BWr8wfQHGK6WChVa3bKUmdWou%2BjpArdGkzZ41c1zG%2Fu5uGH4swzd561F%2BuhIT4%2BLnSuPsv9%2BJKIpjNr9dXYOyk7%2FBZrcjIT4eCnoKgedJP4BEqhG77E3NKP31FO7cfQA5K0dSYuLgz2TwCWJSOBzG6crzKK%2BohNfni%2Bx6OMUMMNe%2Fgf7ocbw0v0acKg6J8Ql0q%2BT%2FAXR5PNi5dz9c71upuQqCKFAD%2BYhrZLEAmpodaHO3Qy6TI3NhBpbrshGtOWKOSMYwYGQM8nJzoFJNxP2HjyIQho4PewK6hBktoDcUwtIln4PjOWzflQ%2Be5yl0yCCYgYikTclGlxadio%2BBQCSiW1UXoVGrKYwH4RgMrjU1HAB4vR6LzWYfFUCKxfS8Ftk5qxHoCUQAUkRJaSEokkV6Y%2F%2BJUOC4hn6A39NVXVBYeNP8piH6HeA4fPbpdBQV5KOx0QaL1YppX3Jgk0TwH2Vg6S3u%2BdB91%2B%2FpuNYPYFl5uP5V7ZqvsrX7jxqMXR6ff3gCQSTzFI0a1TX3wIs8ul%2Bq4HuWAAiM39vhOuR1O1fQ2gT%2F26Z8Z5vrl2OHi9OXZn995nLV9aFfS6UC9JeJPfuK0NBohWpCHMSAAsFe74WWP%2BvT25wtP9Bpob6uGqqyDnOtaeumjRu%2ByFu36VntK%2FPA5umTJeUtPWZSU9BCgud661odVp3DZtkc7AnYR33RRC708PrVi1larW7XwZIjLnd7R6SgSqWSNjU1B3F72pz5TZbXmX5vV81Yb7Lg7XT%2FUXriu8XLVqw6c6XqWnBKiiYU%2BMt3wWF7u7i91XlSEITwSAZ%2FCzAAHsJVbwXYFFEAAAAASUVORK5CYII%3D)](https://www.gnu.org/software/bash/) +[![LinuxGSM](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) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/d19c5234dc3743d8a8a14093711ca52d)](https://www.codacy.com/gh/GameServerManagers/LinuxGSM/dashboard?utm_source=github.com&utm_medium=referral&utm_content=GameServerManagers/LinuxGSM&utm_campaign=Badge_Grade) [![Backup Repo](https://github.com/GameServerManagers/LinuxGSM/workflows/Backup%20Repo/badge.svg)](https://bitbucket.org/GameServerManagers/linuxgsm) [![Discord](https://discordapp.com/api/guilds/127498813903601664/widget.png?style=shield)](https://linuxgsm.com/discord) [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/GameServerManagers/LinuxGSM/blob/master/LICENSE) [![made-with-bash](https://img.shields.io/badge/-Made%20with%20Bash-1f425f.svg?logo=image%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw%2FeHBhY2tldCBiZWdpbj0i77u%2FIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8%2BIDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkE3MDg2QTAyQUZCMzExRTVBMkQxRDMzMkJDMUQ4RDk3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkE3MDg2QTAzQUZCMzExRTVBMkQxRDMzMkJDMUQ4RDk3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTcwODZBMDBBRkIzMTFFNUEyRDFEMzMyQkMxRDhEOTciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTcwODZBMDFBRkIzMTFFNUEyRDFEMzMyQkMxRDhEOTciLz4gPC9yZGY6RGVzY3JpcHRpb24%2BIDwvcmRmOlJERj4gPC94OnhtcG1ldGE%2BIDw%2FeHBhY2tldCBlbmQ9InIiPz6lm45hAAADkklEQVR42qyVa0yTVxzGn7d9Wy03MS2ii8s%2BeokYNQSVhCzOjXZOFNF4jx%2BMRmPUMEUEqVG36jo2thizLSQSMd4N8ZoQ8RKjJtooaCpK6ZoCtRXKpRempbTv5ey83bhkAUphz8fznvP8znn%2B%2F3NeEEJgNBoRRSmz0ub%2FfuxEacBg%2FDmYtiCjgo5NG2mBXq%2BH5I1ogMRk9Zbd%2BQU2e1ML6VPLOyf5tvBQ8yT1lG10imxsABm7SLs898GTpyYynEzP60hO3trHDKvMigUwdeaceacqzp7nOI4n0SSIIjl36ao4Z356OV07fSQAk6xJ3XGg%2BLCr1d1OYlVHp4eUHPnerU79ZA%2F1kuv1JQMAg%2BE4O2P23EumF3VkvHprsZKMzKwbRUXFEyTvSIEmTVbrysp%2BWr8wfQHGK6WChVa3bKUmdWou%2BjpArdGkzZ41c1zG%2Fu5uGH4swzd561F%2BuhIT4%2BLnSuPsv9%2BJKIpjNr9dXYOyk7%2FBZrcjIT4eCnoKgedJP4BEqhG77E3NKP31FO7cfQA5K0dSYuLgz2TwCWJSOBzG6crzKK%2BohNfni%2Bx6OMUMMNe%2Fgf7ocbw0v0acKg6J8Ql0q%2BT%2FAXR5PNi5dz9c71upuQqCKFAD%2BYhrZLEAmpodaHO3Qy6TI3NhBpbrshGtOWKOSMYwYGQM8nJzoFJNxP2HjyIQho4PewK6hBktoDcUwtIln4PjOWzflQ%2Be5yl0yCCYgYikTclGlxadio%2BBQCSiW1UXoVGrKYwH4RgMrjU1HAB4vR6LzWYfFUCKxfS8Ftk5qxHoCUQAUkRJaSEokkV6Y%2F%2BJUOC4hn6A39NVXVBYeNP8piH6HeA4fPbpdBQV5KOx0QaL1YppX3Jgk0TwH2Vg6S3u%2BdB91%2B%2FpuNYPYFl5uP5V7ZqvsrX7jxqMXR6ff3gCQSTzFI0a1TX3wIs8ul%2Bq4HuWAAiM39vhOuR1O1fQ2gT%2F26Z8Z5vrl2OHi9OXZn995nLV9aFfS6UC9JeJPfuK0NBohWpCHMSAAsFe74WWP%2BvT25wtP9Bpob6uGqqyDnOtaeumjRu%2ByFu36VntK%2FPA5umTJeUtPWZSU9BCgud661odVp3DZtkc7AnYR33RRC708PrVi1larW7XwZIjLnd7R6SgSqWSNjU1B3F72pz5TZbXmX5vV81Yb7Lg7XT%2FUXriu8XLVqw6c6XqWnBKiiYU%2BMt3wWF7u7i91XlSEITwSAZ%2FCzAAHsJVbwXYFFEAAAAASUVORK5CYII%3D)](https://www.gnu.org/software/bash/) [LinuxGSM](https://linuxgsm.com) is the command-line tool for quick, simple deployment and management of Linux dedicated game servers. @@ -45,9 +45,9 @@ Documentation is found at [linuxgsm.com](https://linuxgsm.com) and [docs.linuxgs There are a various ways to get support, check out the [support](https://linuxgsm.com/support/) page to the right support. -## :heart: Donate +## :heart: Sponsor -If you would like to [donate](https://linuxgsm.com/donate) to the project there are several ways you can, via [GitHub Sponsors](https://github.com/sponsors/dgibbs64) and [PayPal](https://www.paypal.me/dgibbs64). I would like to thank everyone who has previously sent a donation. Since 2012 LinuxGSM has been steadily growing with new servers, features and improvements added regularly. +If you would like to [sponsor](https://linuxgsm.com/sponsor) to the project there are several ways you can, via [GitHub Sponsors](https://github.com/sponsors/dgibbs64) and [PayPal](https://www.paypal.me/dgibbs64). I would like to thank everyone who has previously sent a donation. Since 2012 LinuxGSM has been steadily growing with new servers, features and improvements added regularly. ## Contributors diff --git a/lgsm/config-default/config-lgsm/acserver/_default.cfg b/lgsm/config-default/config-lgsm/acserver/_default.cfg index 728671a7a..6dbcf68e6 100644 --- a/lgsm/config-default/config-lgsm/acserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/acserver/_default.cfg @@ -139,7 +139,7 @@ stopmode="2" # 4: gsquery # 5: tcp querymode="5" -querytype="" +querytype="assettocorsa" ## Console type consoleverbose="yes" diff --git a/lgsm/config-default/config-lgsm/arma3server/_default.cfg b/lgsm/config-default/config-lgsm/arma3server/_default.cfg index d7da37cf1..7b338811a 100644 --- a/lgsm/config-default/config-lgsm/arma3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/arma3server/_default.cfg @@ -166,7 +166,7 @@ consoleinteract="no" # Do not edit gamename="ARMA 3" engine="realvirtuality" -glibc="2.13" +glibc="2.27" #### Directories #### # Edit with care diff --git a/lgsm/config-default/config-lgsm/avserver/_default.cfg b/lgsm/config-default/config-lgsm/avserver/_default.cfg index 17d670d0f..2eef21849 100644 --- a/lgsm/config-default/config-lgsm/avserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/avserver/_default.cfg @@ -9,7 +9,7 @@ #### Game Server Settings #### ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters -port="27000" + # https://steamidfinder.com adminsteamid="" if [ -n "${adminsteamid}" ]; then @@ -160,8 +160,8 @@ glibc="2.15" avdatapath="${serverfiles}/galaxy" avgalaxypath="${avdatapath}/${selfname}" systemdir="${serverfiles}" -executabledir="${systemdir}" -executable="./server.sh" +executabledir="${systemdir}/bin" +executable="./bin/AvorionServer" servercfgdir="${avgalaxypath}" servercfg="server.ini" servercfgdefault="server.ini" diff --git a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg index 28f3082b3..564ac84a3 100644 --- a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg @@ -26,6 +26,7 @@ ip="0.0.0.0" port="27015" clientport="27005" sourcetvport="27020" +steamport="26901" defaultmap="de_mirage" maxplayers="16" tickrate="64" diff --git a/lgsm/config-default/config-lgsm/inssserver/_default.cfg b/lgsm/config-default/config-lgsm/inssserver/_default.cfg index e9895b132..1dbc0889f 100644 --- a/lgsm/config-default/config-lgsm/inssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/inssserver/_default.cfg @@ -12,6 +12,8 @@ ip="0.0.0.0" port="27102" queryport="27131" +rconport="27015" +rconpassword="" servername="LinuxGSM Server" defaultmap="Canyon" defaultscenario="Scenario_Crossing_Push_Security" @@ -19,7 +21,7 @@ maxplayers="28" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters ## Parameter Docs | https://sandstorm-support.newworldinteractive.com/hc/en-us/articles/360049211072-Server-Admin-Guide -startparameters="${defaultmap}?Scenario=${defaultscenario}?MaxPlayers=${maxplayers} -Port=${port} -QueryPort=${queryport} -hostname='${servername}' -log" +startparameters="${defaultmap}?Scenario=${defaultscenario}?MaxPlayers=${maxplayers} -Port=${port} -QueryPort=${queryport} -hostname='${servername}' -Rcon -RconPassword=${rconpassword} -RconListenPort=${rconport} -log" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/loserver/_default.cfg b/lgsm/config-default/config-lgsm/loserver/_default.cfg new file mode 100644 index 000000000..313e50a49 --- /dev/null +++ b/lgsm/config-default/config-lgsm/loserver/_default.cfg @@ -0,0 +1,188 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login +steamuser="username" +steampass='password' + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +servername="LinuxGSM" +ip="0.0.0.0" +port="7777" +queryport="27015" +customerkey="" +providerkey="" +slots="100" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-log -force_steamclient_link -messaging -NoLiveServer -EnableCheats -backendapiurloverride='backend.last-oasis.com' -identifier=${servername} -port=${port} -CustomerKey=${customerkey} -ProviderKey=${providerkey} -slots=${slots} -QueryPort=${queryport} -OverrideConnectionAddress=${ip}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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" +mailgunapiregion="us" +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" +pushoveruserkey="userkey" + +# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat +rocketchatalert="off" +rocketchatwebhook="webhook" +rocketchattoken="" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help". +telegramapi="api.telegram.org" +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="920720" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Last Oasis" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/Mist" +executabledir="${systemdir}/Binaries/Linux" +executable="./MistServer-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}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" \ No newline at end of file diff --git a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg index abad7f61c..d5ad3b59f 100644 --- a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg @@ -122,7 +122,7 @@ stopmode="5" # 3: gamedig # 4: gsquery # 5: tcp -querymode="4" +querymode="2" querytype="minecraftbe" ## Console type diff --git a/lgsm/config-default/config-lgsm/mhserver/_default.cfg b/lgsm/config-default/config-lgsm/mhserver/_default.cfg index bb4847c00..fd8b8b1d0 100644 --- a/lgsm/config-default/config-lgsm/mhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mhserver/_default.cfg @@ -17,7 +17,7 @@ queryport="27015" defaultmap="FFA_ThePit" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="Mordhau ${defaultmap} -log -MultiHome=${ip} -Port=${port} -BeaconPort=${beaconport} -QueryPort=${queryport}" +startparameters="Mordhau ${defaultmap} -log -MultiHome=${ip} -Port=${port} -BeaconPort=${beaconport} -QueryPort=${queryport} -GameIni=${servercfgfullpath}" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg index 3fa9a8864..ed65d0f2f 100644 --- a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg @@ -139,7 +139,7 @@ stopmode="2" # 3: gamedig # 4: gsquery # 5: tcp -querymode="1" +querymode="5" querytype="" ## Console type diff --git a/lgsm/config-default/config-lgsm/rustserver/_default.cfg b/lgsm/config-default/config-lgsm/rustserver/_default.cfg index 424cafabf..c956b492c 100644 --- a/lgsm/config-default/config-lgsm/rustserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rustserver/_default.cfg @@ -16,16 +16,18 @@ appport=28082 rconpassword="CHANGE_ME" rconweb="1" # Value is: 1 for the Facepunch web panel, Rustadmin desktop and Rustadmin Online; 0 for RCON tools like Rusty. servername="Rust" -gamemode="vanilla" # values: vanilla, softcore ( Doc: https://wiki.facepunch.com/rust/server-gamemodes ) -maxplayers="50" +gamemode="vanilla" # Values: vanilla, softcore ( Doc: https://wiki.facepunch.com/rust/server-gamemodes ) +serverlevel="Procedural Map" # Values: Procedural Map, Barren, HapisIsland, SavasIsland +customlevelurl="" # Custom level url. +server.levelurl \"${customlevelurl}\" seed="" # range: 1-2147483647, used to reproduce a procedural map. salt="" # range: unknown, used to recover a known setting from an existing map. +maxplayers="50" worldsize="3000" # default: 3000, range: 1000-6000, map size in meters. saveinterval="300" # Auto-save in seconds. tickrate="30" # default: 30, range: 15-100. ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="-batchmode +app.listenip ${ip} +app.port ${appport} +server.ip ${ip} +server.port ${port} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${selfname}\" +server.gamemode ${gamemode} +server.seed ${seed} +server.salt ${salt} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.web ${rconweb} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile" +startparameters="-batchmode +app.listenip ${ip} +app.port ${appport} +server.ip ${ip} +server.port ${port} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${selfname}\" +server.gamemode ${gamemode} +server.level \"${serverlevel}\" +server.seed ${seed} +server.salt ${salt} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.web ${rconweb} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile" #### LinuxGSM Settings #### @@ -108,7 +110,7 @@ logdays="7" ## Monitor | https://docs.linuxgsm.com/commands/monitor # Query delay time -querydelay="5" +querydelay="10" ## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors ansi="on" diff --git a/lgsm/config-default/config-lgsm/rwserver/_default.cfg b/lgsm/config-default/config-lgsm/rwserver/_default.cfg index 3ff7bc137..0ff3726ba 100644 --- a/lgsm/config-default/config-lgsm/rwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rwserver/_default.cfg @@ -135,8 +135,8 @@ stopmode="3" # 3: gamedig # 4: gsquery # 5: tcp -querymode="1" -querytype="" +querymode="2" +querytype="protocol-valve" ## Console type consoleverbose="yes" diff --git a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg index d8ca86974..7c985a636 100644 --- a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg @@ -146,7 +146,7 @@ consoleinteract="no" # Do not edit gamename="7 Days To Die" engine="unity3d" -glibc="2.15" +glibc="2.27" #### Directories #### # Edit with care diff --git a/lgsm/config-default/config-lgsm/ts3server/_default.cfg b/lgsm/config-default/config-lgsm/ts3server/_default.cfg index 3bfaf5d10..694b0501f 100644 --- a/lgsm/config-default/config-lgsm/ts3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ts3server/_default.cfg @@ -123,7 +123,7 @@ stopmode="2" # 4: gsquery # 5: tcp querymode="5" -querytype="" +querytype="teamspeak3" ## Console type consoleverbose="yes" diff --git a/lgsm/data/bo_header.jpg b/lgsm/data/bo_header.jpg new file mode 100644 index 000000000..d63ee5c3d Binary files /dev/null and b/lgsm/data/bo_header.jpg differ diff --git a/lgsm/data/rust_header.jpg b/lgsm/data/rust_header.jpg new file mode 100644 index 000000000..e4006b070 Binary files /dev/null and b/lgsm/data/rust_header.jpg differ diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 687a3f63d..524826a33 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -51,6 +51,7 @@ jc3,jc3server,Just Cause 3 jk2,jk2server,Jedi Knight II: Jedi Outcast kf,kfserver,Killing Floor kf2,kf2server,Killing Floor 2 +lo,loserver,Last Oasis l4d,l4dserver,Left 4 Dead l4d2,l4d2server,Left 4 Dead 2 mc,mcserver,Minecraft @@ -107,8 +108,8 @@ ut2k4,ut2k4server,Unreal Tournament 2004 ut3,ut3server,Unreal Tournament 3 ut99,ut99server,Unreal Tournament 99 vh,vhserver,Valheim -vs,vsserver,Vampire Slayer vints,vintsserver,Vintage Story +vs,vsserver,Vampire Slayer wet,wetserver,Wolfenstein: Enemy Territory wf,wfserver,Warfork wmc,wmcserver,WaterfallMC diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index 5fd999728..782c6e9a4 100755 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -11,7 +11,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Used with email alerts. fn_alert_log(){ info_distro.sh - info_config.sh + info_game.sh info_messages.sh if [ -f "${alertlog}" ]; then rm -f "${alertlog:?}" diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 94e48e672..722a0a4da 100755 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -350,7 +350,7 @@ fn_deps_build_debian(){ if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${shortname}" != "mc" ]&&[ "${shortname}" != "pmc" ]&&[ "${shortname}" != "wmc" ]&&[ "${engine}" != "renderware" ]; then if [ "${arch}" == "x86_64" ]; then # lib32gcc1 is now called lib32gcc-s1 in debian 11 - if { [ "${distroid}" == "debian" ]&&[ "${distroversion}" == "11" ]; }|| { [ "${distroid}" == "ubuntu" ]&&[ "${distroversion}" == "20.10" ]; } ||{ [ "${distroid}" == "pop" ]&&[ "${distroversion}" == "20.10" ]; }; then + if { [ "${distroid}" == "debian" ]&&[ "${distroversion}" == "11" ]; }||{ [ "${distroid}" == "ubuntu" ]&&[ "${distroversion}" == "20.10" ]; }||{ [ "${distroid}" == "pop" ]&&[ "${distroversion}" == "20.10" ]; }; then array_deps_required+=( lib32gcc-s1 lib32stdc++6 ) else array_deps_required+=( lib32gcc1 lib32stdc++6 ) @@ -414,8 +414,20 @@ fn_deps_build_debian(){ # Hurtword/Rust elif [ "${shortname}" == "hw" ]||[ "${shortname}" == "rust" ]; then array_deps_required+=( lib32z1 ) - # Minecraft, Rising World, Wurm - elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]||[ "${shortname}" == "rw" ]; then + # Minecraft, Rising World + elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]; then + javaversion=$(java -version 2>&1 | grep "version") + if [ "${javaversion}" ]; then + # Added for users using Oracle JRE to bypass the check. + javacheck=1 + else + if { [ "${distroid}" == "ubuntu" ]&&[ "${distroversion}" == "20.04" ]; }||{ [ "${distroid}" == "ubuntu" ]&&[ "${distroversion}" == "20.10" ]; }||{ [ "${distroid}" == "ubuntu" ]&&[ "${distroversion}" == "21.04" ]; }||{ [ "${distroid}" == "pop" ]&&[ "${distroversion}" == "20.04" ]; }||{ [ "${distroid}" == "pop" ]&&[ "${distroversion}" == "20.10" ]; }||{ [ "${distroid}" == "pop" ]&&[ "${distroversion}" == "21.04" ]; }; then + array_deps_required+=( openjdk-16-jre ) + else + array_deps_required+=( default-jre ) + fi + fi + elif [ "${shortname}" == "rw" ]; then javaversion=$(java -version 2>&1 | grep "version") if [ "${javaversion}" ]; then # Added for users using Oracle JRE to bypass the check. diff --git a/lgsm/functions/check_ip.sh b/lgsm/functions/check_ip.sh index ae1b99b77..09b948ccd 100755 --- a/lgsm/functions/check_ip.sh +++ b/lgsm/functions/check_ip.sh @@ -8,8 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -info_config.sh -info_parms.sh +info_game.sh if [ ! -f "/bin/ip" ]; then ipcommand="/sbin/ip" diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh index d4421dba1..4c8fda389 100755 --- a/lgsm/functions/check_permissions.sh +++ b/lgsm/functions/check_permissions.sh @@ -31,13 +31,13 @@ fn_check_ownership(){ { echo -e "User\tGroup\tFile\n" if [ "${selfownissue}" == "1" ]; then - find "${rootdir}/${selfname}" -not -user "$(whoami)" -printf "%u\t\t%g\t%p\n" + find "${rootdir}/${selfname}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n" fi if [ "${funcownissue}" == "1" ]; then - find "${functionsdir}" -not -user "$(whoami)" -printf "%u\t\t%g\t%p\n" + find "${functionsdir}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n" fi if [ "${filesownissue}" == "1" ]; then - find "${serverfiles}" -not -user "$(whoami)" -printf "%u\t\t%g\t%p\n" + find "${serverfiles}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n" fi } | column -s $'\t' -t | tee -a "${lgsmlog}" diff --git a/lgsm/functions/check_root.sh b/lgsm/functions/check_root.sh index 1eb6309cb..13942cbd4 100755 --- a/lgsm/functions/check_root.sh +++ b/lgsm/functions/check_root.sh @@ -12,6 +12,9 @@ if [ "$(whoami)" = "root" ]; then fn_print_fail_nl "Do NOT run this script as root!" if [ -d "${lgsmlogdir}" ]; then fn_script_log_fatal "${selfname} attempted to run as root." + else + # Forces exit code is log does not yet exist. + exitcode=1 fi core_exit.sh fi diff --git a/lgsm/functions/check_steamcmd.sh b/lgsm/functions/check_steamcmd.sh index 9b84686dc..030cbbf03 100755 --- a/lgsm/functions/check_steamcmd.sh +++ b/lgsm/functions/check_steamcmd.sh @@ -17,5 +17,6 @@ if [ ${shortname} == "ark" ]; then fi fn_check_steamcmd_dir fn_check_steamcmd_dir_legacy +fn_check_steamcmd_steamapp fn_check_steamcmd_user fn_check_steamcmd_exec diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh index 7925e3ff9..a9cceebdb 100755 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/functions/command_debug.sh @@ -27,7 +27,7 @@ fn_lockfile_trap(){ check.sh fix.sh info_distro.sh -info_config.sh +info_game.sh # NOTE: Check if works with server without parms. Could be intergrated in to info_parms.sh. fn_print_header { @@ -67,6 +67,8 @@ fi if [ "${serverpassword}" ]; then echo -e "${lightblue}Server password:\t${default}${serverpassword}" fi + +fn_reload_startparameters echo -e "${lightblue}Start parameters:${default}" if [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then echo -e "${executable} ${startparameters} -debug" @@ -102,7 +104,12 @@ echo "${port}" >> "${lockdir}/${selfname}.lock" fn_script_log_info "Lockfile generated" fn_script_log_info "${lockdir}/${selfname}.lock" -cd "${executabledir}" || exit +if [ "${shortname}" == "av" ]; then + cd "${systemdir}" || exit +else + cd "${executabledir}" || exit +fi + # Note: do not add double quotes to ${executable} ${startparameters}. if [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then ${executable} ${startparameters} -debug diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 14765ca99..2daeeb2f7 100755 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -12,9 +12,8 @@ fn_firstcommand_set # Run checks and gathers details to display. check.sh -info_config.sh -info_parms.sh info_distro.sh +info_game.sh info_messages.sh if [ "${querymode}" == "2" ]||[ "${querymode}" == "3" ]; then for queryip in "${queryips[@]}"; do @@ -31,9 +30,10 @@ fn_info_message_gameserver fn_info_message_script fn_info_message_backup # Some game servers do not have parms. -if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "jc2" ]&&[ "${shortname}" != "dst" ]&&[ "${shortname}" != "pz" ]&&[ "${engine}" != "renderware" ]; then +if [ "${shortname}" != "jc2" ]&&[ "${shortname}" != "dst" ]&&[ "${shortname}" != "pz" ]&&[ "${engine}" != "renderware" ]; then fn_info_message_commandlineparms fi +fn_info_message_ports_edit fn_info_message_ports fn_info_message_select_engine fn_info_message_statusbottom diff --git a/lgsm/functions/command_dev_query_raw.sh b/lgsm/functions/command_dev_query_raw.sh index 7c2dd95f9..c9123ebcb 100755 --- a/lgsm/functions/command_dev_query_raw.sh +++ b/lgsm/functions/command_dev_query_raw.sh @@ -11,25 +11,204 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh -info_config.sh -info_parms.sh +info_game.sh +info_distro.sh +info_messages.sh echo -e "" -echo -e "Query Port - Raw Output" +echo -e "${lightgreen}Query IP Addresses${default}" echo -e "==================================================================" echo -e "" -echo -e "QUERY IP" for queryip in "${queryips[@]}"; do echo -e "${queryip}" done +echo -e "" +echo -e "${lightgreen}Game Server Ports${default}" +echo -e "==================================================================" +{ +echo -e "${lightblue}Port Name \tPort Number \tStatus \tTCP \tUDP${default}" +if [ -v port ]; then + echo -e "Game: \t${port} \t$(ss -tupl|grep ${port}|wc -l) \t$(ss -tupl|grep ${port}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${port}|grep udp|awk '{ print $2 }')" +else + echo -e "Game:" +fi +if [ "${shortname}" == "rw" ]; then + if [ -v port2 ]; then + echo -e "Game+1: \t${port2} \t$(ss -tupl|grep ${port}|wc -l) \t$(ss -tupl|grep ${port2}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${port2}|grep udp|awk '{ print $2 }')" + else + echo -e "Game+1:" + fi + + if [ -v port3 ]; then + echo -e "Game+2: \t${port3} \t$(ss -tupl|grep ${port}|wc -l) \t$(ss -tupl|grep ${port3}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${port3}|grep udp|awk '{ print $2 }')" + else + echo -e "Game+2:" + fi + + if [ -v port4 ]; then + echo -e "Game+3: \t${port4} \t$(ss -tupl|grep ${port}|wc -l) \t$(ss -tupl|grep ${port4}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${port4}|grep udp|awk '{ print $2 }')" + else + echo -e "Game+3:" + fi +fi + +if [ -v port401 ]; then + echo -e "Game+400: \t${port401} \t$(ss -tupl|grep ${port401}|wc -l) \t$(ss -tupl|grep ${port401}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${port401}|grep udp|awk '{ print $2 }')" +else + echo -e "Game+400:" +fi + +if [ -v portipv6 ]; then + echo -e "Game ipv6: \t${portipv6} \t$(ss -tupl|grep ${portipv6}|wc -l) \t$(ss -tupl|grep ${portipv6}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${portipv6}|grep udp|awk '{ print $2 }')" +else + echo -e "Game ipv6:" +fi + +if [ -v queryport ]; then + echo -e "Query: \t${queryport} \t$(ss -tupl|grep ${queryport}|wc -l) \t$(ss -tupl|grep ${queryport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${queryport}|grep udp|awk '{ print $2 }')" +else + echo -e "Query:" +fi + +if [ -v httpport ]; then + echo -e "HTTP: \t${httpport} \t$(ss -tupl|grep ${httpport}|wc -l) \t$(ss -tupl|grep ${httpport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${httpport}|grep udp|awk '{ print $2 }')" +else + echo -e "HTTP:" +fi + +if [ -v httpqueryport ]; then + echo -e "HTTP Query: \t${httpqueryport} \t$(ss -tupl|grep ${httpqueryport}|wc -l) \t$(ss -tupl|grep ${httpqueryport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${httpqueryport}|grep udp|awk '{ print $2 }')" +else + echo -e "HTTP Query:" +fi + + +if [ -v webadminport ]; then + echo -e "Web Admin: \t${webadminport} \t$(ss -tupl|grep ${webadminport}|wc -l) \t$(ss -tupl|grep ${webadminport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${webadminport}|grep udp|awk '{ print $2 }')" +else + echo -e "Web Admin:" +fi + +if [ -v clientport ]; then + echo -e "Client: \t${clientport} \t$(ss -tupl|grep ${clientport}|wc -l) \t$(ss -tupl|grep ${clientport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${clientport}|grep udp|awk '{ print $2 }')" +else + echo -e "Client:" +fi + +if [ -v rconport ]; then + echo -e "RCON: \t${rconport} \t$(ss -tupl|grep ${rconport}|wc -l) \t$(ss -tupl|grep ${rconport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${rconport}|grep udp|awk '{ print $2 }')" +else + echo -e "RCON:" +fi + +if [ -v rawport ]; then + echo -e "RAW UDP Socket: \t${rawport} \t$(ss -tupl|grep ${rawport}|wc -l) \t$(ss -tupl|grep ${rawport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${rawport}|grep udp|awk '{ print $2 }')" +else + echo -e "RAW UDP Socket:" +fi + +if [ -v masterport ]; then + echo -e "Game: Master: \t${masterport} \t$(ss -tupl|grep ${masterport}|wc -l) \t$(ss -tupl|grep ${masterport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${masterport}|grep udp|awk '{ print $2 }')" +else + echo -e "Game: Master:" +fi + +if [ -v steamport ]; then + echo -e "Steam: \t${steamport} \t$(ss -tupl|grep ${steamport}|wc -l) \t$(ss -tupl|grep ${steamport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${steamport}|grep udp|awk '{ print $2 }')" +else + echo -e "Steam:" +fi + +if [ -v steamauthport ]; then + echo -e "Steam: Auth: \t${steamauthport} \t$(ss -tupl|grep ${steamauthport}|wc -l) \t$(ss -tupl|grep ${steamauthport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${steamauthport}|grep udp|awk '{ print $2 }')" +else + echo -e "Steam: Auth:" +fi + +if [ -v steammasterport ]; then + echo -e "Steam: Master: \t${steammasterport} \t$(ss -tupl|grep ${steammasterport}|wc -l) \t$(ss -tupl|grep ${steammasterport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${steammasterport}|grep udp|awk '{ print $2 }')" +else + echo -e "Steam: Master:" +fi + +if [ -v steamqueryport ]; then + echo -e "Steam: Query: \t${steamqueryport} \t$(ss -tupl|grep ${steamqueryport}|wc -l) \t$(ss -tupl|grep ${steamqueryport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${steamqueryport}|grep udp|awk '{ print $2 }')" +else + echo -e "Steam: Query:" +fi +if [ -v beaconport ]; then + echo -e "Beacon: \t${beaconport} \t$(ss -tupl|grep ${beaconport}|wc -l) \t$(ss -tupl|grep ${beaconport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${beaconport}|grep udp|awk '{ print $2 }')" +else + echo -e "Beacon:" +fi + +if [ -v appport ]; then + echo -e "App: \t${appport} \t$(ss -tupl|grep ${appport}|wc -l) \t$(ss -tupl|grep ${appport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${appport}|grep udp|awk '{ print $2 }')" +else + echo -e "App:" +fi + +if [ -v telnetport ]; then + echo -e "Telnet: \t${telnetport} \t$(ss -tupl|grep ${telnetport}|wc -l) \t$(ss -tupl|grep ${telnetport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${telnetport}|grep udp|awk '{ print $2 }')" +else + echo -e "Telnet:" +fi + +if [ -v sourcetvport ]; then + echo -e "SourceTV: \t${sourcetvport} \t$(ss -tupl|grep ${sourcetvport}|wc -l) \t$(ss -tupl|grep ${sourcetvport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${sourcetvport}|grep udp|awk '{ print $2 }')" +else + echo -e "SourceTV:" +fi + +if [ -v fileport ]; then + echo -e "File: \t${fileport} \t$(ss -tupl|grep ${fileport}|wc -l) \t$(ss -tupl|grep ${fileport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${fileport}|grep udp|awk '{ print $2 }')" +else + echo -e "File:" +fi + +if [ -v udplinkport ]; then + echo -e "UDP Link: \t${udplinkport} \t$(ss -tupl|grep ${udplinkport}|wc -l) \t$(ss -tupl|grep ${udplinkport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${udplinkport}|grep udp|awk '{ print $2 }')" +else + echo -e "UDP Link:" +fi + +if [ -v voiceport ]; then + echo -e "Voice: \t${voiceport} \t$(ss -tupl|grep ${voiceport}|wc -l) \t$(ss -tupl|grep ${voiceport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${voiceport}|grep udp|awk '{ print $2 }')" +else + echo -e "Voice:" +fi + +if [ -v voiceunusedport ]; then + echo -e "Voice (Unused): \t${voiceunusedport} \t$(ss -tupl|grep ${voiceunusedport}|wc -l) \t$(ss -tupl|grep ${voiceunusedport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${voiceunusedport}|grep udp|awk '{ print $2 }')" +else + echo -e "Voice (Unused):" +fi + +if [ -v battleeyeport ]; then + echo -e "BattleEye: \t${battleeyeport} \t$(ss -tupl|grep ${battleeyeport}|wc -l) \t$(ss -tupl|grep ${battleeyeport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${battleeyeport}|grep udp|awk '{ print $2 }')" +else + echo -e "BattleEye:" +fi + +if [ -v statsport ]; then + echo -e "Stats: \t${battleeyeport} \t$(ss -tupl|grep ${statsport}|wc -l) \t$(ss -tupl|grep ${statsport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${statsport}|grep udp|awk '{ print $2 }')" +else + echo -e "Stats:" +fi + +} | column -s $'\t' -t +echo -e "" +echo -e "${lightgreen}SS Output${default}" echo -e "=================================" -echo -e "Ports" -echo -e "=================================" +fn_info_message_ports +echo -e "" +echo -e "${lightgreen}Query Port - Raw Output${default}" +echo -e "==================================================================" echo -e "" echo -e "PORT: ${port}" echo -e "QUERY PORT: ${queryport}" echo -e "" -echo -e "Gamedig Raw Output" +echo -e "${lightgreen}Gamedig Raw Output${default}" echo -e "=================================" echo -e "" if [ ! "$(command -v gamedig 2>/dev/null)" ]; then @@ -45,7 +224,7 @@ for queryip in "${queryips[@]}"; do echo "${gamedigraw}" | jq done echo -e "" -echo -e "gsquery Raw Output" +echo -e "${lightgreen}gsquery Raw Output${default}" echo -e "=================================" echo -e "" for queryip in "${queryips[@]}"; do @@ -57,7 +236,7 @@ for queryip in "${queryips[@]}"; do "${functionsdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}" done echo -e "" -echo -e "TCP Raw Output" +echo -e "${lightgreen}TCP Raw Output${default}" echo -e "=================================" echo -e "" for queryip in "${queryips[@]}"; do @@ -73,10 +252,10 @@ for queryip in "${queryips[@]}"; do fi done echo -e "" -echo -e "Game Port - Raw Output" +echo -e "${lightgreen}Game Port - Raw Output${default}" echo -e "==================================================================" echo -e "" -echo -e "TCP Raw Output" +echo -e "${lightgreen}TCP Raw Output${default}" echo -e "=================================" echo -e "" for queryip in "${queryips[@]}"; do @@ -91,5 +270,12 @@ for queryip in "${queryips[@]}"; do echo -e "TCP query FAIL" fi done +echo -e "" +echo -e "${lightgreen}Steam Master Server Response${default}" +echo -e "==================================================================" +echo -e "" +echo -e "Response: ${displaymasterserver}" +echo -e "" + exitcode=0 core_exit.sh diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index 3602bef93..3f4e397e2 100755 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -74,12 +74,10 @@ fn_monitor_check_queryport(){ fn_script_log_info "Checking port: CHECKING" if [ -n "${rconenabled}" ]&&[ "${rconenabled}" != "true" ]&&[ ${shortname} == "av" ]; then fn_print_warn "Checking port: Unable to query, rcon is not enabled" - fn_print_warn_eol_nl fn_script_log_warn "Checking port: Unable to query, rcon is not enabled" else fn_print_error "Checking port: Unable to query, queryport is not set" fn_script_log_error "Checking port: Unable to query, queryport is not set" - fn_print_error_eol_nl fi core_exit.sh fi @@ -227,8 +225,7 @@ fn_monitor_loop(){ monitorflag=1 check.sh core_logs.sh -info_config.sh -info_parms.sh +info_game.sh # query pre-checks fn_monitor_check_lockfile diff --git a/lgsm/functions/command_postdetails.sh b/lgsm/functions/command_postdetails.sh index fa2907b1e..f8b36fb61 100755 --- a/lgsm/functions/command_postdetails.sh +++ b/lgsm/functions/command_postdetails.sh @@ -31,8 +31,7 @@ if [ "${exitbypass}" ]; then else # Run checks and gathers details to display. check.sh - info_config.sh - info_parms.sh + info_game.sh info_distro.sh info_messages.sh for queryip in "${queryips[@]}" @@ -54,6 +53,7 @@ else if [ "${shortname}" != "jc2" ]&&[ "${shortname}" != "jc3" ]&&[ "${shortname}" != "dst" ]&&[ "${shortname}" != "pz" ]&&[ "${engine}" != "renderware" ]; then fn_info_message_commandlineparms fi + fn_info_message_ports_edit fn_info_message_ports fn_info_message_select_engine fn_info_message_statusbottom diff --git a/lgsm/functions/command_restart.sh b/lgsm/functions/command_restart.sh index 47a6b904c..3bf60c32c 100755 --- a/lgsm/functions/command_restart.sh +++ b/lgsm/functions/command_restart.sh @@ -10,7 +10,7 @@ commandaction="Restarting" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -info_config.sh +info_game.sh exitbypass=1 command_stop.sh command_start.sh diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index e06a0e3e5..58ecfcff7 100755 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -71,7 +71,14 @@ fn_start_tmux(){ date '+%s' > "${lockdir}/${selfname}.lock" echo "${version}" >> "${lockdir}/${selfname}.lock" echo "${port}" >> "${lockdir}/${selfname}.lock" - cd "${executabledir}" || exit + fn_reload_startparameters + + if [ "${shortname}" == "av" ]; then + cd "${systemdir}" || exit + else + cd "${executabledir}" || exit + fi + tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${preexecutable} ${executable} ${startparameters}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" # Create logfile. @@ -184,7 +191,7 @@ fi if [ -z "${fixbypass}" ]; then fix.sh fi -info_config.sh +info_game.sh core_logs.sh # Will check for updates is updateonstart is yes. diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index f0a0bf92c..ef54b525c 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -269,7 +269,7 @@ fn_stop_pre_check(){ check.sh fn_print_dots "${servername}" -info_config.sh +info_game.sh fn_stop_pre_check # Remove lockfile. if [ -f "${lockdir}/${selfname}.lock" ]; then diff --git a/lgsm/functions/command_test_alert.sh b/lgsm/functions/command_test_alert.sh index 9397a445c..7fe61e48a 100755 --- a/lgsm/functions/command_test_alert.sh +++ b/lgsm/functions/command_test_alert.sh @@ -12,7 +12,7 @@ fn_firstcommand_set fn_print_dots "${servername}" check.sh -info_config.sh +info_game.sh alert="test" alert.sh diff --git a/lgsm/functions/command_wipe.sh b/lgsm/functions/command_wipe.sh index 63cb830fb..d2d05defc 100755 --- a/lgsm/functions/command_wipe.sh +++ b/lgsm/functions/command_wipe.sh @@ -12,9 +12,9 @@ fn_firstcommand_set # Provides an exit code upon error. fn_wipe_exit_code(){ - ((exitcode=$?)) + exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${currentaction}" + fn_print_fail_eol_nl core_exit.sh else fn_print_ok_eol_nl @@ -22,209 +22,160 @@ fn_wipe_exit_code(){ } # Removes files to wipe server. -fn_wipe_server_files(){ - fn_print_start_nl "Wiping server" - fn_script_log_info "Wiping server" - # Wipe procedural map. - if [ -n "$(find "${serveridentitydir}" -type f -name "proceduralmap.*.map")" ]; then - echo -en "removing procedural map proceduralmap.*.map file(s)..." - fn_sleep_time - fn_script_log_info "Removing procedural map file(s): ${serveridentitydir}/proceduralmap.*.map" - find "${serveridentitydir:?}" -type f -name "proceduralmap.*.map" -delete | tee -a "${lgsmlog}" - fn_wipe_exit_code - fn_sleep_time - else - echo -e "no procedural map file to remove" - fn_sleep_time - fn_script_log_pass "No procedural map file to remove" - fi - # Wipe Barren map. - if [ -n "$(find "${serveridentitydir}" -type f -name "barren*.map")" ]; then - echo -en "removing barren map barren*.map file(s)..." - fn_sleep_time - fn_script_log_info "Removing map file(s): ${serveridentitydir}/barren*.map" - find "${serveridentitydir:?}" -type f -name "barren*.map" -delete | tee -a "${lgsmlog}" - fn_wipe_exit_code - fn_sleep_time - else - echo -e "no barren map file to remove" - fn_sleep_time - fn_script_log_pass "No barren map file to remove" - fi - # Wipe custom map. - if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ]; then - echo -en "removing custom map file(s)..." - fn_sleep_time - fn_script_log_info "Removing map file(s): ${serveridentitydir}/*.map" - find "${serveridentitydir:?}" -type f -name "*.map" -delete | tee -a "${lgsmlog}" - fn_wipe_exit_code - fn_sleep_time - else - echo -e "no map file to remove" - fn_sleep_time - fn_script_log_pass "No map file to remove" - fi - # Wipe custom map save. - if [ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ]; then - echo -en "removing map save *.sav* file(s)..." - fn_sleep_time - fn_script_log_info "Removing map save(s): ${serveridentitydir}/*.sav*" - find "${serveridentitydir:?}" -type f -name "*.sav*" -delete | tee -a "${lgsmlog}" - fn_wipe_exit_code - fn_sleep_time - else - echo -e "no map save to remove" - fn_sleep_time - fn_script_log_pass "No map save to remove." - fi - # Wipe user dir, might be a legacy thing, maybe to be removed. - if [ -d "${serveridentitydir}/user" ]; then - echo -en "removing user directory..." - fn_sleep_time - fn_script_log_info "removing user directory: ${serveridentitydir}/user" - rm -rf "${serveridentitydir:?}/user" - fn_wipe_exit_code - fn_sleep_time - # We do not print additional information if there is nothing to remove since this might be obsolete. - fi - # Wipe storage dir, might be a legacy thing, maybe to be removed. - if [ -d "${serveridentitydir}/storage" ]; then - echo -en "removing storage directory..." - fn_sleep_time - fn_script_log_info "removing storage directory: ${serveridentitydir}/storage" - rm -rf "${serveridentitydir:?}/storage" - fn_wipe_exit_code - fn_sleep_time - # We do not print additional information if there is nothing to remove since this might be obsolete. - fi - # Wipe sv.files. - if [ -n "$(find "${serveridentitydir}" -type f -name "sv.files.*.db")" ]; then - echo -en "removing server misc srv.files*.db file(s)..." - fn_sleep_time - fn_script_log_info "Removing server misc files: ${serveridentitydir}/sv.files.*.db" - find "${serveridentitydir:?}" -type f -name "sv.files.*.db" -delete | tee -a "${lgsmlog}" - fn_wipe_exit_code - fn_sleep_time - # No further information if not found because it should I could not get this file showing up. - fi - # Wipe player death files. - if [ -n "$(find "${serveridentitydir}" -type f -name "player.deaths.*.db")" ]; then - echo -en "removing player deaths player.deaths.*.db file(s)..." - fn_sleep_time - fn_script_log_info "Removing player death files: ${serveridentitydir}/player.deaths.*.db" - find "${serveridentitydir:?}" -type f -name "player.deaths.*.db" -delete | tee -a "${lgsmlog}" - fn_wipe_exit_code - fn_sleep_time - else - echo -e "no player death to remove" - fn_sleep_time - fn_script_log_pass "No player death to remove" - fi - # Wipe player states files - if [ -n "$(find "${serveridentitydir}" -type f -name "player.states.*.db")" ]; then - echo -en "removing player states player.states.*.db file(s)..." - fn_sleep_time - fn_script_log_info "Removing player states: ${serveridentitydir}/player.states.*.db" - find "${serveridentitydir:?}" -type f -name "player.states.*.db" -delete | tee -a "${lgsmlog}" - fn_wipe_exit_code - fn_sleep_time - else - echo -e "no player states to remove" - fn_sleep_time - fn_script_log_pass "No player states to remove" - fi - # Wipe blueprints only if full-wipe command was used. - if [ "${fullwipe}" == "1" ]; then - if [ -n "$(find "${serveridentitydir}" -type f -name "player.blueprints.*.db")" ]; then - echo -en "removing blueprints player.blueprints.*.db file(s)..." +fn_wipe_files(){ + fn_print_start_nl "${wipetype}" + fn_script_log_info "${wipetype}" + + # Remove Map files + if [ -n "${serverwipe}" ]||[ -n "${mapwipe}" ]; then + if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ]; then + echo -en "removing .map file(s)..." + fn_script_log_info "removing *.map file(s)" fn_sleep_time - fn_script_log_info "Removing blueprint file(s): ${serveridentitydir}/player.blueprints.*.db" - find "${serveridentitydir:?}" -type f -name "player.blueprints.*.db" -delete | tee -a "${lgsmlog}" + find "${serveridentitydir:?}" -type f -name "*.map" -printf "%f\n" >> "${lgsmlog}" + find "${serveridentitydir:?}" -type f -name "*.map" -delete | tee -a "${lgsmlog}" fn_wipe_exit_code + else + echo -e "no .map file(s) to remove" + fn_sleep_time + fn_script_log_pass "no .map file(s) to remove" + fi + fi + # Remove Save files. + if [ -n "${serverwipe}" ]||[ -n "${mapwipe}" ]; then + if [ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ]; then + echo -en "removing .sav file(s)..." + fn_script_log_info "removing .sav file(s)" fn_sleep_time + find "${serveridentitydir:?}" -type f -name "*.sav*" -printf "%f\n" >> "${lgsmlog}" + find "${serveridentitydir:?}" -type f -name "*.sav*" -delete + fn_wipe_exit_code else - echo -e "no blueprint file to remove" + echo -e "no .sav file(s) to remove" + fn_script_log_pass "no .sav file(s) to remove" fn_sleep_time - fn_script_log_pass "No blueprint file to remove" fi - elif [ -n "$(find "${serveridentitydir}" -type f -name "player.blueprints.*.db")" ]; then - echo -e "keeping blueprints" - fn_sleep_time - fn_script_log_info "Keeping blueprints" - else - echo -e "no blueprints found" - fn_sleep_time - fn_script_log_pass "No blueprints found" fi - # Wipe some logs that might be there. - if [ -n "$(find "${serveridentitydir}" -type f -name "Log.*.txt")" ]; then - echo -en "removing log files..." - fn_sleep_time - fn_script_log_info "Removing log files: ${serveridentitydir}/Log.*.txt" - find "${serveridentitydir:?}" -type f -name "Log.*.txt" -delete - fn_wipe_exit_code - fn_sleep_time - # We do not print additional information if there are no logs to remove. + # Remove db files for full wipe. + # Excluding player.tokens.db for Rust+. + if [ -n "${serverwipe}" ]; then + if [ -n "$(find "${serveridentitydir}" -type f ! -name 'player.tokens.db' -name "*.db")" ]; then + echo -en "removing .db file(s)..." + fn_script_log_info "removing .db file(s)" + fn_sleep_time + find "${serveridentitydir:?}" -type f ! -name 'player.tokens.db' -name "*.db" -printf "%f\n" >> "${lgsmlog}" + find "${serveridentitydir:?}" -type f ! -name 'player.tokens.db' -name "*.db" -delete + fn_wipe_exit_code + else + echo -e "no .db file(s) to remove" + fn_sleep_time + fn_script_log_pass "no .db file(s) to remove" + fi fi } -fn_stop_warning(){ - fn_print_warn "this game server will be stopped during wipe" - fn_script_log_warn "this game server will be stopped during wipe" +fn_map_wipe_warning(){ + fn_print_warn "Map wipe will reset the map data and keep blueprint data" + fn_script_log_warn "Map wipe will reset the map data and keep blueprint data" totalseconds=3 for seconds in {3..1}; do - fn_print_warn "this game server will be stopped during wipe: ${totalseconds}" + fn_print_warn "Map wipe will reset the map data and keep blueprint data: ${totalseconds}" totalseconds=$((totalseconds - 1)) sleep 1 if [ "${seconds}" == "0" ]; then break fi done - fn_print_warn_nl "this game server will be stopped during wipe" + fn_print_warn_nl "Map wipe will reset the map data and keep blueprint data" } -fn_wipe_warning(){ - fn_print_warn "wipe is about to start" - fn_script_log_warn "wipe is about to start" +fn_full_wipe_warning(){ + fn_print_warn "Server wipe will reset the map data and remove blueprint data" + fn_script_log_warn "Server wipe will reset the map data and remove blueprint data" totalseconds=3 for seconds in {3..1}; do - fn_print_warn "wipe is about to start: ${totalseconds}" + fn_print_warn "Server wipe will reset the map data and remove blueprint data: ${totalseconds}" totalseconds=$((totalseconds - 1)) sleep 1 if [ "${seconds}" == "0" ]; then break fi done - fn_print_warn "wipe is about to start" + fn_print_warn_nl "Server wipe will reset the map data and remove blueprint data" } -# Will change the seed everytime the wipe command is run if the seed in config is not set. +# Will change the seed if the seed is not defined by the user. fn_wipe_random_seed(){ - shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" + if [ -f "${datadir}/${selfname}-seed.txt" ]&&[ -n "${randomseed}" ]; then + shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" + seed=$(cat "${datadir}/${selfname}-seed.txt") + randomseed=1 + echo -en "generating new random seed (${cyan}${seed}${default})..." + fn_script_log_pass "generating new random seed (${cyan}${seed}${default})" + fn_sleep_time + fn_print_ok_eol_nl + fi +} + +# A summary of what wipe is going to do. +fn_wipe_details(){ + fn_print_information_nl "Wipe does not remove Rust+ data." + echo -en "* Wipe map data: " + if [ -n "${serverwipe}" ]||[ -n "${mapwipe}" ]; then + fn_print_yes_eol_nl + else + fn_print_no_eol_nl + fi + + echo -en "* Wipe blueprint data: " + if [ -n "${serverwipe}" ]; then + fn_print_yes_eol_nl + else + fn_print_no_eol_nl + fi + + echo -en "* Change Procedural Map seed: " + if [ -n "${randomseed}" ]; then + fn_print_yes_eol_nl + else + fn_print_no_eol_nl + fi } fn_print_dots "" check.sh +fix_rust.sh # Check if there is something to wipe. -if [ -d "${serveridentitydir}/storage" ]||[ -d "${serveridentitydir}/user" ]||[ -n "$(find "${serveridentitydir}" -type f -name "*.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_wipe_warning +if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ]&&[ -n "$(find "${serveridentitydir}" -type f ! -name 'player.tokens.db' -name "*.db")" ]; then + if [ -n "${serverwipe}" ]; then + wipetype="Full wipe" + fn_full_wipe_warning + fn_wipe_details + elif [ -n "${mapwipe}" ]; then + wipetype="Map wipe" + fn_map_wipe_warning + fn_wipe_details + fi check_status.sh if [ "${status}" != "0" ]; then - fn_stop_warning + fn_print_restart_warning exitbypass=1 command_stop.sh fn_firstcommand_reset - fn_wipe_server_files + fn_wipe_files + fn_wipe_random_seed + fn_print_complete_nl "${wipetype}" + fn_script_log_pass "${wipetype}" exitbypass=1 command_start.sh fn_firstcommand_reset else - fn_wipe_server_files + fn_wipe_files + fn_wipe_random_seed + fn_print_complete_nl "${wipetype}" + fn_script_log_pass "${wipetype}" fi - fn_print_complete_nl "Wiping ${selfname}" - fn_script_log_pass "Wiping ${selfname}" - fn_wipe_random_seed else fn_print_ok_nl "Wipe not required" fn_script_log_pass "Wipe not required" diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 2c8c269bf..9d80913a7 100755 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -92,9 +92,14 @@ fn_dl_steamcmd(){ if [ -n "$(grep -i "Error!" "${steamcmdlog}" | tail -1)" ]&&[ "$(grep -ic "Error!" "${steamcmdlog}")" -ge "${counter}" ] ; then # Not enough space. if [ -n "$(grep "0x202" "${steamcmdlog}" | tail -1)" ]; then - fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough space to download server files" - fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Not enough space to download server files" + fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" + fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" core_exit.sh + # Not enough space. + elif [ -n "$(grep "0x212" "${steamcmdlog}" | tail -1)" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" + fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" + core_exit.sh # Need tp purchase game. elif [ -n "$(grep "No subscription" "${steamcmdlog}" | tail -1)" ]; then fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Steam account does not have a license for the required game" @@ -116,6 +121,7 @@ fn_dl_steamcmd(){ fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Update required but not completed - check network" else fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured" + echo -en "Please provide content log to LinuxGSM developers https://linuxgsm.com/steamcmd-error" fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured" fi elif [ "${exitcode}" != "0" ]; then diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 89b0ef0fa..067ccff54 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v21.2.2" +modulesversion="v21.2.5" # Core @@ -381,6 +381,11 @@ functionfile="${FUNCNAME[0]}" fn_fetch_function } +fix_lo.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + fix_mcb.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function @@ -508,22 +513,12 @@ fn_fetch_function # Info -info_stats.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -info_config.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - info_distro.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function } -info_gamedig.sh(){ +info_game.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function } @@ -533,7 +528,7 @@ functionfile="${FUNCNAME[0]}" fn_fetch_function } -info_parms.sh(){ +info_stats.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function } diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 904bad37d..ea3c84f6d 100755 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -40,8 +40,8 @@ cmd_mods_update=( "mu;mods-update" "command_mods_update.sh" "Update installed mo # 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=( "w;wipe;wi" "command_wipe.sh" "Map assets are wiped and blueprints are kept." ) -cmd_full_wipe=( "fw;full-wipe;wa;wipeall" "fullwipe=1; command_wipe.sh" "Map assets and blueprints are wiped." ) +cmd_fullwipe=( "fw;full-wipe;wa;wipeall" "serverwipe=1; command_wipe.sh" "Reset the map and remove blueprint data." ) +cmd_mapwipe=( "mw;map-wipe;w;wipe;wi" "mapwipe=1; command_wipe.sh" "Reset the map and keep blueprint data." ) cmd_map_compressor_u99=( "mc;map-compressor" "compress_ut99_maps.sh" "Compresses all ${gamename} server maps." ) cmd_map_compressor_u2=( "mc;map-compressor" "compress_unreal2_maps.sh" "Compresses all ${gamename} server maps." ) cmd_install_cdkey=( "cd;server-cd-key" "install_ut2k4_key.sh" "Add your server cd key." ) @@ -105,7 +105,7 @@ fi # Unreal exclusive. if [ "${shortname}" == "rust" ]; then - currentopt+=( "${cmd_wipe[@]}" "${cmd_full_wipe[@]}" ) + currentopt+=( "${cmd_fullwipe[@]}" "${cmd_mapwipe[@]}" ) fi if [ "${engine}" == "unreal2" ]; then if [ "${shortname}" == "ut2k4" ]; then diff --git a/lgsm/functions/core_legacy.sh b/lgsm/functions/core_legacy.sh index e28cb7457..811acfbba 100755 --- a/lgsm/functions/core_legacy.sh +++ b/lgsm/functions/core_legacy.sh @@ -79,5 +79,6 @@ if [ -z "${wsstartmap}" ]; then fi fn_parms(){ -parms="${startparameters}" + fn_reload_startparameters + parms="${startparameters}" } diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh index 8dfca6661..463f833c2 100755 --- a/lgsm/functions/core_messages.sh +++ b/lgsm/functions/core_messages.sh @@ -375,6 +375,28 @@ fn_prompt_message(){ # On-Screen End of Line ################################## +# YES +fn_print_yes_eol(){ + echo -en "${cyan}YES${default}" + fn_sleep_time +} + +fn_print_yes_eol_nl(){ + echo -e "${cyan}YES${default}" + fn_sleep_time +} + +# NO +fn_print_no_eol(){ + echo -en "${red}NO${default}" + fn_sleep_time +} + +fn_print_no_eol_nl(){ + echo -e "${red}NO${default}" + fn_sleep_time +} + # OK fn_print_ok_eol(){ echo -en "${green}OK${default}" diff --git a/lgsm/functions/core_steamcmd.sh b/lgsm/functions/core_steamcmd.sh index ece274f0f..5fbd5db9f 100755 --- a/lgsm/functions/core_steamcmd.sh +++ b/lgsm/functions/core_steamcmd.sh @@ -97,6 +97,13 @@ fn_check_steamcmd_dir_legacy(){ fi } +fn_check_steamcmd_steamapp(){ + # Check that steamapp directory fixes issue #3481 + if [ ! -d "${serverfiles}/steamapps" ]; then + mkdir -p "${serverfiles}/steamapps" + fi +} + fn_check_steamcmd_ark(){ # Checks if SteamCMD exists in # Engine/Binaries/ThirdParty/SteamCMD/Linux diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index 1b5e63db6..b5cbcc77a 100755 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -94,9 +94,9 @@ fi # Fixes that are run on install only. if [ "${commandname}" == "INSTALL" ]; then - if [ "${shortname}" == "av" ]||[ "${shortname}" == "cmw" ]||[ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "onset" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "samp" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then + if [ "${shortname}" == "av" ]||[ "${shortname}" == "cmw" ]||[ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "lo" ]||[ "${shortname}" == "onset" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "samp" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then echo -e "" - echo -e "${lightyellow}Applying Post-Install Fixes}${default}" + echo -e "${lightyellow}Applying Post-Install Fixes${default}" echo -e "=================================" fn_sleep_time postinstall=1 @@ -106,6 +106,8 @@ if [ "${commandname}" == "INSTALL" ]; then fix_kf.sh elif [ "${shortname}" == "kf2" ]; then fix_kf2.sh + elif [ "${shortname}" == "lo" ]; then + fix_lo.sh elif [ "${shortname}" == "ro" ]; then fix_ro.sh elif [ "${shortname}" == "samp" ]; then diff --git a/lgsm/functions/fix_lo.sh b/lgsm/functions/fix_lo.sh new file mode 100644 index 000000000..466d6abd0 --- /dev/null +++ b/lgsm/functions/fix_lo.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# LinuxGSM fix_lo.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Resolves installation issue with Last Oasis + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +local APPID_FILE=${executabledir}/steam_appid.txt +if [ ! -f "${APPID_FILE}" ]; then + fn_print_information "adding ${APPID_FILE} to ${gamename} server." + fn_sleep_time + echo "903950" > "${APPID_FILE}" +else + fn_print_information "${APPID_FILE} already exists. No action to be taken." + fn_sleep_time +fi diff --git a/lgsm/functions/fix_rust.sh b/lgsm/functions/fix_rust.sh index 1e62898df..4488377a3 100755 --- a/lgsm/functions/fix_rust.sh +++ b/lgsm/functions/fix_rust.sh @@ -9,3 +9,13 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: [Raknet] Server Shutting Down (Shutting Down). export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/RustDedicated_Data/Plugins/x86_64" + +# Part of random seed feature. +# If seed is not defined by user generate a seed file. +if [ -z "${seed}" ]; then + if [ ! -f "${datadir}/${selfname}-seed.txt" ]; then + shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" + fi + seed="$(cat "${datadir}/${selfname}-seed.txt")" + randomseed=1 +fi diff --git a/lgsm/functions/fix_ts3.sh b/lgsm/functions/fix_ts3.sh index b1ed7d84b..021f03764 100755 --- a/lgsm/functions/fix_ts3.sh +++ b/lgsm/functions/fix_ts3.sh @@ -17,7 +17,7 @@ fi # Fixes: failed to register local accounting service: No such file or directory. accountingfile="/dev/shm/7gbhujb54g8z9hu43jre8" -if [ -f "${accountingfile}" ]; then +if [ -f "${accountingfile}" ]&&[ "${status}" == "0" ]; then # Check permissions for the file if the current user owns it, if not exit. if [ "$( stat -c %U ${accountingfile})" == "$(whoami)" ]; then fixname="Delete file ${accountingfile}" diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 283d8ed39..fdfc076ab 100755 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -11,6 +11,11 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ### Game Server pid if [ "${status}" == "1" ]; then gameserverpid=$(tmux list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}') + if [ "${engine}" == "source" ]; then + srcdslinuxpid=$(ps -ef | grep -v grep | grep "${gameserverpid}" | grep srcds_linux | awk '{print $2}') + elif [ "${engine}" == "goldsrc" ]; then + hldslinuxpid=$(ps -ef | grep -v grep | grep "${gameserverpid}" | grep hlds_linux | awk '{print $2}') + fi fi ### Distro information @@ -83,6 +88,10 @@ else fi fi +if [ "$(command -V java 2>/dev/null)" ]; then + javaversion=$(java -version 2>&1 | grep "version") +fi + ## Uptime uptime=$(/dev/null)" ]; then if [ "${ip}" ]&&[ "${port}" ]; then - if [ "${steammaster}" == "true" ]; then + if [ "${steammaster}" == "true" ]||[ ${commandname} == "DEV-QUERY-RAW" ]; then # Will query server IP addresses first. for queryip in "${queryips[@]}"; do masterserver="$(curl --connect-timeout 10 -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${queryip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null)" @@ -288,3 +297,6 @@ if [ "${appid}" ]; then glibc="2.14" fi fi + +# Gather Port Info using ss +ssinfo="$(ss -tuplwn)" diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_game.sh old mode 100755 new mode 100644 similarity index 79% rename from lgsm/functions/info_config.sh rename to lgsm/functions/info_game.sh index 07960e290..4b45ab417 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_game.sh @@ -1,9 +1,9 @@ #!/bin/bash -# LinuxGSM info_config.sh module +# LinuxGSM info_game.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Gets specific details from config files. +# Description: Gathers various game server information. functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" @@ -14,8 +14,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # grep -v "foo" filter out lines that contain foo # cut -f1 -d "/" remove everything after / - -fn_info_config_assettocorsa(){ +fn_info_game_ac(){ if [ ! -f "${servercfgfullpath}" ]; then httpport="${zero}" port="${zero}" @@ -25,7 +24,7 @@ fn_info_config_assettocorsa(){ else httpport=$(grep "HTTP_PORT" "${servercfgfullpath}" | tr -cd '[:digit:]') port=$(grep "TCP_PORT" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport="${port}" + queryport="${httpport}" servername=$(grep "NAME" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/NAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| head -n 1) adminpassword=$(grep "ADMIN_PASSWORD" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMIN_PASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') @@ -39,87 +38,149 @@ fn_info_config_assettocorsa(){ fi } -fn_info_config_justcause2(){ +fn_info_game_ark(){ + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + adminpassword="${unavailable}" + serverpassword="${unavailable}" + else + servername=$(grep "SessionName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/SessionName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + adminpassword=$(grep "ServerAdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerAdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' ) + serverpassword=$( grep "ServerPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + servername=${servername:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + fi + + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} + rconport=${rconport:-"0"} + rawport=$((port+1)) + maxplayers=${maxplayers:-"0"} +} + +fn_info_game_arma3(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" + adminpassword="${unavailable}" serverpassword="${unavailable}" maxplayers="${zero}" - port="${zero}" - queryport="${zero}" else - servername=$(grep "Name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverdescription=$(grep "Description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - port=$(grep "BindPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - queryport="${port}" - configip=$(grep "BindIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/BindIP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="BindIP" + servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + adminpassword=$(grep "passwordAdmin" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/passwordAdmin//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') # Not Set servername=${servername:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} maxplayers=${maxplayers:-"0"} - port=${port:-"0"} + fi + + # Parameters + port=${port:-"2302"} + voiceport=${port:-"2302"} + queryport=$((port+1)) + steammasterport=$((port+2)) + voiceunusedport=$((port+3)) + battleeyeport=$((port+4)) +} + +fn_info_game_av() { + if [ ! -f "${servercfgfullpath}" ]; then + maxplayers="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + rconpassword="${unavailable}" + rconport="${unavailable}" + rconenabled="${unavailable}" + queryport="${unavailable}" + else + maxplayers=$(grep "maxPlayers=" "${servercfgfullpath}" | sed 's/maxPlayers=//') + servername=$(grep "name=" "${servercfgfullpath}" | sed 's/name=//') + serverpassword=$(grep "password=" "${servercfgfullpath}" | sed 's/password=//') + + port=$(grep "port=" "${servercfgfullpath}" | sed 's/port=//') + queryport=$((port+3)) + steamqueryport=$((port+20)) + steammasterport=$((port+21)) + rconport=$(grep "rconPort=" "${servercfgfullpath}" | sed 's/rconPort=//') + + rconpassword=$(grep "rconPassword=" "${servercfgfullpath}" | sed 's/rconPassword=//') + if [ -n "${rconpassword}" ]; then + rconenabled="true" + fi + + # Not set + maxplayers=${maxplayers:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + rconport=${rconport:-"0"} + rconenabled=${rconenabled:-"false"} queryport=${queryport:-"0"} fi } -fn_info_config_justcause3(){ +fn_info_game_bf1942(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - serverdescription="${unavailable}" serverpassword="${unavailable}" maxplayers="${zero}" port="${zero}" - queryPort="${zero}" - steamport="${zero}" - tickrate="${zero}" + queryport="${zero}" else - servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverdescription=$(grep "description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "\"maxPlayers\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - port=$(grep "\"port\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$(grep "\"queryPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - steamport=$(grep "\"steamPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - tickrate=$(grep "\"maxTickRate\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + servername=$(grep -E "^game.serverName " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName //g' | tr -d '=\";,:' | xargs) + serverpassword=$(grep "game.serverPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/game.serverPassword//g' | tr -d '=\";,:' | xargs) + maxplayers=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + queryport="22000" - configip=$(grep "host" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/host//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + configip=$(grep "game.serverIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverIP//g' | tr -d '=\";,:' | xargs) ipsetinconfig=1 - ipinconfigvar="host" + ipinconfigvar="game.serverIP" # Not Set servername=${servername:-"NOT SET"} - serverdescription=${serverdescription:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers=:-"0"} - port=${port=:-"0"} - queryport=${queryport=:-"0"} - steamport=${steamport=:-"0"} - tickrate=${tickrate=:-"0"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} fi } -fn_info_config_ark(){ +fn_info_game_bfv(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - adminpassword="${unavailable}" serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" else - servername=$(grep "SessionName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/SessionName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - adminpassword=$(grep "ServerAdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerAdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' ) - serverpassword=$( grep "ServerPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "game.serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName//g' | tr -d '=\";,:' | xargs) + serverpassword=$(grep "game.serverPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/game.serverPassword//g' | tr -d '=\";,:' | xargs) + maxplayers=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + queryport="23000" + + configip=$(grep "game.serverIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverIP//g' | tr -d '=\";,:' | xargs) + ipsetinconfig=1 + ipinconfigvar="game.serverIP" # Not Set servername=${servername:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} fi } -fn_info_config_ballistic_overkill(){ +fn_info_game_bo(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" serverpassword="${unavailable}" @@ -130,7 +191,7 @@ fn_info_config_ballistic_overkill(){ servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') serverpassword=$(grep "Password=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') port=$(grep "ServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$((port + 1)) + queryport=$((port+1)) maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') # Not Set @@ -142,7 +203,8 @@ fn_info_config_ballistic_overkill(){ fi } -fn_info_config_barotrauma(){ +fn_info_game_bt(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" serverpassword="${unavailable}" @@ -163,94 +225,53 @@ fn_info_config_barotrauma(){ queryport=${queryport:-"0"} maxplayers=${maxplayers:-"0"} fi -} -fn_info_config_battalion1944(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - else - servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - fi + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} } -fn_info_config_bf1942(){ +fn_info_game_bt1944(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" + gamemode="${unavailable}" else - - servername=$(grep -E "^game.serverName " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName //g' | tr -d '=\";,:' | xargs) - serverpassword=$(grep "game.serverPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/game.serverPassword//g' | tr -d '=\";,:' | xargs) - maxplayers=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - queryport="22000" - - configip=$(grep "game.serverIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverIP//g' | tr -d '=\";,:' | xargs) - ipsetinconfig=1 - ipinconfigvar="game.serverIP" + servername=$(grep -m2 "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "Password" "${servercfgfullpath}" | grep -v "RCONPassword" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + gamemode=$(grep -m2 "PlayMode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/PlayMode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') # Not Set servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} + gamemode=${gamemode:-"NOT SET"} fi -} - -fn_info_config_bfv(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" - else - - servername=$(grep "game.serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName//g' | tr -d '=\";,:' | xargs) - serverpassword=$(grep "game.serverPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/game.serverPassword//g' | tr -d '=\";,:' | xargs) - maxplayers=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - queryport="23000" - - configip=$(grep "game.serverIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverIP//g' | tr -d '=\";,:' | xargs) - ipsetinconfig=1 - ipinconfigvar="game.serverIP" - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - fi + # Parameters + port=${port:-"0"} + rconport=$((port+2)) + queryport=${queryport:-"0"} } -fn_info_config_chivalry(){ +fn_info_game_cmw(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" serverpassword="${unavailable}" adminpassword="${unavailable}" - else + rconport="${unavailable}" + else servername=$(grep -E "^ServerName" "${servercfgfullpath}" | sed 's/^ServerName=//') - adminpassword=$(grep -E "^AdminPassword" "${servercfgfullpath}" | sed 's/^AdminPassword=//') + rconport=$(grep -E "^RConPort=" "${servercfgdir}/DefaultGame.ini" | tr -cd '[:digit:]') # Not Set servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - port=${port:-"0"} + rconport=${port:-"0"} fi } -fn_info_config_cod(){ +fn_info_game_cod(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" rconpassword="${unavailable}" @@ -262,9 +283,15 @@ fn_info_config_cod(){ servername=${servername:-"NOT SET"} rconpassword=${rconpassword=:-"NOT SET"} fi + + # Parameters + defaultmap=${defaultmap:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${port:-"0"} } -fn_info_config_cod2(){ +fn_info_game_cod2(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" rconpassword="${unavailable}" @@ -278,7 +305,7 @@ fn_info_config_cod2(){ fi } -fn_info_config_cod4(){ +fn_info_game_cod4(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" rconpassword="${unavailable}" @@ -292,7 +319,7 @@ fn_info_config_cod4(){ fi } -fn_info_config_codwaw(){ +fn_info_game_codwaw(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" rconpassword="${unavailable}" @@ -306,7 +333,31 @@ fn_info_config_codwaw(){ fi } -fn_info_config_dontstarve(){ +fn_info_game_col(){ + if [ -f "${servercfgfullpath}" ]; then + servername=$(jq -r '.ServerSettings.ServerName' "${servercfgfullpath}") + serverpassword=$(jq -r '.ServerSettings.ServerPassword' "${servercfgfullpath}") + maxplayers=$(jq -r '.ServerSettings.MaxPlayerCount' "${servercfgfullpath}") + port=$(jq -r '.ServerSettings.ServerGamePort' "${servercfgfullpath}") + steamport=$(jq -r '.ServerSettings.ServerSteamPort' "${servercfgfullpath}") + rconpassword=$(jq -r '.ServerSettings.RCONPassword' "${servercfgfullpath}") + configip=$(jq -r '.ServerSettings.ServerIP' "${servercfgfullpath}") + + # password not set + serverpassword=${serverpassword:-"NOT SET"} + queryport=${port:-"0"} + else + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"27004"} + steamport=${steamport:-"27005"} + rconpassword=${rconpassword:-"NOT SET"} + fi +} + +fn_info_game_dst(){ + # Config if [ ! -f "${clustercfgfullpath}" ]; then servername="${unavailable}" serverpassword="${unavailable}" @@ -337,21 +388,28 @@ fn_info_config_dontstarve(){ if [ ! -f "${servercfgfullpath}" ]; then port="${zero}" - steamauthenticationport="${zero}" - steammasterserverport="${zero}" + steamauthport="${zero}" + steammasterport="${zero}" else port=$(grep "server_port" "${servercfgfullpath}" | grep "^server_port" | grep -v "#" | tr -cd '[:digit:]') - steamauthenticationport=$(grep "authentication_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - steammasterserverport=$(grep "master_server_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + steamauthport=$(grep "authentication_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + steammasterport=$(grep "master_server_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') # Not Set port=${port:-"0"} - steamauthenticationport=${steamauthenticationport:-"0"} - steammasterserverport=${steammasterserverport:-"0"} + steamauthport=${steamauthport:-"0"} + steammasterport=${steammasterport:-"0"} fi + + # Parameters + sharding=${sharding:-"NOT SET"} + master=${master:-"NOT SET"} + shard=${shard:-"NOT SET"} + cluster=${cluster:-"NOT SET"} + cave=${cave:-"NOT SET"} } -fn_info_config_eco(){ +fn_info_game_eco(){ if [ ! -f "${servercfgfullpath}" ]; then configip="${unavailable}" servername="${unavailable}" @@ -379,7 +437,38 @@ fn_info_config_eco(){ fi } -fn_info_config_factorio(){ +fn_info_game_etl(){ + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + else + port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport="${port}" + rconpassword=$(grep "set rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + configip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ipsetinconfig=1 + ipinconfigvar="set net_ip" + + # Not Set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"27960"} + queryport=${queryport:-"27960"} + fi +} + +fn_info_game_fctr(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="Factorio Server" serverpassword="${unavailable}" @@ -403,790 +492,899 @@ fn_info_config_factorio(){ savegameinterval=${savegameinterval:-"0"} versioncount=${versioncount:-"0"} fi + + # Parameters + port=${port:-"0"} + rconport=${rconport:-"0"} + rconpassword=${rconpassword:-"NOT SET"} } -fn_info_config_minecraft(){ +fn_info_game_jc2(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - rconpassword="${unavailable}" - rconport="${zero}" + serverpassword="${unavailable}" maxplayers="${zero}" port="${zero}" queryport="${zero}" - queryenabled="${unavailable}" - gamemode="${unavailable}" - gameworld="${unavailable}" else - servername=$(grep "motd" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/motd//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "rcon.password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon.password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconport=$(grep "rcon.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "server-port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - queryport=$(grep "query.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - if [ -z "${queryport}" ]; then - queryport=${port} - fi - queryenabled=$(grep "enable-query" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/enable-query//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - gamemode=$(grep "gamemode" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - configip=$(grep "server-ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/server-ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="server-ip" - - # Not Set + servername=$(grep "Name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverdescription=$(grep "Description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + port=$(grep "BindPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + queryport="${port}" + configip=$(grep "BindIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/BindIP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ipsetinconfig=1 + ipinconfigvar="BindIP" + + # Not Set servername=${servername:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - rconport=${rconport:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} - port=${port:-"NOT SET"} - queryport=${queryport:-"NOT SET"} - queryenabled="${queryenabled:-"NOT SET"}" - gamemode=${gamemode:-"NOT SET"} - gameworld=${gameworld:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${queryport:-"0"} fi } -fn_info_config_minecraft_bedrock(){ +fn_info_game_hw(){ + servername=${servername:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + maxplayers=${maxplayers:-"0"} + defaultmap=${defaultmap:-"NOT SET"} + creativemode=${creativemode:-"NOT SET"} +} + +fn_info_game_inss(){ + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} + rconport=${rconport:-"0"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + defaultmap=${defaultmap:-"NOT SET"} + defaultscenario=${defaultscenario:-"NOT SET"} + maxplayers=${maxplayers:-"0"} +} + +fn_info_game_jc3(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" + serverdescription="${unavailable}" + serverpassword="${unavailable}" maxplayers="${zero}" port="${zero}" - port6="${zero}" - queryport="${zero}" - gamemode="${unavailable}" - gameworld="${unavailable}" + queryPort="${zero}" + steamport="${zero}" + httpport="${zero}" + tickrate="${zero}" else - servername=$(grep "server-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "server-port\b" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port6=$(grep "server-portv6\b" "${servercfgfullpath}" | sed 's/v6//g' | grep -v "#" | tr -cd '[:digit:]') - queryport=${port} - gamemode=$(grep "gamemode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/gamemode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverdescription=$(grep "description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "\"maxPlayers\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + port=$(grep "\"port\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$(grep "\"queryPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + steamport=$(grep "\"steamPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + httpport=$(grep "\"httpPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + tickrate=$(grep "\"maxTickRate\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + + configip=$(grep "host" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/host//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ipsetinconfig=1 + ipinconfigvar="host" # Not Set servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} - port=${port:-"NOT SET"} - port6=${port6:-"NOT SET"} - queryport=${queryport:-"NOT SET"} - gamemode=${gamemode:-"NOT SET"} - gameworld=${gameworld:-"NOT SET"} + serverdescription=${serverdescription:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers=:-"0"} + port=${port=:-"0"} + queryport=${queryport=:-"0"} + steamport=${steamport=:-"0"} + httpport=${httpport=:-"0"} + tickrate=${tickrate=:-"0"} fi } -fn_info_config_mofm(){ +fn_info_game_jk2(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" + maxplayers="${zero}" else - servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/ServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "seta 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 "seta 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 "seta 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 "seta sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + serverversion=$(grep "seta mv_serverversion" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta mv_serverversion//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') # Not Set + rconpassword=${rconpassword:-"NOT SET"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} fi + + # Parameters + queryport="${port:-"0"}" } -fn_info_config_onset(){ +fn_info_game_kf(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - maxplayers="${zero}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" port="${zero}" - httpport="${zero}" queryport="${zero}" + queryportgs="${zero}" + steamport="${zero}" + steammasterport="${zero}" + lanport="${zero}" + httpport="${zero}" + webadminenabled="${unavailable}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" else - servername=$(grep -v "servername_short" "${servercfgfullpath}" | grep "servername" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/servername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' ) - maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - httpport=$((port-2)) - queryport=$((port-1)) + servername=$(sed -nr 's/^ServerName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$((port+1)) + queryportgs=$(sed -nr 's/^OldQueryPortNumber=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + steamport="20560" + steammasterport="28852" + lanport=$(grep "LANServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') + httpport=$(sed -nr 's/^ListenPort=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminuser=$(sed -nr 's/^AdminName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminpass="${adminpassword}" # Not Set servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} - port=${port:-"NOT SET"} - httpport=${httpport:-"NOT SET"} - queryport=${queryport:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + queryportgs=${queryportgs:-"0"} + steamport=${steamport:-"0"} + steammasterport=${steammasterport:-"0"} + lanport=${lanport:-"0"} + httpport=${httpport:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} fi } -fn_info_config_mohaa(){ +fn_info_game_kf2(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" - maxplayers="${zero}" + adminpassword="${unavailable}" + port="${unavailable}" + queryport="${unavailable}" + webadminenabled="${unavailable}" + httpport="${zero}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" 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:]') + servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "Port" "${servercfgdir}/LinuxServer-KFEngine.ini" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]') + webadminenabled=$(grep "bEnabled" "${servercfgdir}/KFWeb.ini" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + httpport=$(grep "ListenPort" "${servercfgdir}/KFWeb.ini" | grep -v "#" | tr -cd '[:digit:]') + webadminuser="Admin" + webadminpass=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') # Not Set - rconpassword=${rconpassword:-"NOT SET"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} - -#Post Scriptum: The bloody Seventh -fn_info_config_pstbs(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - maxplayers="${unavailable}" - reservedslots="${unavailable}" - else - servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=";,:' | sed -e 's/^[ \t]//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') - reservedslots=$(grep "NumReservedSlots=" "${servercfgfullpath}" | tr -cd '[:digit:]') - fi - - if [ ! -f "${servercfgdir}/Rcon.cfg" ]; then - rconport=${unavailable} - rconpassword=${unavailable} - else - rconport=$(grep "Port=" "${servercfgdir}/Rcon.cfg" | tr -cd '[:digit:]') - rconpassword=$(grep "Password=" "${servercfgdir}/Rcon.cfg" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + httpport=${webadminport:-"0"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} fi - rconport=${rconport:-"0"} - if [ -z "${rconpassword}" ]||[ ${#rconpassword} == 1 ]; then - rconpassword="NOT SET" - fi - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - numreservedslots=${numreservedslots:-"0"} + # Parameters + queryport=${queryport:-"0"} + defaultmap=${defaultmap:-"NOT SET"} } -fn_info_config_projectcars(){ +fn_info_game_mc(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - serverpassword="${unavailable}" + rconpassword="${unavailable}" + rconport="${zero}" maxplayers="${zero}" port="${zero}" queryport="${zero}" - steamport="${zero}" + queryenabled="${unavailable}" + gamemode="${unavailable}" + gameworld="${unavailable}" else - servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "password " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - port=$(grep "hostPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - queryport=$(grep "queryPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - steamport=$(grep "steamPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + servername=$(grep "motd" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/motd//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "rcon.password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon.password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconport=$(grep "rcon.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "server-port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryport=$(grep "query.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + if [ -z "${queryport}" ]; then + queryport=${port:-"0"} + 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]*$//') + + configip=$(grep "server-ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/server-ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ipsetinconfig=1 + ipinconfigvar="server-ip" # Not Set servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + rconport=${rconport:-"NOT SET"} maxplayers=${maxplayers:-"NOT SET"} port=${port:-"NOT SET"} queryport=${queryport:-"NOT SET"} - steamport=${steamport:-"NOT SET"} + queryenabled="${queryenabled:-"NOT SET"}" + gamemode=${gamemode:-"NOT SET"} + gameworld=${gameworld:-"NOT SET"} fi } -fn_info_config_projectzomboid(){ +fn_info_game_mcb(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - serverpassword="${unavailable}" - rconpassword="${unavailable}" maxplayers="${zero}" port="${zero}" + portipv6="${zero}" + queryport="${zero}" + gamemode="${unavailable}" gameworld="${unavailable}" else - servername=$(grep "PublicName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/PublicName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Password" | sed -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "RCONPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/RCONPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "DefaultPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - gameworld=$(grep "Map" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Map" | sed -e '/^#/d' -e 's/Map//g' | tr -d '=\";' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "server-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "server-port\b" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + portipv6=$(grep "server-portv6\b" "${servercfgfullpath}" | sed 's/v6//g' | grep -v "#" | tr -cd '[:digit:]') + queryport=${port:-"0"} + gamemode=$(grep "gamemode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/gamemode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') # Not Set servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} maxplayers=${maxplayers:-"NOT SET"} port=${port:-"NOT SET"} + portipv6=${portipv6:-"NOT SET"} + queryport=${queryport:-"NOT SET"} + gamemode=${gamemode:-"NOT SET"} gameworld=${gameworld:-"NOT SET"} fi } -fn_info_config_quakeworld(){ +fn_info_game_mh(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" + rconpassword="${unavailable}" + maxplayers="${unavailable}" 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]*$//' | cut -f1 -d "/") - servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "/") - maxplayers=$(grep "maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + 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 - rconpassword=${rconpassword:-"NOT SET"} + # Not set servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} maxplayers=${maxplayers:-"0"} fi + + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} + beaconport=${beaconport:-"0"} } -fn_info_config_quake2(){ +fn_info_game_mohaa(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" maxplayers="${zero}" else - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + 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 + + # Parameters + port=${port:-"0"} + queryport=${port:-"0"} + defaultmap=${defaultmap:-"NOT SET"} } -fn_info_config_quake3(){ +fn_info_game_mom(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" - maxplayers="${zero}" + maxplayer="${zero}" + defaultmap="${unavailable}" else - rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/ServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/MaxPlayers//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + defaultmap=$(grep "MapName" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/MapName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') # Not Set - rconpassword=${rconpassword:-"NOT SET"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} + maxplayer=${maxplayers:-"NOT SET"} + defaultmap=${defaultmap:-"NOT SET"} fi + + # Parameters + port=${port:-"7777"} + beaconport=${queryport:-"15000"} } -fn_info_config_jk2(){ +fn_info_game_mta(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" + configip="${zero}" + port="${unavailable}" + httpport="${unavailable}" + ase="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" maxplayers="${zero}" else - rconpassword=$(grep "seta 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 "seta 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 "seta 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 "seta sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - serverversion=$(grep "seta mv_serverversion" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta mv_serverversion//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep -m 1 "serverport" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') + httpport=$(grep -m 1 "httpport" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') + servername=$(grep -m 1 "servername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<") + serverpassword=$(grep -m 1 "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<") + maxplayers=$(grep -m 1 "maxplayers" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') + ase=$(grep -m 1 "ase" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') + if [ "${ase}" == "1" ]; then + ase="Enabled" + else + ase="Disabled" + fi + # configip=$(grep -m 1 "serverip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<") + # ipsetinconfig=1 + # ipinconfigvar="serverip" # Not Set - rconpassword=${rconpassword:-"NOT SET"} + port=${port:-"22003"} + httpport=${httpport:-"22005"} + ase=${ase:-"Disabled"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} maxplayers=${maxplayers:-"0"} fi + + # Parameters + queryport=$((port+123)) } -fn_info_config_quakelive(){ +fn_info_game_mumble(){ + if [ ! -f "${servercfgfullpath}" ]; then + port="64738" + queryport="${port}" + servername="Mumble" + else + port=$(grep "port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^;/d' -e 's/port//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + queryport="${port}" + + configip=$(grep "host=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^;/d' -e 's/host=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ipsetinconfig=1 + ipinconfigvar="voice_ip" + + # Not Set + port=${port:-"64738"} + queryport=${queryport:-"64738"} + servername="Mumble Port ${port}" + fi +} + +fn_info_game_onset(){ if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" servername="${unavailable}" - serverpassword="${unavailable}" maxplayers="${zero}" port="${zero}" + httpport="${zero}" queryport="${zero}" - rconport="${zero}" - statsport="${zero}" else - rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "sv_maxClients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - port=$(grep "net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - queryport="${port}" - rconport=$(grep "zmq_rcon_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - statsport=$(grep "zmq_stats_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - - configip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="set net_ip" + servername=$(grep -v "servername_short" "${servercfgfullpath}" | grep "servername" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/servername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' ) + maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + httpport=$((port-2)) + queryport=$((port-1)) # Not Set - rconpassword=${rconpassword:-"NOT SET"} servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${queryport:-"0"} - rconport=${rconport:-"0"} - statsport=${statsport:-"0"} + maxplayers=${maxplayers:-"NOT SET"} + port=${port:-"NOT SET"} + httpport=${httpport:-"NOT SET"} + queryport=${queryport:-"NOT SET"} fi } -fn_info_config_realvirtuality(){ +fn_info_game_pc(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - adminpassword="${unavailable}" serverpassword="${unavailable}" maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + steamport="${zero}" else - servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - adminpassword=$(grep "passwordAdmin" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/passwordAdmin//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "password " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + port=$(grep "hostPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport=$(grep "queryPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + steamport=$(grep "steamPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') # Not Set servername=${servername:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"NOT SET"} + port=${port:-"NOT SET"} + queryport=${queryport:-"NOT SET"} + steamport=${steamport:-"NOT SET"} + fi +} + +fn_info_game_pstbs(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${unavailable}" + reservedslots="${unavailable}" + else + servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=";,:' | sed -e 's/^[ \t]//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') + reservedslots=$(grep "NumReservedSlots=" "${servercfgfullpath}" | tr -cd '[:digit:]') + fi + + if [ ! -f "${servercfgdir}/Rcon.cfg" ]; then + rconport=${unavailable} + rconpassword=${unavailable} + else + rconport=$(grep "Port=" "${servercfgdir}/Rcon.cfg" | tr -cd '[:digit:]') + rconpassword=$(grep "Password=" "${servercfgdir}/Rcon.cfg" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + fi + + rconport=${rconport:-"0"} + if [ -z "${rconpassword}" ]||[ ${#rconpassword} == 1 ]; then + rconpassword="NOT SET" + fi + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + numreservedslots=${numreservedslots:-"0"} +} + +fn_info_game_pvr(){ + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | awk -F '=' '{print $2}') + + # Not set + servername=${servername:-"NOT SET"} maxplayers=${maxplayers:-"0"} fi + + # Parameters + port=${port:-"0"} + port401=$((port+400)) + queryport=${port:-"0"} } -fn_info_config_risingworld(){ +fn_info_game_pz(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" + serverpassword="${unavailable}" rconpassword="${unavailable}" - rconport="${zero}" maxplayers="${zero}" port="${zero}" - gamemode="${unavailable}" gameworld="${unavailable}" else - servername=$(grep "server_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "server_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconport=$(grep "rcon_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - maxplayers=$(grep "settings_max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "server_port" "${servercfgfullpath}" | grep -v "database_mysql_server_port" | grep -v "#" | tr -cd '[:digit:]') - gamemode=$(grep "gamemode" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - gameworld=$(grep "server_world_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_world_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - javaram=$(grep "server_memory" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_memory//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - configip=$(grep "server_ip" "${servercfgfullpath}" | grep -v "database_mysql_server_ip" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/server_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="server-ip" + servername=$(grep "PublicName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/PublicName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Password" | sed -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "RCONPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/RCONPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "DefaultPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + gameworld=$(grep "Map" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Map" | sed -e '/^#/d' -e 's/Map//g' | tr -d '=\";' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') # Not Set servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"} - rconport=${rconport:-"NOT SET"} maxplayers=${maxplayers:-"NOT SET"} port=${port:-"NOT SET"} - gamemode=${gamemode:-"NOT SET"} gameworld=${gameworld:-"NOT SET"} fi + + # Parameters + adminpassword=${adminpassword:-"NOT SET"} + queryport=${port:-"0"} } -fn_info_config_rtcw(){ +fn_info_game_q2(){ + # Config 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:]') + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') # Not Set rconpassword=${rconpassword:-"NOT SET"} servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} maxplayers=${maxplayers:-"0"} fi + + # Parameters + port=${port:-"0"} + queryport=${port:-"0"} + defaultmap=${defaultmap:-"NOT SET"} } -#StickyBots -fn_info_config_sbots(){ +fn_info_game_q3(){ if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" servername="${unavailable}" - maxplayers="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" else - servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=";,:' | sed -e 's/^[ \t]//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') - fi + rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} + # Not Set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi } -fn_info_config_sof2(){ +fn_info_game_ql(){ if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + rconport="${zero}" + statsport="${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]*$//') + rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + maxplayers=$(grep "sv_maxClients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + port=$(grep "net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport="${port}" + rconport=$(grep "zmq_rcon_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + statsport=$(grep "zmq_stats_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + configip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ipsetinconfig=1 + ipinconfigvar="set net_ip" # Not Set rconpassword=${rconpassword:-"NOT SET"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${queryport:-"0"} + rconport=${rconport:-"0"} + statsport=${statsport:-"0"} fi } -fn_info_config_source(){ +fn_info_game_qw(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" - rconpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" else - servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "sv_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/sv_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + 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]*$//' | cut -f1 -d "/") + servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "/") + maxplayers=$(grep "maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} fi + + # Parameters + port=${port:-"0"} + queryport=${port:-"0"} } -fn_info_config_starbound(){ +fn_info_game_ro(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - queryenabled="${unavailable}" - rconenabled="${unavailable}" - rconpassword="${unavailable}" - port="21025" - queryport="21025" - rconport="21026" - maxplayers="8" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + steamport="${zero}" + steammasterport="${zero}" + lanport="${zero}" + httpport="${zero}" + webadminenabled="${unavailable}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" else - servername=$(grep "serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/serverName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - queryenabled=$(grep "runQueryServer" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/runQueryServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconenabled=$(grep "runRconServer" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/runRconServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "rconServerPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/rconServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "gameServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$(grep "queryServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - rconport=$(grep "rconServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | tr -cd '[:digit:]') + servername=$(sed -nr 's/^ServerName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$((port+1)) + steamport="20610" + steammasterport="28902" + lanport=$(grep "LANServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') + httpport=$(sed -nr 's/^ListenPort=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminuser=$(sed -nr 's/^AdminName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminpass="${adminpassword}" # Not Set servername=${servername:-"NOT SET"} - queryenabled=${queryenabled:-"NOT SET"} - rconenabled=${rconenabled:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - port=${port:-"21025"} - queryport=${queryport:-"21025"} - rconport=${rconport:-"21026"} - maxplayers=${maxplayers:-"8"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + steamport=${steamport:-"0"} + steammasterport=${steammasterport:-"0"} + lanport=${lanport:-"0"} + httpport=${httpport:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} fi } -fn_info_config_teamspeak3(){ +fn_info_game_rtcw(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then - dbplugin="${unavailable}" - port="9987" - queryport="10011" - fileport="30033" + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" else - dbplugin=$(grep "dbplugin=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/dbplugin=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "default_voice_port" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$(grep "query_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - fileport=$(grep "filetransfer_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - configip=$(grep "voice_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/voice_ip//g' | sed 's/,.*//' | tr -d '=\";,' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="voice_ip" + 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 - port=${port:-"9987"} - queryport=${queryport:-"10011"} - fileport=${fileport:-"30033"} + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} fi + + # Parameters + port=${port:-"0"} + queryport=${port:-"0"} + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_game_rust(){ + # Parameters + servername=${servername:-"NOT SET"} + port=${port:-"0"} + queryport=${port:-"0"} + appport=${appport:-"0"} + rconport=${rconport:-"0"} + gamemode=${gamemode:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + rconpassword=${rconpassword:-"NOT SET"} + rconweb=${rconweb:-"NOT SET"} + tickrate=${tickrate:-"0"} + saveinterval=${saveinterval:-"0"} + serverlevel=${serverlevel:-"NOT SET"} + worldsize=${worldsize:-"0"} } -fn_info_config_mumble(){ +fn_info_game_rw(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then - port="64738" - queryport="${port}" - servername="Mumble" + servername="${unavailable}" + rconpassword="${unavailable}" + rconport="${zero}" + maxplayers="${zero}" + port="${zero}" + port2="${zero}" + port3="${zero}" + port4="${zero}" + queryport="${zero}" + gamemode="${unavailable}" + gameworld="${unavailable}" else - port=$(grep "port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^;/d' -e 's/port//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "server_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "server_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconport=$(grep "rcon_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + maxplayers=$(grep "settings_max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "server_port" "${servercfgfullpath}" | grep -v "database_mysql_server_port" | grep -v "#" | tr -cd '[:digit:]') + port2=$((port+1)) + port3=$((port+2)) + port4=$((port+3)) queryport="${port}" - - configip=$(grep "host=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^;/d' -e 's/host=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + gamemode=$(grep "settings_default_gamemode=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/settings_default_gamemode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + gameworld=$(grep "server_world_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_world_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + #javaram=$(grep "server_memory" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_memory//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + configip=$(grep "server_ip" "${servercfgfullpath}" | grep -v "database_mysql_server_ip" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/server_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') ipsetinconfig=1 - ipinconfigvar="voice_ip" + ipinconfigvar="server-ip" # Not Set - port=${port:-"64738"} - queryport=${queryport:-"64738"} - servername="Mumble Port ${port}" + servername=${servername:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + rconport=${rconport:-"NOT SET"} + maxplayers=${maxplayers:-"NOT SET"} + port=${port:-"NOT SET"} + gamemode=${gamemode:-"NOT SET"} + gameworld=${gameworld:-"NOT SET"} fi + + # Parameters + servername=${servername:-"NOT SET"} + port=${port:-"0"} + httpqueryport=$((port-1)) } -fn_info_config_samp(){ +fn_info_game_samp(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="unnamed server" serverpassword="${unavailable}" rconpassword="${unavailable}" port="7777" + rconport="${port}" maxplayers="50" else servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + rconport="${port}" maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') # Not Set servername=${servername:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"} - port=${port:-"8303"} + port=${port:-"7777"} + rconport="${port}" maxplayers=${maxplayers:-"12"} fi -} - -fn_info_config_teeworlds(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="unnamed server" - serverpassword="${unavailable}" - rconpassword="${unavailable}" - port="8303" - queryport="8303" - maxplayers="12" - else - servername=$(grep "sv_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^password" | sed -e '/^#/d' -e 's/^password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "sv_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "sv_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - queryport="${port}" - maxplayers=$(grep "sv_max_clients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - port=${port:-"8303"} - queryport=${port:-"8303"} - maxplayers=${maxplayers:-"12"} - fi -} - -fn_info_config_terraria(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - port="${zero}" - gameworld="${unavailable}" - maxplayers="${zero}" - queryport="${zero}" - else - servername=$(grep "worldname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/worldname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "port" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=${port:-"0"} - gameworld=$(grep "world=" "${servercfgfullpath}" | grep -v "//" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/world=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - - # Not Set - servername=${servername:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - gameworld=${gameworld:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} - -fn_info_config_towerunite(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - maxplayers="${zero}" - else - servername=$(grep "ServerTitle" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerTitle//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not Set - servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} -fn_info_config_unreal(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - port="${zero}" - queryport="${zero}" - queryportgs="${zero}" - webadminenabled="${unavailable}" - webadminport="${zero}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" - else - servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - port=$(grep "Port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]') - queryport=$((port + 1)) - queryportgs=$(grep "OldQueryPortNumber" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - webadminenabled=$(grep "bEnabled" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - webadminport=$(grep "ListenPort" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - webadminuser=$(grep "AdminUsername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminUsername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - webadminpass=$(grep "UTServerAdmin.UTServerAdmin" "${servercfgfullpath}" -A 4 | grep "AdminPassword" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - queryportgs=${queryportgs:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"0"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} - fi + # Parameters + queryport=${port:-"0"} } -fn_info_config_unreal2(){ +fn_info_game_sb(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - port="${zero}" - queryport="${zero}" - queryportgs="${zero}" - webadminenabled="${unavailable}" - webadminport="${zero}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" + queryenabled="${unavailable}" + rconenabled="${unavailable}" + rconpassword="${unavailable}" + port="21025" + queryport="21025" + rconport="21026" + maxplayers="8" else - servername=$(sed -nr 's/^ServerName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$((port + 1)) - queryportgs=$(sed -nr 's/^OldQueryPortNumber=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - webadminport=$(sed -nr 's/^ListenPort=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - webadminuser=$(sed -nr 's/^AdminName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - webadminpass="${adminpassword}" + servername=$(grep "serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/serverName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + queryenabled=$(grep "runQueryServer" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/runQueryServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconenabled=$(grep "runRconServer" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/runRconServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "rconServerPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/rconServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "gameServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$(grep "queryServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + rconport=$(grep "rconServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | tr -cd '[:digit:]') # Not Set servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - queryportgs=${queryportgs:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"0"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} + queryenabled=${queryenabled:-"NOT SET"} + rconenabled=${rconenabled:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + port=${port:-"21025"} + queryport=${queryport:-"21025"} + rconport=${rconport:-"21026"} + maxplayers=${maxplayers:-"8"} fi } -fn_info_config_unreal3(){ +fn_info_game_sbots(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" maxplayers="${unavailable}" - webadminenabled="${unavailable}" - webadminport="${zero}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" else - servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - webadminenabled=$(grep "bEnabled" "${servercfgdir}/UTWeb.ini" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - webadminport=$(grep "ListenPort" "${servercfgdir}/UTWeb.ini" | grep -v "#" | tr -cd '[:digit:]') - webadminuser="Admin" - webadminpass=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + 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:]') # Not Set servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"0"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} + maxplayers=${maxplayers:-"0"} fi -} - -fn_info_config_ut(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - else - servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') - # Not set - servername=${servername:-"NOT SET"} - fi + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + defaultmap=${defaultmap:-"NOT SET"} + maxplayers=${maxplayers:-"0"} } -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_game_scpsl(){ + # Config + if [ -f "${servercfgfullpath}" ]; then + servername=$(sed -nr 's/^server_name: (.*)$/\1/p' "${servercfgfullpath}") + maxplayers=$(sed -nr 's/^max_players: (.*)$/\1/p' "${servercfgfullpath}") + configip=$(sed -nr 's/^ipv4_bind_ip: (.*)$/\1/p' "${servercfgfullpath}") + tickrate=$(sed -nr 's/^server_tickrate: (.*)$/\1/p' "${servercfgfullpath}") + adminpassword=$(sed -nr 's/^administrator_query_password: (.*)$/\1/p' "${servercfgfullpath}") -fn_info_config_kf2(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - port="${unavailable}" - queryport="${unavailable}" - webadminenabled="${unavailable}" - webadminport="${zero}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" + if [ "${adminpassword}" == "none" ]; then + adminpassword="NOT SET" + fi else - servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "Port" "${servercfgdir}/LinuxServer-KFEngine.ini" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]') - webadminenabled=$(grep "bEnabled" "${servercfgdir}/KFWeb.ini" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - webadminport=$(grep "ListenPort" "${servercfgdir}/KFWeb.ini" | grep -v "#" | tr -cd '[:digit:]') - webadminuser="Admin" - webadminpass=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not Set servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + configip=${configip:-"0.0.0.0"} + tickrate=${tickrate:-"NOT SET"} adminpassword=${adminpassword:-"NOT SET"} - port=${port:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"0"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} fi + + # Parameters + queryport="${port:-"0"}" } -fn_info_config_sdtd(){ +fn_info_game_sdtd(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" serverpassword="${unavailable}" port="${zero}" + port3="${zero}" queryport="${zero}" webadminenabled="${unavailable}" webadminport="${zero}" @@ -1202,168 +1400,139 @@ fn_info_config_sdtd(){ servername=$(grep "ServerName" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") port=$(grep "ServerPort" "${servercfgfullpath}" | grep -Eo 'value="[0-9]+"' | tr -cd '[:digit:]') + port3=$((port+2)) queryport=${port:-"0"} - webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd '[:digit:]') webadminpass=$(grep "ControlPanelPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - telnetenabled=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - telnetpass=$(grep "TelnetPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - # Telnet IP will be localhost if no password is set - # check_ip will set the IP first. This will overwrite it. - if [ -z "${telnetpass}" ]; then - telnetip="127.0.0.1" - fi - maxplayers=$(grep "ServerMaxPlayerCount" "${servercfgfullpath}" | tr -cd '[:digit:]') - gamemode=$(grep "GameMode" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - gameworld=$(grep "GameWorld" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"0"} - webadminpass=${webadminpass:-"NOT SET"} - telnetenabled=${telnetenabled:-"NOT SET"} - telnetport=${telnetport:-"0"} - telnetpass=${telnetpass:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} - gamemode=${gamemode:-"NOT SET"} - gameworld=${gameworld:-"NOT SET"} - fi -} - -fn_info_config_mta(){ - if [ ! -f "${servercfgfullpath}" ]; then - configip="${zero}" - port="${unavailable}" - httpport="${unavailable}" - ase="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - else - port=$(grep -m 1 "serverport" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') - httpport=$(grep -m 1 "httpport" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') - servername=$(grep -m 1 "servername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<") - serverpassword=$(grep -m 1 "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<") - maxplayers=$(grep -m 1 "maxplayers" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') - ase=$(grep -m 1 "ase" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') - if [ "${ase}" == "1" ]; then - ase="Enabled" - else - ase="Disabled" + telnetenabled=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + telnetpass=$(grep "TelnetPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + # Telnet IP will be localhost if no password is set + # check_ip will set the IP first. This will overwrite it. + if [ -z "${telnetpass}" ]; then + telnetip="127.0.0.1" fi - # configip=$(grep -m 1 "serverip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<") - # ipsetinconfig=1 - # ipinconfigvar="serverip" + maxplayers=$(grep "ServerMaxPlayerCount" "${servercfgfullpath}" | tr -cd '[:digit:]') + gamemode=$(grep "GameMode" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + gameworld=$(grep "GameWorld" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") # Not Set - port=${port:-"22003"} - httpport=${httpport:-"22005"} - ase=${ase:-"Disabled"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${queryport:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminport=${webadminport:-"0"} + webadminpass=${webadminpass:-"NOT SET"} + telnetenabled=${telnetenabled:-"NOT SET"} + telnetport=${telnetport:-"0"} + telnetpass=${telnetpass:-"NOT SET"} + maxplayers=${maxplayers:-"NOT SET"} + gamemode=${gamemode:-"NOT SET"} + gameworld=${gameworld:-"NOT SET"} fi } -fn_info_config_wolfensteinenemyterritory(){ +fn_info_game_sof2(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" maxplayers="${zero}" - port="${zero}" - queryport="${zero}" else - port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - queryport="${port}" - rconpassword=$(grep "set zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - - configip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="set net_ip" + 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"} - port=${port:-"27960"} - queryport=${queryport:-"27960"} fi + + # Parameters + port=${port:-"0"} + queryport=${port:-"0"} + defaultmap=${defaultmap:-"NOT SET"} } -fn_info_config_etlegacy(){ +fn_info_game_sol(){ if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" + adminpassword="${unavailable}" + maxplayers="${unavailable}" port="${zero}" queryport="${zero}" + servername="${unavailable}" + serverpassword="${unavailable}" else - port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + adminpassword=$(grep "Admin_Password=" "${servercfgfullpath}" | awk -F '=' '{print $2}') + maxplayers=$(grep "Max_Players=" "${servercfgfullpath}" | tr -cd '[:digit:]') + port=$(grep "Port=" "${servercfgfullpath}" | tr -cd '[:digit:]') queryport="${port}" - rconpassword=$(grep "set rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - - configip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="set net_ip" + filesport=$((port+10)) + servername=$(grep "Server_Name=" "${servercfgfullpath}" | awk -F '=' '{print $2}') + serverpassword=$(grep "Game_Password=" "${servercfgfullpath}" | awk -F '=' '{print $2}') - # Not Set - rconpassword=${rconpassword:-"NOT SET"} + # Not set + adminpassword=${adminpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"23073"} + queryport=${queryport:-"23083"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"27960"} - queryport=${queryport:-"27960"} fi } -fn_info_config_wurmunlimited(){ +fn_info_game_source(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then - port="${zero}" - queryport="${zero}" - rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" - adminpassword="${unavailable}" - maxplayers="${zero}" + rconpassword="${unavailable}" else - - port=$(grep "EXTERNALPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - queryport=$(grep "QUERYPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - servername=$(grep "SERVERNAME=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERNAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "SERVERPASSWORD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERPASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - adminpassword=$(grep "ADMINPWD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMINPWD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MAXPLAYERS=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - configip=$(grep "IP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/IP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="IP" + servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "sv_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/sv_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') # Not Set - port=${port:-"3724"} - queryport=${queryport:-"27017"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} + rconpassword=${rconpassword:-"NOT SET"} fi + + # Parameters + defaultmap=${defaultmap:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + rconport=${port:-"0"} + queryport=${port:-"0"} + clientport=${clientport:-"0"} + # Steamport can be between 26901-26910 and is normaly automatically set. + # Some servers might support -steamport parameter to set + if [ "${steamport}" == "0" ]||[ -v "${steamport}" ]; then + steamport="$(echo "${ssinfo}" | grep "${srcdslinuxpid}" | awk '{print $5}' | grep ":269" | cut -d ":" -f2)" + fi +} + +fn_info_game_spark(){ + defaultmap=${defaultmap:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=$((port+1)) + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} + webadminport=${webadminport:-"0"} + # Commented out as displaying not set in details parameters + #mods=${mods:-"NOT SET"} } -fn_info_config_squad(){ +fn_info_game_squad(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" maxplayers="${unavailable}" @@ -1389,7 +1558,8 @@ fn_info_config_squad(){ maxplayers=${maxplayers:-"0"} } -fn_info_config_stationeers(){ +fn_info_game_st(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" serverpassword="${unavailable}" @@ -1407,165 +1577,379 @@ fn_info_config_stationeers(){ rconpassword=${rconpassword:-"NOT SET"} maxplayers=${maxplayers:-"0"} fi + + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} + httpport=${port:-"0"} + worldtype=${worldtype:-"NOT SET"} + autosaveinterval=${autosaveinterval:-"0"} + clearinterval=${clearinterval:-"0"} + worldname=${worldname:-"NOT SET"} +} +fn_info_game_terraria(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + port="${zero}" + gameworld="${unavailable}" + maxplayers="${zero}" + queryport="${zero}" + else + servername=$(grep "worldname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/worldname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "port" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=${port:-"0"} + gameworld=$(grep "world=" "${servercfgfullpath}" | grep -v "//" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/world=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + # Not Set + servername=${servername:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + gameworld=${gameworld:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_game_ts3(){ + if [ ! -f "${servercfgfullpath}" ]; then + dbplugin="${unavailable}" + port="9987" + queryport="10011" + querysshport="10022" + queryhttpport="10080" + queryhttpsport="10443" + fileport="30033" + telnetport="10011" + else + dbplugin=$(grep "dbplugin=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/dbplugin=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "default_voice_port" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$(grep "query_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + querysshport=$(grep "query_ssh_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryhttpport=$(grep "query_http_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryhttpsport=$(grep "query_https_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + fileport=$(grep "filetransfer_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + telnetport="${queryport}" + + configip=$(grep "voice_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/voice_ip//g' | sed 's/,.*//' | tr -d '=\";,' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ipsetinconfig=1 + ipinconfigvar="voice_ip" + + # Not Set + dbplugin=${dbplugin:-"NOT SET"} + port=${port:-"9987"} + queryport=${queryport:-"10011"} + querysshport=${querysshport:-"10022"} + queryhttpport=${queryhttpport:-"10080"} + queryhttpsport=${queryhttpsport:-"10443"} + fileport=${fileport:-"30033"} + telnetport=${telnetport:-"10011"} + fi } -fn_info_config_mordhau(){ +fn_info_game_tu(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" + maxplayers="${zero}" + else + servername=$(grep "ServerTitle" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerTitle//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not Set + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi + + # Parameters + port=${port:-"0"} + steamport=$((port+1)) + queryport=${queryport:-"0"} +} + +fn_info_game_tw(){ + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="unnamed server" serverpassword="${unavailable}" rconpassword="${unavailable}" - maxplayers="${unavailable}" + port="8303" + queryport="8303" + maxplayers="12" 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}') + servername=$(grep "sv_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^password" | sed -e '/^#/d' -e 's/^password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "sv_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "sv_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryport="${port}" + maxplayers=$(grep "sv_max_clients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - # Not set + # Not Set servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} + port=${port:-"8303"} + queryport=${port:-"8303"} + maxplayers=${maxplayers:-"12"} + fi + + # Parameters + queryport="${port:-"0"}" +} + +fn_info_game_unreal(){ + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + queryportgs="${zero}" + webadminenabled="${unavailable}" + webadminport="${zero}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + port=$(grep "Port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]') + queryport=$((port+1)) + queryportgs=$(grep "OldQueryPortNumber" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + beaconport=$(grep "ServerBeaconPort" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + webadminenabled=$(grep "bEnabled" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + httpport=$(grep "ListenPort" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + webadminuser=$(grep "AdminUsername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminUsername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + webadminpass=$(grep "UTServerAdmin.UTServerAdmin" "${servercfgfullpath}" -A 4 | grep "AdminPassword" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + beaconport=${beaconport:-"8777"} + queryportgs=${queryportgs:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminport=${webadminport:-"0"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} + fi + + # Parameters + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_game_unreal2(){ + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + queryportgs="${zero}" + webadminenabled="${unavailable}" + webadminport="${zero}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" + else + servername=$(sed -nr 's/^ServerName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$((port+1)) + queryportgs=$(sed -nr 's/^OldQueryPortNumber=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminport=$(sed -nr 's/^ListenPort=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminuser=$(sed -nr 's/^AdminName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminpass="${adminpassword}" + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + queryportgs=${queryportgs:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminport=${webadminport:-"0"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} fi + + # Parameters + defaultmap=${defaultmap:-"NOT SET"} } +fn_info_game_unt(){ + servername=${selfname:-"NOT SET"} + port=${port:-"0"} + queryport=$((port+1)) +} -fn_info_config_avorion() { +fn_info_game_ut(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then - maxplayers="${unavailable}" servername="${unavailable}" - serverpassword="${unavailable}" - rconpassword="${unavailable}" - rconport="${unavailable}" - rconenabled="${unavailable}" - queryport="${unavailable}" else - maxplayers=$(grep "maxPlayers=" "${servercfgfullpath}" | sed 's/maxPlayers=//') - servername=$(grep "name=" "${servercfgfullpath}" | sed 's/name=//') - serverpassword=$(grep "password=" "${servercfgfullpath}" | sed 's/password=//') - rconpassword=$(grep "rconPassword=" "${servercfgfullpath}" | sed 's/rconPassword=//') - rconport=$(grep "rconPort=" "${servercfgfullpath}" | sed 's/rconPort=//') - if [ -n "${rconpassword}" ]; then - rconenabled="true" - queryport="${rconport}" - fi + servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') # Not set - maxplayers=${maxplayers:-"NOT SET"} servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - rconport=${rconport:-"0"} - rconenabled=${rconenabled:-"false"} - queryport=${queryport:-"0"} fi + + # Parameters + port=${port:-"0"} + queryport=$((port+1)) } -fn_info_config_soldat(){ +fn_info_game_ut2k4(){ if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" adminpassword="${unavailable}" - maxplayers="${unavailable}" port="${zero}" queryport="${zero}" - servername="${unavailable}" - serverpassword="${unavailable}" + queryportgs="${zero}" + lanport="${zero}" + webadminenabled="${unavailable}" + httpport="${zero}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" else - adminpassword=$(grep "Admin_Password=" "${servercfgfullpath}" | awk -F '=' '{print $2}') - maxplayers=$(grep "Max_Players=" "${servercfgfullpath}" | tr -cd '[:digit:]') - port=$(grep "Port=" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport="${port}" - servername=$(grep "Server_Name=" "${servercfgfullpath}" | awk -F '=' '{print $2}') - serverpassword=$(grep "Game_Password=" "${servercfgfullpath}" | awk -F '=' '{print $2}') + servername=$(sed -nr 's/^ServerName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$((port+1)) + queryportgs=$(sed -nr 's/^OldQueryPortNumber=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + lanport=$(grep "LANServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + httpport=$(sed -nr 's/^ListenPort=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminuser=$(sed -nr 's/^AdminName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminpass="${adminpassword}" - # Not set - adminpassword=${adminpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"23073"} - queryport=${queryport:-"23083"} + # Not Set servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + queryportgs=${queryportgs:-"0"} + lanport=${lanport:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + httpport=${httpport:-"0"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} fi } -fn_info_config_pavlovvr(){ +fn_info_game_ut3(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" maxplayers="${unavailable}" + webadminenabled="${unavailable}" + webadminport="${zero}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" else - servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | awk -F '=' '{print $2}') + servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + webadminenabled=$(grep "bEnabled" "${servercfgdir}/UTWeb.ini" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + webadminport=$(grep "ListenPort" "${servercfgdir}/UTWeb.ini" | grep -v "#" | tr -cd '[:digit:]') + webadminuser="Admin" + webadminpass=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - # Not set + # Not Set servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"0"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + maxplayers=${maxplayers:-"NOT SET"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminport=${webadminport:-"0"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} fi -} -fn_info_config_col(){ - if [ -f "${servercfgfullpath}" ]; then - servername=$(jq -r '.ServerSettings.ServerName' "${servercfgfullpath}") - serverpassword=$(jq -r '.ServerSettings.ServerPassword' "${servercfgfullpath}") - maxplayers=$(jq -r '.ServerSettings.MaxPlayerCount' "${servercfgfullpath}") - port=$(jq -r '.ServerSettings.ServerGamePort' "${servercfgfullpath}") - steamport=$(jq -r '.ServerSettings.ServerSteamPort' "${servercfgfullpath}") - rconpassword=$(jq -r '.ServerSettings.RCONPassword' "${servercfgfullpath}") - configip=$(jq -r '.ServerSettings.ServerIP' "${servercfgfullpath}") + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} + defaultmap=${defaultmap:-"NOT SET"} +} - # password not set - serverpassword=${serverpassword:-"NOT SET"} - queryport=${port:-"0"} +fn_info_game_vh(){ + port=${port:-"0"} + if [ "${public}" != "0" ]; then + queryport=$((port+1)) else - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"27004"} - steamport=${steamport:-"27005"} - rconpassword=${rconpassword:-"NOT SET"} + querymode="1" fi + gameworld=${gameworld:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} } -fn_info_config_vintagestory(){ +fn_info_game_wet(){ if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" servername="${unavailable}" - maxplayers="${unavailable}" serverpassword="${unavailable}" - port="${unavailable}" - queryport="${unavailable}" - configip="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" else - servername=$(jq -r '.ServerName' "${servercfgfullpath}") - maxplayers=$(jq -r '.MaxClients' "${servercfgfullpath}") - serverpassword=$(jq -r 'select(.Password != null) | .Password' "${servercfgfullpath}") - port=$(jq -r '.Port' "${servercfgfullpath}") - queryport=${port:-"0"} - configip=$(jq -r 'select(.Ip != null) | .Ip' "${servercfgfullpath}") + port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport="${port}" + rconpassword=$(grep "set zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + configip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ipsetinconfig=1 + ipinconfigvar="set net_ip" + # Not Set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - configip=${configip:-"0.0.0.0"} + maxplayers=${maxplayers:-"0"} + port=${port:-"27960"} + queryport=${queryport:-"27960"} fi } -fn_info_config_scpsl(){ - if [ -f "${servercfgfullpath}" ]; then - servername=$(sed -nr 's/^server_name: (.*)$/\1/p' "${servercfgfullpath}") - maxplayers=$(sed -nr 's/^max_players: (.*)$/\1/p' "${servercfgfullpath}") - configip=$(sed -nr 's/^ipv4_bind_ip: (.*)$/\1/p' "${servercfgfullpath}") - tickrate=$(sed -nr 's/^server_tickrate: (.*)$/\1/p' "${servercfgfullpath}") - adminpassword=$(sed -nr 's/^administrator_query_password: (.*)$/\1/p' "${servercfgfullpath}") - - if [ "${adminpassword}" == "none" ]; then - adminpassword="NOT SET" - fi +fn_info_game_wf(){ + # Config + 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"} - configip=${configip:-"0.0.0.0"} - tickrate=${tickrate:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} fi + + # Parameters + port=${port:-"0"} + queryport="${port:-"0"}" + webadminport=${webadminport:-"0"} } -fn_info_config_waterfall(){ + +fn_info_game_wmc(){ if [ -f "${servercfgfullpath}" ]; then servername=$(sed -e '/^listeners:/,/^[a-z]/!d' "${servercfgfullpath}" | sed -nr 's/^[ ]+motd: (.*)$/\1/p' | tr -d "'" | sed 's/&1//') queryport=$(sed -nr 's/^[ -]+query_port: ([0-9]+)/\1/p' "${servercfgfullpath}") @@ -1587,132 +1971,183 @@ fn_info_config_waterfall(){ fi } +fn_info_game_wurm(){ + if [ ! -f "${servercfgfullpath}" ]; then + port="${zero}" + queryport="${zero}" + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + maxplayers="${zero}" + else + + port=$(grep "EXTERNALPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryport=$(grep "QUERYPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + servername=$(grep "SERVERNAME=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERNAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "SERVERPASSWORD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERPASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + adminpassword=$(grep "ADMINPWD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMINPWD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MAXPLAYERS=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + configip=$(grep "IP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/IP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ipsetinconfig=1 + ipinconfigvar="IP" + + # Not Set + port=${port:-"3724"} + queryport=${queryport:-"27017"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +unavailable="${red}UNAVAILABLE${default}" +zero="${red}0${default}" + if [ "${shortname}" == "ac" ]; then - fn_info_config_assettocorsa + fn_info_game_ac elif [ "${shortname}" == "ark" ]; then - fn_info_config_ark + fn_info_game_ark +elif [ "${shortname}" == "arma3" ]; then + fn_info_game_arma3 elif [ "${shortname}" == "av" ]; then - fn_info_config_avorion + fn_info_game_av +elif [ "${shortname}" == "bf1942" ]; then + fn_info_game_bf1942 +elif [ "${shortname}" == "bfv" ]; then + fn_info_game_bfv elif [ "${shortname}" == "bo" ]; then - fn_info_config_ballistic_overkill + fn_info_game_bo elif [ "${shortname}" == "bt" ]; then - fn_info_config_barotrauma + fn_info_game_bt elif [ "${shortname}" == "bt1944" ]; then - fn_info_config_battalion1944 -elif [ "${shortname}" == "bf1942" ]; then - fn_info_config_bf1942 -elif [ "${shortname}" == "bfv" ]; then - fn_info_config_bfv + fn_info_game_bt1944 elif [ "${shortname}" == "cmw" ]; then - fn_info_config_chivalry + fn_info_game_cmw elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]; then - fn_info_config_cod + fn_info_game_cod elif [ "${shortname}" == "cod2" ]; then - fn_info_config_cod2 + fn_info_game_cod2 elif [ "${shortname}" == "cod4" ]; then - fn_info_config_cod4 + fn_info_game_cod4 elif [ "${shortname}" == "codwaw" ]; then - fn_info_config_codwaw + fn_info_game_codwaw elif [ "${shortname}" == "col" ]; then - fn_info_config_col + fn_info_game_col elif [ "${shortname}" == "dst" ]; then - fn_info_config_dontstarve + fn_info_game_dst elif [ "${shortname}" == "eco" ]; then - fn_info_config_eco + fn_info_game_eco +elif [ "${shortname}" == "etl" ]; then + fn_info_game_etl elif [ "${shortname}" == "fctr" ]; then - fn_info_config_factorio + fn_info_game_fctr +elif [ "${shortname}" == "hw" ]; then + fn_info_game_hw +elif [ "${shortname}" == "inss" ]; then + fn_info_game_inss elif [ "${shortname}" == "jc2" ]; then - fn_info_config_justcause2 + fn_info_game_jc2 elif [ "${shortname}" == "jc3" ]; then - fn_info_config_justcause3 -elif [ "${shortname}" == "kf2" ]; then - fn_info_config_kf2 -elif [ "${shortname}" == "mohaa" ]; then - fn_info_config_mohaa -elif [ "${shortname}" == "mofm" ]; then - fn_info_config_mofm -elif [ "${shortname}" == "qw" ]; then - fn_info_config_quakeworld -elif [ "${shortname}" == "q2" ]; then - fn_info_config_quake2 -elif [ "${shortname}" == "q3" ]; then - fn_info_config_quake3 -elif [ "${shortname}" == "ql" ]; then - fn_info_config_quakelive + fn_info_game_jc3 elif [ "${shortname}" == "jk2" ]; then - fn_info_config_jk2 + fn_info_game_jk2 +elif [ "${shortname}" == "kf" ]; then + fn_info_game_kf +elif [ "${shortname}" == "kf2" ]; then + fn_info_game_kf2 elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]; then - fn_info_config_minecraft + fn_info_game_mc elif [ "${shortname}" == "mcb" ]; then - fn_info_config_minecraft_bedrock + fn_info_game_mcb +elif [ "${shortname}" == "mh" ]; then + fn_info_game_mh +elif [ "${shortname}" == "mohaa" ]; then + fn_info_game_mohaa +elif [ "${shortname}" == "mom" ]; then + fn_info_game_mom +elif [ "${shortname}" == "mta" ]; then + fn_info_game_mta +elif [ "${shortname}" == "mumble" ]; then + fn_info_game_mumble elif [ "${shortname}" == "onset" ]; then - fn_info_config_onset -elif [ "${shortname}" == "pstbs" ]; then - fn_info_config_pstbs + fn_info_game_onset elif [ "${shortname}" == "pc" ]; then - fn_info_config_projectcars + fn_info_game_pc +elif [ "${shortname}" == "pstbs" ]; then + fn_info_game_pstbs +elif [ "${shortname}" == "pvr" ];then + fn_info_game_pvr elif [ "${shortname}" == "pz" ]; then - fn_info_config_projectzomboid -elif [ "${shortname}" == "arma3" ]; then - fn_info_config_realvirtuality + fn_info_game_pz +elif [ "${shortname}" == "q2" ]; then + fn_info_game_q2 +elif [ "${shortname}" == "q3" ]; then + fn_info_game_q3 +elif [ "${shortname}" == "ql" ]; then + fn_info_game_ql +elif [ "${shortname}" == "qw" ]; then + fn_info_game_qw +elif [ "${shortname}" == "ro" ]; then + fn_info_game_ro elif [ "${shortname}" == "rtcw" ]; then - fn_info_config_rtcw + fn_info_game_rtcw +elif [ "${shortname}" == "rust" ]; then + fn_info_game_rust elif [ "${shortname}" == "rw" ]; then - fn_info_config_risingworld -elif [ "${shortname}" == "sol" ]; then - fn_info_config_soldat -elif [ "${shortname}" == "sof2" ]; then - fn_info_config_sof2 -elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then - fn_info_config_source -elif [ "${shortname}" == "sb" ]; then - fn_info_config_starbound -elif [ "${shortname}" == "ts3" ]; then - fn_info_config_teamspeak3 -elif [ "${shortname}" == "mumble" ]; then - fn_info_config_mumble + fn_info_game_rw elif [ "${shortname}" == "samp" ]; then - fn_info_config_samp -elif [ "${shortname}" == "pstbs" ]; then - fn_info_config_sbots -elif [ "${shortname}" == "tw" ]; then - fn_info_config_teeworlds -elif [ "${shortname}" == "terraria" ]; then - fn_info_config_terraria -elif [ "${shortname}" == "tu" ]; then - fn_info_config_towerunite -elif [ "${engine}" == "unreal" ]; then - fn_info_config_unreal -elif [ "${engine}" == "unreal2" ]; then - fn_info_config_unreal2 -elif [ "${engine}" == "unreal3" ]; then - fn_info_config_unreal3 -elif [ "${shortname}" == "ut" ]; then - fn_info_config_ut + fn_info_game_samp +elif [ "${shortname}" == "sb" ]; then + fn_info_game_sb +elif [ "${shortname}" == "sbots" ]; then + fn_info_game_sbots elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then - fn_info_config_scpsl + fn_info_game_scpsl elif [ "${shortname}" == "sdtd" ]; then - fn_info_config_sdtd -elif [ "${shortname}" == "wet" ]; then - fn_info_config_wolfensteinenemyterritory -elif [ "${shortname}" == "wf" ]; then - fn_info_config_warfork -elif [ "${shortname}" == "etl" ]; then - fn_info_config_etlegacy -elif [ "${shortname}" == "wurm" ]; then - fn_info_config_wurmunlimited -elif [ "${shortname}" == "mta" ]; then - fn_info_config_mta + fn_info_game_sdtd +elif [ "${shortname}" == "sof2" ]; then + fn_info_game_sof2 +elif [ "${shortname}" == "sol" ]; then + fn_info_game_sol +elif [ "${engine}" == "spark" ]; then + fn_info_game_spark elif [ "${shortname}" == "squad" ]; then - fn_info_config_squad + fn_info_game_squad elif [ "${shortname}" == "st" ]; then - fn_info_config_stationeers -elif [ "${shortname}" == "mh" ]; then - fn_info_config_mordhau -elif [ "${shortname}" == "pvr" ];then - fn_info_config_pavlovvr + fn_info_game_st +elif [ "${shortname}" == "terraria" ]; then + fn_info_game_terraria +elif [ "${shortname}" == "tu" ]; then + fn_info_game_tu +elif [ "${shortname}" == "tw" ]; then + fn_info_game_tw +elif [ "${shortname}" == "unt" ]; then + fn_info_game_unt +elif [ "${shortname}" == "ut" ]; then + fn_info_game_ut +elif [ "${shortname}" == "ut2k4" ]; then + fn_info_game_ut2k4 +elif [ "${shortname}" == "ut3" ]; then + fn_info_game_ut3 +elif [ "${shortname}" == "vh" ]; then + fn_info_game_vh elif [ "${shortname}" == "vints" ]; then - fn_info_config_vintagestory + fn_info_game_vints +elif [ "${shortname}" == "wet" ]; then + fn_info_game_wet +elif [ "${shortname}" == "wf" ]; then + fn_info_game_wf elif [ "${shortname}" == "wmc" ]; then - fn_info_config_waterfall + fn_info_game_wmc +elif [ "${shortname}" == "wurm" ]; then + fn_info_game_wurm +elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then + fn_info_game_source +elif [ "${engine}" == "unreal" ]; then + fn_info_game_unreal +elif [ "${engine}" == "unreal2" ]; then + fn_info_game_unreal2 fi diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 099d8de8e..9afe2e0d2 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -92,7 +92,7 @@ fn_info_message_distro(){ echo -e "${lightyellow}Distro Details${default}" fn_messages_separator { - echo -e "${lightblue}Date:\t${default}${date}" + echo -e "${lightblue}Date:\t${default}$(date)" echo -e "${lightblue}Distro:\t${default}${distroname}" echo -e "${lightblue}Arch:\t${default}${arch}" echo -e "${lightblue}Kernel:\t${default}${kernel}" @@ -100,6 +100,9 @@ fn_info_message_distro(){ 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}" + if [ -n "${javaram}" ]; then + echo -e "${lightblue}Java:\t${default}${javaversion}" + fi } | column -s $'\t' -t } @@ -262,6 +265,11 @@ fn_info_message_gameserver(){ echo -e "${lightblue}Beta Password:\t${default}${betapassword}" fi + # Server Version + if [ -n "${gdversion}" ]; then + echo -e "${lightblue}Server Version:\t${default}${gdversion}" + fi + # Server ip echo -e "${lightblue}Server IP:\t${default}${ip}:${port}" @@ -347,7 +355,7 @@ fn_info_message_gameserver(){ fi if [ -n "${defaultscenario}" ]; then - # Current scenario + # Current scenario (Insurgency: Sandstorm) if [ -n "${gdgamemode}" ]; then echo -e "${lightblue}Current scenario:\t${default}${gdgamemode}" fi @@ -425,7 +433,22 @@ fn_info_message_gameserver(){ # Save interval (Rust) if [ -n "${saveinterval}" ]; then - echo -e "${lightblue}ASE:\t${default}${saveinterval} s" + echo -e "${lightblue}Save interval:\t${default}${saveinterval}s" + fi + + # Seed (Rust) + if [ -n "${seed}" ]; then + echo -e "${lightblue}Seed:\t${default}${seed}" + fi + + # Salt (Rust) + if [ -n "${salt}" ]; then + echo -e "${lightblue}Salt:\t${default}${salt}" + fi + + # World Size (Rust) + if [ -n "${worldsize}" ]; then + echo -e "${lightblue}World size:\t${default}${worldsize}m" fi # Random map rotation mode (Squad and Post Scriptum) @@ -614,7 +637,7 @@ fn_info_message_commandlineparms(){ echo -e "${preexecutable} ${executable} ${startparameters}" } -fn_info_message_ports(){ +fn_info_message_ports_edit(){ # # Ports # ================================= @@ -627,18 +650,18 @@ fn_info_message_ports(){ startparameterslocation="${red}UNKNOWN${default}" # engines/games that require editing in the config file. - local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "Barotrauma" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Minecraft Bedrock" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" "Vintage Story" "wurm") + local ports_edit_array=( "ac" "arma3" "bo" "bt" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "mumble" "pc" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "wurm") for port_edit in "${ports_edit_array[@]}"; do if [ "${shortname}" == "ut3" ]; then startparameterslocation="${servercfgdir}/UTWeb.ini" elif [ "${shortname}" == "kf2" ]; then startparameterslocation="${servercfgdir}/LinuxServer-KFEngine.ini\n${servercfgdir}/KFWeb.ini" - elif [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then + elif [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then startparameterslocation="${servercfgfullpath}" fi done # engines/games that require editing the start parameters. - local ports_edit_array=( "Avorion" "col" "goldsrc" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "qfusion" "Rust" "scpsl" "scpslsm" "Soldat" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned" "vh" ) + local ports_edit_array=( "av" "col" "fctr" "goldsrc" "hw" "iw3.0" "ioquake3" "qfusion" "rust" "scpsl" "scpslsm" "sol" "spark" "source" "unreal4" "arma3" "unt" "vh" ) for port_edit in "${ports_edit_array[@]}"; do if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then startparameterslocation="${configdirserver}" @@ -646,7 +669,27 @@ fn_info_message_ports(){ done echo -e "${startparameterslocation}" echo -e "" +} + +fn_info_message_ports(){ echo -e "${lightblue}Useful port diagnostic command:${default}" + if [ "${shortname}" == "av" ]; then + echo -e "ss -tuplwn | grep AvorionServer" + elif [ "${shortname}" == "bf1942" ]; then + echo -e "ss -tuplwn | grep bf1942_lnxded" + elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "rw" ]||[ "${shortname}" == "wmc" ]; then + echo -e "ss -tuplwn | grep java" + elif [ "${shortname}" == "terraria" ]; then + echo -e "ss -tuplwn | grep Main" + elif [ "${engine}" == "source" ]; then + echo -e "ss -tuplwn | grep srcds_linux" + elif [ "${engine}" == "goldsrc" ]; then + echo -e "ss -tuplwn | grep hlds_linux" + else + executableshort="$(basename "${executable}" | cut -c -15)" + echo -e "ss -tuplwn | grep ${executableshort}" + fi + echo -e "" } fn_info_message_statusbottom(){ @@ -702,466 +745,562 @@ fn_info_logs(){ # Engine/Game Specific details -fn_info_message_assettocorsa(){ - echo -e "netstat -atunp| grep acServer" - echo -e "" +# Function used to generate port info. by passing info to function. (Reduces repeating code) +# example output +# DESCRIPTION PORT PROTOCOL LISTEN +# Game 7777 udp 1 +# RAW UDP Socket 7778 udp 1 +# Query 27015 udp 1 +# RCON 27020 tcp 1 + +fn_port(){ + if [ "${1}" == "header" ]; then + echo -e "${lightblue}DESCRIPTION\tPORT\tPROTOCOL\tLISTEN${default}" + else + portname="${1}" + porttype="${2}" + portprotocol="${3}" + echo -e "${portname}\t${!porttype}\t${portprotocol}\t$(echo "${ssinfo}" | grep ${portprotocol} | grep ${!porttype} | wc -l)" + fi +} + +fn_info_message_ac(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> HTTP\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Game" port tcp + fn_port "Query" queryport udp + fn_port "HTTP" httpport tcp } | column -s $'\t' -t } fn_info_message_ark(){ - echo -e "netstat -atunp | grep ShooterGame" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - # Don't do arithmetics if ever the port wasn't a numeric value - if [ "${port}" -eq "${port}" ]; then - echo -e "> RAW\tINBOUND\t$((port+1))\tudp" - fi - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "RAW UDP Socket" rawport udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp } | column -s $'\t' -t } -fn_info_message_avorion() { - echo "netstat -atunp | grep Avorion" - echo -e "" +fn_info_message_arma3(){ { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Voice" voiceport udp + fn_port "Query Steam" queryport udp + fn_port "Steam Master" steammasterport udp + fn_port "Voice (unused)" voiceunusedport udp + fn_port "BattleEye" battleeyeport udp } | column -s $'\t' -t } -fn_info_message_ballisticoverkill(){ - echo -e "netstat -atunp | grep BODS.x86" - echo -e "" +fn_info_message_av(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Steam Master" steammasterport udp + fn_port "Steam Query" steamqueryport udp + fn_port "RCON" rconport tcp } | column -s $'\t' -t } -fn_info_message_battalion1944(){ - echo -e "netstat -atunp | grep BattalionServ" - echo -e "" +fn_info_message_bf1942(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - # Don't do arithmetics if ever the port wasn't a numeric value - # unconfirmed - http://wiki.battaliongame.com/Community_Servers#Firewalls_.2F_Port_Forwarding - if [ "${port}" -eq "${port}" ]; then - echo -e "> Steam\tINBOUND\t$((port+1))\tudp" - echo -e "> Unused\tINBOUND\t$((port+2))\ttcp" - fi - echo -e "> Query\tINBOUND\t${queryport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } -fn_info_message_cod(){ - echo -e "netstat -atunp | grep cod_lnxded" - echo -e "" +fn_info_message_bfv(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } -fn_info_message_coduo(){ - echo -e "netstat -atunp | grep coduo_lnxded" - echo -e "" +fn_info_message_bo(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } -fn_info_message_chivalry(){ +fn_info_message_bt(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_bt1944(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_message_cmw(){ fn_info_message_password_strip - echo -e "netstat -atunp | grep UDKGame" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> RCON\tINBOUND\t27960\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_message_cod(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_coduo(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } fn_info_message_cod2(){ - echo -e "netstat -atunp | grep cod2_lnxded" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } fn_info_message_cod4(){ - echo -e "netstat -atunp" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } fn_info_message_codwaw(){ - echo -e "netstat -atunp | grep codwaw_lnxded" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_col(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "Steam" steamport tcp + } | column -s $'\t' -t +} + +fn_info_message_csgo(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "RCON" rconport tcp + fn_port "SourceTV" sourcetvport udp + fn_port "Client" clientport udp } | column -s $'\t' -t } fn_info_message_dst(){ - echo -e "netstat -atunp | grep dontstarve" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game: Server\tINBOUND\t${port}\tudp" - echo -e "> Game: Master\tINBOUND\t${masterport}\tudp" - echo -e "> Steam: Auth\tINBOUND\t${steamauthenticationport}\tudp" - echo -e "> Steam: Master\tINBOUND\t${steammasterserverport}\tudp" + fn_port "header" + fn_port "Game: Server" port udp + fn_port "Game: Master" masterport udp + fn_port "Steam: Auth" steamauthport udp + fn_port "Steam: Master" steammasterport udp } | column -s $'\t' -t } fn_info_message_eco(){ - echo -e "netstat -atunp | grep EcoServer" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Web Admin" webadminport tcp } | column -s $'\t' -t } - -fn_info_message_etlegacy(){ - echo -e "netstat -atunp | grep etlded" - echo -e "" +fn_info_message_etl(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } -fn_info_message_factorio(){ - echo -e "netstat -atunp | grep factorio" - echo -e "" +fn_info_message_fctr(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "RCON" rconport tcp } | column -s $'\t' -t } fn_info_message_goldsrc(){ - echo -e "netstat -atunp | grep hlds_linux" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp" - echo -e "< Client\tOUTBOUND\t${clientport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Client" clientport udp } | column -s $'\t' -t } -fn_info_message_hurtworld(){ - echo -e "netstat -atunp | grep Hurtworld" - echo -e "" +fn_info_message_hw(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_ins(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "RCON" rconport tcp + fn_port "SourceTV" sourcetvport udp + fn_port "Client" clientport udp } | column -s $'\t' -t } fn_info_message_inss(){ - echo -e "netstat -atunp | grep Insurgency" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - if [ -n "${rconport}" ]; then - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" - fi + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp } | column -s $'\t' -t } - fn_info_message_jk2(){ - echo -e "netstat -atunp | grep jk2mvded" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t - } +fn_info_message_jc2(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} -fn_info_message_justcause2(){ - echo -e "netstat -atunp | grep Jcmp-Server" - echo -e "" +fn_info_message_jc3(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Steam" steamport udp + fn_port "HTTP" httpport tcp } | column -s $'\t' -t } -fn_info_message_justcause3(){ - echo -e "netstat -atunp | grep Server" - echo -e "" +fn_info_message_jk2(){ { - 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" + fn_port "header" + fn_port "Game" port udp } | column -s $'\t' -t } -fn_info_message_minecraft(){ - echo -e "netstat -atunp | grep java" +fn_info_message_kf(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Query (GameSpy)" queryportgs udp + fn_port "Web Admin" webadminport tcp + fn_port "LAN" lanport udp + fn_port "Steam" steamport udp + fn_port "Steam Master" steammasterport udp + } | column -s $'\t' -t echo -e "" + echo -e "${lightgreen}${servername} Web Admin${default}" + fn_messages_separator { - 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" + echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" + echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" + echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" } | column -s $'\t' -t } -fn_info_message_minecraft_bedrock(){ - echo -e "netstat -atunp | grep bedrock_serv" +fn_info_message_kf2(){ + fn_info_message_password_strip + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Web Admin" webadminport tcp + } | column -s $'\t' -t echo -e "" + echo -e "${lightgreen}${servername} Web Admin${default}" + fn_messages_separator { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Game\tINBOUND\t${port6}\tudp6" + echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" + echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" + echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" } | column -s $'\t' -t } -fn_info_message_onset(){ - echo -e "netstat -atunp | grep OnsetServer" - echo -e "" +fn_info_message_lo(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> HTTP\tINBOUND\t${httpport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_mc(){ + { + fn_port "header" + fn_port "Game" port tcp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_message_mcb(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Game" portipv6 udp6 + } | column -s $'\t' -t +} + +fn_info_message_mh(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Beacon" beaconport udp } | column -s $'\t' -t } fn_info_message_mohaa(){ - echo -e "netstat -atunp | grep mohaa_lnxded" - echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp } | column -s $'\t' -t } fn_info_message_mom(){ - echo -e "netstat -atunp | grep MemoriesOfMar" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> BeaconPort\tINBOUND\t${beaconport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Beacon" beaconport udp } | column -s $'\t' -t } -fn_info_message_mumble(){ - echo -e "netstat -atunp | grep murmur" - echo -e "" +fn_info_message_mta(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Voice\tINBOUND\t${port}\tudp" - echo -e "> ServerQuery\tINBOUND\t${port}\ttcp" + fn_port "header" + fn_port "Game" port udp + if [ "${ase}" == "Enabled" ]; then + fn_port "Query" queryport udp + fi + fn_port "HTTP" httpport tcp } | column -s $'\t' -t } -fn_info_message_pstbs(){ - echo -e "netstat -atunp | grep PostScriptum" - echo -e "" + +fn_info_message_mumble(){ { - 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" + fn_port "header" + fn_port "Voice" port udp + fn_port "Query" queryport tcp } | column -s $'\t' -t } -fn_info_message_projectcars(){ - echo -e "netstat -atunp | grep DedicatedS" - echo -e "" +fn_info_message_onset(){ { - 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" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "HTTP" httpport tcp } | column -s $'\t' -t } -fn_info_message_projectzomboid(){ - echo -e "netstat -atunp | grep ProjectZomb" - echo -e "" +fn_info_message_pc(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Steam" steamport udp } | column -s $'\t' -t } -fn_info_message_quake(){ - echo -e "netstat -atunp | grep mvdsv" - echo -e "" +fn_info_message_pstbs(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp } | column -s $'\t' -t } -fn_info_message_quake2(){ - echo -e "netstat -atunp | grep quake2" - echo -e "" +fn_info_message_pvr(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Game" port tcp + fn_port "Game+400" port401 udp + fn_port "Query" queryport tcp } | column -s $'\t' -t } -fn_info_message_quake3(){ - echo -e "netstat -atunp | grep q3ded" - echo -e "" +fn_info_message_pz(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } -fn_info_message_quakelive(){ - echo -e "netstat -atunp | grep qzeroded" - echo -e "" - if [ -z "${port}" ]||[ -z "${rconport}" ]||[ -z "${statsport}" ]; then - echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}." - echo -e "" - fi +fn_info_message_qw(){ { - 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" + fn_port "header" + fn_port "Game" port udp } | column -s $'\t' -t } -fn_info_message_arma3(){ - echo -e "netstat -atunp | grep arma3server" - echo -e "" - # Default port - if [ -z "${port}" ]; then - port="2302" - fi +fn_info_message_q2(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - # Don't do arithmetics if ever the port wasn't a numeric value - if [ "${port}" -eq "${port}" ]; then - echo -e "> Query Steam\tINBOUND\t$((port+1))\tudp" - echo -e "> Steam: Master traffic\tINBOUND\t$((port+2))\tudp" - echo -e "> Undocumented Port\tINBOUND\t$((port+3))\tudp" - fi + fn_port "header" + fn_port "Game" port udp } | column -s $'\t' -t } -fn_info_message_bf1942(){ - echo -e "netstat -atunp | grep bf1942_lnxd" - echo -e "" +fn_info_message_q3(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" - echo -e "> Query Steam\tINBOUND\t${queryport}\tudp" + fn_port "header" + fn_port "Game" port udp } | column -s $'\t' -t } -fn_info_message_bfv(){ - echo -e "netstat -atunp | grep bfv_linded" - echo -e "" +fn_info_message_ql(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + fn_port "Stats" statsport udp } | column -s $'\t' -t } -fn_info_message_risingworld(){ - echo -e "netstat -atunp | grep java" +fn_info_message_ro(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Web Admin" webadminport tcp + fn_port "LAN" lanport udp + fn_port "Steam" steamport udp + fn_port "Steam Master" steammasterport udp + } | column -s $'\t' -t echo -e "" + echo -e "${lightgreen}${servername} Web Admin${default}" + fn_messages_separator { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp" - echo -e "> Query HTTP\tINBOUND\t${httpqueryport}\ttcp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" + echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" + echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" } | column -s $'\t' -t } fn_info_message_rtcw(){ - echo -e "netstat -atunp | grep iowolfded" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp } | column -s $'\t' -t } fn_info_message_rust(){ - echo -e "netstat -atunp | grep Rust" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + fn_port "App" appport tcp + } | column -s $'\t' -t +} + +fn_info_message_rw(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Game+1" port2 udp + fn_port "Game+2" port3 udp + fn_port "Game+3" port4 udp + fn_port "Game+1" port2 tcp + fn_port "Game+2" port3 tcp + fn_port "Game+3" port4 tcp + fn_port "Query" queryport tcp + fn_port "Query HTTP" httpqueryport tcp + fn_port "RCON" rconport tcp } | column -s $'\t' -t } fn_info_message_samp(){ - echo -e "netstat -atunp | grep samp03svr" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp" + fn_port "header" + fn_port "Game" port udp + fn_port "RCON" rconport udp + } | column -s $'\t' -t +} + +fn_info_message_sb(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "RCON" rconport tcp } | column -s $'\t' -t } fn_info_message_sbots(){ - echo -e "netstat -atunp | grep blank1" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_scpsl(){ + { + fn_port "header" + fn_port "Game" port tcp } | column -s $'\t' -t } fn_info_message_sdtd(){ fn_info_message_password_strip - echo -e "netstat -atunp | grep 7DaysToDie" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp" - echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Game+2" port3 udp + fn_port "Query" queryport tcp + fn_port "Web Admin" webadminport tcp + fn_port "Telnet" telnetport tcp } | column -s $'\t' -t echo -e "" echo -e "${lightgreen}${gamename} Web Admin${default}" fn_messages_separator { echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" - echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}/index.html" + echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" } | column -s $'\t' -t echo -e "" @@ -1175,37 +1314,46 @@ fn_info_message_sdtd(){ } 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" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } +fn_info_message_sol(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Files" filesport tcp + } | column -s $'\t' -t +} fn_info_message_source(){ - echo -e "netstat -atunp | grep srcds_linux" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp" - echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp" - echo -e "< Client\tOUTBOUND\t${clientport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "RCON" rconport tcp + fn_port "SourceTV" sourcetvport udp + # Will not show if unaviable + if [ "${steamport}" == "0" ]||[ -z "${steamport}" ]; then + fn_port "Steam" steamport udp + fi + fn_port "Client" clientport udp } | column -s $'\t' -t } fn_info_message_spark(){ fn_info_message_password_strip - echo -e "netstat -atunp | grep server_linux" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Web Admin" webadminport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${servername} Web Admin${default}" + echo -e "${lightgreen}${gamename} Web Admin${default}" fn_messages_separator { echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}/index.html" @@ -1215,107 +1363,75 @@ fn_info_message_spark(){ } fn_info_message_squad(){ - echo -e "netstat -atunp | grep SquadServer" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp } | column -s $'\t' -t } -fn_info_message_starbound(){ - echo -e "netstat -atunp | grep starbound" - echo -e "" +fn_info_message_st(){ { - 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" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Web Admin" webadminport tcp } | column -s $'\t' -t -} - -fn_info_message_stationeers(){ - echo -e "netstat -atunp | grep rocketstation" echo -e "" + echo -e "${lightgreen}${gamename} Web Admin${default}" + fn_messages_separator { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\ttcp" - echo -e "> Query\tINBOUND\t${queryport}\ttcp" + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" } | column -s $'\t' -t } -fn_info_message_teamspeak3(){ - echo -e "netstat -atunp | grep ts3server" - echo -e "" +fn_info_message_ts3(){ { - 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" + fn_port "header" + fn_port "Voice" port udp + fn_port "Query" queryport tcp + fn_port "Query (SSH)" querysshport tcp + fn_port "Query (http)" queryhttpport tcp + fn_port "Query (https)" queryhttpsport tcp + fn_port "File Transfer" fileport tcp + fn_port "Telnet" telnetport tcp } | column -s $'\t' -t } -fn_info_message_teeworlds(){ - echo -e "netstat -atunp | grep teeworlds" - echo -e "" +fn_info_message_tw(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\Query\tINBOUND\t${port}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } fn_info_message_terraria(){ - echo -e "netstat -atunp | grep Terraria" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\ttcp" + fn_port "header" + fn_port "Game" port tcp + fn_port "Query" queryport tcp } | column -s $'\t' -t } -fn_info_message_towerunite(){ - echo -e "netstat -atunp | grep TowerServer" - echo -e "" +fn_info_message_tu(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\ttcp" - # Don't do arithmetics if ever the port wasn't a numeric value - if [ "${port}" -eq "${port}" ]; then - echo -e "> Steam\tINBOUND\t$((port+1))\tudp" - fi - echo -e "> Query\tINBOUND\t${queryport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Steam" steamport udp } | column -s $'\t' -t } fn_info_message_unreal(){ fn_info_message_password_strip - echo -e "netstat -atunp | grep ucc-bin" - echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE" - echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - if [ "${engine}" == "unreal" ]; then - echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp" - fi - if [ "${engine}" != "unreal" ]&&[ "${appid}" != "223250" ]; then - echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}" - fi - if [ "${appid}" == "215360" ]; then - echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp" - else - echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp" - fi - if [ "${appid}" ]; then - if [ "${appid}" == "223250" ]; then - echo -e "> Steam\tINBOUND\t20610\tudp" - else - echo -e "> Steam\tINBOUND\t20660\tudp" - fi - fi - echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "LAN Beacon" beaconport udp + fn_port "Web Admin" webadminport tcp } | column -s $'\t' -t echo -e "" echo -e "${lightgreen}${servername} Web Admin${default}" @@ -1328,18 +1444,14 @@ fn_info_message_unreal(){ } | column -s $'\t' -t } -fn_info_message_unreal2(){ - fn_info_message_password_strip - echo -e "netstat -atunp | grep ucc-bin" - echo -e "" +fn_info_message_ut2k4(){ { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE" - echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - if [ "${appid}" != "223250" ]; then - echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}" - fi - echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Query (GameSpy)" queryportgs udp + fn_port "Web Admin" webadminport tcp + fn_port "LAN" lanport udp } | column -s $'\t' -t echo -e "" echo -e "${lightgreen}${servername} Web Admin${default}" @@ -1352,15 +1464,14 @@ fn_info_message_unreal2(){ } | column -s $'\t' -t } -fn_info_message_unreal3(){ +fn_info_message_unreal(){ fn_info_message_password_strip - echo -e "netstat -atunp | grep ut3-bin" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "LAN Beacon" beaconport udp + fn_port "Web Admin" webadminport tcp } | column -s $'\t' -t echo -e "" echo -e "${lightgreen}${servername} Web Admin${default}" @@ -1373,45 +1484,29 @@ fn_info_message_unreal3(){ } | column -s $'\t' -t } -fn_info_message_unturned(){ - echo -e "netstat -atunp | grep Unturned" - echo -e "" +fn_info_message_unt(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } fn_info_message_ut(){ - echo -e "netstat -atunp | grep UE4Server" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_vh(){ - echo -e "netstat -atunp | grep valheim" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } -fn_info_message_kf2(){ +fn_info_message_ut3(){ fn_info_message_password_strip - echo -e "netstat -atunp | grep KFGame" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\ttcp\tPort=${port}" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> Steam\tINBOUND\t20560\tudp" - echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Web Admin" webadminport tcp } | column -s $'\t' -t echo -e "" echo -e "${lightgreen}${servername} Web Admin${default}" @@ -1424,141 +1519,69 @@ fn_info_message_kf2(){ } | column -s $'\t' -t } -fn_info_message_wolfensteinenemyterritory(){ - echo -e "netstat -atunp | grep etded" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - - -fn_info_message_wurmunlimited(){ - echo -e "netstat -atunp | grep WurmServer" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\ttcp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_mta(){ - echo -e "netstat -atunp | grep mta-server" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" - echo -e "> HTTP Server\tINBOUND\t${httpport}\ttcp" - if [ "${ase}" == "Enabled" ]; then - echo -e "> Query Port\tOUTBOUND\t${queryport}\tudp" - fi - } | column -s $'\t' -t -} - -fn_info_message_mordhau(){ - echo -e "netstat -atunp | grep Mord" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> BeaconPort\tINBOUND\t${beaconport}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_barotrauma(){ - echo -e "netstat -atunp | grep /./Server.bin" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t$((port+1))\tudp" - } | column -s $'\t' -t -} - -fn_info_message_soldat() { - echo -e "netstat -atunp | grep soldat" - echo -e "" +fn_info_message_vh(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> FILES\tINBOUND\t$((port+10))\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } -fn_info_message_warfork(){ - echo -e "netstat -atunp | grep wf_server" - echo -e "" +fn_info_message_vints(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> HTTP\tINBOUND\t${httpport}\ttcp" + fn_port "header" + fn_port "Game" port tcp } | column -s $'\t' -t } -fn_info_message_pavlovvr(){ - echo "netstat -atunp | grep Pavlov" - echo -e "" +fn_info_message_wet(){ { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Game\tINBOUND\t$((port+400))\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } -fn_info_message_colony(){ - echo -e "netstat -atunp | grep colonyserv" - echo -e "" +fn_info_message_wf(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Steam\tINBOUND\t${steamport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "HTTP" httpport tcp } | column -s $'\t' -t } -fn_info_message_vintagestory(){ - echo "netstat -atunp | grep cli" - echo -e "" +fn_info_message_wurm(){ { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tTCP" - } | column -s $'\t' -t -} - -fn_info_message_scpsl(){ - echo -e "netstat -atunp | grep SCPSL" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port tcp + fn_port "Query" queryport udp } | column -s $'\t' -t } fn_info_message_select_engine(){ # Display details depending on game or engine. if [ "${shortname}" == "ac" ]; then - fn_info_message_assettocorsa + fn_info_message_ac elif [ "${shortname}" == "ark" ]; then fn_info_message_ark - elif [ "${shortname}" == "av" ]; then - fn_info_message_avorion elif [ "${shortname}" == "arma3" ]; then fn_info_message_arma3 + elif [ "${shortname}" == "av" ]; then + fn_info_message_av elif [ "${shortname}" == "bf1942" ]; then fn_info_message_bf1942 elif [ "${shortname}" == "bfv" ]; then fn_info_message_bfv elif [ "${shortname}" == "bo" ]; then - fn_info_message_ballisticoverkill + fn_info_message_bo elif [ "${shortname}" == "bt" ]; then - fn_info_message_barotrauma + fn_info_message_bt elif [ "${shortname}" == "bt1944" ]; then - fn_info_message_battalion1944 + fn_info_message_bt1944 + elif [ "${shortname}" == "csgo" ]; then + fn_info_message_csgo elif [ "${shortname}" == "cmw" ]; then - fn_info_message_chivalry + fn_info_message_cmw elif [ "${shortname}" == "cod" ]; then fn_info_message_cod elif [ "${shortname}" == "coduo" ]; then @@ -1570,105 +1593,117 @@ fn_info_message_select_engine(){ elif [ "${shortname}" == "codwaw" ]; then fn_info_message_codwaw elif [ "${shortname}" == "col" ]; then - fn_info_message_colony + fn_info_message_col elif [ "${shortname}" == "dst" ]; then fn_info_message_dst elif [ "${shortname}" == "eco" ]; then fn_info_message_eco elif [ "${shortname}" == "etl" ]; then - fn_info_message_etlegacy + fn_info_message_etl elif [ "${shortname}" == "fctr" ]; then - fn_info_message_factorio + fn_info_message_fctr elif [ "${shortname}" == "hw" ]; then - fn_info_message_hurtworld + fn_info_message_hw + elif [ "${shortname}" == "ins" ]; then + fn_info_message_ins elif [ "${shortname}" == "inss" ]; then fn_info_message_inss - elif [ "${shortname}" == "jk2" ]; then - fn_info_message_jk2 elif [ "${shortname}" == "jc2" ]; then - fn_info_message_justcause2 + fn_info_message_jc2 elif [ "${shortname}" == "jc3" ]; then - fn_info_message_justcause3 + fn_info_message_jc3 + elif [ "${shortname}" == "jk2" ]; then + fn_info_message_jk2 + elif [ "${shortname}" == "kf" ]; then + fn_info_message_kf elif [ "${shortname}" == "kf2" ]; then fn_info_message_kf2 + elif [ "${shortname}" == "lo" ]; then + fn_info_message_lo elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]; then - fn_info_message_minecraft + fn_info_message_mc elif [ "${shortname}" == "mcb" ]; then - fn_info_message_minecraft_bedrock + fn_info_message_mcb elif [ "${shortname}" == "mh" ]; then - fn_info_message_mordhau + fn_info_message_mh elif [ "${shortname}" == "mohaa" ]; then fn_info_message_mohaa elif [ "${shortname}" == "mta" ]; then fn_info_message_mta elif [ "${shortname}" == "mumble" ]; then fn_info_message_mumble - elif [ "${shortname}" == "onset" ]; then - fn_info_message_onset elif [ "${shortname}" == "mom" ]; then fn_info_message_mom - elif [ "${shortname}" == "pz" ]; then - fn_info_message_projectzomboid + elif [ "${shortname}" == "onset" ]; then + fn_info_message_onset + elif [ "${shortname}" == "pc" ]; then + fn_info_message_pc elif [ "${shortname}" == "pstbs" ]; then fn_info_message_pstbs - elif [ "${shortname}" == "pc" ]; then - fn_info_message_projectcars - elif [ "${shortname}" == "qw" ]; then - fn_info_message_quake + elif [ "${shortname}" == "pvr" ]; then + fn_info_message_pvr + elif [ "${shortname}" == "pz" ]; then + fn_info_message_pz elif [ "${shortname}" == "q2" ]; then - fn_info_message_quake2 + fn_info_message_q2 elif [ "${shortname}" == "q3" ]; then - fn_info_message_quake3 + fn_info_message_q3 elif [ "${shortname}" == "ql" ]; then - fn_info_message_quakelive + fn_info_message_ql + elif [ "${shortname}" == "qw" ]; then + fn_info_message_qw + elif [ "${shortname}" == "ro" ]; then + fn_info_message_ro + elif [ "${shortname}" == "rtcw" ]; then + fn_info_message_rtcw elif [ "${shortname}" == "samp" ]; then fn_info_message_samp + elif [ "${shortname}" == "sb" ]; then + fn_info_message_sb + elif [ "${shortname}" == "sbots" ]; then + fn_info_message_sbots elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then fn_info_message_scpsl elif [ "${shortname}" == "sdtd" ]; then fn_info_message_sdtd - elif [ "${shortname}" == "squad" ]; then - fn_info_message_squad - elif [ "${shortname}" == "st" ]; then - fn_info_message_stationeers elif [ "${shortname}" == "sof2" ]; then fn_info_message_sof2 elif [ "${shortname}" == "sol" ]; then - fn_info_message_soldat - elif [ "${shortname}" == "sb" ]; then - fn_info_message_starbound - elif [ "${shortname}" == "sbots" ]; then - fn_info_message_sbots + fn_info_message_sol + elif [ "${shortname}" == "squad" ]; then + fn_info_message_squad + elif [ "${shortname}" == "st" ]; then + fn_info_message_st elif [ "${shortname}" == "terraria" ]; then fn_info_message_terraria elif [ "${shortname}" == "ts3" ]; then - fn_info_message_teamspeak3 + fn_info_message_ts3 elif [ "${shortname}" == "tu" ]; then - fn_info_message_towerunite + fn_info_message_tu elif [ "${shortname}" == "tw" ]; then - fn_info_message_teeworlds + fn_info_message_tw elif [ "${shortname}" == "unt" ]; then - fn_info_message_unturned - elif [ "${shortname}" == "ut" ]; then - fn_info_message_ut + fn_info_message_unt elif [ "${shortname}" == "vh" ]; then fn_info_message_vh - elif [ "${shortname}" == "rtcw" ]; then - fn_info_message_rtcw - elif [ "${shortname}" == "pvr" ]; then - fn_info_message_pavlovvr + elif [ "${shortname}" == "vints" ]; then + fn_info_message_vints elif [ "${shortname}" == "rust" ]; then fn_info_message_rust - elif [ "${shortname}" == "vints" ]; then - fn_info_message_vintagestory - elif [ "${shortname}" == "wf" ]; then - fn_info_message_warfork - elif [ "${shortname}" == "wurm" ]; then - fn_info_message_wurmunlimited elif [ "${shortname}" == "rw" ]; then - fn_info_message_risingworld + fn_info_message_rw + elif [ "${shortname}" == "ut" ]; then + fn_info_message_ut + elif [ "${shortname}" == "ut2k4" ]; then + fn_info_message_ut2k4 + elif [ "${shortname}" == "ut3" ]; then + fn_info_message_ut3 elif [ "${shortname}" == "wet" ]; then - fn_info_message_wolfensteinenemyterritory + fn_info_message_wet + elif [ "${shortname}" == "wf" ]; then + fn_info_message_wf + elif [ "${shortname}" == "wurm" ]; then + fn_info_message_wurm elif [ "${engine}" == "goldsrc" ]; then fn_info_message_goldsrc elif [ "${engine}" == "source" ]; then @@ -1677,11 +1712,7 @@ fn_info_message_select_engine(){ fn_info_message_spark elif [ "${engine}" == "unreal" ]; then fn_info_message_unreal - elif [ "${engine}" == "unreal2" ]; then - fn_info_message_unreal2 - elif [ "${engine}" == "unreal3" ]; then - fn_info_message_unreal3 else - fn_print_error_nl "Unable to detect server engine." + fn_print_error_nl "Unable to detect game server." fi } diff --git a/lgsm/functions/info_parms.sh b/lgsm/functions/info_parms.sh deleted file mode 100755 index f2496ce5d..000000000 --- a/lgsm/functions/info_parms.sh +++ /dev/null @@ -1,327 +0,0 @@ -#!/bin/bash -# LinuxGSM info_parms.sh module -# Author: Daniel Gibbs -# Contributors: http://linuxgsm.com/contrib -# Website: https://linuxgsm.com -# Description: If specific parms are not set then this will be displayed in details. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -## Examples of filtering to get info from config files -# sed 's/foo//g' - remove foo -# tr -cd '[:digit:]' leave only digits -# tr -d '=\"; ' remove selected charectors =\"; -# grep -v "foo" filter out lines that contain foo - -unavailable="${red}UNAVAILABLE${default}" -zero="${red}0${default}" - -fn_info_parms_ark(){ - port=${port:-"0"} - queryport=${queryport:-"0"} - rconport=${rconport:-"0"} - maxplayers=${maxplayers:-"0"} -} - -fn_info_parms_barotrauma(){ - port=${port:-"0"} - queryport=${queryport:-"0"} -} - -fn_info_parms_cod(){ - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${port:-"0"} -} - -fn_info_parms_dst(){ - sharding=${sharding:-"NOT SET"} - master=${master:-"NOT SET"} - shard=${shard:-"NOT SET"} - cluster=${cluster:-"NOT SET"} - cave=${cave:-"NOT SET"} -} - -fn_info_parms_factorio(){ - port=${port:-"0"} - rconport=${rconport:-"0"} - rconpassword=${rconpassword:-"NOT SET"} -} - -fn_info_parms_hurtworld(){ - servername=${servername:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - maxplayers=${maxplayers:-"0"} - defaultmap=${defaultmap:-"NOT SET"} - creativemode=${creativemode:-"NOT SET"} -} - -fn_info_parms_inss(){ - port=${port:-"0"} - queryport=${queryport:-"0"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - defaultmap=${defaultmap:-"NOT SET"} - defaultscenario=${defaultscenario:-"NOT SET"} - maxplayers=${maxplayers:-"0"} -} - -fn_info_parms_jk2(){ - queryport=${port} -} - -fn_info_parms_kf2(){ - queryport=${queryport:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_mordhau(){ - port=${port:-"0"} - queryport=${queryport:-"0"} - beaconport=${beaconport:-"0"} -} - -fn_info_parms_mohaa(){ - port=${port:-"0"} - queryport=${port:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_mom(){ - port=${port:-"7777"} - beaconport=${queryport:-"15000"} -} - -fn_info_parms_mta(){ - queryport=$((port + 123)) -} - -fn_info_parms_projectzomboid(){ - adminpassword=${adminpassword:-"NOT SET"} - queryport=${port:-"0"} -} - -fn_info_parms_quakeworld(){ - port=${port:-"0"} - queryport=${port:-"0"} -} - -fn_info_parms_quake2(){ - port=${port:-"0"} - queryport=${port:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_realvirtuality(){ - port=${port:-"0"} - queryport=$((port + 1)) -} - -fn_info_parms_risingworld(){ - servername=${servername:-"NOT SET"} - port=${port:-"0"} - httpqueryport=$((port - 1)) -} - -fn_info_parms_rtcw(){ - port=${port:-"0"} - queryport="${port:-"0"}" - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_rust(){ - servername=${servername:-"NOT SET"} - port=${port:-"0"} - queryport=${port:-"0"} - rconport=${rconport:-"0"} - rconpassword=${rconpassword:-"NOT SET"} - rconweb=${rconweb:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - saveinterval=${saveinterval:-"0"} - tickrate=${tickrate:-"0"} - # Part of random seed feature. - if [ -z "${seed}" ]; then - if [ ! -f "${datadir}/${selfname}-seed.txt" ]; then - shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" - fi - seed=$(cat "${datadir}/${selfname}-seed.txt") - fi -} - -fn_info_parms_samp(){ - queryport=${port:-"0"} -} - -fn_info_parms_sof2(){ - port=${port:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_source(){ - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${port:-"0"} - clientport=${clientport:-"0"} -} - -fn_info_parms_spark(){ - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=$((port + 1)) - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} - webadminport=${webadminport:-"0"} - mods=${mods:-"NOT SET"} -} - -fn_info_parms_stickybots(){ - port=${port:-"0"} - queryport=${queryport:-"0"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} -} - -fn_info_parms_sof2(){ - port=${port:-"0"} - queryport=${port:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_towerunite(){ - port=${port:-"0"} - queryport=${queryport:-"0"} -} - -fn_info_parms_teeworlds(){ - queryport=${port:-"0"} -} - -fn_info_parms_pavlovvr(){ - port=${port:-"0"} - queryport=${queryport:-"0"} -} - -fn_info_parms_unreal(){ - defaultmap=${defaultmap:-"NOT SET"} - queryport=$((port + 1)) -} - -fn_info_parms_unreal2(){ - defaultmap=${defaultmap:-"NOT SET"} - queryport=$((port + 1)) -} - -fn_info_parms_unreal3(){ - port=${port:-"0"} - queryport=${queryport:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_unturned(){ - servername=${selfname:-"NOT SET"} - port=${port:-"0"} - queryport=$((port + 1)) -} - -fn_info_parms_ut(){ - port=${port:-"0"} -} - -fn_info_parms_vh(){ - port=${port:-"0"} - if [ "${public}" != "0" ]; then - queryport=$((port + 1)) - else - querymode="1" - fi - gameworld=${gameworld:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} -} - -fn_info_parms_wf(){ - port=${port:-"0"} - queryport="${port:-"0"}" - webadminport=${webadminport:-"0"} -} - -fn_info_parms_queryport(){ - queryport="${port:-"0"}" -} - -if [ "${shortname}" == "ark" ]; then - fn_info_parms_ark -elif [ "${shortname}" == "arma3" ]; then - fn_info_parms_realvirtuality -elif [ "${shortname}" == "bt" ]; then - fn_info_parms_barotrauma -elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${engine}" == "iw2.0" ]||[ "${engine}" == "iw3.0" ]; then - fn_info_parms_cod -elif [ "${shortname}" == "fctr" ]; then - fn_info_parms_factorio -elif [ "${shortname}" == "inss" ]; then - fn_info_parms_inss -elif [ "${shortname}" == "jk2" ]; then - fn_info_parms_jk2 -elif [ "${shortname}" == "kf2" ]; then - fn_info_parms_kf2 -elif [ "${shortname}" == "mohaa" ]; then - fn_info_parms_mohaa -elif [ "${shortname}" == "mom" ]; then - fn_info_parms_mom -elif [ "${shortname}" == "pz" ]; then - fn_info_parms_projectzomboid -elif [ "${shortname}" == "pvr" ]; then - fn_info_parms_pavlovvr -elif [ "${shortname}" == "qw" ]; then - fn_info_parms_quakeworld -elif [ "${shortname}" == "q2" ]||[ "${shortname}" == "q3" ]; then - fn_info_parms_quake2 -elif [ "${shortname}" == "rtcw" ]; then - fn_info_parms_rtcw -elif [ "${shortname}" == "rust" ]; then - fn_info_parms_rust -elif [ "${shortname}" == "samp" ]; then - fn_info_parms_samp -elif [ "${shortname}" == "rw" ]; then - fn_info_parms_risingworld -elif [ "${shortname}" == "sof2" ]; then - fn_info_parms_sof2 -elif [ "${shortname}" == "sbots" ]; then - fn_info_parms_stickybots -elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then - fn_info_parms_source -elif [ "${engine}" == "spark" ]; then - fn_info_parms_spark -elif [ "${shortname}" == "tu" ]; then - fn_info_parms_towerunite -elif [ "${shortname}" == "tw" ]; then - fn_info_parms_teeworlds -elif [ "${shortname}" == "vh" ]; then - fn_info_parms_vh -elif [ "${shortname}" == "mh" ]; then - fn_info_parms_mordhau -elif [ "${shortname}" == "mta" ]; then - fn_info_parms_mta -elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then - fn_info_parms_unreal -elif [ "${engine}" == "unreal3" ]; then - fn_info_parms_unreal3 -elif [ "${shortname}" == "unt" ]; then - fn_info_parms_unturned -elif [ "${shortname}" == "ut" ]; then - fn_info_parms_ut -elif [ "${shortname}" == "wf" ]; then - fn_info_parms_wf -# for servers that have a missing queryport from the config -elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then - fn_info_parms_queryport -fi diff --git a/lgsm/functions/info_stats.sh b/lgsm/functions/info_stats.sh index 211208717..03bebe420 100755 --- a/lgsm/functions/info_stats.sh +++ b/lgsm/functions/info_stats.sh @@ -62,40 +62,34 @@ memusedroundup="$(((memused + 99) / 100 * 100))" # Hardware Property - UA-165287622-3 ## Distro. -curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 ## Game Server Name. -curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 ## LinuxGSM Version. -curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 ## CPU usage of a game server. if [ -n "${cpuusedmhzroundup}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 fi ## Ram usage of a game server. if [ -n "${memusedroundup}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 fi ## Disk usage of a game server. if [ -n "${serverfilesdu}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 @@ -103,7 +97,6 @@ fi ## CPU Model. if [ -n "${cpumodel}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 @@ -112,7 +105,6 @@ fi ## CPU Frequency. if [ -n "${cpufreqency}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 @@ -120,7 +112,6 @@ fi ## Server RAM. if [ -n "${physmemtotal}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 @@ -128,17 +119,44 @@ fi ## Server Disk. if [ -n "${totalspace}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 fi +## Alert Stats. +if [ "${discordalert}" == "on" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Discord" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +if [ "${emailalert}" == "on" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Email" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +if [ "${iftttalert}" == "on" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=IFTTT" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +if [ "${mailgunalert}" == "on" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Mailgun" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +if [ "${pushbulletalert}" == "on" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Pushbullet" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +if [ "${pushoveralert}" == "on" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Pushover" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +if [ "${rocketchatalert}" == "on" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Rocket Chat" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +if [ "${slackalert}" == "on" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Slack" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +if [ "${telegramalert}" == "on" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Telegram" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi + ## Summary Stats -curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 fn_script_log_info "Send LinuxGSM stats" fn_script_log_info "* uuid-${selfname}: ${uuidinstance}" diff --git a/lgsm/functions/install_modules.sh b/lgsm/functions/install_modules.sh deleted file mode 100755 index af1050a94..000000000 --- a/lgsm/functions/install_modules.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# LinuxGSM install_modules.sh module -# Author: Daniel Gibbs -# Contributors: http://linuxgsm.com/contrib -# Website: https://linuxgsm.com -# Description: Downloads all modules on install. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -echo -e "" -echo -e "${lightyellow}Downloading LinuxGSM Modules${default}" -echo -e "=================================" - -fn_fetch_file "https://github.com/GameServerManagers/LinuxGSM/archive/master.tar.gz" "${tmpdir}" "master.tar.gz" "nochmodx" "norun" "noforce" "nohash" -fn_dl_extract "${tmpdir}" "master.tar.gz" "${tmpdir}" -cp "${tmpdir}/LinuxGSM-master/lgsm/functions"/*.sh "${functionsdir}" -cp "${tmpdir}/LinuxGSM-master/lgsm/functions"/*.py "${functionsdir}" -chmod +x "${functionsdir}"/* -command_update_linuxgsm.sh -fn_firstcommand_reset diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index bf0233177..b6b9f5240 100755 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -27,7 +27,7 @@ fn_install_server_files(){ elif [ "${shortname}" == "codwaw" ]; then remote_fileurl="http://linuxgsm.download/CallOfDutyWorldAtWar/codwaw-lnxded-1.7-full.tar.xz"; local_filedir="${tmpdir}"; local_filename="codwaw-lnxded-1.7-full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="2c6be1bb66ea631b9b2e7ae6216c6680" elif [ "${shortname}" == "etl" ]; then - remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/etlegacy-v2.77-i386-et-260b.tar.xz"; local_filedir="${tmpdir}"; local_filename="etlegacy-v2.77-i386-et-260b.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="7f301708f5bb1272c243f9e2d1b735dc" + remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/etlegacy-v2.77.1-i386-et-260b.tar.xz"; local_filedir="${tmpdir}"; local_filename="etlegacy-v2.77.1-i386-et-260b.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="cc307a9232abd3999be499b42d8e4ea8" elif [ "${shortname}" == "mohaa" ]; then remote_fileurl="http://linuxgsm.download/MedalofHonorAlliedAssault/moh_revival_v1.12_RC3.5.1.tar.xz"; local_filedir="${tmpdir}"; local_filename="moh_revival_v1.12_RC3.5.1.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="7c664538999252eeaf2b6d9949416480" elif [ "${shortname}" == "ns" ]; then diff --git a/lgsm/functions/query_gamedig.sh b/lgsm/functions/query_gamedig.sh index 4d479a4c0..32b70aac2 100755 --- a/lgsm/functions/query_gamedig.sh +++ b/lgsm/functions/query_gamedig.sh @@ -14,6 +14,10 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; # will bypass query if server offline. check_status.sh if [ "${status}" != "0" ]; then + # GameDig requires you use the voice port when querying. + if [ "${querytype}" == "teamspeak3" ]; then + queryport="${port}" + fi # checks if query is working null = pass. gamedigcmd=$(echo -e "gamedig --type \"${querytype}\" --host \"${queryip}\" --query_port \"${queryport}\"|jq") gamedigraw=$(gamedig --type "${querytype}" --host "${queryip}" --query_port "${queryport}") @@ -25,6 +29,10 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; querystatus=$(echo "${gamedigraw}" | jq '.error|length') fi + if [ "${querytype}" == "teamspeak3" ]; then + fn_info_game_ts3 + fi + # server name. gdname=$(echo "${gamedigraw}" | jq -re '.name') if [ "${gdname}" == "null" ]; then @@ -34,6 +42,8 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; # numplayers. if [ "${querytype}" == "minecraft" ]; then gdplayers=$(echo "${gamedigraw}" | jq -re '.players | length-1') + elif [ "${querytype}" == "teamspeak3" ]; then + gdplayers=$(echo "${gamedigraw}" | jq -re '.raw.virtualserver_clientsonline') else gdplayers=$(echo "${gamedigraw}" | jq -re '.players | length') fi @@ -46,7 +56,7 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; # maxplayers. gdmaxplayers=$(echo "${gamedigraw}" | jq -re '.maxplayers') if [ "${gdmaxplayers}" == "null" ]; then - unset maxplayers + unset gdmaxplayers elif [ "${gdmaxplayers}" == "[]" ]; then gdmaxplayers=0 fi @@ -68,5 +78,16 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; if [ "${gdbots}" == "null" ]||[ "${gdbots}" == "0" ]; then unset gdbots fi + + # server version. + if [ "${querytype}" == "teamspeak3" ]; then + dversion=$(echo "${gamedigraw}" | jq -re '.raw.virtualserver_version') + else + gdversion=$(echo "${gamedigraw}" | jq -re '.raw.version') + fi + + if [ "${gdversion}" == "null" ]||[ "${gdversion}" == "0" ]; then + unset gdversion + fi fi fi diff --git a/lgsm/functions/update_minecraft_bedrock.sh b/lgsm/functions/update_minecraft_bedrock.sh index f109a52e3..f4054ae00 100644 --- a/lgsm/functions/update_minecraft_bedrock.sh +++ b/lgsm/functions/update_minecraft_bedrock.sh @@ -7,8 +7,11 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +#random number for userAgent +randnum=$((1 + RANDOM % 5000)) + fn_update_minecraft_dl(){ - latestmcbuildurl=$(curl -Ls "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*zip') + latestmcbuildurl=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -Ls -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.${randnum}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*zip') fn_fetch_file "${latestmcbuildurl}" "" "" "" "${tmpdir}" "bedrock_server.${remotebuild}.zip" echo -e "Extracting to ${serverfiles}...\c" if [ "${firstcommandname}" == "INSTALL" ]; then @@ -79,7 +82,7 @@ fn_update_minecraft_localbuild(){ fn_update_minecraft_remotebuild(){ # Gets remote build info. - remotebuild=$(curl -Ls "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]") + remotebuild=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -Ls -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.${randnum}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]") if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuild variable has been set. diff --git a/lgsm/functions/update_papermc.sh b/lgsm/functions/update_papermc.sh index ae512c0ba..2e669d93d 100644 --- a/lgsm/functions/update_papermc.sh +++ b/lgsm/functions/update_papermc.sh @@ -74,7 +74,7 @@ fn_update_papermc_remotebuild(){ fn_update_papermc_compare(){ fn_print_dots "Checking for update: ${remotelocation}" sleep 0.5 - if [ "${localbuild}" != "${remotebuild}" ]||[ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ]||[ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available for version ${paperversion}" diff --git a/linuxgsm.sh b/linuxgsm.sh index 08bb0975f..462ea09ad 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.2.2" +version="v21.2.5" shortname="core" gameservername="core" commandname="CORE" @@ -478,7 +478,7 @@ else elif grep -qE "^[[:blank:]]*preexecutable=" "${configdirserver}/_default.cfg"; then eval preexecutable="$(sed -nr 's/^ *preexecutable=(.*)$/\1/p' "${configdirserver}/_default.cfg")" fi - + # For legacy configs that still use parms= 15.03.21 if grep -qE "^[[:blank:]]*parms=" "${configdirserver}/secrets-${selfname}.cfg"; then eval parms="$(sed -nr 's/^ *parms=(.*)$/\1/p' "${configdirserver}/secrets-${selfname}.cfg")" @@ -497,7 +497,6 @@ else fi } - fn_reload_startparameters # 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" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index c4a716aa9..ef62e9724 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.2.2" +version="v21.2.5" shortname="fctr" gameservername="fctrserver" commandname="CORE" @@ -923,7 +923,7 @@ echo -e "" echo -e "5.0 - Monitor Tests" echo -e "==================================================================" echo -e "" -info_config.sh +info_game.sh echo -e "Server IP - Port: ${ip}:${port}" echo -e "Server IP - Query Port: ${ip}:${queryport}" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index ff1eec547..474d45f06 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.2.2" +version="v21.2.5" shortname="jc2" gameservername="jc2server" commandname="CORE" @@ -1082,7 +1082,7 @@ echo -e "" echo -e "5.0 - Monitor Tests" echo -e "==================================================================" echo -e "" -info_config.sh +info_game.sh echo -e "Server IP - Port: ${ip}:${port}" echo -e "Server IP - Query Port: ${ip}:${queryport}" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index ce24f3df0..b6d6217cd 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.2.2" +version="v21.2.5" shortname="mc" gameservername="mcserver" commandname="CORE" @@ -945,7 +945,7 @@ echo -e "" echo -e "5.0 - Monitor Tests" echo -e "==================================================================" echo -e "" -info_config.sh +info_game.sh echo -e "Server IP - Port: ${ip}:${port}" echo -e "Server IP - Query Port: ${ip}:${queryport}" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index d867b41ac..6d2b5d95f 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.2.2" +version="v21.2.5" shortname="ts3" gameservername="ts3server" commandname="CORE" @@ -922,7 +922,7 @@ echo -e "" echo -e "5.0 - Monitor Tests" echo -e "==================================================================" echo -e "" -info_config.sh +info_game.sh echo -e "Server IP - Port: ${ip}:${port}" echo -e "Server IP - Query Port: ${ip}:${queryport}"