diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..ef3ef8bd9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs. +# Atom: Please assure your Atom's config setting Tab Type is set to auto, otherwise Atom-EditorConfig may not work as expected. Also disable whitespace package. +# http://editorconfig.org/ + +root = true + +[*] +charset = utf-8 +indent_style = tab +indent_size = 4 +trim_trailing_whitespace = true +end_of_line = lf +insert_final_newline = true diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..bbe6490d1 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,22 @@ +# crlf line endings for text files +* text eol=lf + +# Denote all files that are truly binary and should not be modified. +*.png binary +*.jpg binary +*.so.6 binary + +# Custom for Visual Studio +*.cs diff=csharp + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..5712ac3e7 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: dgibbs64 # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: [paypal.me/dgibbs64] # Replace with a single custom sponsorship URL diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 000000000..31d08d206 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,48 @@ +--- +name: Bug Report +about: Found a bug? Raise a report. +title: "[BUG]" +labels: 'type: bug' +assignees: '' + +--- + +Issues raised here are **ONLY** for: +* LinuxGSM bugs. +* Feature suggestions. +* Code contributions. + +Issues raised here are **NOT** for: +* General support. +* Specific game server issues (e.g CS:GO, TF2). +* Dedicated server issues (e.g Ubuntu, CentOS). +* Anything not directly related to LinuxGSM development. + +For general support visit the **[LinuxGSM-Support](https://linuxgsm.com/support)**. + +***Please use the template below, deleting the above text*** + +## User Story + +As a [user description], I want [desired action] so that [desired outcome]. + +## Basic info + +* **Distro:** [Ubuntu 18.04] +* **Game:** [Garry's Mod] +* **Command:** [Monitor] +* **LinuxGSM version:** [v20.1.3] + +## Further Information + +A clear description of what the bug is and any ideas on how to resolve it. Plus any further context that might be relevant to the issue. + +## To Reproduce + +Steps to reproduce the behaviour: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +## Expected behaviour diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 000000000..8ba27fa9f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,42 @@ +--- +name: Feature Request +about: Suggest an idea for LinuxGSM. +title: "[FEATURE]" +labels: 'type: feature request' +assignees: '' + +--- + +Issues raised here are **ONLY** for: +* LinuxGSM bugs. +* Feature suggestions. +* Code contributions. + +Issues raised here are **NOT** for: +* General support. +* Specific game server issues (e.g CS:GO, TF2). +* Dedicated server issues (e.g Ubuntu, CentOS). +* Anything not directly related to LinuxGSM development. + +For general support visit the **[LinuxGSM Support](https://linuxgsm.com/support)** page. + +***Please use the template below, deleting the above text*** + +## User Story + +As a [user description], I want [desired action] so that [desired outcome]. + +## Basic info + +* **Distro:** [Ubuntu 20.04] +* **Game:** [Garry's Mod] +* **Command:** [Monitor] +* **LinuxGSM version:** [v20.1.3] + +## Further Information + +A clear description of what the feature is and any ideas on how to achieve this. + +## Further Reading + +Provide any useful documentation or resources that might help. diff --git a/.github/ISSUE_TEMPLATE/new-server-request.md b/.github/ISSUE_TEMPLATE/new-server-request.md new file mode 100644 index 000000000..84176741f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/new-server-request.md @@ -0,0 +1,32 @@ +--- +name: New Server Request +about: Suggest a new game server to be added. +title: "[Server Request]" +labels: 'type: game server request' +assignees: '' + +--- + +## What game server would you like adding? + +[game server] + +## Can you link to any tutorials or guides? + +Provide any useful documentation or resources that might help. + +## Is the server on Steam? + +* [ ] Yes +* [ ] No + +If yes Use SteamDB to get the appid. (https://steamdb.info). + +[appid] + +## Is the server supported on Linux? + +We only support Linux servers and do **not** support Wine. + +* [ ] Yes +* [ ] No diff --git a/.github/issue_label_bot.yaml b/.github/issue_label_bot.yaml new file mode 100644 index 000000000..ee6d724f1 --- /dev/null +++ b/.github/issue_label_bot.yaml @@ -0,0 +1,4 @@ +label-alias: + bug: 'type: bug' + feature_request: 'type: feature request' + question: 'question' diff --git a/.github/potential-duplicates.yml b/.github/potential-duplicates.yml new file mode 100644 index 000000000..3ca5a7cb8 --- /dev/null +++ b/.github/potential-duplicates.yml @@ -0,0 +1,13 @@ +# Label name and color to set, when potential duplicates are detected +issueLabel: "duplicate" +labelColor: 579e01 + +# If similarity is higher than this threshold, issue will be marked as duplicate +threshold: 0.60 + +# Comment to post when potential duplicates are detected +referenceComment: > + Potential duplicates: + {{#issues}} + - [#{{ number }}] {{ title }} ({{ accuracy }}%) + {{/issues}} diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..af1c7faba --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,34 @@ +# Description + +Please include a summary of the change and which issues are fixed. + +Fixes #[issue] + +## Type of change + +* [ ] Bug fix (a change which fixes an issue). +* [ ] New feature (change which adds functionality). +* [ ] New Server (new server added). +* [ ] Refactor (restructures existing code). +* [ ] Comment update (typo, spelling, explanation, examples, etc). + +## Checklist + +PR will not be merged until all steps are complete. + +* [ ] This pull request links to an issue. +* [ ] This pull request uses the `develop` branch as its base. +* [ ] This pull request Subject follows the Conventional Commits standard. +* [ ] This code follows the style guidelines of this project. +* [ ] I have performed a self-review of my code. +* [ ] I have checked that this code is commented where required. +* [ ] I have provided a detailed with enough description of this PR. +* [ ] I have checked If documentation needs updating. + +## Documentation + +If documentation does need updating either update it by creating a PR (preferred) or request a documentation update. +* User docs: https://github.com/GameServerManagers/LinuxGSM-Docs +* Dev docs: https://github.com/GameServerManagers/LinuxGSM-Dev-Docs + +**Thank you for your Pull Request!** diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 000000000..27bcee3fb --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,4 @@ +template: | + ## What’s Changed + + $CHANGES diff --git a/.github/topissuebot.yml b/.github/topissuebot.yml new file mode 100644 index 000000000..06c64ae01 --- /dev/null +++ b/.github/topissuebot.yml @@ -0,0 +1,4 @@ +# Configuration for top-issue-bot +labelName: ":thumbsup: Top Issue!" +labelColor: "f442c2" +numberOfIssuesToLabel: 5 diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 000000000..f82cb60d9 --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,17 @@ +name: Release Drafter + +on: + push: + # branches to consider in the event; optional, defaults to all + branches: + - master +jobs: + update_release_draft: + runs-on: ubuntu-latest + steps: + # Drafts your next Release notes as Pull Requests are merged into "master" + - uses: release-drafter/release-drafter@v5 + with: + config-name: release-drafter.yml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/git-sync.yml b/.github/workflows/git-sync.yml new file mode 100644 index 000000000..a5a827096 --- /dev/null +++ b/.github/workflows/git-sync.yml @@ -0,0 +1,26 @@ +name: Github to Bitbucket sync +# This action will sync the github repo with a backup bitbucket repo. +# This will allow LinuxGSM to use Bitbucket as and alternative download if github fails. +on: + push: + branches: + - master + - 'develop' + +jobs: + repo-sync: + runs-on: ubuntu-latest + steps: + - name: webfactory/ssh-agent + uses: webfactory/ssh-agent@v0.4.1 + with: + ssh-private-key: ${{ secrets.BITBUCKET_SECRET }} + + - name: repo-sync + uses: wei/git-sync@v2.1.0 + with: + ssh_private_key: ${{ secrets.BITBUCKET_SECRET }} + source_repo: "https://github.com/GameServerManagers/LinuxGSM" + source_branch: "refs/heads/*" + destination_repo: "git@bitbucket.org:GameServerManagers/linuxgsm.git" + destination_branch: "refs/heads/*" diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml new file mode 100644 index 000000000..63f0cf2db --- /dev/null +++ b/.github/workflows/lock.yml @@ -0,0 +1,21 @@ +name: 'Lock Threads' + +on: + schedule: + - cron: '0 0 * * *' + +jobs: + lock: + runs-on: ubuntu-latest + steps: + - uses: dessant/lock-threads@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + issue-lock-comment: > + This issue has been automatically locked since there + has not been any recent activity after it was closed. + Please open a new issue for related bugs. + pr-lock-comment: > + This pull request has been automatically locked since there + has not been any recent activity after it was closed. + Please open a new issue for related bugs. diff --git a/.github/write-good.yml b/.github/write-good.yml new file mode 100644 index 000000000..00eefa99c --- /dev/null +++ b/.github/write-good.yml @@ -0,0 +1,4 @@ +# .github/write-good.yml +writeGood: true +alex: true +spellchecker: true diff --git a/.gitignore b/.gitignore index 2b0bcabc1..12218bea3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ *.db -.idea \ No newline at end of file +.idea diff --git a/.travis.yml b/.travis.yml index 7a1c63dcf..0ea421b0e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,44 @@ -language: bash -sudo: false +language: node_js +dist: bionic +node_js: + - "stable" env: -- DISTRO=ubuntu-trusty + global: + secure: VsS98cwJ5X/Ev3HEm7KEOPftYay+7jNTHepTS7d+gQNHcDR1UYKTmqlQNSIoUC52Ejs1cHq43jOfle4330zDPOYI0v5BMri6/iZKpmMxAw6KWNiUgSkziTP2kHC4NRLwEoU2WQTI3JZQjrBEfsPmD81+yR/eWXV3rph+YcSOxao= before_script: - - curl -L "https://shunit2.googlecode.com/files/shunit2-2.1.6.tgz" | tar zx + - curl -L "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/shunit2/shunit2-2.1.6.tgz" | tar zx + +install: + - npm install gamedig addons: apt: - sources: - - ubuntu-toolchain-r-test packages: - - tmux - mailutils - - postfix - - lib32gcc1 - - libstdc++6 - - libstdc++6:i386 - - telnet - - expect - -script: + - postfix + - jq + - lib32gcc1 + - lib32stdc++6 + - shellcheck + - libcurl4-openssl-dev + - libdw-dev + - cmake - - bash tests/tests_jc2server.sh - - bash tests/tests_ts3server.sh \ No newline at end of file +jobs: + include: + - stage: "Jobs" + name: "code coverage" + script: bash tests/tests_kcov.sh; kcov --bash-method=DEBUG coverage tests/tests_mcserver.sh + - script: bash tests/tests_mcserver.sh + name: "Minecraft" + - script: bash tests/tests_jc2server.sh + name: "Just Cause 2" + - script: bash tests/tests_fctrserver.sh + name: "Factorio" + - script: bash tests/tests_ts3server.sh + name: "Teamspeak 3" + - script: bash tests/tests_defaultcfg/tests_defaultcfg.sh + name: "_default.cfg checks" +after_success: +- bash <(curl -Ls https://coverage.codacy.com/get.sh) diff --git a/7DaysToDie/sdtdserver b/7DaysToDie/sdtdserver deleted file mode 100644 index 7315b5eae..000000000 --- a/7DaysToDie/sdtdserver +++ /dev/null @@ -1,129 +0,0 @@ -#!/bin/bash -# 7 Days To Die -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="username" -steampass="password" - -# Start Variables -ip="0.0.0.0" -updateonstart="off" - -# http://7daystodie.gamepedia.com/Server -fn_parms(){ -parms="-configfile=${servercfgfullpath} -dedicated" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="294420" - -# Server Details -servicename="sdtd-server" -gamename="7 Days To Die" -engine="unity3d" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./startserver.sh" -servercfg="${servicename}.xml" -servercfgdir="${filesdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/serverconfig.xml" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${rootdir}/log/server" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -gamelog="${gamelogdir}/${servicename}-game.log" -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt - diff --git a/ARKSurvivalEvolved/arkserver b/ARKSurvivalEvolved/arkserver deleted file mode 100644 index 93ce6151c..000000000 --- a/ARKSurvivalEvolved/arkserver +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/bash -# ARK: Survivial Evolved -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -ip="0.0.0.0" -updateonstart="off" - -fn_parms(){ -parms="TheIsland?listen" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="376030" - -# Server Details -servicename="ark-server" -gamename="ARK: Survivial Evolved" -engine="unreal4" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/ShooterGame" -executabledir="${systemdir}/Binaries/Linux" -executable="./ShooterGameServer" -servercfgdir="${systemdir}/Saved/Config/LinuxServer" -servercfg="GameUserSettings.ini" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.ini" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/ARKSurvivalEvolved/cfg/lgsm-default.ini b/ARKSurvivalEvolved/cfg/lgsm-default.ini deleted file mode 100644 index e14a10c6f..000000000 --- a/ARKSurvivalEvolved/cfg/lgsm-default.ini +++ /dev/null @@ -1,135 +0,0 @@ -[ServerSettings] -AllowFlyerCarryPvE=False -AllowThirdPersonPlayer=False -AlwaysNotifyPlayerLeft=False -AutoSavePeriodMinutes=15.000000 -ClampResourceHarvestDamage=False -DayCycleSpeedScale=1.000000 -DayTimeSpeedScale=1.000000 -DifficultyOffset=0.200000 -DinoCharacterFoodDrainMultiplier=1.000000 -DinoCharacterHealthRecoveryMultiplier=1.000000 -DinoCharacterStaminaDrainMultiplier=1.000000 -DinoCountMultiplier=1.000000 -DinoDamageMultiplier=1.000000 -DinoResistanceMultiplier=1.000000 -DisableStructureDecayPvE=False -DontAlwaysNotifyPlayerJoined=False -EnablePvPGamma=False -GlobalVoiceChat=False -HarvestAmountMultiplier=1.000000 -HarvestHealthMultiplier=1.000000 -KickIdlePlayersPeriod=2400.000000 -NewMaxStructuresInRange=6000.000000 -NightTimeSpeedScale=1.000000 -NoTributeDownloads=False -PlayerCharacterFoodDrainMultiplier=1.000000 -PlayerCharacterHealthRecoveryMultiplier=1.000000 -PlayerCharacterStaminaDrainMultiplier=1.000000 -PlayerCharacterWaterDrainMultiplier=1.000000 -PlayerDamageMultiplier=1.000000 -PlayerResistanceMultiplier=1.000000 -ProximityChat=False -ProximityVoiceChat=False -PvEStructureDecayDestructionPeriod=0.000000 -PvEStructureDecayPeriodMultiplier=1.000000 -RCONEnabled=True -RCONPort=32330 -ResourcesRespawnPeriodMultiplier=1.000000 -ServerAdminPassword=adminpassword -ServerCrosshair=False -ServerForceNoHUD=False -ServerHardcore=False -ServerPassword= -ServerPVE=False -ShowMapPlayerLocation=False -StructureDamageMultiplier=1.000000 -StructureResistanceMultiplier=1.000000 -TamedDinoDamageMultiplier=1.000000 -TamedDinoResistanceMultiplier=1.000000 -TamingSpeedMultiplier=1.000000 -XPMultiplier=1.000000 - -[/Script/ShooterGame.ShooterGameUserSettings] -MasterAudioVolume=1.000000 -MusicAudioVolume=1.000000 -SFXAudioVolume=1.000000 -VoiceAudioVolume=1.000000 -CameraShakeScale=1.000000 -bFirstPersonRiding=False -bThirdPersonPlayer=False -bShowStatusNotificationMessages=True -TrueSkyQuality=0.270000 -FOVMultiplier=1.000000 -GroundClutterDensity=1.000000 -bFilmGrain=False -bMotionBlur=True -bUseDFAO=True -bUseSSAO=True -bShowChatBox=True -bCameraViewBob=True -bInvertLookY=False -bFloatingNames=True -bChatBubbles=True -bHideServerInfo=False -bJoinNotifications=False -bCraftablesShowAllItems=True -LookLeftRightSensitivity=1.000000 -LookUpDownSensitivity=1.000000 -GraphicsQuality=2 -ActiveLingeringWorldTiles=10 -ClientNetQuality=3 -LastServerSearchType=0 -LastServerSearchHideFull=False -LastServerSearchProtected=False -HideItemTextOverlay=False -bDistanceFieldShadowing=True -LODScalar=1.000000 -HighQualityMaterials=True -HighQualitySurfaces=True -bTemperatureF=False -bDisableTorporEffect=False -bChatShowSteamName=False -bChatShowTribeName=True -EmoteKeyBind1=0 -EmoteKeyBind2=0 -bUseVSync=False -ResolutionSizeX=1280 -ResolutionSizeY=720 -LastUserConfirmedResolutionSizeX=1280 -LastUserConfirmedResolutionSizeY=720 -WindowPosX=-1 -WindowPosY=-1 -bUseDesktopResolutionForFullscreen=False -FullscreenMode=2 -LastConfirmedFullscreenMode=2 -Version=5 - -[ScalabilityGroups] -sg.ResolutionQuality=100 -sg.ViewDistanceQuality=3 -sg.AntiAliasingQuality=3 -sg.ShadowQuality=3 -sg.PostProcessQuality=3 -sg.TextureQuality=3 -sg.EffectsQuality=3 -sg.TrueSkyQuality=3 -sg.GroundClutterQuality=3 -sg.IBLQuality=1 -sg.HeightFieldShadowQuality=3 - -[SessionSettings] -SessionName=arkserver -QueryPort=27015 -Port=7777 -;MultiHome=INSERT_IPv4_HERE ;Example:192.168.0.9. If not just remove any line containing MultiHome. - -[/Script/Engine.GameSession] -MaxPlayers=127 - -[MultiHome] -;MultiHome=True ;If MultiHome=IPv4 is filled in. If not just remove any line containing MultiHome. - -[MessageOfTheDay] -Message=Welcome to ARK Server -Duration=5 diff --git a/Arma3/arma3server b/Arma3/arma3server deleted file mode 100644 index 80d8ab72e..000000000 --- a/Arma3/arma3server +++ /dev/null @@ -1,141 +0,0 @@ -#!/bin/bash -# ARMA 3 -# Server Management Script -# Author: Daniel Gibbs -# Contributor: Scarsz -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="username" -steampass="password" - -# Start Variables -ip="0.0.0.0" -updateonstart="off" - -fn_parms(){ -parms="-netlog -ip=${ip} -cfg=${networkcfgfullpath} -config=${servercfgfullpath} -mod=${mods}" -} - -# ARMA 3 Modules -# add mods with relative paths: -# mods/\@CBA_A3\; -# or several mods as: -# mods/\@CBA_A3\;mods/\@task_force_radio -# and chmod modules directories to 775 -mods="" - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -# Stable -appid="233780" -# Development -# appid="233780 -beta development" - -# Server Details -servicename="arma3-server" -gamename="ARMA 3" -engine="realvirtuality" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./arma3server" -servercfg="${servicename}.server.cfg" -networkcfg="${servicename}.network.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -networkcfgfullpath="${servercfgdir}/${networkcfg}" -servercfgdefault="${servercfgdir}/lgsm-default.server.cfg" -networkcfgdefault="${servercfgdir}/lgsm-default.network.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -#gamelogdir="" # No server logs available -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/Arma3/cfg/lgsm-default.network.cfg b/Arma3/cfg/lgsm-default.network.cfg deleted file mode 100644 index 5bba89f8d..000000000 --- a/Arma3/cfg/lgsm-default.network.cfg +++ /dev/null @@ -1,77 +0,0 @@ -// -// network.cfg - Defines network tuning parameters -// -// This file is to be passed to the -cfg parameter on the command line for the server -// See http://community.bistudio.com/wiki/basic.cfg -// The following settings are the suggested settings - -// BANDWIDTH SETTINGS - -// Bandwidth the server is guaranteed to have (in bps) -// General guideline is NumberOfPlayers * 256kb -// Default: 131072 -MinBandwidth=5120000; -// Bandwidth the server can never go above (in bps) -// For a single server, use full network speed; decrease when running multiple servers -MaxBandwidth=10240000; - -// PACKET SETTINGS - -// Maximum number of packets per frame. -// Increasing the value potentially decreases lag, but increases desync -// Default: 128 -MaxMsgSend=2048; -// Maximum payload of guaranteed packet (in b) -// Small messages are packed to larger packets -// Guaranteed packets are used for non-repetitive events, like shooting -// Lower value means more packets are sent, so less events will get combined -// Default: 512 -MaxSizeGuaranteed=512; -// Maximum payload of non-guaranteed packet (in b) -// Increasing this value may improve bandwidth requirement, but may also increase lag -// Largest factor in desync -// Guidance is half of MaxSizeGuaranteed -// Default: 256 -MaxSizeNonguaranteed=256; -// Maximal size of a packet sent over the network -// Only necessary if ISP forces lower packet size and there are connectivity issues -// Default: 1400 -// class sockets{maxPacketSize=1400}; - -// SMOOTHNESS SETTINGS - -// Minimal error required to send network updates for far units -// Smaller values will make for smoother movement at long ranges, but will increase network traffic -// Default: 0.003 -MinErrorToSend=0.01; -// Minimal error required to send network updates for near units -// Using larger value can reduce traffic sent for near units -// Also controls client to server traffic -// Default: 0.01 -MinErrorToSendNear=0.02; - -// GEOLOCATION SETTINGS - -// Server latitude -serverLatitude=52; -serverLatitudeAuto=52; - -// Server Longitude -serverLongitude=0; -serverLongitudeAuto=0; -// MISC -// View Distance (not sure if this actually works) -viewDistance=10000; - -// Maximum size (in b) for custom face or sound files -// Default: 0 -MaxCustomFileSize=0; -// Server language -language="English"; -steamLanguage="English"; -// Adapter -adapter=-1; -// Windowed mode -Windowed=0; - -3D_Performance=1.000000; \ No newline at end of file diff --git a/Arma3/cfg/lgsm-default.server.cfg b/Arma3/cfg/lgsm-default.server.cfg deleted file mode 100644 index df3f59911..000000000 --- a/Arma3/cfg/lgsm-default.server.cfg +++ /dev/null @@ -1,122 +0,0 @@ -// ArmA 3 Server Config File -// -// More info about parameters: -// https://community.bistudio.com/wiki/server.cfg - - -// PORTS - -// Server Port -// default: 2302. -serverport=2302; - -// Steam Master Port -// default: 2304. -steamport=2304; - -// Steam Query Port -// default: 2303. -steamqueryport=2303; - - -// GENERAL SETTINGS - -// Server Name -hostname = "arma3server"; - -// Server Password -//password = "arma3pass"; - -// Admin Password -passwordAdmin = "arma3adminpass"; - -// Server Slots -maxPlayers = 32; - -// Logfile -logFile = "arma3server.log"; - -// Minimum Required Client Build -//requiredBuild = 95691 - -// Message of the Day (MOTD) -motd[]={ - "Welcome to My Arma 3 Server", - "TS3 Server: teamspeak.somewhere.com", - "Web: www.example.com" -}; - -// MOTD Interval (Seconds) -motdInterval = 30; - - -// VOTING - -// Server Mission Start -// minimum number of clients before server starts mission -voteMissionPlayers = 1; - -// Accepted Vote Threshold -// 0.33 = 33% clients. -voteThreshold = 0.33; - -// INGAME SETTINGS - -// Disable Voice over Net (VoN) -// 0 = voice enabled. -// 1 = voice disabled. -disableVoN = 0; - -// VoN Codec Quality -// 0-10 = 8kHz (narrowband). -// 11-20 = 16kHz (wideband). -// 21-30 = 32kHz (ultrawideband). -vonCodecQuality = 3; - -//Persistent Battlefield -// 0 = disable. -// 1 = enable. -persistent = 1; - -// Time Stamp Format -// none, short, full -timeStampFormat = "short"; - - -// SERVER SECURITY/ANTI HACK - -// Verify Signitures for Client Addons -// 0 = off. -// 1 = weak protection (depricated). -// 2 = full protection. -verifySignatures = 2; - -// Secure Player ID -// 1 = Server warning message. -// 2 = Kick client. -requiredSecureId = 2; - -// Kick Duplicate Player IDs -kickDuplicate = 1; - -// BattlEye Anti-Cheat -// 0 = disable -// 1 = enable -BattlEye = 1; - -// Allowed File Extentions -allowedLoadFileExtensions[] = {"hpp","sqs","sqf","fsm","cpp","paa","txt","xml","inc","ext","sqm","ods","fxy","lip","csv","kb","bik","bikb","html","htm","biedi"}; -allowedPreprocessFileExtensions[] = {"hpp","sqs","sqf","fsm","cpp","paa","txt","xml","inc","ext","sqm","ods","fxy","lip","csv","kb","bik","bikb","html","htm","biedi"}; -allowedHTMLLoadExtensions[] = {"htm","html","xml","txt"}; - -// SCRIPTING ISSUES -onUserConnected = ""; // -onUserDisconnected = ""; // -doubleIdDetected = ""; // - -// SIGNATURE VERIFICATION -// kick = kick (_this select 0) -// ban = ban (_this select 0) -onUnsignedData = "kick (_this select 0)"; -onHackedData = "kick (_this select 0)"; -onDifferentData = ""; \ No newline at end of file diff --git a/BlackMesa/bmdmserver b/BlackMesa/bmdmserver deleted file mode 100644 index 19b577df8..000000000 --- a/BlackMesa/bmdmserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Black Mesa: Deathmatch -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="dm_bounce" -maxplayers="16" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game bms -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="346680" - -# Server Details -servicename="bmdm-server" -gamename="Black Mesa: Deathmatch" -engine="source" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/bms" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/BlackMesa/cfg/lgsm-default.cfg b/BlackMesa/cfg/lgsm-default.cfg deleted file mode 100644 index 9a047db15..000000000 --- a/BlackMesa/cfg/lgsm-default.cfg +++ /dev/null @@ -1,24 +0,0 @@ -// Black Mesa server.cfg file -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 - -mp_timelimit 900 -mp_warmup_time 30 -// sv_lan 0 -// mp_flashlight 1 -// mp_forcerespawn 0 -// mp_friendlyfire 0 -// mp_fraglimit 45 \ No newline at end of file diff --git a/BladeSymphony/bsserver b/BladeSymphony/bsserver deleted file mode 100644 index fc2e67d84..000000000 --- a/BladeSymphony/bsserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Blade Symphony -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="username" -steampass="password" - -# Start Variables -defaultmap="duel_winter" -maxplayers="16" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-autoupdate -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="228780" - -# Server Details -servicename="bs-server" -gamename="Blade Symphony" -engine="source" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/berimbau" -executabledir="${filesdir}" -executable="./srcds_run.sh" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/BladeSymphony/cfg/lgsm-default.cfg b/BladeSymphony/cfg/lgsm-default.cfg deleted file mode 100644 index c2b66dcbc..000000000 --- a/BladeSymphony/cfg/lgsm-default.cfg +++ /dev/null @@ -1,15 +0,0 @@ -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..7fe220357 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,73 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at me@danielgibbs.co.uk. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..bcb1caf7f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,219 @@ +# Contributing to LinuxGSM + +👍🎉 Thank you for taking the time to contribute! 🎉👍 + +The following is a set of guidelines for contributing to LinuxGSM, which are hosted in the [GameServerManagers Organization](https://github.com/gameservermanagers) on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. + +## Table of Contents + + [Contributing to LinuxGSM](#contributing-to-linuxgsm) + * [Table of Contents](#table-of-contents) + * [Code of Conduct](#code-of-conduct) + * [🎉 Bug/Enhancement Contributions 🐛](#bug-enhancement-contributions) + + [🐛Reporting Bugs](#reporting-bugs) + - [Before Submitting A Bug Report](#before-submitting-a-bug-report) + - [How Do I Submit A (Good) Bug Report?](#how-do-i-submit-a--good--bug-report-) + + [🎉Suggesting Features](#suggesting-features) + - [Before Submitting An Feature Suggestion](#before-submitting-an-feature-suggestion) + - [How Do I Submit A (Good) Feature Suggestion?](#how-do-i-submit-a--good--feature-suggestion-) + + [🎮 Game Server Requests](#game-server-requests) + - [Before Submitting a Game Server Request](#before-submitting-a-game-server-request) + - [How Do I Submit A (Good) Game Server Request?](#how-do-i-submit-a--good--game-server-request-) + + [🎮 Game Server Specific Issues](#game-server-specific-issues) + * [💻 Code Contributions](#code-contributions) + + [Pull Requests](#pull-requests) + - [Pull Request naming convention](#pull-request-naming-convention) + + [Testing](#testing) + - [Pull Request Status Checks](#pull-request-status-checks) + - [Test Environment](#test-environment) + + [:wine_glass: Styleguides](#-wine-glass--styleguides) + - [Git Commit Messages](#git-commit-messages) + - [BASH Styleguide](#bash-styleguide) + * [:blue_book: Document Contributions](#-blue-book--document-contributions) + + [Documentation Styleguide](#documentation-styleguide) + * [Issue and Pull Request Labels](#issue-and-pull-request-labels) + +## Code of Conduct + +This project and everyone participating in it are governed by the [LinuxGSM Code of Conduct](https://github.com/GameServerManagers/linuxgsm/blob/master/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behaviour to [daniel.gibbs@linuxgsm.com](mailto:daniel.gibbs@linuxgsm.com). + +## 🎉 Bug/Enhancement Contributions 🐛 + +### 🐛Reporting Bugs + +This section guides you through submitting a bug report for LinuxGSM. Following these guidelines help maintainers and the community understand your report 📝, reproduce the behaviour💻, and find any related reports 🔎. + +Before creating bug reports, please check [this list](https://github.com/GameServerManagers/linuxgsm/blob/master/CONTRIBUTING.md#before-submitting-a-bug-report) as you might find out that you don’t need to create one. When you are creating a bug report, please [include as many details as possible](https://github.com/GameServerManagers/linuxgsm/blob/master/CONTRIBUTING.md#how-do-i-submit-a-good-bug-report). Fill out [the required template]([https://github.com/GameServerManagers/LinuxGSM/issues/new/choose](https://github.com/GameServerManagers/LinuxGSM/issues/new/choose)), the information it asks for helps us resolve issues faster. + +#### Before 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. +* **Perform a** [**cursory search**](https://github.com/search?q=org:GameServerManagers%20type:issues&type=Issues) to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue and give it a thumbs up instead of opening a new one. + +#### How Do I Submit A (Good) Bug Report? + +Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue and provide the following information by filling in [the issues form](https://github.com/GameServerManagers/LinuxGSM/issues/new/choose). + +* **Use a clear and descriptive title** for the issue to identify the problem. +* **Complete the user story** to give a summary of the issue. +* **Provide basic info** to help us understand the context of the issue. +* **Provide further info** to give specifics and more detail. +* **Give steps to reproduce** the issue, allowing developers to follow steps that lead to the issue. +* **Explain what you expect** to happen, so we know what you think should occur. + +### 🎉Suggesting Features + +This section guides you through submitting a feature suggestion for LinuxGSM, including completely new features and minor improvements to existing functionality. Following these guidelines help maintainers and the community understand your suggestion 📝 and find related suggestions 🔎. + +#### Before Submitting An Feature Suggestion + +* **Check the** [**documentation**](https://docs.linuxgsm.com/%5D(https://docs.linuxgsm.com/)) to confirm that the enhancement doesn’t already exist. +* **Check your** [**LinuxGSM version**](https://docs.linuxgsm.com/commands/update-lgsm)**.** A newer version of LinuxGSM may already have your enhancement. +* **Perform a** [**cursory search**](https://github.com/search?q=org:GameServerManagers%20type:issues&type=Issues) to see if the enhancement has already been suggested. If it has **and the enhancement is still open**, add a comment to the existing issue and give it a thumbs up instead of opening a new one. + +#### How Do I Submit A (Good) Feature Suggestion? + +Features are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue and provide the following information by filling in [the issues form](https://github.com/GameServerManagers/LinuxGSM/issues/new/choose). + +* **Use a clear and descriptive title** for the issue to identify the problem. +* **Complete the user story** to give a summary of the issue. +* **Provide basic info** to help us understand the context of the enhancement. +* **Provide further info** to give specifics and more detail. +* **Provide any further reading** materials that might assist in developing the enhancement. + +### 🎮 Game Server Requests + +This section guides you through submitting a game server request for LinuxGSM, Following these guidelines help maintainers and the community understand your game server request 📝. +#### Before Submitting a Game Server Request + +* **Check for existing** [**game server requests**](https://github.com/GameServerManagers/LinuxGSM/labels/type%3A%20game%20server%20request) to see if the new game server has already been suggested. If it has **and if the new game server is still open**, give it a thumbs. +* **Check the game server is supported on Linux**, this does not include Wine servers which we do not support. +#### How Do I Submit A (Good) Game Server Request? +* The title should be as follows: **[Server Request] Game Name** +* **Provide Steam App ID** if applicable +* **Supply any documentation/how-to guides** for the game server. + +### 🎮 Game Server Specific Issues + +LinuxGSM is a management script that acts as a wrapper around game servers. These game servers are developed by different game developers such as Valve, Epic and Facepunch to name a few. + +LinuxGSM has no control over the development and limited knowledge of issues directly relating to the game servers themselves. The same also applies for any mods, add-ons, maps etc. + +If there is an issue with a specific game server or mod the best action may be to contact the game/mod developers on there support forums. If it is unclear some community members should be able to help. + +A [list](https://docs.linuxgsm.com/support/game-server) of known game developer forums is available on the [LinuxGSM docs](https://docs.linuxgsm.com/support/game-server). + +## 💻 Code Contributions + +### Pull Requests + +The process described here has several goals: + +* Maintain LinuxGSM quality. +* Fix problems that are important to users. +* Engage the community in working toward the best possible LinuxGSM. +* Enable a sustainable system for LinuxGSM maintainers to review contributions. + +Please follow these steps to have your contribution considered by the maintainers: + +1. Follow all check-list in [the template](https://github.com/GameServerManagers/LinuxGSM/blob/master/.github/pull_request_template.md) +2. Follow the [style guides](#styleguides) +3. After you submit your pull request, verify that all [status checks](https://help.github.com/articles/about-status-checks/) are passing + +What if the status checks are failing? If a status check is failing, and you believe that the failure is unrelated to your change, please leave a comment on the pull request explaining why you believe the failure is unrelated. A maintainer will re-run the status check for you. If we conclude that the failure was a false positive, then we will open an issue to track that problem with our status check suite. + +While the prerequisites above must be satisfied before having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted. + +#### Pull Request naming convention + +When naming a pull request to ensure that it is following [Conventional Commits](https://www.conventionalcommits.org/) standards; as your pull request commits will be squashed, with the PR subject becoming the commit that is used for generating the [changelog](https://github.com/GameServerManagers/LinuxGSM/releases) for the next release. + +The pull request subject line should always be able to complete the following sentence: + +If applied, this commit will _your subject line here_ + +For example: + +* If applied, this commit will **refactor subsystem X for readability** +* If applied, this commit will **update getting started documentation** +* If applied, this commit will **remove deprecated methods** +* If applied, this commit will **release version 1.0.0** +* If applied, this commit will **merge pull request #123 from user/branch** + +Notice how this doesn’t work for the other non-imperative forms: + +* If applied, this commit will **fixed bug with Y** +* If applied, this commit will **change the behaviour of X** +* If applied, this commit will **more fixes for broken stuff** +* If applied, this commit will **sweet new API methods** + +Below is an example of the subject line for a pull request: + +**feat(alerts): add slack support to alerts** + +**fix(csgoserver): remove SteamCMD auth requirement 32-bit workaround** + +### Testing + +#### Pull Request Status Checks +When a Pull Request is submitted, a series of status check tests are conducted. These tests will asses the code quality, complete CI tests etc. To get your PR merged these status checks must pass. + +#### Test Environment +It is recommended that you have a testing environment available to test your code during development. To test your own code you must change some variables within the `linuxgsm.sh` file. This will force the use of your own code branch. +```bash +## GitHub Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="GameServerManagers" +githubrepo="LinuxGSM" +githubbranch="master" +``` + +### :wine_glass: Styleguides + +#### Git Commit Messages + +LinuxGSM uses the Conventional commits standard to allow other developers to get easy to understand, descriptive commit messages as you develop. While it is recommended that you use this standard for your commits, as your commits will eventually be squashed when your PR is merged following this standard is not strictly enforced for commits, however, it is recommended for more complex commits. + +#### BASH Styleguide + +LinuxGSM uses [ShellCheck](https://www.shellcheck.net/) to follow BASH best practices. It is recommended that you make use of linter tools for your text editor such as [linter-shellcheck](https://atom.io/packages/linter-shellcheck). LinuxGSM uses [Codacy](https://app.codacy.com/manual/GameServerManagers/LinuxGSM/dashboard) to analyse any Pull Requests to give you feedback on code standards. + +LinuxGSM also has some of its style standards that should be followed. These are available in the [dev docs](https://dev-docs.linuxgsm.com/) + +## :blue_book: Document Contributions + +As well as code contributions it is possible to contribute by writing and improving documentation. Documents contributions can be submitted similarly by submitting a Pull Request. + +### Documentation Styleguide + +LinuxGSM has various documentation available to assist [users](https://docs.linuxgsm.com) and [developers](dev-docs.linuxgsm.com). LinuxGSM primarily uses [GitBook](http://gitbook.com/) which uses the [Markdown](https://www.markdownguide.org/) document standard. LinuxGSM uses [Codacy](https://app.codacy.com/manual/GameServerManagers/LinuxGSM/dashboard) to analyse any Pull Requests to give you feedback on markup standards. + +## Issue and Pull Request Labels + +This section lists the labels we use to help us track and manage issues and pull requests. + +[GitHub search](https://help.github.com/articles/searching-issues/) makes it easy to use labels for finding groups of issues or pull requests you're interested in. There are several categories of labels available: + +**command** Labels +Highlights the LinuxGSM command the Issue/PR relates too. + +**info** Labels +Labels to help pinpoint what the issue or PR relates too. + +variants: +* _distro_ +* _engine_ +* _game_ +* _info_ + +**outcome** Labels +Labels that identify why an issue was closed. + +**status** Labels +Labels to update people on the status of the issue. + +**type** Labels +Labels identifying the type of issue, such as a bug, feature, refactor etc. diff --git a/ChivalryMedievalWarfare/cmwserver b/ChivalryMedievalWarfare/cmwserver deleted file mode 100644 index 18332a1f8..000000000 --- a/ChivalryMedievalWarfare/cmwserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Chivalry: Medieval Warfare -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="aocffa-moor_p" -maxplayers="16" -port="7000" -queryport="7010" -clientport="27005" -adminpassword="adminpassword" -ip="0.0.0.0" -updateonstart="off" - -fn_parms(){ -parms="${defaultmap}\?steamsockets\?adminpassword=${adminpassword}\?port=${port}\?queryport=${queryport} -seekfreeloadingserver" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="220070" - -# Server Details -servicename="cmw-server" -gamename="Chivalry: Medieval Warfare" -engine="unreal3" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}" -executabledir="${filesdir}/Binaries/Linux" -executable="./UDKGameServer-Linux" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/CounterStrike/cfg/lgsm-default.cfg b/CounterStrike/cfg/lgsm-default.cfg deleted file mode 100644 index ceb8f9374..000000000 --- a/CounterStrike/cfg/lgsm-default.cfg +++ /dev/null @@ -1,38 +0,0 @@ -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 - -// disable autoaim -sv_aim 0 - -// disable clients' ability to pause the server -pausable 0 - -// maximum client movement speed -sv_maxspeed 320 - -// 20 minute timelimit -mp_timelimit 20 - -// cheats off -sv_cheats 0 - -// load ban files -exec listip.cfg -exec banned.cfg - - - - diff --git a/CounterStrike/csserver b/CounterStrike/csserver deleted file mode 100644 index 92a7108ce..000000000 --- a/CounterStrike/csserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Counter Strike -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="de_dust2" -maxplayers="16" -port="27015" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 -fn_parms(){ -parms="-game cstrike -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="90" -appidmod="cstrike" - -# Server Details -servicename="cs-server" -gamename="Counter Strike 1.6" -engine="goldsource" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/cstrike" -executabledir="${filesdir}" -executable="./hlds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/CounterStrikeConditionZero/cfg/lgsm-default.cfg b/CounterStrikeConditionZero/cfg/lgsm-default.cfg deleted file mode 100644 index ceb8f9374..000000000 --- a/CounterStrikeConditionZero/cfg/lgsm-default.cfg +++ /dev/null @@ -1,38 +0,0 @@ -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 - -// disable autoaim -sv_aim 0 - -// disable clients' ability to pause the server -pausable 0 - -// maximum client movement speed -sv_maxspeed 320 - -// 20 minute timelimit -mp_timelimit 20 - -// cheats off -sv_cheats 0 - -// load ban files -exec listip.cfg -exec banned.cfg - - - - diff --git a/CounterStrikeConditionZero/csczserver b/CounterStrikeConditionZero/csczserver deleted file mode 100644 index 68f5b36e4..000000000 --- a/CounterStrikeConditionZero/csczserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Counter Strike: Condition Zero -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="de_dust2" -maxplayers="16" -port="27015" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 -fn_parms(){ -parms="-game czero -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="90" -appidmod="czero" - -# Server Details -servicename="cscz-server" -gamename="Counter Strike: Condition Zero" -engine="goldsource" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/czero" -executabledir="${filesdir}" -executable="./hlds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/CounterStrikeGlobalOffensive/cfg/lgsm-default.cfg b/CounterStrikeGlobalOffensive/cfg/lgsm-default.cfg deleted file mode 100644 index 15906f925..000000000 --- a/CounterStrikeGlobalOffensive/cfg/lgsm-default.cfg +++ /dev/null @@ -1,23 +0,0 @@ -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 - -exec banned_user.cfg -exec banned_ip.cfg -writeid -writeip - - - diff --git a/CounterStrikeGlobalOffensive/csgoserver b/CounterStrikeGlobalOffensive/csgoserver deleted file mode 100755 index fcc9eae9c..000000000 --- a/CounterStrikeGlobalOffensive/csgoserver +++ /dev/null @@ -1,155 +0,0 @@ -#!/bin/bash -# Counter Strike: Global Offensive -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -# https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers#Starting_the_Server -# [Game Modes] gametype gamemode -# Arms Race 1 0 -# Classic Casual 0 0 -# Classic Competitive 0 1 -# Demolition 1 1 -# Deathmatch 1 2 -gamemode="0" -gametype="0" -defaultmap="de_dust2" -mapgroup="random_classic" -maxplayers="16" -tickrate="64" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# Required: Game Server Login Token -# GSLT is required for running a public server. -# More info: http://gameservermanagers.com/gslt -gslt="" - -# Optional: Workshop Parameters -# https://developer.valvesoftware.com/wiki/CSGO_Workshop_For_Server_Operators -# To get an authkey visit - http://steamcommunity.com/dev/apikey -# authkey="" -# ws_collection_id="" -# ws_start_map="" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +mapgroup ${mapgroup} +game_mode ${gamemode} +game_type ${gametype} +host_workshop_collection ${ws_collection_id} +workshop_start_map ${ws_start_map} -authkey ${authkey}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="740" - -# Server Details -servicename="csgo-server" -gamename="Counter Strike: Global Offensive" -engine="source" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/csgo" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/CounterStrikeSource/cfg/lgsm-default.cfg b/CounterStrikeSource/cfg/lgsm-default.cfg deleted file mode 100644 index c2b66dcbc..000000000 --- a/CounterStrikeSource/cfg/lgsm-default.cfg +++ /dev/null @@ -1,15 +0,0 @@ -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 \ No newline at end of file diff --git a/CounterStrikeSource/cssserver b/CounterStrikeSource/cssserver deleted file mode 100644 index 6079cec51..000000000 --- a/CounterStrikeSource/cssserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Counter Strike: Source -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="de_dust2" -maxplayers="16" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game cstrike -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="232330" - -# Server Details -servicename="css-server" -gamename="Counter Strike: Source" -engine="source" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/cstrike" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/DayOfDefeat/cfg/lgsm-default.cfg b/DayOfDefeat/cfg/lgsm-default.cfg deleted file mode 100644 index ceb8f9374..000000000 --- a/DayOfDefeat/cfg/lgsm-default.cfg +++ /dev/null @@ -1,38 +0,0 @@ -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 - -// disable autoaim -sv_aim 0 - -// disable clients' ability to pause the server -pausable 0 - -// maximum client movement speed -sv_maxspeed 320 - -// 20 minute timelimit -mp_timelimit 20 - -// cheats off -sv_cheats 0 - -// load ban files -exec listip.cfg -exec banned.cfg - - - - diff --git a/DayOfDefeat/dodserver b/DayOfDefeat/dodserver deleted file mode 100644 index 22ca76075..000000000 --- a/DayOfDefeat/dodserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Day of Defeat -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="dod_Anzio" -maxplayers="16" -port="27015" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 -fn_parms(){ -parms="-game dod -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="90" -appidmod="dod" - -# Server Details -servicename="dod-server" -gamename="Day of Defeat" -engine="goldsource" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/dod" -executabledir="${filesdir}" -executable="./hlds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/DayOfDefeatSource/cfg/lgsm-default.cfg b/DayOfDefeatSource/cfg/lgsm-default.cfg deleted file mode 100644 index ceb8f9374..000000000 --- a/DayOfDefeatSource/cfg/lgsm-default.cfg +++ /dev/null @@ -1,38 +0,0 @@ -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 - -// disable autoaim -sv_aim 0 - -// disable clients' ability to pause the server -pausable 0 - -// maximum client movement speed -sv_maxspeed 320 - -// 20 minute timelimit -mp_timelimit 20 - -// cheats off -sv_cheats 0 - -// load ban files -exec listip.cfg -exec banned.cfg - - - - diff --git a/DayOfDefeatSource/dodsserver b/DayOfDefeatSource/dodsserver deleted file mode 100644 index 923d9ea3b..000000000 --- a/DayOfDefeatSource/dodsserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Day of Defeat: Source -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="dod_Anzio" -maxplayers="16" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game dod -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="232290" - -# Server Details -servicename="dods-server" -gamename="Day of Defeat: Source" -engine="source" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/dod" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/DeathmatchClassic/cfg/lgsm-default.cfg b/DeathmatchClassic/cfg/lgsm-default.cfg deleted file mode 100644 index 585afb9e2..000000000 --- a/DeathmatchClassic/cfg/lgsm-default.cfg +++ /dev/null @@ -1,35 +0,0 @@ -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 - -// disable autoaim -sv_aim 0 - -// disable clients' ability to pause the server -pausable 0 - -// maximum client movement speed -sv_maxspeed 320 - -// 20 minute timelimit -mp_timelimit 20 - -// cheats off -sv_cheats 0 - -// load ban files -exec listip.cfg -exec banned.cfg - diff --git a/DeathmatchClassic/dmcserver b/DeathmatchClassic/dmcserver deleted file mode 100644 index c22fbc94e..000000000 --- a/DeathmatchClassic/dmcserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Deathmatch Classic -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="dcdm5" -maxplayers="16" -port="27015" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 -fn_parms(){ -parms="-game dmc -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="90" -appidmod="dmc" - -# Server Details -servicename="dmc-server" -gamename="Deathmatch Classic" -engine="goldsource" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/dmc" -executabledir="${filesdir}" -executable="./hlds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/DontStarveTogether/dstserver b/DontStarveTogether/dstserver deleted file mode 100644 index ea1e832d0..000000000 --- a/DontStarveTogether/dstserver +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/bash -# Dont Starve Together -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -ip="0.0.0.0" -updateonstart="off" - -fn_parms(){ -parms="" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="343050" - -# Server Details -servicename="dst-server" -gamename="Dont Starve Together" -engine="dontstarve" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}" -executabledir="${filesdir}/bin" -executable="./dontstarve_dedicated_server_nullrenderer" -servercfg="settings.ini" -servercfgdir="${HOME}/.klei/DoNotStarveTogether" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.ini" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/DontStarveTogether/lgsm-default.ini b/DontStarveTogether/lgsm-default.ini deleted file mode 100644 index 351a1238c..000000000 --- a/DontStarveTogether/lgsm-default.ini +++ /dev/null @@ -1,39 +0,0 @@ -[network] -default_server_name = dstserver -default_server_description = Welcome to dstserver -server_port = 10999 -server_password = password - -# max_players = 1 .. 64 -max_players = 16 - -# pvp = true | false -pvp = false - -# game_mode = endless | survival | wilderness -game_mode = endless - -# enable_autosaver = true | false -enable_autosaver = true - -# tick_rate = [ 10 | 15 | 30 | 60 ] -tick_rate = 30 - -connection_timeout = 8000 -server_save_slot = 1 - -# enable_vote_kick = true | false -enable_vote_kick = true - -# pause_when_empty = true | false -pause_when_empty = true - -[account] -dedicated_lan_server = false - -[STEAM] -DISABLECLOUD = true - -[MISC] -CONSOLE_ENABLED = true -autocompiler_enabled = true diff --git a/DoubleActionBoogaloo/cfg/lgsm-default.cfg b/DoubleActionBoogaloo/cfg/lgsm-default.cfg deleted file mode 100644 index c2b66dcbc..000000000 --- a/DoubleActionBoogaloo/cfg/lgsm-default.cfg +++ /dev/null @@ -1,15 +0,0 @@ -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 \ No newline at end of file diff --git a/DoubleActionBoogaloo/dabserver b/DoubleActionBoogaloo/dabserver deleted file mode 100644 index f3bac60ed..000000000 --- a/DoubleActionBoogaloo/dabserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Double Action: Boogaloo -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="da_rooftops" -maxplayers="10" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="317800" - -# Server Details -servicename="da-server" -gamename="Double Action: Boogaloo" -engine="source" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/dab" -executabledir="${filesdir}" -executable="./dabds.sh" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/DoubleActionBoogaloo/dependencies/libm.so.6 b/DoubleActionBoogaloo/dependencies/libm.so.6 deleted file mode 100644 index 39034023b..000000000 Binary files a/DoubleActionBoogaloo/dependencies/libm.so.6 and /dev/null differ diff --git a/FistfulOfFrags/cfg/lgsm-default.cfg b/FistfulOfFrags/cfg/lgsm-default.cfg deleted file mode 100644 index d7e1d9aa9..000000000 --- a/FistfulOfFrags/cfg/lgsm-default.cfg +++ /dev/null @@ -1,124 +0,0 @@ -// **************************************************************************** -// * -// Fistful of Frags - server.cfg * -// Version 271015 * -// * -// **************************************************************************** - -// ............................. Basic Settings ............................. // - -// Hostname for server. -hostname "" - -// RCON - remote console password. -rcon_password "" - -// Server password - for private servers. -sv_password "" - -// Contact email for server sysop. -sv_contact "email@example.com" - -// LAN Mode - If set the server will not show on the internet. -// Default: sv_lan 0 -sv_lan 0 - -// ............................... Map Cycles ............................... // -// info: There are several predefined mapcycles available that are listed below. -// You can also create your own custom mapcycle. - -// "mapcycle.txt" - All Shootout/2 Team Shootout/4 Team Shootout maps -// "mapcycle_12.txt" - All 12 slot maps for Shootout/2 Team Shootout/4 Team Shootout -// "mapcycle_32.txt" - All 32 slot maps for Shootout/2 Team Shootout/4 Team Shootout -// "mapcycle_tp.txt" - All Teamplay maps -// "mapcycle_gt.txt" - All Ghost Town maps -mapcyclefile "mapcycle.txt" - -// ....................... Time Limits/Round Settings ....................... // - -// Time spend on a single map (in minutes) before switching to a new one automatically. -// Default: mp_timelimit 0 -mp_timelimit 15 - -// ........................ Server Specific Commands ........................ // -// info: any commands that only apply to this game. - -// Game Modes -// 1 = Shootout/2 Team Shootout/4 Team Shootout/Ghost Town -// 2 = Teamplay -// 3 = Break Bad -// 4 = Elimination -fof_sv_currentmode 1 - -// Teamplay -// 0 = Free-for-all -// 1 = Team Deathmatch -mp_teamplay 0 - -// Team numbers -// 2 = Vigilantes & Desperados -// 3 = Vigilantes, Desperados & Bandidos -// 4 = Vigilantes, Desperados, Bandidos & Rangers -fof_sv_maxteams 4 - -// Friendly fire - Allows team members to injure other members of their team. -// 0 = Friendly fire disabled -// 1 = Friendly fire enabled -mp_friendlyfire 0 - -// ............................. Communication ............................. // - -// Enable communication over voice via microphone. -// Default: sv_voiceenable 1 -sv_voiceenable 1 - -// Players can hear all other players, no team restrictions. -// Default: sv_alltalk 0 -sv_alltalk 1 - -// ............................. Fast Download .............................. // -// info: Allows custom maps to be downloaded to the client. - -// Allows clients to download custom maps and textures etc. from the server at 20 kbps. -// Default: sv_allowdownload 1 -sv_allowdownload 1 - -// Allows clients to download custom maps, textures etc. from a web server with no transfer limit. -// Example: -// server location: maps/custommap.bsp -// web server location: http://example.com/custom/maps/custommap.bsp -// sv_downloadurl "http://example.com/custom" -// Default: sv_downloadurl "" -sv_downloadurl "" - -// ................................ Ban List ............................... // - -// personal banlist based on user IDs. -exec banned_user.cfg - -// personal banlist based on user IPs. -exec banned_ip.cfg - -writeid -writeip - -// ............................. Server Logging ............................. // - -//Enables logging to file, console, and udp < on | off >. -log on - -// Log server bans in the server logs. -// Default: sv_logbans 1 -sv_logbans 1 - -// Echo log information to the console. -// Default: sv_logecho 1 -sv_logecho 1 - -// Log server information in the log file. -// Default: sv_logfile 1 -sv_logfile 1 - -// Log server information to only one file. -// Default: sv_log_onefile 0 -sv_log_onefile 0 \ No newline at end of file diff --git a/FistfulOfFrags/dependencies/libm.so.6 b/FistfulOfFrags/dependencies/libm.so.6 deleted file mode 100644 index 39034023b..000000000 Binary files a/FistfulOfFrags/dependencies/libm.so.6 and /dev/null differ diff --git a/FistfulOfFrags/fofserver b/FistfulOfFrags/fofserver deleted file mode 100644 index 3aa4e88c7..000000000 --- a/FistfulOfFrags/fofserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Fistful Of Frags -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="fof_depot" -maxplayers="16" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game fof -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="295230" - -# Server Details -servicename="fof-server" -gamename="Fistful of Frags" -engine="source" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/fof" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/GameServerQuery/gsquery.py b/GameServerQuery/gsquery.py deleted file mode 100644 index a1380a5a7..000000000 --- a/GameServerQuery/gsquery.py +++ /dev/null @@ -1,123 +0,0 @@ -#! /usr/bin/env python -# -*- coding: utf-8 -*- -# Game Server Query -# Author: Anonymous & Daniel Gibbs -# # Website: http://gameservermanagers.com -# Version: 030515 - -import optparse -import socket -import sys - -class GameServer: - def __init__( self, options, arguments ): - self.option = options - self.argument = arguments - # - self.server_response_timeout = 5 - self.default_buffer_length = 1024 - # - if self.option.engine == 'source': - self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0' - if self.option.engine == 'goldsource': - self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0' - if self.option.engine == 'spark': - self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0' - if self.option.engine == 'realvirtuality': - self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0' - if self.option.engine == 'unity3d': - self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0' - elif self.option.engine == 'unreal': - self.query_prompt_string = '\x5C\x69\x6E\x66\x6F\x5C' - elif self.option.engine == 'unreal2': - self.query_prompt_string = '\x79\x00\x00\x00\x00' - elif self.option.engine == 'avalanche': - self.query_prompt_string = '\xFE\xFD\x09\x10\x20\x30\x40' - self.connected = False - self.response = None - self.sanity_checks() - - def fatal_error( self, error_message, error_code=1 ): - sys.stderr.write( 'ERROR: ' + str(error_message) + '\n' ) - sys.exit( error_code ) - - def exit_success( self, success_message='' ): - sys.stdout.write( 'OK: ' + str(success_message) + '\n' ) - sys.exit( 0 ) - - def responding( self ): - # Connect. - connection = socket.socket( socket.AF_INET, socket.SOCK_DGRAM ) - connection.settimeout( self.server_response_timeout ) - try: - self.connected = connection.connect( ( self.option.address, int(self.option.port) ) ) - except socket.timeout: - self.fatal_error( 'Request timed out', 1 ) - except: - self.fatal_error( 'Unable to connect', 1 ) - # Send. - connection.send( self.query_prompt_string ) - # Receive. - try: - self.response = connection.recv( self.default_buffer_length ) - except socket.error: - self.fatal_error( 'Unable to receive', 2 ) - connection.close() - # Response. - if self.response == None: - self.fatal_error( 'No response', 3 ) - if len( self.response ) < 10 : - sys.exit( 'Short response.', 3 ) - else: - self.exit_success( str( self.response ) ) - - def sanity_checks( self ): - if not self.option.address: - self.fatal_error( 'No IPv4 address supplied.', 4 ) - if not self.option.port: - self.fatal_error( 'No port supplied.', 4 ) - -if __name__ == '__main__': - parser = optparse.OptionParser( - usage = 'usage: python %prog [options]', - version = '%prog 0.0.1' - ) - parser.add_option( - '-a', '--address', - action = 'store', - dest = 'address', - default = False, - help = 'The IPv4 address of the server.' - ) - parser.add_option( - '-p', '--port', - action = 'store', - dest = 'port', - default = False, - help = 'The IPv4 port of the server.' - ) - parser.add_option( - '-e', '--engine', - action = 'store', - dest = 'engine', - default = False, - help = 'Engine type: avalanche, goldsource, realvirtuality, spark, source, unity3d, unreal, unreal2.' - ) - parser.add_option( - '-v', '--verbose', - action = 'store_true', - dest = 'verbose', - default = False, - help = 'Display verbose output.' - ) - parser.add_option( - '-d', '--debug', - action = 'store_true', - dest = 'debug', - default = False, - help = 'Display debugging output.' - ) - options, arguments = parser.parse_args() - # - server = GameServer( options, arguments ) - server.responding() diff --git a/GarrysMod/cfg/lgsm-default.cfg b/GarrysMod/cfg/lgsm-default.cfg deleted file mode 100644 index 2e61eb6a2..000000000 --- a/GarrysMod/cfg/lgsm-default.cfg +++ /dev/null @@ -1,86 +0,0 @@ -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 -lua_log_sv 0 - -sv_rcon_banpenalty 0 -sv_rcon_maxfailures 20 -sv_rcon_minfailures 20 -sv_rcon_minfailuretime 20 - -// Network Settings -sv_downloadurl "" -sv_loadingurl "" -net_maxfilesize 64 -sv_maxrate 40000 -sv_minrate 40000 -sv_maxupdaterate 66 -sv_minupdaterate 10 -sv_maxcmdrate 60 -sv_mincmdrate 10 - -// Server Settings -sv_airaccelerate 100 -sv_gravity 600 -sv_allow_wait_command 0 -sv_allow_voice_from_file 0 -sv_turbophysics 0 -sv_max_usercmd_future_ticks 12 -gmod_physiterations 2 -sv_client_min_interp_ratio 1 -sv_client_max_interp_ratio 2 -think_limit 20 -sv_region 0 -sv_noclipspeed 5 -sv_noclipaccelerate 5 -sv_lan 0 -sv_alltalk 1 -sv_contact youremail@changeme.com -sv_cheats 0 -sv_allowcslua 0 -sv_pausable 0 -sv_filterban 1 -sv_forcepreload 1 -sv_footsteps 1 -sv_voiceenable 1 -sv_voicecodec vaudio_speex -sv_timeout 120 -sv_deltaprint 0 -sv_allowupload 0 -sv_allowdownload 0 - -// Sandbox Settings -sbox_noclip 0 -sbox_godmode 0 -sbox_weapons 0 -sbox_playershurtplayers 0 -sbox_maxprops 100 -sbox_maxragdolls 50 -sbox_maxnpcs 10 -sbox_maxballoons 10 -sbox_maxeffects 0 -sbox_maxdynamite 0 -sbox_maxlamps 5 -sbox_maxthrusters 20 -sbox_maxwheels 20 -sbox_maxhoverballs 20 -sbox_maxvehicles 1 -sbox_maxbuttons 20 -sbox_maxemitters 0 - -// Misc Config -exec banned_user.cfg -exec banned_ip.cfg -heartbeat diff --git a/GarrysMod/dependencies/libc.so.6 b/GarrysMod/dependencies/libc.so.6 deleted file mode 100644 index ee77b1740..000000000 Binary files a/GarrysMod/dependencies/libc.so.6 and /dev/null differ diff --git a/GarrysMod/dependencies/libm.so.6 b/GarrysMod/dependencies/libm.so.6 deleted file mode 100644 index 2f0eb4672..000000000 Binary files a/GarrysMod/dependencies/libm.so.6 and /dev/null differ diff --git a/GarrysMod/dependencies/libpthread.so.0 b/GarrysMod/dependencies/libpthread.so.0 deleted file mode 100644 index a4bfc2282..000000000 Binary files a/GarrysMod/dependencies/libpthread.so.0 and /dev/null differ diff --git a/GarrysMod/dependencies/libstdc++.so.6 b/GarrysMod/dependencies/libstdc++.so.6 deleted file mode 100644 index fa1204704..000000000 Binary files a/GarrysMod/dependencies/libstdc++.so.6 and /dev/null differ diff --git a/GarrysMod/gmodserver b/GarrysMod/gmodserver deleted file mode 100644 index 98ede6927..000000000 --- a/GarrysMod/gmodserver +++ /dev/null @@ -1,138 +0,0 @@ -#!/bin/bash -# Garry's Mod -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Workshop Variables -# http://wiki.garrysmod.com/page/Workshop_for_Dedicated_Servers -workshopauth="" -workshopcollectionid="" - -# Start Variables -defaultmap="gm_construct" -gamemode="sandbox" -maxplayers="16" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game garrysmod -strictportbind -ip ${ip} -port ${port} +host_workshop_collection ${workshopcollectionid} -authkey ${workshopauth} +clientport ${clientport} +tv_port ${sourcetvport} +gamemode ${gamemode} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="4020" - -# Server Details -servicename="gmod-server" -gamename="Garry's Mod" -engine="source" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/garrysmod" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/HalfLife2Deathmatch/cfg/lgsm-default.cfg b/HalfLife2Deathmatch/cfg/lgsm-default.cfg deleted file mode 100644 index c2b66dcbc..000000000 --- a/HalfLife2Deathmatch/cfg/lgsm-default.cfg +++ /dev/null @@ -1,15 +0,0 @@ -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 \ No newline at end of file diff --git a/HalfLife2Deathmatch/hl2dmserver b/HalfLife2Deathmatch/hl2dmserver deleted file mode 100644 index a113a1a76..000000000 --- a/HalfLife2Deathmatch/hl2dmserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Half Life 2: Deathmatch -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="dm_lockdown" -maxplayers="16" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game hl2mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="232370" - -# Server Details -servicename="hl2dm-server" -gamename="Half Life 2: Deathmatch" -engine="source" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/hl2mp" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/HalfLifeDeathmatch/cfg/lgsm-default.cfg b/HalfLifeDeathmatch/cfg/lgsm-default.cfg deleted file mode 100644 index 585afb9e2..000000000 --- a/HalfLifeDeathmatch/cfg/lgsm-default.cfg +++ /dev/null @@ -1,35 +0,0 @@ -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 - -// disable autoaim -sv_aim 0 - -// disable clients' ability to pause the server -pausable 0 - -// maximum client movement speed -sv_maxspeed 320 - -// 20 minute timelimit -mp_timelimit 20 - -// cheats off -sv_cheats 0 - -// load ban files -exec listip.cfg -exec banned.cfg - diff --git a/HalfLifeDeathmatch/hldmserver b/HalfLifeDeathmatch/hldmserver deleted file mode 100644 index 5e3008f28..000000000 --- a/HalfLifeDeathmatch/hldmserver +++ /dev/null @@ -1,131 +0,0 @@ -#!/bin/bash -# Half Life: Deathmatch -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="crossfire" -maxplayers="16" -port="27015" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 -fn_parms(){ -parms="-game valve -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="90" - -# Server Details -servicename="hldm-server" -gamename="Half Life: Deathmatch" -engine="goldsource" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/valve" -executabledir="${filesdir}" -executable="./hlds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/HalfLifeDeathmatchSource/cfg/lgsm-default.cfg b/HalfLifeDeathmatchSource/cfg/lgsm-default.cfg deleted file mode 100644 index c2b66dcbc..000000000 --- a/HalfLifeDeathmatchSource/cfg/lgsm-default.cfg +++ /dev/null @@ -1,15 +0,0 @@ -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 \ No newline at end of file diff --git a/HalfLifeDeathmatchSource/hldmsserver b/HalfLifeDeathmatchSource/hldmsserver deleted file mode 100644 index 89a5595f6..000000000 --- a/HalfLifeDeathmatchSource/hldmsserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Half-Life Deathmatch: Source -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="crossfire" -maxplayers="16" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game hl1mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="255470" - -# Server Details -servicename="hldms-server" -gamename="Half-Life Deathmatch: Source" -engine="source" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/hl1mp" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/Insurgency/cfg/lgsm-default.cfg b/Insurgency/cfg/lgsm-default.cfg deleted file mode 100644 index dde80d728..000000000 --- a/Insurgency/cfg/lgsm-default.cfg +++ /dev/null @@ -1,125 +0,0 @@ -// **************************************************************************** -// * -// Ingurgency - server.cfg * -// Version 150815 * -// * -// **************************************************************************** - -// ............................. Basic Settings ............................. // - -// Hostname for server. -hostname "" - -// RCON - remote console password. -rcon_password "" - -// Server password - for private servers. -sv_password "" - -// Contact email for server sysop. -sv_contact "email@example.com" - -// LAN Mode - If set the server will not show on the internet. -// Default: sv_lan 0 -sv_lan 0 - -// ......................... Matchmaking Playlists ......................... // -// info: Selecting a playlist will allow the server to show up in matchmaking. -// Playlists use predefined settings and mapcycle. - -// You do not need to select a mapcycle as the server will cycle though the -// predefined playlist mapcycle. -// -// If you want to change the predefined playlist mapcycle you can create a -// custom mapcycle but only with maps from the playlist mapcycle. -// -// You can also create your own custom playlists. -// http://steamcommunity.com/sharedfiles/filedetails/?id=461776759 - -// "nwi/comp" -// "nwi/coop" -// "nwi/coop_elite" -// "nwi/coop_hardcore" -// "nwi/pvp_sustained" -// "nwi/pvp_tactical" -// -sv_playlist "nwi/coop" - -// ............................... Map Cycles ............................... // -// info: There are several predefined mapcycles available that are listed below. -// You can also create your own custom mapcycle. - -// "mapcycle.txt" - by default this contains the most popular options -// "mapcycle_all.txt" - all possible map/mode combinations for PvP -// "mapcycle_ambush.txt" - all ambush (VIP) maps -// "mapcycle_attackdefend.txt" - push & strike maps -// "mapcycle_checkpoint.txt" - all checkpoint maps -// "mapcycle_comp.txt" - firefight & elimination maps -// "mapcycle_cooperative.txt" - survival, coop, hunt maps -// "mapcycle_firefight.txt" - all firefight maps -// "mapcycle_flashpoint.txt" - all flashpoint maps -// "mapcycle_hunt.txt" - all hunt maps -// "mapcycle_infiltrate.txt" - all infiltrate (CTF) maps -// "mapcycle_objrespawn.txt" - all firefight & flashpoint featuring respawning for completing objectives -// "mapcycle_occupy.txt" - all occupy maps -// "mapcycle_practice.txt" -// "mapcycle_push.txt" - all push maps -// "mapcycle_singlelife.txt" - strike & ambush single life modes -// "mapcycle_skirmish.txt" - all skirmish maps -// "mapcycle_strike.txt" - all strike maps -// "mapcycle_survival.txt" - all survival maps -// "mapcycle_sustained_combat.txt" -// "mapcycle_tactical_operations.txt" -// "mapcycle_workshop.txt" - used by Workshop system -// -//mapcyclefile "mapcycle.txt" - -// ............................. Fast Download .............................. // -// info: Allows custom maps to be downloaded to the client. - -// Allows clients to download custom maps and textures etc. from the server at 20 kbps. -// Default: sv_allowdownload 1 -sv_allowdownload 1 - -// Allows clients to download custom maps, textures etc. from a web server with no transfer limit. -// Example: -// server location: maps/custommap.bsp -// web server location: http://example.com/custom/maps/custommap.bsp -// sv_downloadurl "http://example.com/custom" -// Default: sv_downloadurl "" -sv_downloadurl "" - -// ................................ Ban List ............................... // - -// sv_nwi_banlist is the official banlist. -sv_nwi_banlist 1 - -// personal banlist based on user IDs. -exec banned_user.cfg - -// personal banlist based on user IPs. -exec banned_ip.cfg - -writeid -writeip - -// ............................. Server Logging ............................. // - -//Enables logging to file, console, and udp < on | off >. -log on - -// Log server bans in the server logs. -// Default: sv_logbans 1 -sv_logbans 1 - -// Echo log information to the console. -// Default: sv_logecho 1 -sv_logecho 1 - -// Log server information in the log file. -// Default: sv_logfile 1 -sv_logfile 1 - -// Log server information to only one file. -// Default: sv_log_onefile 0 -sv_log_onefile 0 diff --git a/Insurgency/dependencies/libc.so.6 b/Insurgency/dependencies/libc.so.6 deleted file mode 100644 index c007d9f75..000000000 Binary files a/Insurgency/dependencies/libc.so.6 and /dev/null differ diff --git a/Insurgency/dependencies/libm.so.6 b/Insurgency/dependencies/libm.so.6 deleted file mode 100644 index 39034023b..000000000 Binary files a/Insurgency/dependencies/libm.so.6 and /dev/null differ diff --git a/Insurgency/dependencies/libpthread.so.0 b/Insurgency/dependencies/libpthread.so.0 deleted file mode 100644 index a4bfc2282..000000000 Binary files a/Insurgency/dependencies/libpthread.so.0 and /dev/null differ diff --git a/Insurgency/dependencies/librt.so.1 b/Insurgency/dependencies/librt.so.1 deleted file mode 100644 index 4d3d88ad2..000000000 Binary files a/Insurgency/dependencies/librt.so.1 and /dev/null differ diff --git a/Insurgency/insserver b/Insurgency/insserver deleted file mode 100644 index 775ca961d..000000000 --- a/Insurgency/insserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Insurgency -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="ministry" -maxplayers="16" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game insurgency -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="237410" - -# Server Details -servicename="ins-server" -gamename="Insurgency" -engine="source" - -# Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/insurgency" -executabledir="${filesdir}" -executable="./srcds_linux" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/JustCause2/cfg/config.lua b/JustCause2/cfg/config.lua deleted file mode 100644 index f803a493f..000000000 --- a/JustCause2/cfg/config.lua +++ /dev/null @@ -1,179 +0,0 @@ --- Welcome to the JC2-MP server configuration file! - ---[[ -SERVER OPTIONS - -Server-related options. ---]] -Server = -{ - -- The maximum number of players that can be on the server at any - -- given time. Make sure your connection and server can handle it! - -- Default value: 5000 - MaxPlayers = 5000, - -- Used to control what IP this server binds to. Unless you're a dedicated - -- game host, you don't need to worry about this. - -- Default value: "" - BindIP = "", - -- The port the server uses. - -- Default value: 7777 - BindPort = 7777, - -- The time before a player is timed out after temporarily losing - -- connection, or crashing without properly disconnecting. - -- Default value (in milliseconds): 10000 - Timeout = 10000, - - -- The name of the server, as seen by players and the server browser. - -- Default value: "JC2-MP Server" - Name = "JC2-MP Server", - -- The server description, as seen by players and the server browser. - -- Default value: "No description available" - Description = "No description available.", - -- The server password. - -- Default value: "" - Password = "", - - -- Controls whether the server announces its presence to the master server - -- and therefore to the server browser. - -- Default value: true - Announce = true, - - -- Controls how often synchronization packets are broadcast by the server - -- in milliseconds - -- Default value (in milliseconds): 180 - SyncUpdate = 180, - - -- CAUTION: Setting this variable to true unlocks a number of potentially - -- unsafe operations, which include: - -- * Native Lua packages (.dll, .so) - -- * Execution of Lua from arbitrary paths (Access to loadfile/dofile) - -- * Unbound io functions, allowing for access to the entire file-system - -- Default value: false - IKnowWhatImDoing = false -} - ---[[ -SYNCRATE OPTIONS - -Sync rate options. These values control how often synchronization -packets are sent by the clients, in milliseconds. This lets you -control how frequent the sync comes in, which may result in a -smoother or less laggy experience ---]] -SyncRates = -{ - -- Default value (in milliseconds): 75 - Vehicle = 75, - -- Default value (in milliseconds): 120 - OnFoot = 120, - -- Default value (in milliseconds): 1000 - Passenger = 1000, - -- Default value (in milliseconds): 250 - MountedGun = 250, - -- Default value (in milliseconds): 350 - StuntPosition = 350 -} - ---[[ -STREAMER OPTIONS - -Streamer-related options. The streamer is responsible for controlling the -visibility of objects (including players and vehicles) for other players. - -What this means is that if you want to extend the distance at which objects -remain visible for players, you need to change the StreamDistance. ---]] -Streamer = -{ - -- The default distance before objects are streamed out. - -- Default value (in metres): 500 - StreamDistance = 500 -} - ---[[ -VEHICLE OPTIONS - -Vehicle-related options. ---]] -Vehicle = -{ - -- The number of seconds required for a vehicle to respawn after - -- vehicle death. - -- Default value (in seconds): 10 - -- For instant respawn: 0 - -- For no respawning: nil - DeathRespawnTime = 10, - -- Controls whether to remove the vehicle if respawning is turned off, - -- and the vehicle dies. - -- Default value: false - DeathRemove = false, - - -- The number of seconds required for a vehicle to respawn after it is - -- left unoccupied. - -- Default value (in seconds): 45 - -- For instant respawn: 0 - -- For no respawning: nil - UnoccupiedRespawnTime = 45, - -- Controls whether to remove the vehicle if respawning is turned off, - -- and the vehicle is left unoccupied. - -- Default value: false - UnoccupiedRemove = false, -} - ---[[ -PLAYER OPTIONS - -Player-related options. ---]] -Player = -{ - -- The default spawn position for players. If you do not use a script - -- to handle spawns, such as the freeroam script, then this spawn position - -- will be used. - -- Default value: Vector3( -6550, 209, -3290 ) - SpawnPosition = Vector3( -6550, 209, -3290 ) -} - ---[[ -MODULE OPTIONS - -Lua module-related options. ---]] -Module = -{ - --[[ - To prevent a large number of errors building up, modules are automatically - unloaded after a certain number of errors in a given timespan. Each error - adds to a counter, which is decremented if there has not been an error - in a certain amount of time. - - This allows you to adjust the number of errors before the module is unloaded, - as well as the time since the last error for the counter to be decremented. - --]] - - -- The maximum number of errors before a module is unloaded. - -- Default value: 5 - MaxErrorCount = 5, - -- The time from the last error necessary for the error counter to be decremented. - -- Default value (in milliseconds): 500 - ErrorDecrementTime = 500 -} - ---[[ -WORLD OPTIONS - -Default settings for worlds. ---]] -World = -{ - -- The default time of day at world creation. - -- Default value (in hours): 0.0 - Time = 0.0, - - -- The increment added to the time of day each second. - -- Default value (in minutes): 1 - TimeStep = 1, - - -- The default weather severity at world creation. - -- Default value: 0 - WeatherSeverity = 0 diff --git a/JustCause2/jc2server b/JustCause2/jc2server deleted file mode 100644 index 1180bd6d4..000000000 --- a/JustCause2/jc2server +++ /dev/null @@ -1,125 +0,0 @@ -#!/bin/bash -# Just Cause 2 -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -updateonstart="off" - -fn_parms(){ -parms="" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="261140" - -# Server Details -servicename="jc2-server" -gamename="Just Cause 2" -engine="avalanche" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./Jcmp-Server" -servercfg="config.lua" -servercfgdir="${filesdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/default_config.lua" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -#gamelogdir="" # No server logs available -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/KillingFloor/kfserver b/KillingFloor/kfserver deleted file mode 100644 index 9c3842a06..000000000 --- a/KillingFloor/kfserver +++ /dev/null @@ -1,134 +0,0 @@ -#!/bin/bash -# Killing Floor -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="username" -steampass="password" - -# Start Variables -defaultmap="KF-BioticsLab.rom" -ip="0.0.0.0" -updateonstart="off" - -fn_parms(){ -parms="server ${defaultmap}?game=KFmod.KFGameType?VACSecured=true -nohomedir ini=${servercfg} log=${gamelog}" - -# Start Variables for Objective mode -#defaultmap="KFO-Steamland" -#parms="server ${defaultmap}?Game=KFStoryGame.KFStoryGame?VACSecured=true -nohomedir ini=${servercfg} log=${gamelog}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="215360" - -# Server Details -servicename="kf-server" -gamename="Killing Floor" -engine="unreal2" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/System" -executabledir="${systemdir}" -executable="./ucc-bin" -servercfg="${servicename}.ini" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/Default.ini" -compressedmapsdir="${rootdir}/Maps-Compressed" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${rootdir}/log/server" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -gamelog="${gamelogdir}/${servicename}-game.log" -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -gamelogdate="${gamelogdir}/${servicename}-game-$(date '+%d-%m-%Y-%H-%M-%S').log" -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/LICENSE b/LICENSE index 64aaf3c3f..6fa6c795f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ -The MIT License (MIT) +MIT License -Copyright (c) 2015 Daniel Gibbs +Copyright (c) 2012-2020 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 @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/Left4Dead/cfg/lgsm-default.cfg b/Left4Dead/cfg/lgsm-default.cfg deleted file mode 100644 index c2b66dcbc..000000000 --- a/Left4Dead/cfg/lgsm-default.cfg +++ /dev/null @@ -1,15 +0,0 @@ -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 \ No newline at end of file diff --git a/Left4Dead/l4dserver b/Left4Dead/l4dserver deleted file mode 100644 index 225b63b8c..000000000 --- a/Left4Dead/l4dserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Left 4 Dead -# Server Management Script -# Author: Daniel Gibbs -# Contributor: Summit Singh Thakur -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="l4d_hospital01_apartment" -maxplayers="8" -port="27015" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game left4dead -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} -tickrate ${tickrate} +map ${defaultmap} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="222840" - -# Server Details -servicename="l4d-server" -gamename="Left 4 Dead" -engine="source" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/left4dead" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/Left4Dead2/cfg/lgsm-default.cfg b/Left4Dead2/cfg/lgsm-default.cfg deleted file mode 100644 index c2b66dcbc..000000000 --- a/Left4Dead2/cfg/lgsm-default.cfg +++ /dev/null @@ -1,15 +0,0 @@ -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 \ No newline at end of file diff --git a/Left4Dead2/l4d2server b/Left4Dead2/l4d2server deleted file mode 100644 index f3bedff70..000000000 --- a/Left4Dead2/l4d2server +++ /dev/null @@ -1,131 +0,0 @@ -#!/bin/bash -# Left 4 Dead 2 -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="c5m1_waterfront" -maxplayers="8" -port="27015" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game left4dead2 -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="222860" - -# Server Details -servicename="l4d2-server" -gamename="Left 4 Dead 2" -engine="source" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/left4dead2" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/Mumble/mumbleserver b/Mumble/mumbleserver deleted file mode 100644 index 9c3510839..000000000 --- a/Mumble/mumbleserver +++ /dev/null @@ -1,112 +0,0 @@ -#!/bin/bash -# Mumble -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Server Details -gamename="Mumble" -servicename="mumble-server" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./murmur.x86" -servercfg="murmur.ini" -servercfgdir="${filesdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -logdir="${rootdir}/log" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -fn_parms(){ -parms="-fg -ini ${servercfgfullpath}" -} - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt - diff --git a/NS2Combat/dependencies/libc.so.6 b/NS2Combat/dependencies/libc.so.6 deleted file mode 100644 index ee77b1740..000000000 Binary files a/NS2Combat/dependencies/libc.so.6 and /dev/null differ diff --git a/NS2Combat/dependencies/libm.so.6 b/NS2Combat/dependencies/libm.so.6 deleted file mode 100644 index 39034023b..000000000 Binary files a/NS2Combat/dependencies/libm.so.6 and /dev/null differ diff --git a/NS2Combat/dependencies/libstdc++.so.6 b/NS2Combat/dependencies/libstdc++.so.6 deleted file mode 100644 index fa1204704..000000000 Binary files a/NS2Combat/dependencies/libstdc++.so.6 and /dev/null differ diff --git a/NS2Combat/ns2cserver b/NS2Combat/ns2cserver deleted file mode 100644 index 2d057a588..000000000 --- a/NS2Combat/ns2cserver +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/bash -# NS2: Combat -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="username" -steampass="password" - -# Start Variables -defaultmap="co_core" -port="27015" -maxplayers="24" -ip="0.0.0.0" -updateonstart="off" -servername="NS2C Server" -webadminuser="admin" -webadminpass="admin" -webadminport="8080" -configpath="server1" -modstorage="server1/Workshop" -mods="" -password="" -# Add the following line to the parms if you want a private server. Ensuring -# that the password variable above is not left empty. -# -password \"${password}\" - -# http://wiki.unknownworlds.com/ns2/Dedicated_Server -fn_parms(){ -parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${rootdir}/${configpath}\" -modstorage \"${rootdir}/${modstorage}\" -mods \"${mods}\"" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="313900" - -# Server Details -servicename="ns2c-server" -gamename="NS2: Combat" -engine="spark" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}" -executabledir="${filesdir}/ia32" -executable="./ns2combatserver_linux32" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/NaturalSelection2/dependencies/libc.so.6 b/NaturalSelection2/dependencies/libc.so.6 deleted file mode 100644 index ee77b1740..000000000 Binary files a/NaturalSelection2/dependencies/libc.so.6 and /dev/null differ diff --git a/NaturalSelection2/dependencies/libm.so.6 b/NaturalSelection2/dependencies/libm.so.6 deleted file mode 100644 index 39034023b..000000000 Binary files a/NaturalSelection2/dependencies/libm.so.6 and /dev/null differ diff --git a/NaturalSelection2/dependencies/libstdc++.so.6 b/NaturalSelection2/dependencies/libstdc++.so.6 deleted file mode 100644 index fa1204704..000000000 Binary files a/NaturalSelection2/dependencies/libstdc++.so.6 and /dev/null differ diff --git a/NaturalSelection2/ns2server b/NaturalSelection2/ns2server deleted file mode 100644 index 8de53b806..000000000 --- a/NaturalSelection2/ns2server +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/bash -# Natural Selection 2 -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="username" -steampass="password" - -# Start Variables -defaultmap="ns2_summit" -port="27015" -maxplayers="24" -ip="0.0.0.0" -updateonstart="off" -servername="NS2 Server" -webadminuser="admin" -webadminpass="admin" -webadminport="8080" -configpath="server1" -modstorage="server1/Workshop" -mods="" -password="" -# Add the following line to the parms if you want a private server. Ensuring -# that the password variable above is not left empty. -# -password \"${password}\" - -# http://wiki.unknownworlds.com/ns2/Dedicated_Server -fn_parms(){ -parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${rootdir}/${configpath}\" -modstorage \"${rootdir}/${modstorage}\" -mods \"${mods}\"" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="4940" - -# Server Details -servicename="ns2-server" -gamename="Natural Selection 2" -engine="spark" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./server_linux32" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/NoMoreRoomInHell/cfg/lgsm-default.cfg b/NoMoreRoomInHell/cfg/lgsm-default.cfg deleted file mode 100644 index 83645c78c..000000000 --- a/NoMoreRoomInHell/cfg/lgsm-default.cfg +++ /dev/null @@ -1,121 +0,0 @@ -// **************************************************************************** -// * -// No More Room in Hell - server.cfg * -// Version 150815 * -// * -// **************************************************************************** - -// ............................. Basic Settings ............................. // - -// Hostname for server. -hostname "" - -// RCON - remote console password. -rcon_password "" - -// Server password - for private servers. -sv_password "" - -// Contact email for server sysop. -sv_contact "email@example.com" - -// LAN Mode - If set the server will not show on the internet. -// Default: sv_lan 0 -sv_lan 0 - -// ............................... Map Cycles ............................... // -// info: There are several predefined mapcycles available that are listed below. -// You can also create your own custom mapcycle. - -// "mapcycle.txt" - all maps -// "mapcycle_objective.txt" - objective maps only -// "mapcycle_survival.txt" - survival maps only -// -mapcyclefile "mapcycle.txt" - -// ....................... Time Limits/Round Settings ....................... // - -// Time spend on a single map (in minutes) before switching to a new one automatically. -// Default: mp_timelimit 1 -mp_timelimit 45 - -// Maximum number of rounds to spend on a map before moving to the next one. -// Default: mp_maxrounds 2 -mp_maxrounds 2 - -// ........................ Server Specific Commands ........................ // -// info: any commands that only apply to this game. - -// Difficulty -// info: http://git.io/v35eI -// "casual" - casual difficulty. -// "classic" - classic difficulty. -sv_difficulty "classic" - -// Server tags - Tags show up on the in-game server browser. This helps -// users filter servers. -// vanilla - he server runs the default settings. -// custom - the server runs custom gameplay settings or mods. -// example: sv_tags "custom, fastdl" -sv_tags "" - -// Friendly fire - Allows team members to injure other members of their team. -// Default: mp_friendlyfire 0 -mp_friendlyfire 0 - -// ............................. Communication ............................. // - -// Enable communication over voice via microphone. -// Default: sv_voiceenable 1 -sv_voiceenable 1 - -// Players can hear all other players, no team restrictions. -// Default: sv_alltalk 0 -sv_alltalk 1 - -// ............................. Fast Download .............................. // -// info: Allows custom maps to be downloaded to the client. - -// Allows clients to download custom maps and textures etc. from the server at 20 kbps. -// Default: sv_allowdownload 1 -sv_allowdownload 1 - -// Allows clients to download custom maps, textures etc. from a web server with no transfer limit. -// Example: -// server location: maps/custommap.bsp -// web server location: http://example.com/custom/maps/custommap.bsp -// sv_downloadurl "http://example.com/custom" -// Default: sv_downloadurl "" -sv_downloadurl "" - -// ................................ Ban List ............................... // - -// personal banlist based on user IDs. -exec banned_user.cfg - -// personal banlist based on user IPs. -exec banned_ip.cfg - -writeid -writeip - -// ............................. Server Logging ............................. // - -//Enables logging to file, console, and udp < on | off >. -log on - -// Log server bans in the server logs. -// Default: sv_logbans 1 -sv_logbans 1 - -// Echo log information to the console. -// Default: sv_logecho 1 -sv_logecho 1 - -// Log server information in the log file. -// Default: sv_logfile 1 -sv_logfile 1 - -// Log server information to only one file. -// Default: sv_log_onefile 0 -sv_log_onefile 0 diff --git a/NoMoreRoomInHell/dependencies/libm.so.6 b/NoMoreRoomInHell/dependencies/libm.so.6 deleted file mode 100644 index 39034023b..000000000 Binary files a/NoMoreRoomInHell/dependencies/libm.so.6 and /dev/null differ diff --git a/NoMoreRoomInHell/nmrihserver b/NoMoreRoomInHell/nmrihserver deleted file mode 100644 index 4cb7a6b24..000000000 --- a/NoMoreRoomInHell/nmrihserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# No More Room in Hell -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="nmo_broadway" -maxplayers="8" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game nmrih -insecure -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="317670" - -# Server Details -servicename="nmrih-server" -gamename="No More Room in Hell" -engine="source" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/nmrih" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/OpposingForce/cfg/lgsm-default.cfg b/OpposingForce/cfg/lgsm-default.cfg deleted file mode 100644 index 585afb9e2..000000000 --- a/OpposingForce/cfg/lgsm-default.cfg +++ /dev/null @@ -1,35 +0,0 @@ -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 - -// disable autoaim -sv_aim 0 - -// disable clients' ability to pause the server -pausable 0 - -// maximum client movement speed -sv_maxspeed 320 - -// 20 minute timelimit -mp_timelimit 20 - -// cheats off -sv_cheats 0 - -// load ban files -exec listip.cfg -exec banned.cfg - diff --git a/OpposingForce/opforserver b/OpposingForce/opforserver deleted file mode 100644 index 04b0fdb94..000000000 --- a/OpposingForce/opforserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Half-Life: Opposing Force -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="op4_bootcamp" -maxplayers="16" -port="27015" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 -fn_parms(){ -parms="-game gearbox -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="90" -appidmod="gearbox" - -# Server Details -servicename="opfor-server" -gamename="Half-Life: Opposing Force" -engine="goldsource" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/gearbox" -executabledir="${filesdir}" -executable="./hlds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -defaultcfg="${servercfgdir}/server.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/PiratesVikingandKnightsII/cfg/lgsm-default.cfg b/PiratesVikingandKnightsII/cfg/lgsm-default.cfg deleted file mode 100644 index 8469f1014..000000000 --- a/PiratesVikingandKnightsII/cfg/lgsm-default.cfg +++ /dev/null @@ -1,119 +0,0 @@ -// **************************************************************************** -// * -// Pirates, Vikings, and Knights II * -// Version 150815 * -// * -// **************************************************************************** - -// ............................. Basic Settings ............................. // - -// Hostname for server. -hostname "" - -// RCON - remote console password. -rcon_password "" - -// Server password - for private servers. -sv_password "" - -// Contact email for server sysop. -sv_contact "email@example.com" - -// LAN Mode - If set the server will not show on the internet. -// Default: sv_lan 0 -sv_lan 0 - -// ............................... Map Cycles ............................... // -// You can create your own custom mapcycle. -mapcyclefile "mapcycle.txt" - -// ....................... Time Limits/Round Settings ....................... // - -// Time spend on a single map (in minutes) before switching to a new one automatically. -// Default: mp_timelimit 0 -mp_timelimit 20 - -// Wait for the end of round before changing map. -// Default: mp_timelimit_waitroundend 0 -mp_timelimit_waitroundend 1 - -// Round duration in minutes. -// Default: mp_roundtime 3 -mp_roundtime 3 - -// Round limit in number of rounds. -// Default: mp_roundlimit 0 - -// Win limit in number of rounds. -// Default: mp_winlimit 0 -mp_winlimit 0 - -// ........................ Server Specific Commands ........................ // - -// Server tags - Tags show up on the in-game server browser. This helps -// users filter servers. -// vanilla - he server runs the default settings. -// custom - the server runs custom gameplay settings or mods. -// example: sv_tags "custom, fastdl" -sv_tags "" - -// Friendly fire - Allows team members to injure other members of their team. -// Default: mp_friendlyfire 0 -mp_friendlyfire 0 - -// ............................. Communication ............................. // - -// Enable communication over voice via microphone. -// Default: sv_voiceenable 1 -sv_voiceenable 1 - -// Players can hear all other players, no team restrictions. -// Default: sv_alltalk 0 -sv_alltalk 0 - -// ............................. Fast Download .............................. // -// info: Allows custom maps to be downloaded to the client. - -// Allows clients to download custom maps and textures etc. from the server at 20 kbps. -// Default: sv_allowdownload 1 -sv_allowdownload 1 - -// Allows clients to download custom maps, textures etc. from a web server with no transfer limit. -// Example: -// server location: maps/custommap.bsp -// web server location: http://example.com/custom/maps/custommap.bsp -// sv_downloadurl "http://example.com/custom" -// Default: sv_downloadurl "" -sv_downloadurl "" - -// ................................ Ban List ............................... // - -// personal banlist based on user IDs. -exec banned_user.cfg - -// personal banlist based on user IPs. -exec banned_ip.cfg - -writeid -writeip - -// ............................. Server Logging ............................. // - -//Enables logging to file, console, and udp < on | off >. -log on - -// Log server bans in the server logs. -// Default: sv_logbans 1 -sv_logbans 1 - -// Echo log information to the console. -// Default: sv_logecho 1 -sv_logecho 1 - -// Log server information in the log file. -// Default: sv_logfile 1 -sv_logfile 1 - -// Log server information to only one file. -// Default: sv_log_onefile 0 -sv_log_onefile 0 diff --git a/PiratesVikingandKnightsII/pvkiiserver b/PiratesVikingandKnightsII/pvkiiserver deleted file mode 100644 index f105b3a57..000000000 --- a/PiratesVikingandKnightsII/pvkiiserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# No More Room in Hell -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="bt_island" -maxplayers="24" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game pvkii -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="17575" - -# Server Details -servicename="pvkii-server" -gamename="Pirates, Vikings, and Knights II" -engine="source" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/pvkii" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/ProjectZomboid/cfg/servertest.ini b/ProjectZomboid/cfg/servertest.ini deleted file mode 100644 index df25258ab..000000000 --- a/ProjectZomboid/cfg/servertest.ini +++ /dev/null @@ -1,46 +0,0 @@ -nightlengthmodifier=1.0 -PVP=true -PauseEmpty=false -GlobalChat=true -Open=true -ServerWelcomeMessage= Welcome to Project Zomboid MP ! to chat locally press "t", to global chat press "y" or add "/all" before chatting Press /help to have a list of server commands -LogLocalChat=false -AutoCreateUserInWhiteList=false -DisplayUserName=true -SpawnPoint=0,0,0 -SafetySystem=true -ShowSafety=true -SafetyToggleTimer=100 -SafetyCooldownTimer=120 -SpawnItems= -DefaultPort=16261 -ResetID=834499345 -Mods= -Map=Muldraugh, KY -SpawnRegions=servertest_spawnregions.lua -DoLuaChecksum=true -Public=false -PublicName=pzserver -PublicDescription= -MaxPlayers=64 -PingFrequency=10 -PingLimit=400 -HoursForLootRespawn=0 -MaxItemsForLootRespawn=4 -ConstructionPreventsLootRespawn=true -DropOffWhiteListAfterDeath=false -NoFireSpread=false -NoFire=false -AnnounceDeath=false -MinutesPerPage=1.0 -HoursForCorpseRemoval=0 -SaveWorldEveryMinutes=0 -PlayerSafehouse=false -AdminSafehouse=false -SafehouseAllowTrepass=true -SafehouseAllowFire=true -SafehouseAllowLoot=true -SafehouseAllowRespawn=false -SafehouseDaySurvivedToClaim=0 -SafeHouseRemovalTime=144 -AllowDestructionBySledgehammer=true diff --git a/ProjectZomboid/pzserver b/ProjectZomboid/pzserver deleted file mode 100644 index 0d87dd24c..000000000 --- a/ProjectZomboid/pzserver +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/bash -# Project Zomboid -# Server Management Script -# Author: Daniel Gibbs -# Contributions: Bryce Van Dyk (SingingTree) -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="password" - -# Start Variables -ip="0.0.0.0" -updateonstart="off" - -fn_parms(){ -parms="" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="380870" - -# Server Details -servicename="pz-server" -gamename="Project Zomboid" -engine="projectzomboid" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./start-server.sh" -servercfg="servertest.ini" -servercfgdir="${HOME}/Zomboid/Server" -servercfgfullpath="${servercfgdir}/${servercfg}" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${HOME}/Zomboid/Logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/README.md b/README.md index b69d5dc8a..6f6f41c6f 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,54 @@ -

Linux Game Server Managers_

-linux Game Server Managers - -[![Build Status](https://travis-ci.org/dgibbs64/linuxgsm.svg?branch=master)](https://travis-ci.org/dgibbs64/linuxgsm) - -The Linux Game Server Managers are command line tools for quick, simple deployment and management of various dedicated game servers and voice comms servers. - -

Hassle-Free Dedicated Servers

-Game servers traditionally are not easy to manage yourself. Admins often have to spend hours just messing around trying to get their server working. LGSM is designed to be a simple as possible allowing Admins to spend less time on management and more time on the fun stuff. - -

Main features

-
    -
  • Backup
  • -
  • Console
  • -
  • Details
  • -
  • Installer (SteamCMD)
  • -
  • Monitor (including email notification)
  • -
  • Update (SteamCMD)
  • -
  • Start/Stop/Restart server
  • -
-

Compatibility

-The Linux Game Server Managers are tested to work on the following Linux distros. -
    -
  • Debian based (Ubuntu, Mint etc.).
  • -
  • Redhat based (CentOS, Fedora etc.).
  • -
+

+
+ 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://linuxgsm.com) is the command-line tool for quick, simple deployment and management of Linux dedicated game servers. + +## Hassle-Free Dedicated Game Servers + +Traditionally game servers are not easy to manage yourself. Admins often have to spend hours messing around trying to get their server working. LinuxGSM is a command-line tool designed to be as simple as possible, allowing admins to spend less time on management and more time gaming. + +## Main features + +100+ game servers supported + +* :truck: Installer +* :mag: Monitor +* :phone: Alerts +* :cloud: Updater +* :blue_book: Server Details +* :floppy_disk: Backup +* :computer: Console + +## :penguin: Compatibility + +LinuxGSM will run on popular distros as long as the minimum requirements are met. + +* Ubuntu +* Debian +* CentOS + Other distros are likely to work but are not fully tested. -

Specific Requirements

- -

FAQ

-All FAQ can be found here. - -https://github.com/dgibbs64/linuxgsm/wiki/FAQ -

Donate

-If you want to donate to the project you can via PayPal, Flattr or Gratipay. I have had a may kind people show their support by sending me a donation. Any donations you send help cover my server costs and buy me a drink. Cheers! - -

Useful Links

- \ No newline at end of file + +## :wrench: Requirements + +Each game server has its own specific dependency requirements. Visit a specific game server installation page on the [LinuxGSM](https://linuxgsm.com) website to check dependency requirements for the game server you want to install. + +## :blue_book: Documentation + +Documentation is found at [linuxgsm.com](https://linuxgsm.com) and [docs.linuxgsm.com](https://docs.linuxgsm.com). + +## :question: Support + +There are a various ways to get support, check out the [support](https://linuxgsm.com/support/) page to the right support. + +## :heart: Donate + +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. + +## Contributors + +A big thank you goes to all the wonderful people who contribute ideas, code, docs and support to this project. diff --git a/RedOrchestra/roserver b/RedOrchestra/roserver deleted file mode 100644 index 57e42f9ac..000000000 --- a/RedOrchestra/roserver +++ /dev/null @@ -1,130 +0,0 @@ -#!/bin/bash -# Red Orchestra: Ostfront 41-45 -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="username" -steampass="password" - -# Start Variables -defaultmap="RO-Arad.rom" -ip="0.0.0.0" -updateonstart="off" - -fn_parms(){ -parms="server ${defaultmap}?game=ROGame.ROTeamGame?VACSecured=true -nohomedir ini=${servercfg} log=${gamelog}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Server Details -servicename="ro-server" -gamename="Red Orchestra: Ostfront 41-45" -engine="unreal2" - -# Steam -appid="223250" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/system" -executabledir="${systemdir}" -executable="./ucc-bin" -servercfg="${servicename}.ini" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/default.ini" -compressedmapsdir="${rootdir}/Maps-Compressed" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${rootdir}/log/server" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -gamelog="${gamelogdir}/${servicename}-game.log" -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -gamelogdate="${gamelogdir}/${servicename}-game-$(date '+%d-%m-%Y-%H-%M-%S').log" -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/Ricochet/cfg/lgsm-default.cfg b/Ricochet/cfg/lgsm-default.cfg deleted file mode 100644 index 585afb9e2..000000000 --- a/Ricochet/cfg/lgsm-default.cfg +++ /dev/null @@ -1,35 +0,0 @@ -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 - -// disable autoaim -sv_aim 0 - -// disable clients' ability to pause the server -pausable 0 - -// maximum client movement speed -sv_maxspeed 320 - -// 20 minute timelimit -mp_timelimit 20 - -// cheats off -sv_cheats 0 - -// load ban files -exec listip.cfg -exec banned.cfg - diff --git a/Ricochet/ricochetserver b/Ricochet/ricochetserver deleted file mode 100644 index 803fe095e..000000000 --- a/Ricochet/ricochetserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Ricochet -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="rc_arena" -maxplayers="16" -port="27015" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 -fn_parms(){ -parms="-game ricochet -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="90" -appidmod="ricochet" - -# Server Details -servicename="ricochet-server" -gamename="Ricochet" -engine="goldsource" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/ricochet" -executabledir="${filesdir}" -executable="./hlds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/SeriousSam3BFE/cfg/lgsm-default.ini b/SeriousSam3BFE/cfg/lgsm-default.ini deleted file mode 100644 index 1bf1a3c90..000000000 --- a/SeriousSam3BFE/cfg/lgsm-default.ini +++ /dev/null @@ -1,49 +0,0 @@ --- Generated with Server GUI 3 --- http://mrag.nl/sgui3/ - --- General -rcts_strWelcomeNote = "Server RCON MOTD"; -rcts_strAdminPassword = "rconpassword"; -prj_strLogFile = ""; -net_strLocalHost = ""; -gam_idGameMode = "Cooperative"; -ser_iMaxClientBPS = 11000; -prj_iDedicatedFPS = 100; -gam_ctMaxPlayers = 12; -prj_uwPort = 27015; -prj_strMultiplayerSessionName = "Serious Sam 3 Server"; - --- Options -gam_bAllowJoinInProgress = 1; -gam_bAllowPowerupItems = 1; -gam_bAllowArmorItems = 1; -gam_bWeaponsStay = 1; -gam_bAmmoStays = 1; -gam_bArmorStays = 1; -gam_bHealthStays = 1; -gam_bAllowHealthItems = 1; -gam_bInfiniteAmmo = 0; - --- Levels -local mapList = ""; -mapList = mapList .. "Content\SeriousSam3\Levels\01_BFE\01_CairoSquare\01_CairoSquare.wld;"; -mapList = mapList .. "Content\SeriousSam3\Levels\01_BFE\02_CairoMuseum\02_CairoMuseum.wld;"; -mapList = mapList .. "Content\SeriousSam3\Levels\01_BFE\03_IbnTulun\03_IbnTulun.wld;"; -mapList = mapList .. "Content\SeriousSam3\Levels\01_BFE\04_IbnTulun\04_Medina.wld;"; -mapList = mapList .. "Content\SeriousSam3\Levels\01_BFE\05_CairoTown\05_CairoTown.wld;"; -mapList = mapList .. "Content\SeriousSam3\Levels\01_BFE\06_Pyramids\06_Pyramids.wld;"; -mapList = mapList .. "Content\SeriousSam3\Levels\01_BFE\07_Karnak1\07_Karnak1.wld;"; -mapList = mapList .. "Content\SeriousSam3\Levels\01_BFE\08_Karnak2\08_Karnak2.wld;"; -mapList = mapList .. "Content\SeriousSam3\Levels\01_BFE\09_Luxor\09_Luxor.wld;"; -mapList = mapList .. "Content\SeriousSam3\Levels\01_BFE\10_LostNubianTemples\10_LostNubianTemples.wld;"; -mapList = mapList .. "Content\SeriousSam3\Levels\01_BFE\11_Ramesseum\11_Ramesseum.wld;"; -mapList = mapList .. "Content\SeriousSam3\Levels\01_BFE\12_HatshepsutTemple\12_HatshepsutTemple.wld;"; -mapList = mapList .. "Content\SeriousSam3\Levels\02_DLC\01_Philae\01_Philae.wld;"; -mapList = mapList .. "Content\SeriousSam3\Levels\02_DLC\02_AbuSimbel\02_AbuSimbel.wld;"; -mapList = mapList .. "Content\SeriousSam3\Levels\02_DLC\03_TempleOfSethirkopshef\03_TempleOfSethirkopshef.wld;"; -prj_StrMapList = mapList; - --- Scripts - --- Custom - diff --git a/SeriousSam3BFE/help/DedicatedServer_Readme.txt b/SeriousSam3BFE/help/DedicatedServer_Readme.txt deleted file mode 100644 index cf5aa8094..000000000 --- a/SeriousSam3BFE/help/DedicatedServer_Readme.txt +++ /dev/null @@ -1,139 +0,0 @@ -Serious Engine Dedicated Server -=============================== - -1. Starting and stopping the dedicated server ---------------------------------------------- - -You can launch the dedicated server either from the Steam client's Tools tab, or by directly starting its executable file. In either case, a Steam client needs to be running on that machine, though the user logged in doesn't have to actually own the game. - -In absence of any further configuration, the server will start the first level of the Coop campaign, with all default settings, on the default port. - -The server will pause immediately after the first level is loaded, and wait for players to join, to conserve the game state. When the first player joins, the game will unpause. - -When all players disconnect, the server will restart its session from the first level again. - -To stop the server, press Ctrl+C in its console window and wait until it shuts down. - -2. Server ports ---------------- - -The server will be immediately visible on your LAN, but to make sure it is also visible on the internet, you need to open the port 27016. Note that this is only game enumeration port, as the game traffic port cannot be specified at the moment, thus this will not alleviate the need for NAT punching. I.e. it is not recommended to run a dedicated server behind a NAT/router that doesn't properly support NAT punching, or otherwise all connections to it will have very high pings. We expect the game traffic port to be specifiable in one of the future updates, but it is not currently possible. - -If you want to allow remote administration (see the section about remote administration below), you need to also forward port 27015 (TCP-only). - -You can change the port that the server is running on using the command-line option "+port". The server will use the given port for Rcon administration and the given port +1 for game enumeration (see above). So, e.g. if you use "+port 25600", game enumeration will work on port 25601 and rcon on port 25600. When game traffic specification becomes possible, it will be on port 25600 in the example, but this is currently not supported. - -You can change the network interface that the server will bind to using the command-line option "+ip". This is used both fr Rcon administration and for game enumeration. When game traffic specification becomes possible, it will also use this, but this is currently not supported (game traffic chooses an interface automatically). - -3. Command line ---------------- - -Command line options can be used to modify any cvar using this format: - -SamHD_DedicatedServer.exe +cvarname1 cvarvalue1 +cvarname2 cvarvalue2 ... +cvarnameN cvarvalueN - -Quotes are needed around values that contain spaces. Cvar names in the command line can be either short names (e.g. +level "Path/Level") where available, or long names (+gam_strLevel "Path/Level"). - -4. Configuration scripts ------------------------- - -When starting, in addition to the command line option, the server will read configuration parameters from the following sources (in this order): - * Content/SeriousSamHD/Config/dedicatedserver.cfg, - * eventual custom script specified via the +exec command line option, - * eventual per-session script specified via the +gameoptions command line option. -The first two are read once on boot, the last one is read on each session start and restart. (When all player's disconnect, the server will load this again before starting the first level.) - -All of those scripts are fully-featured console scripts, i.e. they use the Lua programming language, so you can put ifs, functions and other programming constructs in them. For a full syntax description and other documentation regarding the Lua programming language, please visit: http://www.lua.org . - -Dedicated server does not load or save any .ini files. - -5. Most relevant command line options and cvars ------------------------------------------------ -(long name shown in parentheses) - * +gamemode (gam_idGameMode) - Valid values are: - (cooperative group) - Cooperative (this is the default) - CooperativeCoinOp - TeamSurvival - (versus group) - BeastHunt - CaptureTheFlag - Deathmatch - InstantKill - LastManStanding - LastTeamStanding - MyBurden - TeamBeastHunt - TeamDeathmatch - Note that players can vote to change the game mode, but they cannot switch a server from Cooperative modes to Versus modes or vice versa. - IMPORTANT: Changing this option resets all other gam_ options to defaults for that game mode. If you are also customizing other gam_ options from a script or via Rcon, make sure you change gam_idGameMode first, and then change all others! - * +level (gam_strLevel) - Specifies which level to start. Path is relative to the folder the game was installed in. If not specified, the server will start the default first level. - * +maxplayers (gam_ctMaxPlayers) - Max number of players in the session. Cannot be higher than 16. - * +port (prj_uwPort) - Specifies the port number to start the server on. Default is 27015. - * +ip (net_strLocalHost) - Specifies the network interface to start the server on. Default is empty, meaning automatic. - * +fps (prj_iDedicatedFPS) - Specifies the framerate the dedicated server will run in (min 10). - * +exec (prj_strExecCfg) - Specifies the configuration file to execute when the server first starts. - * +gameoptions (prj_strOptionsScript) - Specifies the game options script to execute. It is executed whenever the server (re)starts the first level. - * +sessionname (prj_strMultiplayerSessionName) - Session name that will be displayed in the server browser. If you don't set this, current username from Windows will be shown. - * +rconpass (rcts_strAdminPassword) - Password used to connect to the server via Rcon (see "Remote administration" above). - * +logfile (prj_strLogFile) - Save the DedicatedServer.log into a different file. Useful if you want to run multiple servers from the same installation. - -NOTE: You can use any of the standard game options like gam_bInifiniteAmmo that customize the gameplay, but note that gam_bCustomizeDifficulty is required for them to take effect! - -6. Some other useful console variables and functions ----------------------------------------------------- - - * gamListPlayers() - print the list of all players to the console in format: 'playerindex: playername' - * gamKickByName() - kick the client with the given player name out of the game - * gamKickByIndex() - kick the client with the given index out of the game - * gamBanByName() - ban the client with the given player name out of the game - * gamBanByIndex() - ban the client with the given index out of the game - - * gamRestartServer() - restarts the dedicated server (disconnects all players) so any changes to game settings or other server options can take effect - * gamRestartGame() - restart game with new session params without disconnecting players - * samRestartMap() - restart the current map (without disconnecting all players) so any changes to game difficulty and similar options can take effect - * gamStop() - stops the current game - * gamStart() - start game with new session params without disconnecting players - * samVotePass() - force the current vote to pass - * samVoteFail() - force the current vote to fail - - * ser_iMaxClientBPS - limit the bandwidth used by each individual client on the server. This caps the cli_iMaxBPS on the server side. - * prj_strMapList - Semicolon separated list of maps used for multiplayer map rotation. - * prj_strMapListFile - Path to the file containing a list of maps used for multiplayer map rotation. - * prj_strDefaultMapDir - Default map folder to use for the map list (specified either by prj_strMapList or prj_strMapListFile). To make it posible to specify map names in a short form, if a '#' prefix is used in a map path, the '#' char will be replaced by the value of this cvar. - -All other cvars and cfuncs can be used, most notable are cvars with "gam_" prefix which can be used to setup difficulty options and similar. To get the list of those or more details about them, use the game client's console with its autocompletion and help. - -7. Remote administration (RCon) -------------------------------- - -Remote administration of Serious Sam HD dedicated servers is implemented via the Telnet protocol. Use any telnet client (e.g. telnet.exe) to connect to the IP and port the server is running on (default is 27015). - -Example: -C:\> telnet my.server.ip 27015 - -(*) NOTE: On Vista and Win7, the telnet command is not installed by default. You need to enable it using the "Turn Windows features on or off" section of the Control Panel. - -You need to specify the rcon password (using the +rconpass "password" command-line option) when starting the server, otherwise it won't allow you to connect to it via Rcon. Also make sure the appropriate port is open, as explained above. - -After entering the correct rcon password, the telnet client will behave similarly to the in-game console (except that SHIFT+TAB combo doesn't work). Additionally you can type a question mark ("?"), followed by a cvar or cfunc to get the help about it. - -8. Example configuration script -------------------------------- - -Here's an example config script. Put that in a text file named "server.cfg" in the root of the game installation (parent of Bin/), and specify "+exec server.cfg" in the command line (without quotes). - ---------8<----- cut here ----------- - -rconpass = "SuperSecretPassword"; -- MAKE SURE YOU CHANGE THIS!!!! -sessionname = "My Server Name" -- set this to the name of your server - -gam_ctMaxPlayers = 8 -gamemode="Deathmatch" -gam_bAutoCycleMaps = 1 - -local prj_strMapList = { - "#SunPalace.wld", -- put a list of map file names for rotation here -} - ---------8<------cut here ---------- \ No newline at end of file diff --git a/SeriousSam3BFE/ss3sserver b/SeriousSam3BFE/ss3sserver deleted file mode 100644 index 3e0d707e4..000000000 --- a/SeriousSam3BFE/ss3sserver +++ /dev/null @@ -1,129 +0,0 @@ -#!/bin/bash -# Serious Sam 3: BFE -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -ip="0.0.0.0" -updateonstart="off" - -# https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/SeriousSam3BFE/help/DedicatedServer_Readme.txt -fn_parms(){ -parms="+ip ${ip} +logfile ${gamelog} +exec ${servercfgfullpath}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="41080" - -# Server Details -servicename="ss3-server" -gamename="Serious Sam 3: BFE" -engine="seriousengine35" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/Bin" -executable="./runSam3_DedicatedServer.sh" -executabledir="${systemdir}" -servercfg="${servicename}.ini" -servercfgdir="${filesdir}/Content/SeriousSam3/Config" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.ini" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${rootdir}/log/server" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -gamelog="${gamelogdir}/${servicename}-game.log" -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -gamelogdate="${gamelogdir}/${servicename}-game-$(date '+%d-%m-%Y-%H-%M-%S').log" -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/StarBound/cfg/sbboot.config b/StarBound/cfg/sbboot.config deleted file mode 100644 index 62f133536..000000000 --- a/StarBound/cfg/sbboot.config +++ /dev/null @@ -1,141 +0,0 @@ -{ - "handleFatalSignals" : true, - "handleInterruptSignal" : true, - "rootMaintenanceSleep" : 5000, - "logFileBackups" : 5, - "assetSources" : [ - "../assets/packed.pak", - "../assets/user" - ], - "modSource" : "../giraffe_storage/mods/", - "storageDirectory" : "../giraffe_storage/", - "defaultConfiguration" : { - "gameServerPort" : 21025, - "gameServerBind" : "*", - - "serverUsers" : {}, - "allowAnonymousConnections" : true, - - "bannedUuids" : [], - "bannedIPs" : [], - - "serverName" : "A Starbound Server", - "maxPlayers" : 8, - "upnpPortForwarding" : true, - - "checkAssetsDigest" : false, - - "allowAdminCommands" : true, - "allowAdminCommandsFromAnyone" : false, - "anonymousConnectionsAreAdmin" : false, - - "runQueryServer" : false, - "queryServerPort" : 21025, - "queryServerBind" : "*", - - "runRconServer" : false, - "rconServerPort" : 21026, - "rconServerBind" : "*", - "rconServerPassword" : "", - "rconServerTimeout" : 1000, - - "windowTitle" : "Starbound - Beta", - "vsync" : true, - "renderSleep" : true, - "maxFrameSkip" : 10, - "sampleRate" : 44100, - "audioChannels" : 2, - "audioChannelSeparation" : [-25, 25], - - "clearUniverseFiles" : false, - "clearPlayerFiles" : false, - "playerBackupFileCount" : 3, - - "sfxVol" : 100, - "musicVol" : 100, - "windowedResolution" : [1000, 600], - "maximizedResolution" : [1000, 600], - "fullscreenResolution" : [1920, 1080], - "fullscreen" : false, - "maximized" : true, - "zoomLevel" : 3.0, - "speechBubbles" : true, - - "crafting.filterHaveMaterials" : false, - "title.connectionString" : "", - - "bindings" : { - "PlayerUp" : [ { "type" : "key", "value" : "W", "mods" : [] } ], - "PlayerDown" : [ { "type" : "key", "value" : "S", "mods" : [] } ], - "PlayerLeft" : [ { "type" : "key", "value" : "A", "mods" : [] } ], - "PlayerRight" : [ { "type" : "key", "value" : "D", "mods" : [] } ], - "PlayerJump" : [ { "type" : "key", "value" : "Space", "mods" : [] } ], - "PlayerDropItem" : [ { "type" : "key", "value" : "Q", "mods" : [] } ], - "PlayerInteract" : [ { "type" : "key", "value" : "E", "mods" : [] } ], - "PlayerShifting" : [ { "type" : "key", "value" : "RShift", "mods" : [] }, { "type" : "key", "value" : "LShift", "mods" : [] } ], - "PlayerTechAction1" : [ { "type" : "key", "value" : "F", "mods" : [] } ], - "PlayerTechAction2" : [ { "type" : "key", "value" : "G", "mods" : [] } ], - "PlayerTechAction3" : [ { "type" : "key", "value" : "H", "mods" : [] } ], - "EmoteBlabbering" : [ { "type" : "key", "value" : "Right", "mods" : ["LCt rl", "LShift"] } ], - "EmoteShouting" : [ { "type" : "key", "value" : "Up", "mods" : ["LCtrl", "LAlt"] } ], - "EmoteHappy" : [ { "type" : "key", "value" : "Up", "mods" : [] } ], - "EmoteSad" : [ { "type" : "key", "value" : "Down", "mods" : [] } ], - "EmoteNeutral" : [ { "type" : "key", "value" : "Left", "mods" : [] } ], - "EmoteLaugh" : [ { "type" : "key", "value" : "Left", "mods" : [ "LCtrl" ] } ], - "EmoteAnnoyed" : [ { "type" : "key", "value" : "Right", "mods" : [] } ], - "EmoteOh" : [ { "type" : "key", "value" : "Right", "mods" : [ "LCtrl" ] } ], - "EmoteOooh" : [ { "type" : "key", "value" : "Down", "mods" : [ "LCtrl" ] } ], - "EmoteBlink" : [ { "type" : "key", "value" : "Up", "mods" : [ "LCtrl" ] } ], - "EmoteWink" : [ { "type" : "key", "value" : "Up", "mods" : ["LCtrl", "LSh ift"] } ], - "EmoteEat" : [ { "type" : "key", "value" : "Down", "mods" : ["LCtrl", "LS hift"] } ], - "EmoteSleep" : [ { "type" : "key", "value" : "Left", "mods" : ["LCtrl", " LShift"] } ], - "ShowLabels" : [ { "type" : "key", "value" : "RAlt", "mods" : [] }, { "ty pe" : "key", "value" : "LAlt", "mods" : [] } ], - "CameraShift" : [ { "type" : "key", "value" : "RCtrl", "mods" : [] }, { " type" : "key", "value" : "LCtrl", "mods" : [] } ], - "CockpitUp" : [ { "type" : "key", "value" : "W", "mods" : [] }, { "type" : "key", "value" : "Up", "mods" : [] } ], - "CockpitDown" : [ { "type" : "key", "value" : "S", "mods" : [] }, { "type " : "key", "value" : "Down", "mods" : [] } ], - "CockpitLeft" : [ { "type" : "key", "value" : "Left", "mods" : [] }, { "t ype" : "key", "value" : "A", "mods" : [] } ], - "CockpitRight" : [ { "type" : "key", "value" : "Right", "mods" : [] }, { "type" : "key", "value" : "D", "mods" : [] } ], - "TitleBack" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ], - "CinematicSkip" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ], - "CinematicNext" : [ { "type" : "key", "value" : "Right", "mods" : [] }, { "type" : "key", "value" : "Return", "mods" : [] } ], - "GuiClose" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ], - "GuiShifting" : [ { "type" : "key", "value" : "RShift", "mods" : [] }, { "type" : "key", "value" : "LShift", "mods" : [] } ], - "KeybindingCancel" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ] , - "KeybindingClear" : [ { "type" : "key", "value" : "Del", "mods" : [] }, { "type" : "key", "value" : "Backspace", "mods" : [] } ], - "ChatPageUp" : [ { "type" : "key", "value" : "PageUp", "mods" : [] } ], - "ChatPageDown" : [ { "type" : "key", "value" : "PageDown", "mods" : [] } ], - "ChatPreviousLine" : [ { "type" : "key", "value" : "Up", "mods" : [] } ], - "ChatNextLine" : [ { "type" : "key", "value" : "Down", "mods" : [] } ], - "ChatSendLine" : [ { "type" : "key", "value" : "Return", "mods" : [] } ], - "ChatBegin" : [ { "type" : "key", "value" : "Return", "mods" : [] } ], - "ChatBeginCommand" : [ { "type" : "key", "value" : "/", "mods" : [] } ], - "ChatStop" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ], - "InterfaceShowHelp" : [ { "type" : "key", "value" : "F1", "mods" : [] } ] , - "InterfaceHideHud" : [ { "type" : "key", "value" : "Z", "mods" : [ "LAlt" ] } ], - "InterfaceSwapHands" : [ { "type" : "key", "value" : "Z", "mods" : [] } ] , - "InterfaceDeselectHands" : [ { "type" : "key", "value" : "X", "mods" : [] } ], - "InterfaceBar1" : [ { "type" : "key", "value" : "1", "mods" : [] } ], - "InterfaceBar2" : [ { "type" : "key", "value" : "2", "mods" : [] } ], - "InterfaceBar3" : [ { "type" : "key", "value" : "3", "mods" : [] } ], - "InterfaceBar4" : [ { "type" : "key", "value" : "4", "mods" : [] } ], - "InterfaceBar5" : [ { "type" : "key", "value" : "5", "mods" : [] } ], - "InterfaceBar6" : [ { "type" : "key", "value" : "6", "mods" : [] } ], - "InterfaceBar7" : [ { "type" : "key", "value" : "7", "mods" : [] } ], - "InterfaceBar8" : [ { "type" : "key", "value" : "8", "mods" : [] } ], - "InterfaceBar9" : [ { "type" : "key", "value" : "9", "mods" : [] } ], - "InterfaceBar10" : [ { "type" : "key", "value" : "0", "mods" : [] } ], - "EssentialBar1" : [ { "type" : "key", "value" : "R", "mods" : [] } ], - "EssentialBar2" : [ { "type" : "key", "value" : "T", "mods" : [] } ], - "EssentialBar3" : [ { "type" : "key", "value" : "Y", "mods" : [] } ], - "InterfaceBarNPos" : [ { "type" : "key", "value" : "-", "mods" : [] }, { "type" : "key", "value" : "`", "mods" : [] } ], - "InterfaceRepeatCommand" : [ { "type" : "key", "value" : "P", "mods" : [] } ], - "InterfaceToggleFullscreen" : [ { "type" : "key", "value" : "F11", "mods" : [] } ], - "InterfaceEscapeMenu" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ], - "InterfaceInventory" : [ { "type" : "key", "value" : "I", "mods" : [] } ] , - "InterfaceCodex" : [ { "type" : "key", "value" : "L", "mods" : [] } ], - "InterfaceQuest" : [ { "type" : "key", "value" : "J", "mods" : [] } ], - "InterfaceCrafting" : [ { "type" : "key", "value" : "C", "mods" : [] } ], - "InterfaceInspectCursor" : [ { "type" : "key", "value" : "N", "mods" : [] } ] - } - } -} diff --git a/StarBound/sbserver b/StarBound/sbserver deleted file mode 100644 index 9c3263a76..000000000 --- a/StarBound/sbserver +++ /dev/null @@ -1,125 +0,0 @@ -#!/bin/bash -# Starbound -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="username" -steampass="password" - -# Start Variables -ip="0.0.0.0" -updateonstart="off" - -fn_parms(){ -parms="" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="211820" - -# Server Details -servicename="sb-server" -gamename="Starbound" -engine="starbound" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}" -executabledir="${filesdir}/linux64" -executable="./starbound_server" -servercfg="sbboot.config" -servercfgdir="${executabledir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${filesdir}/giraffe_storage" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/TeamFortress2/cfg/lgsm-default.cfg b/TeamFortress2/cfg/lgsm-default.cfg deleted file mode 100644 index c2b66dcbc..000000000 --- a/TeamFortress2/cfg/lgsm-default.cfg +++ /dev/null @@ -1,15 +0,0 @@ -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 \ No newline at end of file diff --git a/TeamFortress2/tf2server b/TeamFortress2/tf2server deleted file mode 100644 index bc7f9b985..000000000 --- a/TeamFortress2/tf2server +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/bash -# Team Fortress 2 -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="cp_badlands" -maxplayers="16" -port="27015" -sourcetvport="27020" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# Optional: Game Server Login Token -# GSLT can be used for running a public server. -# More info: http://gameservermanagers.com/gslt -gslt="" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server -fn_parms(){ -parms="-game tf -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="232250" - -# Server Details -servicename="tf2-server" -gamename="Team Fortress 2" -engine="source" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/tf" -executabledir="${filesdir}" -executable="./srcds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}/cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/TeamFortressClassic/cfg/lgsm-default.cfg b/TeamFortressClassic/cfg/lgsm-default.cfg deleted file mode 100644 index ceb8f9374..000000000 --- a/TeamFortressClassic/cfg/lgsm-default.cfg +++ /dev/null @@ -1,38 +0,0 @@ -// Server Name -hostname "" - -// RCON Password -rcon_password "" - -// Server Password -sv_password "" - -// Server Logging -log on -sv_logbans 1 -sv_logecho 1 -sv_logfile 1 -sv_log_onefile 0 - -// disable autoaim -sv_aim 0 - -// disable clients' ability to pause the server -pausable 0 - -// maximum client movement speed -sv_maxspeed 320 - -// 20 minute timelimit -mp_timelimit 20 - -// cheats off -sv_cheats 0 - -// load ban files -exec listip.cfg -exec banned.cfg - - - - diff --git a/TeamFortressClassic/tfcserver b/TeamFortressClassic/tfcserver deleted file mode 100644 index 135e528a9..000000000 --- a/TeamFortressClassic/tfcserver +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -# Team Fortress Classic -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="anonymous" -steampass="" - -# Start Variables -defaultmap="dustbowl" -maxplayers="16" -port="27015" -clientport="27005" -ip="0.0.0.0" -updateonstart="off" - -# https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 -fn_parms(){ -parms="-game tfc -strictportbind _ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="90" -appidmos="tfc" - -# Server Details -servicename="tfc-server" -gamename="Team Fortress Classic" -engine="goldsource" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/tfc" -executabledir="${filesdir}" -executable="./hlds_run" -servercfg="${servicename}.cfg" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${systemdir}/logs" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/TeamSpeak3/ts3server b/TeamSpeak3/ts3server deleted file mode 100644 index 2af8ede5b..000000000 --- a/TeamSpeak3/ts3server +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/bash -# Teamspeak 3 -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Start Variables -updateonstart="off" - -# Server Details -gamename="Teamspeak 3" -servername="Teamspeak 3 Server" -servicename="ts3-server" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./ts3server_startscript.sh" -servercfg="${servicename}.ini" -servercfgdir="${filesdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${filesdir}/logs" -scriptlogdir="${rootdir}/log/script" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/Teeworlds/cfg/ctf.cfg b/Teeworlds/cfg/ctf.cfg deleted file mode 100644 index a92b1a494..000000000 --- a/Teeworlds/cfg/ctf.cfg +++ /dev/null @@ -1,7 +0,0 @@ -sv_gametype ctf -sv_powerups 1 -sv_scorelimit 500 -sv_spectator_slots 0 -sv_timelimit 0 -sv_tournament_mode 0 -sv_map_reload 1 \ No newline at end of file diff --git a/Teeworlds/cfg/dm.cfg b/Teeworlds/cfg/dm.cfg deleted file mode 100644 index 426386d1d..000000000 --- a/Teeworlds/cfg/dm.cfg +++ /dev/null @@ -1,7 +0,0 @@ -sv_gametype dm -sv_powerups 1 -sv_scorelimit 20 -sv_spectator_slots 0 -sv_timelimit 0 -sv_tournament_mode 0 -sv_map_reload 1 \ No newline at end of file diff --git a/Teeworlds/cfg/duel.cfg b/Teeworlds/cfg/duel.cfg deleted file mode 100644 index b70e632a2..000000000 --- a/Teeworlds/cfg/duel.cfg +++ /dev/null @@ -1,7 +0,0 @@ -sv_gametype tdm -sv_powerups 0 -sv_scorelimit 10 -sv_spectator_slots 10 -sv_timelimit 5 -sv_tournament_mode 1 -sv_map_reload 1 \ No newline at end of file diff --git a/Teeworlds/cfg/lgsm-default.cfg b/Teeworlds/cfg/lgsm-default.cfg deleted file mode 100644 index efefdf149..000000000 --- a/Teeworlds/cfg/lgsm-default.cfg +++ /dev/null @@ -1,26 +0,0 @@ -sv_name "" -sv_rcon_password "" -password "" -sv_max_clients 12 -sv_port 8303 -sv_register 1 -sv_spamprotection 0 -sv_vote_map 1 -sv_warmup 10 -logfile "" -addvote restart 10 -addvote exec dm.cfg -addvote exec ctf.cfg -addvote exec duel.cfg -addvote exec tdm.cfg -addvote "change_map ctf1" -addvote "change_map ctf2" -addvote "change_map ctf3" -addvote "change_map ctf4" -addvote "change_map ctf5" -addvote "change_map dm1" -addvote "change_map dm2" -addvote "change_map dm6" -addvote "change_map dm7" -addvote "change_map dm8" -addvote "change_map dm9" \ No newline at end of file diff --git a/Teeworlds/cfg/tdm.cfg b/Teeworlds/cfg/tdm.cfg deleted file mode 100644 index c2ab04326..000000000 --- a/Teeworlds/cfg/tdm.cfg +++ /dev/null @@ -1,14 +0,0 @@ -// **************************************************************************** -// * -// TeeWorlds - tdm.cfg * -// Version 281015 * -// * -// **************************************************************************** - -sv_gametype tdm -sv_powerups 1 -sv_scorelimit 50 -sv_spectator_slots 0 -sv_timelimit 0 -sv_tournament_mode 0 -sv_map_reload 1 \ No newline at end of file diff --git a/Teeworlds/twserver b/Teeworlds/twserver deleted file mode 100644 index 5cfc0ad4a..000000000 --- a/Teeworlds/twserver +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/bash -# Teeworlds -# Server Management Script -# Author: Daniel Gibbs -# Contributor: Bryce Van Dyk (SingingTree) -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="username" -steampass="password" - -# Start Variables -ip="0.0.0.0" -updateonstart="off" - -fn_parms(){ -parms="-f ${servercfgfullpath}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="380840" - -# Server Details -servicename="tw-server" -gamename="Teeworlds" -engine="teeworlds" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./teeworlds_srv" -servercfg="${servicename}.cfg" # Teeworlds can also auto load any config if an autoexec.cfg file is present in the server dir -servercfgdir="${filesdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${rootdir}/log/server" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -gamelog="${gamelogdir}/${servicename}-game.log" -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/Terraria/cfg/lgsm-default.txt b/Terraria/cfg/lgsm-default.txt deleted file mode 100644 index d6258d4cf..000000000 --- a/Terraria/cfg/lgsm-default.txt +++ /dev/null @@ -1,68 +0,0 @@ -#this is an example config file for TerrariaServer.exe -#use the command 'TerrariaServer.exe -config serverconfig.txt' to use this configuration or run start-server.bat -#please report crashes by emailing crashlog.txt to support@terraria.org - -#the following is a list of available command line parameters: - -#-config Specifies the configuration file to use. -#-port Specifies the port to listen on. -#-players / -maxplayers Sets the max number of players -#-pass / -password Sets the server password -#-world Load a world and automatically start the server. -#-autocreate <#> Creates a world if none is found in the path specified by -world. World size is specified by: 1(small), 2(medium), and 3(large). -#-banlist Specifies the location of the banlist. Defaults to "banlist.txt" in the working directory. -#-worldname Sets the name of the world when using -autocreate. -#-secure Adds addition cheat protection to the server. -#-noupnp Disables automatic port forwarding -#-steam Enables Steam Support -#-lobby or Allows friends to join the server or sets it to private if Steam is enabled -#-ip Sets the IP address for the server to listen on -#-forcepriority Sets the process priority for this task. If this is used the "priority" setting below will be ignored. - -#remove the # in front of commands to enable them. - -#Load a world and automatically start the server. -#world=C:\Users\YOUR_USERNAME_HERE\My Documents\My Games\Terraria\Worlds\world1.wld - -#Creates a new world if none is found. World size is specified by: 1(small), 2(medium), and 3(large). -#autocreate=1 - -#Sets the name of the world when using autocreate -#worldname=Terraria - -#Sets the difficulty of the world when using autocreate 0(normal), 1(expert) -#difficulty=1 - -#Sets the max number of players allowed on a server. Value must be between 1 and 255 -#maxplayers=8 - -#Set the port number -#port=7777 - -#Set the server password -#password=p@55w0rd - -#Set the message of the day -#motd=Please dont cut the purple trees! - -#Sets the folder where world files will be stored -#worldpath=C:\Users\Defaults\My Documents\My Games\Terraria\Worlds\ - -#The location of the banlist. Defaults to "banlist.txt" in the working directory. -#banlist=banlist.txt - -#Adds addition cheat protection. -#secure=1 - -#Sets the server language 1:English, 2:German, 3:Italian, 4:French, 5:Spanish -#lang=1 - -#Automatically forward ports with uPNP -#upnp=1 - -#Reduces enemy skipping but increases bandwidth usage. The lower the number the less skipping will happen, but more data is sent. 0 is off. -#npcstream=60 - -#Default system priority 0:Realtime, 1:High, 2:AboveNormal, 3:Normal, 4:BelowNormal, 5:Idle -#priority=1 - diff --git a/Terraria/terrariaserver b/Terraria/terrariaserver deleted file mode 100644 index 78e7c5bde..000000000 --- a/Terraria/terrariaserver +++ /dev/null @@ -1,127 +0,0 @@ -#!/bin/bash -# Terraria -# Server Management Script -# Author: Daniel Gibbs -# Contributor: Bryce Van Dyk (SingingTree) -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Steam login -steamuser="username" -steampass="password" - -# Start Variables -ip="0.0.0.0" -updateonstart="off" - -fn_parms(){ -parms="-config ${servercfgfullpath}" -} - -#### Advanced Variables #### - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -# Steam -appid="105600" - -# Server Details -servicename="terraria-server" -gamename="Terraria" -engine="terraria" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./TerrariaServer" -servercfg="${servicename}.txt" -servercfgdir="${filesdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.txt" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -#gamelogdir="" # Terraria Doesn't Have a Server Log -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/UnrealTournament2004/ut2k4server b/UnrealTournament2004/ut2k4server deleted file mode 100644 index b64042f2b..000000000 --- a/UnrealTournament2004/ut2k4server +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/bash -# Unreal Tournament 2004 -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Start Variables -defaultmap="DM-Rankin" -ip="0.0.0.0" - -fn_parms(){ -parms="server ${defaultmap}?game=XGame.xDeathMatch -nohomedir ini=${servercfg} log=${gamelog}" -} - -# Server Details -servicename="ut2k4-server" -gamename="Unreal Tournament 2004" -engine="unreal2" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/System" -executabledir="${systemdir}" -executable="./ucc-bin" -servercfg="${servicename}.ini" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/UT2004.ini" -compressedmapsdir="${rootdir}/Maps-Compressed" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${rootdir}/log/server" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -gamelog="${gamelogdir}/${servicename}-game.log" -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -gamelogdate="${gamelogdir}/${servicename}-game-$(date '+%d-%m-%Y-%H-%M-%S').log" -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/UnrealTournament99/ut99server b/UnrealTournament99/ut99server deleted file mode 100644 index 259f6a235..000000000 --- a/UnrealTournament99/ut99server +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/bash -# Unreal Tournament 99 -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="121215" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="off" -email="email@example.com" - -# Start Variables -defaultmap="DM-Deck16][" -ip="0.0.0.0" - -fn_parms(){ -parms="server ${defaultmap}.unr ini=${servercfgfullpath}" -} - -#### Advanced Variables #### - -# Server Details -servicename="ut99-server" -gamename="Unreal Tournament 99" -engine="unreal" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}/System" -executabledir="${systemdir}" -executable="./ucc-bin" -servercfg="${servicename}.ini" -servercfgdir="${systemdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/Default.ini" -compressedmapsdir="${rootdir}/Maps-Compressed" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -# Github Branch Select -# Allows for the use of different function files -# from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" -githubbranch="master" - -##### Script ##### -# Do not edit - -fn_getgithubfile(){ -filename=$1 -exec=$2 -fileurl=${3:-$filename} -filepath="${rootdir}/${filename}" -filedir=$(dirname "${filepath}") -# If the function file is missing, then download -if [ ! -f "${filepath}" ]; then - if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" - fi - githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" - echo -e " fetching ${filename}...\c" - if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then - : - else - echo -e "\e[0;31mFAIL\e[0m\n" - echo "Curl is not installed!" - echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo " ${curl}"|grep "curl:" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" - fi -fi -if [ "${exec}" ]; then - source "${filepath}" -fi -} - -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 -} - -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_functions - -getopt=$1 -fn_getopt diff --git a/appmanifest/appmanifest_10.acf b/appmanifest/appmanifest_10.acf deleted file mode 100644 index 9217b6129..000000000 --- a/appmanifest/appmanifest_10.acf +++ /dev/null @@ -1,22 +0,0 @@ -"AppState" -{ - "AppID" "10" - "Universe" "1" - "StateFlags" "1090" - "installdir" "Half-Life" - "LastUpdated" "0" - "UpdateResult" "0" - "SizeOnDisk" "0" - "buildid" "0" - "LastOwner" "0" - "BytesToDownload" "0" - "BytesDownloaded" "0" - "AutoUpdateBehavior" "0" - "AllowOtherDownloadsWhileRunning" "0" - "UserConfig" - { - } - "MountedDepots" - { - } -} diff --git a/appmanifest/appmanifest_70.acf b/appmanifest/appmanifest_70.acf deleted file mode 100644 index e5d6f2807..000000000 --- a/appmanifest/appmanifest_70.acf +++ /dev/null @@ -1,22 +0,0 @@ -"AppState" -{ - "AppID" "70" - "Universe" "1" - "StateFlags" "1090" - "installdir" "Half-Life" - "LastUpdated" "0" - "UpdateResult" "0" - "SizeOnDisk" "0" - "buildid" "0" - "LastOwner" "0" - "BytesToDownload" "0" - "BytesDownloaded" "0" - "AutoUpdateBehavior" "0" - "AllowOtherDownloadsWhileRunning" "0" - "UserConfig" - { - } - "MountedDepots" - { - } -} diff --git a/appmanifest/appmanifest_90.acf b/appmanifest/appmanifest_90.acf deleted file mode 100644 index 7de939d34..000000000 --- a/appmanifest/appmanifest_90.acf +++ /dev/null @@ -1,28 +0,0 @@ -"AppState" -{ - "AppID" "90" - "Universe" "1" - "StateFlags" "1026" - "installdir" "Half-Life" - "LastUpdated" "0" - "UpdateResult" "0" - "SizeOnDisk" "0" - "buildid" "0" - "LastOwner" "0" - "BytesToDownload" "0" - "BytesDownloaded" "0" - "AutoUpdateBehavior" "0" - "AllowOtherDownloadsWhileRunning" "0" - "UserConfig" - { - } - "MountedDepots" - { - } - "SharedDepots" - { - "1" "70" - "11" "10" - "71" "70" - } -} diff --git a/appmanifest/czero/appmanifest_90.acf b/appmanifest/czero/appmanifest_90.acf deleted file mode 100644 index 2373e5421..000000000 --- a/appmanifest/czero/appmanifest_90.acf +++ /dev/null @@ -1,31 +0,0 @@ -"AppState" -{ - "appid" "90" - "Universe" "1" - "StateFlags" "4" - "installdir" "Half-Life" - "LastUpdated" "1390662869" - "UpdateResult" "0" - "SizeOnDisk" "41586625" - "buildid" "63549" - "LastOwner" "76561199609699388" - "BytesToDownload" "224501136" - "BytesDownloaded" "224501136" - "AutoUpdateBehavior" "0" - "AllowOtherDownloadsWhileRunning" "0" - "UserConfig" - { - "mod" "czero" - } - "MountedDepots" - { - "4" "3196956435784640171" - } - "SharedDepots" - { - "1" "70" - "11" "10" - "71" "70" - "81" "80" - } -} diff --git a/appmanifest/dod/appmanifest_90.acf b/appmanifest/dod/appmanifest_90.acf deleted file mode 100644 index 704e4d1f0..000000000 --- a/appmanifest/dod/appmanifest_90.acf +++ /dev/null @@ -1,31 +0,0 @@ -"AppState" -{ - "AppID" "90" - "Universe" "1" - "StateFlags" "1030" - "installdir" "Half-Life" - "LastUpdated" "1390652241" - "UpdateResult" "0" - "SizeOnDisk" "41586625" - "buildid" "63549" - "LastOwner" "76561201453793332" - "BytesToDownload" "236411088" - "BytesDownloaded" "0" - "AutoUpdateBehavior" "0" - "AllowOtherDownloadsWhileRunning" "0" - "UserConfig" - { - "mod" "dod" - } - "MountedDepots" - { - "4" "3196956435784640171" - } - "SharedDepots" - { - "1" "70" - "11" "10" - "71" "70" - "31" "30" - } -} diff --git a/appmanifest/tfc/appmanifest_90.acf b/appmanifest/tfc/appmanifest_90.acf deleted file mode 100644 index aa3f4e2a9..000000000 --- a/appmanifest/tfc/appmanifest_90.acf +++ /dev/null @@ -1,31 +0,0 @@ -"AppState" -{ - "AppID" "90" - "Universe" "1" - "StateFlags" "4" - "installdir" "Half-Life" - "LastUpdated" "1390765182" - "UpdateResult" "0" - "SizeOnDisk" "41586625" - "buildid" "63549" - "LastOwner" "76561198445953036" - "BytesToDownload" "62362560" - "BytesDownloaded" "0" - "AutoUpdateBehavior" "0" - "AllowOtherDownloadsWhileRunning" "0" - "UserConfig" - { - "mod" "tfc" - } - "MountedDepots" - { - "4" "3196956435784640171" - } - "SharedDepots" - { - "1" "70" - "11" "10" - "71" "70" - "21" "20" - } -} diff --git a/functions/README.md b/functions/README.md deleted file mode 100644 index bb76d811c..000000000 --- a/functions/README.md +++ /dev/null @@ -1,4 +0,0 @@ -

Linux Game Server Manager - Functions

- -These functions are universal functions that work in all scripts. - diff --git a/functions/fn_backup b/functions/fn_backup deleted file mode 100644 index dd3122d17..000000000 --- a/functions/fn_backup +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# LGSM fn_backup function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Creates a .tar.gz file in the backup directory. - -local modulename="Backup" -fn_check_root -fn_check_systemdir -backupname="${servicename}-$(date '+%Y-%m-%d-%H%M%S')" -echo "" -echo "${gamename} Backup" -echo "============================" -echo "" -echo "The following backup will be created:" -echo "" -echo "${backupdir}/${backupname}.tar.gz" -echo "" -while true; do - read -p "Continue? [y/N]" yn - case $yn in - [Yy]* ) break;; - [Nn]* ) echo Exiting; return;; - * ) echo "Please answer yes or no.";; -esac -done -tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:") -if [ "${tmuxwc}" -eq 1 ]; then - echo "" - fn_printwarningnl "${servicename} is currently running." - sleep 1 - while true; do - read -p "Stop ${servicename} while running the backup? [y/N]" yn - case $yn in - [Yy]* ) fn_stop; break;; - [Nn]* ) break;; - * ) echo "Please answer yes or no.";; - esac - done -fi -fn_scriptlog "Started" -echo -en "starting backup.\r" -sleep 1 -echo -en "starting backup..\r" -sleep 1 -echo -en "starting backup...\r" -sleep 1 -echo -en "\n" -cd "${rootdir}" -mkdir -pv "${backupdir}" > /dev/null 2>&1 -tar -cvzf "${backupdir}/${backupname}.tar.gz" --exclude "${backupdir}" ./* -echo "" -echo "Backup created: ${backupdir}/${backupname}.tar.gz" -fn_scriptlog "Created: ${backupdir}/${backupname}.tar.gz" -sleep 1 -echo "" -fn_printcompletenl "Complete." -fn_scriptlog "Complete" -echo "" diff --git a/functions/fn_check_ip b/functions/fn_check_ip deleted file mode 100644 index e5b81268d..000000000 --- a/functions/fn_check_ip +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# LGSM fn_check_ip function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Automatically identifies the server interface IP. -# If multiple interfaces are detected the user will need to manualy set using ip="0.0.0.0". - -if [ ! -f /bin/ip ]; then - ipcommand="/sbin/ip" -else - ipcommand="ip" -fi -getip=$(${ipcommand} -o -4 addr|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -v 127.0.0) -getipwc=$(${ipcommand} -o -4 addr|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -vc 127.0.0) - -if [ "${ip}" == "0.0.0.0" ]||[ "${ip}" == "" ]; then - if [ "${getipwc}" -ge "2" ]; then - fn_printwarn "Multiple active network interfaces found.\n\n" - echo -en "Manually specify the IP you want to use within the ${selfname} script.\n" - echo -en "Set ip=\"0.0.0.0\" to one of the following:\n" - echo -en "${getip}\n" - echo -en "" - echo -en "http://gameservermanagers.com/network-interfaces" - echo -en "" - exit 1 - else - ip=${getip} - fi -fi diff --git a/functions/fn_check_logs b/functions/fn_check_logs deleted file mode 100644 index 526a4036b..000000000 --- a/functions/fn_check_logs +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# LGSM fn_check_logs function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Checks that log files exist on server start - -# Create dir's for the script and console logs -if [ ! -d "${scriptlogdir}" ]; then - fn_printdots "Checking for log files" - sleep 1 - fn_printinfo "Checking for log files: Creating log files" - echo -en "\n" - checklogs=1 - fn_install_logs -fi diff --git a/functions/fn_check_root b/functions/fn_check_root deleted file mode 100644 index 16f253e35..000000000 --- a/functions/fn_check_root +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# LGSM fn_check_root function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -if [ $(whoami) = "root" ]; then - fn_printfailnl "Do NOT run this script as root!" - exit 1 -fi diff --git a/functions/fn_check_steamcmd b/functions/fn_check_steamcmd deleted file mode 100644 index 4ec0bb948..000000000 --- a/functions/fn_check_steamcmd +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# LGSM fn_check_steamcmd function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Downloads SteamCMD on install and checks if missing before running functions that require SteamCMD - - -if [ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament 2004" ]; then - : # These servers do not require SteamCMD. Check is skipped. -elif [ "${modulename}" == "Starting" ]||[ "${modulename}" == "Update" ]; then - # Checks if SteamCMD exists when starting or updating a server. - # Re-installs if missing. - if [ ! -f ${rootdir}/steamcmd/steamcmd.sh ]; then - fn_details_config - fn_printwarn "SteamCMD is missing" - fn_scriptlog "SteamCMD is missing" - sleep 1 - echo -en "\n" - mkdir -pv "${rootdir}/steamcmd" - cd "${rootdir}/steamcmd" - echo -e "downloading steamcmd_linux.tar.gz...\c" - wget -N /dev/null http://media.steampowered.com/client/steamcmd_linux.tar.gz 2>&1 | grep -F HTTP | cut -c45-| uniq - tar --verbose -zxf steamcmd_linux.tar.gz - rm -v steamcmd_linux.tar.gz - chmod +x steamcmd.sh - fn_scriptlog "Re-installed SteamCMD" - fn_printdots "${servername}" - sleep 1 - fi - cd "${rootdir}" -fi diff --git a/functions/fn_check_steamuser b/functions/fn_check_steamuser deleted file mode 100644 index 8861260eb..000000000 --- a/functions/fn_check_steamuser +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# LGSM fn_check_steamuser function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -if [ "${steamuser}" == "username" ]; then - fn_printfailnl "Steam login not set. Update steamuser." - echo " * Change steamuser=\"username\" to a valid steam login." - if [ -d ${scriptlogdir} ]; then - fn_scriptlog "edit ${selfname}. change steamuser=\"username\" to a valid steam login." - exit 1 - fi -fi -if [ -z "${steamuser}" ]; then - fn_printwarnnl "Steam login not set. Using anonymous login." - if [ -d ${scriptlogdir} ]; then - fn_scriptlog "Steam login not set. Using anonymous login." - fi - steamuser="anonymous" - steampass="" - sleep 2 -fi diff --git a/functions/fn_check_systemdir b/functions/fn_check_systemdir deleted file mode 100644 index fba1566f0..000000000 --- a/functions/fn_check_systemdir +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# LGSM fn_check_systemdir function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -if [ ! -e "${systemdir}" ]; then - fn_printfailnl "Cannot access ${systemdir}: No such directory" - exit 1 -fi diff --git a/functions/fn_check_tmux b/functions/fn_check_tmux deleted file mode 100644 index 13aedad4f..000000000 --- a/functions/fn_check_tmux +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# LGSM fn_check_tmux function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Checks if tmux is installed as too many users do not RTFM or know how to use Google. - -if [ "$(command -v tmux)" ]||[ "$(which tmux >/dev/null 2>&1)" ]||[ -f "/usr/bin/tmux" ]||[ -f "/bin/tmux" ]; then - : -else - fn_printfailnl "Tmux not installed" - sleep 1 - fn_scriptlog "Tmux is not installed" - echo " * Tmux is required to run this server." - # Suitable passive agressive message - echo " * Please see the the following link." - echo " * http://gameservermanagers.com/tmux-not-found" - exit 127 -fi diff --git a/functions/fn_check_ts3status b/functions/fn_check_ts3status deleted file mode 100644 index 6cabddb3b..000000000 --- a/functions/fn_check_ts3status +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# LGSM fn_check_ts3status function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Checks the status of Teamspeak 3. - -cd "${executabledir}" -ts3status=$(./ts3server_startscript.sh status servercfgfullpathfile=${servercfgfullpath}) diff --git a/functions/fn_compress_unreal2maps b/functions/fn_compress_unreal2maps deleted file mode 100644 index fec5d113f..000000000 --- a/functions/fn_compress_unreal2maps +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# LGSM fn_compress_unreal2maps function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -fn_check_root -clear -echo "${gamename} Map Compressor" -echo "============================" -echo "Will compress all maps in:" -echo "" -pwd -echo "" -echo "Compressed maps saved to:" -echo "" -echo "${compressedmapsdir}" -echo "" -while true; do - read -p "Start compression [y/N]" yn - case $yn in - [Yy]* ) break;; - [Nn]* ) echo Exiting; return;; - * ) echo "Please answer yes or no.";; - esac -done -mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 -rm -rfv "${filesdir}/Maps/*.uz2" -cd "${systemdir}" -for map in "${filesdir}/Maps/*"; do - ./ucc-bin compress "../Maps/${map}" --nohomedir -done -mv -fv "${filesdir}/Maps/*.uz2" "${compressedmapsdir}" diff --git a/functions/fn_compress_ut99maps b/functions/fn_compress_ut99maps deleted file mode 100644 index f9e0c9433..000000000 --- a/functions/fn_compress_ut99maps +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# LGSM fn_compress_ut99maps function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -fn_check_root -clear -echo "${gamename} Map Compressor" -echo "============================" -echo "Will compress all maps in:" -echo "" -pwd -echo "" -echo "Compressed maps saved to:" -echo "" -echo "${compressedmapsdir}" -echo "" -while true; do - read -p "Start compression [y/N]" yn - case $yn in - [Yy]* ) break;; - [Nn]* ) echo Exiting; return;; - * ) echo "Please answer yes or no.";; - esac -done -mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 -rm -rfv "${filesdir}/Maps/*.unr.uz" -cd "${systemdir}" -for map in "${filesdir}/Maps/*"; do - ./ucc-bin compress ../Maps/${map} --nohomedir -done -mv -fv "${filesdir}/Maps/*.unr.uz" "${compressedmapsdir}" diff --git a/functions/fn_console b/functions/fn_console deleted file mode 100644 index 992c9bd1a..000000000 --- a/functions/fn_console +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# LGSM fn_console function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Gives access to the server tmux console. - -local modulename="Console" -fn_check_root -fn_check_systemdir -echo "" -echo "${gamename} Console" -echo "============================" -echo "" -echo "Press \"CTRL+b d\" to exit console." -fn_printwarningnl "Do NOT press CTRL+c to exit." -echo "" -while true; do - read -e -i "y" -p "Continue? [y/N]" yn - case $yn in - [Yy]* ) break;; - [Nn]* ) echo Exiting; return;; - * ) echo "Please answer yes or no.";; -esac -done -fn_printdots "Starting" -sleep 1 -fn_check_tmux -tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:") -if [ "${tmuxwc}" -eq 1 ]; then - fn_printoknl "Starting" - fn_scriptlog "accessed" - sleep 1 - tmux attach-session -t ${servicename} -else - fn_printfailnl "Server not running" - fn_scriptlog "Failed to access: Server not running" - sleep 1 - while true; do - read -p "Do you want to start the server? [y/N]" yn - case $yn in - [Yy]* ) fn_start; break;; - [Nn]* ) break;; - * ) echo "Please answer yes or no.";; - esac - done -fi diff --git a/functions/fn_csgofix b/functions/fn_csgofix deleted file mode 100644 index 1af77b87a..000000000 --- a/functions/fn_csgofix +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash -# LGSM fn_csgofix function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Resolves various issues with csgo. - -# Fixed server not always creating steam_appid.txt file. -fn_csgoappfix(){ -if [ ! -f "${filesdir}/steam_appid.txt" ]; then - fn_printdots "Applying 730 steam_appid.txt Fix." - sleep 1 - fn_printinfo "Applying 730 steam_appid.txt Fix." - fn_scriptlog "Applying 730 steam_appid.txt Fix" - sleep 1 - echo -en "\n" - echo -n "730" >> "${filesdir}/steam_appid.txt" -fi -} - -fn_csgofixes(){ -# Fixes the following error: -# Error parsing BotProfile.db - unknown attribute 'Rank". -if ! grep -q "//Rank" "${systemdir}/botprofile.db" > /dev/null 2>&1; then - echo "Applying botprofile.db fix." - sleep 1 - echo "" - echo "botprofile.db fix removes the following error from appearing on the console:" - echo " Error parsing BotProfile.db - unknown attribute 'Rank" - sleep 1 - sed -i 's/\tRank/\t\/\/Rank/g' "${systemdir}/botprofile.db" > /dev/null 2>&1 - if [[ $? != 0 ]]; then - fn_printfailure "Applying botprofile.db fix." - else - fn_printcomplete "Applying botprofile.db fix." - fi - echo -en "\n" - echo "" -fi - -# Fixes errors simular to the following: -# Unknown command "cl_bobamt_vert". -if ! grep -q "//exec default" "${servercfgdir}/valve.rc" > /dev/null 2>&1 || ! grep -q "//exec joystick" "${servercfgdir}/valve.rc" > /dev/null 2>&1; then - echo "Applying valve.rc fix." - sleep 1 - echo "" - echo "valve.rc fix removes the following error from appearing on the console:" - echo " Unknown command \"cl_bobamt_vert\"" - sleep 1 - sed -i 's/exec default.cfg/\/\/exec default.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1 - sed -i 's/exec joystick.cfg/\/\/exec joystick.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1 - if [[ $? != 0 ]]; then - fn_printfailure "Applying valve.rc fix." - else - fn_printcomplete "Applying valve.rc fix." - fi - echo -en "\n" - echo "" -fi - -# Fixes errors simular to the following: -# http://forums.steampowered.com/forums/showthread.php?t=3170366. -if [ -f "${systemdir}/subscribed_collection_ids.txt" ]||[ -f "${systemdir}/subscribed_file_ids.txt" ]||[ -f "${systemdir}/ugc_collection_cache.txt" ]; then - echo "workshopmapfix fixes the following error:" - echo " http://forums.steampowered.com/forums/showthread.php?t=3170366" - sleep 1 - echo "" - echo "Applying workshopmap fix." - sleep 1 - rm -f "${systemdir}/subscribed_collection_ids.txt" - rm -f "${systemdir}/subscribed_file_ids.txt" - rm -f "${systemdir}/ugc_collection_cache.txt" - if [[ $? != 0 ]]; then - fn_printfailure "Applying workshopmap fix." - else - fn_printcomplete "Applying workshopmap fix." - fi - echo -en "\n" - echo "" -fi -} - -if [ ! -z "${startfix}" ]; then - fn_csgoappfix -else - fn_csgofixes -fi \ No newline at end of file diff --git a/functions/fn_debug b/functions/fn_debug deleted file mode 100644 index b593f0415..000000000 --- a/functions/fn_debug +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# LGSM fn_debug function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Runs the server without tmux. Runs direct from the terminal. - -local modulename="Debug" -fn_check_root -fn_check_systemdir -fn_check_ip -fn_check_logs -fn_details_distro -fn_parms -echo "" -echo "${gamename} Debug" -echo "============================" -echo "" -echo -e "Distro: ${os}" -echo -e "Arch: ${arch}" -echo -e "Kernel: ${kernel}" -echo -e "Hostname: $HOSTNAME" -echo "" -echo "Start parameters:" -if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then - echo "${executable} ${parms} -debug" -else - echo "${executable} ${parms}" -fi -echo "" -echo -e "Use for identifying server issues only!" -echo -e "Press CTRL+c to drop out of debug mode." -fn_printwarningnl "If ${servicename} is already running it will be stopped." -echo "" -while true; do - read -e -i "y" -p "Continue? [Y/n]" yn - case $yn in - [Yy]* ) break;; - [Nn]* ) echo Exiting; return;; - * ) echo "Please answer yes or no.";; -esac -done -fn_scriptlog "Starting debug" -fn_printinfonl "Stopping any running servers" -fn_scriptlog "Stopping any running servers" -sleep 1 -fn_stop -fn_printdots "Starting debug" -sleep 1 -fn_printok "Starting debug" -fn_scriptlog "Started debug" -sleep 1 -echo -en "\n" -cd "${executabledir}" -if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then - if [ "${gamename}" == "Insurgency" ]; then - fn_insfix - fi - ${executable} ${parms} -debug -else - ${executable} ${parms} -fi \ No newline at end of file diff --git a/functions/fn_deps_detect b/functions/fn_deps_detect deleted file mode 100644 index 1ff872136..000000000 --- a/functions/fn_deps_detect +++ /dev/null @@ -1,149 +0,0 @@ -#!/bin/bash -# LGSM fn_dep_detect function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Detects dependencies the server binary requires. - -local modulename="Backup" -fn_check_root -fn_check_systemdir -cd "${executabledir}" -if [ "${executable}" == "./hlds_run" ];then - executable=hlds_linux -elif [ "${executable}" == "./srcds_run" ]||[ "${executable}" == "./dabds.sh" ]||[ "${executable}" == "./srcds_run.sh" ];then - executable=srcds_linux -elif [ "${executable}" == "./server_linux32" ];then - executable=libSpark_Core.so -elif [ "${executable}" == "./runSam3_DedicatedServer.sh" ];then - executable=Sam3_DedicatedServer -elif [ "${executable}" == "./7DaysToDie.sh" ];then - executable=7DaysToDie.x86 -elif [ "${executable}" == "./ucc-bin" ];then - - if [ -f "${executabledir}/ucc-bin-real" ]; then - executable=ucc-bin-real - elif [ -f "${executabledir}/ut2004-bin" ]; then - executable=ut2004-bin - else - executable=ut-bin - fi - -elif [ "${executable}" == "./ts3server_startscript.sh" ];then - executable=ts3server_linux_amd64 -fi - -if [ -n "$(command -v eu-readelf)" ]; then - readelf=eu-readelf -else - readelf=readelf -fi - -${readelf} -d ${executable} |grep NEEDED|awk '{ print $5 }'|sed 's/\[//g'|sed 's/\]//g' > "${rootdir}/.depdetect_readelf" - - -echo "yum install " > "${rootdir}/.depdetect_centos_list_uniq" -echo "apt-get install " > "${rootdir}/.depdetect_ubuntu_list_uniq" -echo "apt-get install " > "${rootdir}/.depdetect_debian_list_uniq" -while read lib; do - sharedlib=${lib} - if [ "${lib}" == "libm.so.6" ]||[ "${lib}" == "libc.so.6" ]||[ "${lib}" == "libpthread.so.0" ]||[ "${lib}" == "libdl.so.2" ]||[ "${lib}" == "libnsl.so.1" ]||[ "${lib}" == "libgcc_s.so.1" ]||[ "${lib}" == "librt.so.1" ]||[ "${lib}" == "ld-linux.so.2" ];then - echo "glibc.i686" >> "${rootdir}/.depdetect_centos_list" - echo "lib32gcc1" >> "${rootdir}/.depdetect_ubuntu_list" - echo "lib32gcc1" >> "${rootdir}/.depdetect_debian_list" - - elif [ "${lib}" == "libstdc++.so.6" ];then - echo "libstdc++.i686" >> "${rootdir}/.depdetect_centos_list" - echo "libstdc++6:i386" >> "${rootdir}/.depdetect_ubuntu_list" - echo "libstdc++6:i386" >> "${rootdir}/.depdetect_debian_list" - - elif [ "${lib}" == "libstdc++.so.5" ];then - echo "compat-libstdc++-33.i686" >> "${rootdir}/.depdetect_centos_list" - echo "libstdc++5:i386" >> "${rootdir}/.depdetect_ubuntu_list" - echo "libstdc++5:i386" >> "${rootdir}/.depdetect_debian_list" - - elif [ "${lib}" == "libspeex.so.1" ]||[ "${lib}" == "libspeexdsp.so.1" ];then - echo "speex.i686" >> "${rootdir}/.depdetect_centos_list" - echo "speex:i386" >> "${rootdir}/.depdetect_ubuntu_list" - echo "speex:i386" >> "${rootdir}/.depdetect_debian_list" - - elif [ "${lib}" == "./libSDL-1.2.so.0" ]||[ "${lib}" == "libSDL-1.2.so.0" ];then - echo "SDL.i686" >> "${rootdir}/.depdetect_centos_list" - echo "libsdl1.2debian" >> "${rootdir}/.depdetect_ubuntu_list" - echo "libsdl1.2debian" >> "${rootdir}/.depdetect_debian_list" - - elif [ "${lib}" == "libtbb.so.2" ];then - echo "tbb.i686" >> "${rootdir}/.depdetect_centos_list" - echo "libtbb2" >> "${rootdir}/.depdetect_ubuntu_list" - echo "libtbb2" >> "${rootdir}/.depdetect_debian_list" - - elif [ "${lib}" == "libtier0.so" ]||[ "${lib}" == "Core.so" ]||[ "${lib}" == "Editor.so" ]||[ "${lib}" == "Engine.so" ]||[ "${lib}" == "liblua.so" ]||[ "${lib}" == "libsteam_api.so" ]||[ "${lib}" == "ld-linux-x86-64.so.2" ]||[ "${lib}" == "libPhysX3_x86.so" ]||[ "${lib}" == "libPhysX3Common_x86.so" ]||[ "${lib}" == "libPhysX3Cooking_x86.so" ];then - # Known shared libs what dont requires dependencies - : - else - unknownlib=1 - echo "${lib}" >> "${rootdir}/.depdetect_unknown" - fi -done < "${rootdir}/.depdetect_readelf" -sort "${rootdir}/.depdetect_centos_list" | uniq >> "${rootdir}/.depdetect_centos_list_uniq" -sort "${rootdir}/.depdetect_ubuntu_list" | uniq >> "${rootdir}/.depdetect_ubuntu_list_uniq" -sort "${rootdir}/.depdetect_debian_list" | uniq >> "${rootdir}/.depdetect_debian_list_uniq" -if [ "${unknownlib}" == "1" ];then - sort "${rootdir}/.depdetect_unknown" | uniq >> "${rootdir}/.depdetect_unknown_uniq" -fi - -awk -vORS=' ' '{ print $1, $2 }' "${rootdir}/.depdetect_centos_list_uniq" > "${rootdir}/.depdetect_centos_line" -awk -vORS=' ' '{ print $1, $2 }' "${rootdir}/.depdetect_ubuntu_list_uniq" > "${rootdir}/.depdetect_ubuntu_line" -awk -vORS=' ' '{ print $1, $2 }' "${rootdir}/.depdetect_debian_list_uniq" > "${rootdir}/.depdetect_debian_line" - -echo "" -echo "Required Dependencies" -echo "=================================" -echo "${executable}" -echo "" -echo "CentOS" -echo "=================================" -cat "${rootdir}/.depdetect_centos_line" -echo "" -echo "" -echo "Ubuntu" -echo "=================================" -cat "${rootdir}/.depdetect_ubuntu_line" -echo "" -echo "" -echo "Debian" -echo "=================================" -cat "${rootdir}/.depdetect_debian_line" -echo "" -if [ "${unknownlib}" == "1" ];then - echo "" - echo "Unknown shared Library" - echo "=================================" - cat "${rootdir}/.depdetect_unknown" -fi -echo "" -echo "Required Librarys" -echo "=================================" -sort "${rootdir}/.depdetect_readelf" |uniq -echo "" -echo "ldd" -echo "=================================" -ldd ${executable} -echo -en "\n" -rm -f "${rootdir}/.depdetect_centos_line" -rm -f "${rootdir}/.depdetect_centos_list" -rm -f "${rootdir}/.depdetect_centos_list_uniq" - -rm -f "${rootdir}/.depdetect_debian_line" -rm -f "${rootdir}/.depdetect_debian_list" -rm -f "${rootdir}/.depdetect_debian_list_uniq" - -rm -f "${rootdir}/.depdetect_ubuntu_line" -rm -f "${rootdir}/.depdetect_ubuntu_list" -rm -f "${rootdir}/.depdetect_ubuntu_list_uniq" - -rm -f "${rootdir}/.depdetect_readelf" - -rm -f "${rootdir}/.depdetect_unknown" -rm -f "${rootdir}/.depdetect_unknown_uniq" \ No newline at end of file diff --git a/functions/fn_details b/functions/fn_details deleted file mode 100644 index 84ac3c0d9..000000000 --- a/functions/fn_details +++ /dev/null @@ -1,736 +0,0 @@ -#!/bin/bash -# LGSM fn_details function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Displays server infomation. - -# Standard Details -# This applies to all engines - -fn_details_os(){ -echo -e "" -echo -e "\e[93mDistro Details\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -{ - echo -e "\e[34mDistro:\t\e[0m${os}" - echo -e "\e[34mArch:\t\e[0m${arch}" - echo -e "\e[34mKernel:\t\e[0m${kernel}" - echo -e "\e[34mHostname:\t\e[0m$HOSTNAME" - echo -e "\e[34mtmux:\t\e[0m${tmuxv}" - echo -e "\e[34mGLIBC:\t\e[0m${glibcv}" -} | column -s $'\t' -t -} - -fn_details_performance(){ -echo -e "" -echo -e "\e[93mPerformance\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -{ - echo -e "\e[34mUptime:\t\e[0m${days}d, ${hours}h, ${minutes}m" - echo -e "\e[34mAvg Load:\t\e[0m${load}" -} | column -s $'\t' -t -echo -e "" -{ - echo -e "\e[34mMem:\t\e[34mtotal\t used\t free\e[0m" - echo -e "\e[34mPhysical:\t\e[0m${physmemtotal}\t${physmemused}\t${physmemfree}\e[0m" - echo -e "\e[34mSwap:\t\e[0m${swaptotal}\t${swapused}\t${swapfree}\e[0m" -} | column -s $'\t' -t -} - -fn_details_disk(){ -echo -e "" -echo -e "\e[93mStorage\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -{ - echo -e "\e[34mFilesystem:\t\e[0m${filesystem}" - echo -e "\e[34mTotal:\t\e[0m${totalspace}" - echo -e "\e[34mUsed:\t\e[0m${usedspace}" - echo -e "\e[34mAvailable:\t\e[0m${availspace}" - echo -e "\e[34mServerfiles:\t\e[0m${serverfilesdu}" - if [ -d "${backupdir}" ]; then - echo -e "\e[34mBackups:\t\e[0m${backupdirdu}" - fi -} | column -s $'\t' -t -} - -fn_details_gameserver(){ -echo -e "" - -## server details -echo -e "\e[92m${gamename} Server Details\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -{ - # server name - echo -e "\e[34mServer name:\t\e[0m${servername}" - - # server ip - echo -e "\e[34mServer IP:\t\e[0m${ip}:${port}" - - # rcon password - if [ -n "${rconpassword}" ]; then - echo -e "\e[34mRCON password:\t\e[0m${rconpassword}" - fi - - # server password - if [ -n "${serverpassword}" ]; then - echo -e "\e[34mServer password:\t\e[0m${serverpassword}" - fi - - # admin password - if [ -n "${adminpassword}" ]; then - echo -e "\e[34mAdmin password:\t\e[0m${adminpassword}" - fi - - # slots - if [ -n "${slots}" ]; then - echo -e "\e[34mSlots:\t\e[0m${slots}" - fi - - # game mode - if [ -n "${gamemode}" ]; then - echo -e "\e[34mGame mode:\t\e[0m${gamemode}" - fi - - # game world - if [ -n "${gameworld}" ]; then - echo -e "\e[34mGame world:\t\e[0m${gameworld}" - fi - - # tick rate - if [ -n "${tickrate}" ]; then - echo -e "\e[34mTick rate:\t\e[0m${tickrate}" - fi - - # online status - if [ "${gamename}" == "Teamspeak 3" ]; then - fn_check_ts3status - if [ "${ts3status}" = "Server seems to have died" ] || [ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then - echo -e "\e[34mStatus:\t\e[0;31mOFFLINE\e[0m" - else - echo -e "\e[34mStatus:\t\e[0;32mONLINE\e[0m" - fi - else - pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:") - if [ "${pid}" == "0" ]; then - echo -e "\e[34mStatus:\t\e[0;31mOFFLINE\e[0m" - else - echo -e "\e[34mStatus:\t\e[0;32mONLINE\e[0m" - fi - fi - - # teamspeak dbplugin - if [ -n "${dbplugin}" ]; then - echo -e "\e[34mdbplugin:\t\e[0m${dbplugin}" - fi -} | column -s $'\t' -t -echo -e "" - -## script details -echo -e "\e[92m${selfname} Script Details\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -{ - # service name - echo -e "\e[34mService name:\t\e[0m${servicename}" - - # script version - if [ -n "${version}" ]; then - echo -e "\e[34m${selfname} version:\t\e[0m${version}" - fi - - # script user - echo -e "\e[34mUser:\t\e[0m$(whoami)" - - # GLIBC required - if [ -n "${glibcrequired}" ]; then - if [ "$(ldd --version | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" -lt "$(echo "${glibcrequired}" | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" ]; then - if [ "${glibcfix}" == "yes" ]; then - echo -e "\e[34mGLIBC required:\t\e[0;31m${glibcrequired} \e[0m(\e[0;32mUsing GLIBC fix\e[0m)" - else - echo -e "\e[34mGLIBC required:\t\e[0;31m${glibcrequired}\e[0m(\e[0;32mGLIBC version too old\e[0m)" - fi - else - echo -e "\e[34mGLIBC required:\t\e[0;32m${glibcrequired}\e[0m" - fi - fi - - # email notification - if [ -n "${emailnotification}" ]; then - echo -e "\e[34mEmail notification:\t\e[0m${emailnotification}" - fi - - # update on start - if [ -n "${updateonstart}" ]; then - echo -e "\e[34mUpdate on start:\t\e[0m${updateonstart}" - fi - - # script location - echo -e "\e[34mLocation:\t\e[0m${rootdir}" - - # config file location - if [ -n "${servercfgfullpath}" ]; then - echo -e "\e[34mConfig file:\t\e[0m${servercfgfullpath}" - fi - - # network config file location (ARMA 3) - if [ -n "${networkcfgfullpath}" ]; then - echo -e "\e[34mNetwork config file:\t\e[0m${networkcfgfullpath}" - fi -} | column -s $'\t' -t -} - -fn_details_backup(){ -echo -e "" -echo -e "\e[92mBackups\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -if [ ! -d "${backupdir}" ] || [ "${backupcount}" == "0" ]; then - echo -e "No Backups created" -else - { - echo -e "\e[34mNo. of backups:\t\e[0m${backupcount}" - echo -e "\e[34mLatest backup:\e[0m" - echo -e "\e[34m date:\t\e[0m${lastbackupdate}" - echo -e "\e[34m file:\t\e[0m${lastbackup}" - echo -e "\e[34m size:\t\e[0m${lastbackupsize}" - } | column -s $'\t' -t -fi -} - -fn_details_commandlineparms(){ -echo -e "" -echo -e "\e[92mCommand-line Parameters\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -echo -e "${executable} ${parms}" -} - -fn_details_statusbottom(){ -echo -e "" -if [ "${gamename}" == "Teamspeak 3" ]; then - if [ "${ts3status}" = "Server seems to have died" ] || [ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then - echo -e "\e[34mStatus: \e[0;31mOFFLINE\e[0m" - else - echo -e "\e[34mStatus: \e[0;32mONLINE\e[0m" - fi -else - pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:") - if [ "${pid}" == "0" ]; then - echo -e "\e[34mStatus: \e[0;31mOFFLINE\e[0m" - else - echo -e "\e[34mStatus: \e[0;32mONLINE\e[0m" - fi -fi -echo -e "" -} - -# Engine Specific details - -fn_details_avalanche(){ -fn_check_ip -fn_details_config -fn_details_distro -fn_details_os -fn_details_performance -fn_details_disk -fn_details_gameserver -fn_details_backup -echo -e "" -echo -e "\e[92mPorts\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -echo -e "Change ports by editing the parameters in" -echo -e "${servercfgfullpath}." -echo -e "" -echo -e "Useful port diagnostic command:" -echo -e "netstat -atunp | grep Jcmp-Server" -echo -e "" -{ - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" -} | column -s $'\t' -t - -fn_details_statusbottom -} - -fn_details_dontstarve(){ -fn_check_ip -fn_details_config -fn_details_distro -fn_details_os -fn_details_performance -fn_details_disk -fn_details_gameserver -fn_details_backup -echo -e "" -echo -e "\e[92mPorts\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -echo -e "Change ports by editing the parameters in" -echo -e "${servercfgfullpath}." -echo -e "" -echo -e "Useful port diagnostic command:" -echo -e "netstat -atunp | grep dontstarve" -echo -e "" -{ - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" -} | column -s $'\t' -t - -fn_details_statusbottom -} - -fn_details_projectzomboid(){ -fn_check_ip -fn_details_config -fn_details_distro -fn_details_os -fn_details_performance -fn_details_disk -fn_details_gameserver -fn_details_backup -echo -e "" -echo -e "\e[92mPorts\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -echo -e "Change ports by editing the parameters in" -echo -e "${servercfgfullpath}." -echo -e "" -echo -e "Useful port diagnostic command:" -echo -e "netstat -atunp | grep java" -echo -e "" -{ - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" -} | column -s $'\t' -t - -fn_details_statusbottom -} - - -fn_details_realvirtuality(){ -fn_check_ip -fn_parms -fn_details_config -fn_details_distro -fn_details_os -fn_details_performance -fn_details_disk -fn_details_gameserver -fn_details_backup -fn_details_commandlineparms -echo -e "" -echo -e "\e[92mPorts\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -echo -e "Change ports by editing the parameters in" -echo -e "${servercfgfullpath}." -echo -e "" -echo -e "Useful port diagnostic command:" -echo -e "netstat -atunp | grep arma3server" -echo -e "" -if [ -z "${port}" ] || [ -z "${queryport}" ] || [ -z "${masterport}" ]; then - echo -e "\e[0;31mERROR!\e[0m Missing/commented ports in ${servercfg}." - echo -e "" -fi -{ - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp" - echo -e "> Steam: Master traffic\tINBOUND\t${masterport}\tudp" -} | column -s $'\t' -t - -fn_details_statusbottom -} - -fn_details_seriousengine35(){ -fn_check_ip -fn_parms -fn_details_config -fn_details_distro -fn_details_os -fn_details_performance -fn_details_disk -fn_details_gameserver -fn_details_backup -fn_details_commandlineparms -echo -e "" -echo -e "\e[92mPorts\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -echo -e "Change ports by editing the parameters in" -echo -e "${servercfgfullpath}." -echo -e "" -echo -e "Useful port diagnostic command:" -echo -e "netstat -atunp | grep Sam3_Dedicate" -echo -e "" -{ - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game/RCON\tINBOUND\t${port}\ttcp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" -} | column -s $'\t' -t - -fn_details_statusbottom -} - -fn_details_source(){ -fn_check_ip -fn_parms -fn_details_config -fn_details_distro -fn_details_os -fn_details_performance -fn_details_disk -fn_details_gameserver -fn_details_backup -fn_details_commandlineparms -echo -e "" -echo -e "\e[92mPorts\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -echo -e "Change ports by editing the command-line" -echo -e "parameters in ${selfname}." -echo -e "" -echo -e "Useful port diagnostic command:" -echo -e "netstat -atunp | grep srcds_linux" -echo -e "" -{ - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp" - if [ -n "${sourcetvport}" ]; then - echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp" - fi - echo -e "< Client\tOUTBOUND\t${clientport}\tudp" -} | column -s $'\t' -t - -fn_details_statusbottom -} - -fn_details_spark(){ -fn_check_ip -fn_parms -fn_details_config -fn_details_distro -fn_details_os -fn_details_performance -fn_details_disk -fn_details_gameserver -fn_details_backup -fn_details_commandlineparms -echo -e "" -echo -e "\e[92mPorts\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -echo -e "Change ports by editing the command-line" -echo -e "parameters in ${selfname}." -echo -e "" -echo -e "Useful port diagnostic command:" -echo -e "netstat -atunp | grep server_linux3" -echo -e "" -{ - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game/RCON\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp" -} | column -s $'\t' -t -echo -e "" -echo -e "\e[92m${servername} WebAdmin\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -{ - echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}/index.html" - echo -e "\e[34mWebAdmin username:\t\e[0m${webadminuser}" - echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}" -} | column -s $'\t' -t - -fn_details_statusbottom -} - -fn_details_starbound(){ -fn_check_ip -fn_parms -fn_details_config -fn_details_distro -fn_details_os -fn_details_performance -fn_details_disk -fn_details_gameserver -fn_details_backup -fn_details_commandlineparms -echo -e "" -echo -e "\e[92mPorts\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -echo -e "Change ports by editing the command-line" -echo -e "parameters in ${selfname}." -echo -e "" -echo -e "Useful port diagnostic command:" -echo -e "netstat -atunp | grep starbound" -echo -e "" -{ - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\ttcp" - echo -e "> Query\tINBOUND\t${queryport}\ttcp" - echo -e "> Rcon\tINBOUND\t${rconport}\ttcp" -} | column -s $'\t' -t - -fn_details_statusbottom - -} - -fn_details_teamspeak3(){ -fn_details_config -fn_details_distro -fn_details_os -fn_details_performance -fn_details_disk -fn_details_gameserver -fn_details_backup -fn_details_commandlineparms -echo -e "" -echo -e "\e[92mPorts\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -echo -e "Change ports by editing the parameters in" -echo -e "${servercfgfullpath}." -echo -e "" -echo -e "Useful port diagnostic command:" -echo -e "netstat -atunp | grep ts3server" -echo -e "" -{ - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Voice\tINBOUND\t${port}\tudp" - echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp" - echo -e "> File transfer\tINBOUND\t${fileport}\ttcp" -} | column -s $'\t' -t - -fn_details_statusbottom -} - -fn_details_teeworlds(){ -fn_check_ip -fn_parms -fn_details_config -fn_details_distro -fn_details_os -fn_details_performance -fn_details_disk -fn_details_gameserver -fn_details_backup -fn_details_commandlineparms -echo -e "" -echo -e "\e[92mPorts\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -echo -e "Change ports by editing the command-line" -echo -e "parameters in ${servercfgfullpath}." -echo -e "" -echo -e "Useful port diagnostic command:" -echo -e "netstat -atunp | grep teeworlds_srv" -echo -e "" -{ - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\ttcp" -} | column -s $'\t' -t - -fn_details_statusbottom -} - -fn_details_terraria(){ -fn_check_ip -fn_parms -fn_details_config -fn_details_distro -fn_details_os -fn_details_performance -fn_details_disk -fn_details_gameserver -fn_details_backup -fn_details_commandlineparms -echo -e "" -echo -e "\e[92mPorts\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -echo -e "Change ports by editing the command-line" -echo -e "parameters in ${servercfgfullpath}." -echo -e "" -echo -e "Useful port diagnostic command:" -echo -e "netstat -atunp | grep terraia" -echo -e "" -{ - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\ttcp" - echo -e "> Query\tINBOUND\t${queryport}\ttcp" - echo -e "> Rcon\tINBOUND\t${rconport}\ttcp" -} | column -s $'\t' -t - -fn_details_statusbottom -} - -fn_details_unity3d(){ -fn_check_ip -fn_parms -fn_details_config -fn_details_distro -fn_details_os -fn_details_performance -fn_details_disk -fn_details_gameserver -fn_details_backup -fn_details_commandlineparms -echo -e "" -echo -e "\e[92mPorts\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -echo -e "Change ports by editing the parameters in" -echo -e "${servercfgfullpath}." -echo -e "" -echo -e "Useful port diagnostic command:" -echo -e "netstat -atunp | grep 7DaysToDie" -echo -e "" -{ - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game/RCON\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp" - echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp" -} | column -s $'\t' -t -echo -e "" -echo -e "\e[92m${servername} WebAdmin\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -{ - echo -e "\e[34mWebAdmin enabled:\t\e[0m${webadminenabled}" - echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}" - echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}" -} | column -s $'\t' -t -echo -e "" -echo -e "\e[92m${servername} Telnet\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -{ - echo -e "\e[34mTelnet enabled:\t\e[0m${telnetenabled}" - echo -e "\e[34mTelnet address:\t\e[0m${ip} ${telnetport}" - echo -e "\e[34mTelnet password:\t\e[0m${telnetpass}" -} | column -s $'\t' -t - -fn_details_statusbottom -} - -fn_details_unreal(){ -fn_check_ip -fn_parms -fn_details_config -fn_details_distro -fn_details_os -fn_details_performance -fn_details_disk -fn_details_gameserver -fn_details_backup -fn_details_commandlineparms -echo -e "" -echo -e "\e[92mPorts\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -echo -e "Change ports by editing the parameters in" -echo -e "${servercfgfullpath}." -echo -e "" -echo -e "Useful port diagnostic command:" -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 "> GameSpy query\tINBOUND\t${gsqueryport}\tudp\tOldQueryPortNumber=${gsqueryport}" - 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\tOUTBOUND\t20610\tudp" - else - echo -e "< Steam\tOUTBOUND\t20660\tudp" - fi - fi - echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" -} | column -s $'\t' -t -echo -e "" -echo -e "\e[92m${servername} WebAdmin\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -{ - echo -e "\e[34mWebAdmin enabled:\t\e[0m${webadminenabled}" - echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}" - echo -e "\e[34mWebAdmin username:\t\e[0m${webadminuser}" - echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}" -} | column -s $'\t' -t - -fn_details_statusbottom -} - -fn_details_ark(){ -fn_check_ip -fn_parms -fn_details_config -fn_details_distro -fn_details_os -fn_details_performance -fn_details_disk -fn_details_gameserver -fn_details_backup -fn_details_commandlineparms -echo -e "" -echo -e "\e[92mPorts\e[0m" -printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = -echo -e "Change ports by editing the parameters in" -echo -e "${servercfgfullpath}." -echo -e "" -echo -e "Useful port diagnostic command:" -echo -e "netstat -atunp | grep ShooterGame" -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" -} | column -s $'\t' -t - -fn_details_statusbottom -} - -if [ ! -e "${servercfgfullpath}" ]; then - echo "" - fn_printwarnnl "\e[0;31mCONFIGURATION FILE MISSING!\e[0m" - echo "${servercfgfullpath}" - echo "Some details cannot be displayed" - echo -en ".\r" - sleep 1 - echo -en "..\r" - sleep 1 - echo -en "...\r" - sleep 1 - echo -en " \r" -fi - -fn_details_glibc - -if [ "${engine}" == "avalanche" ]; then - fn_details_avalanche -elif [ "${engine}" == "dontstarve" ]; then - fn_details_dontstarve -elif [ "${engine}" == "projectzomboid" ]; then - fn_details_projectzomboid -elif [ "${engine}" == "realvirtuality" ]; then - fn_details_realvirtuality -elif [ "${engine}" == "seriousengine35" ]; then - fn_details_seriousengine35 -elif [ "${engine}" == "source" ] || [ "${engine}" == "goldsource" ]; then - fn_details_source -elif [ "${engine}" == "spark" ]; then - fn_details_spark -elif [ "${engine}" == "starbound" ]; then - fn_details_starbound -elif [ "${engine}" == "teeworlds" ]; then - fn_details_teeworlds -elif [ "${engine}" == "terraria" ]; then - fn_details_terraria -elif [ "${engine}" == "unity3d" ]; then - fn_details_unity3d -elif [ "${engine}" == "unreal" ] || [ "${engine}" == "unreal2" ]; then - fn_details_unreal -elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then - fn_details_ark -elif [ "${gamename}" == "Teamspeak 3" ]; then - fn_details_teamspeak3 -else - fn_printerrornl "Unable to detect server engine." -fi diff --git a/functions/fn_details_config b/functions/fn_details_config deleted file mode 100644 index d24751f81..000000000 --- a/functions/fn_details_config +++ /dev/null @@ -1,787 +0,0 @@ -#!/bin/bash -# LGSM fn_details_config function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Gets specific details from config files. - -## Examples of filtering to get info from config files -# sed 's/foo//g' - remove foo -# tr -cd '[:digit:]' leave only digits -# tr -d '=\"; ' remove selected charectors =\"; -# grep -v "foo" filter out lines that contain foo - -fn_servercfgfullpath(){ -if [ ! -f "${servercfgfullpath}" ]; then - servercfgfullpath="\e[0;31mMISSING!\e[0m ${servercfgfullpath}" -fi -} - -## Just Cause 2 -if [ "${engine}" == "avalanche" ]; then - - # server name - if [ -f "${servercfgfullpath}" ]; then - servername=$(grep "Name" "${servercfgfullpath}" | sed 's/Name//g' | tr -d '=", \n') - if [ ! -n "${servername}" ]; then - servername="NOT SET" - fi - else - servername="\e[0;31mUNAVAILABLE\e[0m" - fi - - # ip - if [ -f "${servercfgfullpath}" ]; then - # check if the ip exists in the config file. Failing this will fall back to the default. - configipcheck=$(grep "BindIP" "${servercfgfullpath}" | sed 's/BindIP//g' | tr -d '=", \n') - fi - if [ -n "${configipcheck}" ]; then - ip=$(grep "BindIP" "${servercfgfullpath}" | sed 's/BindIP//g' | tr -d '=", \n') - fi - - # server password - if [ -f "${servercfgfullpath}" ]; then - serverpassword=$(grep "Password" "${servercfgfullpath}" | sed 's/Password//g' | tr -d '=", \n') - if [ ! -n "${serverpassword}" ]; then - serverpassword="NOT SET" - fi - else - serverpassword="\e[0;31mUNAVAILABLE\e[0m" - fi - - # slots - if [ -f "${servercfgfullpath}" ]; then - slots=$(grep "MaxPlayers" "${servercfgfullpath}" | tr -cd '[:digit:]') - if [ ! -n "${slots}" ]; then - slots="NOT SET" - fi - else - slots="\e[0;31mUNAVAILABLE\e[0m" - fi - - # port - if [ -f "${servercfgfullpath}" ]; then - port=$(grep "BindPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - fi - if [ ! -n "${port}" ]; then - port="0" - fi - - fn_servercfgfullpath - -## Dont Starve Together -elif [ "${engine}" == "dontstarve" ]; then - - # server name - if [ -f "${servercfgfullpath}" ]; then - servername=$(grep "default_server_name = " "${servercfgfullpath}" | sed 's/default_server_name = //g') - if [ ! -n "${servername}" ]; then - servername="NOT SET" - fi - else - servername="\e[0;31mUNAVAILABLE\e[0m" - fi - - # server password - if [ -f "${servercfgfullpath}" ]; then - serverpassword=$(grep "server_password = " "${servercfgfullpath}" | grep -v "#" | sed 's/server_password = //g') - if [ ! -n "${serverpassword}" ]; then - serverpassword="NOT SET" - fi - else - serverpassword="\e[0;31mUNAVAILABLE\e[0m" - fi - - # slots - if [ -f "${servercfgfullpath}" ]; then - slots=$(grep "max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - if [ ! -n "${slots}" ]; then - slots="NOT SET" - fi - else - slots="\e[0;31mUNAVAILABLE\e[0m" - fi - - # game mode - if [ -f "${servercfgfullpath}" ]; then - gamemode=$(grep "game_mode = " "${servercfgfullpath}" | grep -v "#" | sed 's/game_mode = //g') - if [ ! -n "${gamemode}" ]; then - gamemode="NOT SET" - fi - else - gamemode="\e[0;31mUNAVAILABLE\e[0m" - fi - - # tickrate - if [ -f "${servercfgfullpath}" ]; then - tickrate=$(grep "tick_rate" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - if [ ! -n "${tickrate}" ]; then - tickrate="NOT SET" - fi - else - tickrate="\e[0;31mUNAVAILABLE\e[0m" - fi - - # port - if [ -f "${servercfgfullpath}" ]; then - port=$(grep "server_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - fi - if [ ! -n "${port}" ]; then - port="0" - fi - - fn_servercfgfullpath - -## Project Zomboid -elif [ "${engine}" == "projectzomboid" ]; then - - # server name - if [ -f "${servercfgfullpath}" ]; then - servername=$(grep "PublicName=" "${servercfgfullpath}" | sed 's/PublicName=//g' | tr -d '=", \n') - if [ ! -n "${servername}" ]; then - servername="NOT SET" - fi - else - servername="\e[0;31mUNAVAILABLE\e[0m" - fi - - # slots - if [ -f "${servercfgfullpath}" ]; then - slots=$(grep "MaxPlayers=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - if [ ! -n "${slots}" ]; then - slots="NOT SET" - fi - else - slots="\e[0;31mUNAVAILABLE\e[0m" - fi - - # port - if [ -f "${servercfgfullpath}" ]; then - port=$(grep "DefaultPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') - fi - if [ ! -n "${port}" ]; then - port="0" - fi - - fn_servercfgfullpath - -# ARMA 3 -elif [ "${engine}" == "realvirtuality" ]; then - - # server name - if [ -f "${servercfgfullpath}" ]; then - servername=$(grep "hostname" "${servercfgfullpath}" | grep -v "//" | sed -e 's/\//g' | tr -d '=\"; ') - if [ ! -n "${servername}" ]; then - servername="NOT SET" - fi - else - servername="\e[0;31mUNAVAILABLE\e[0m" - fi - - # admin password - if [ -f "${servercfgfullpath}" ]; then - adminpassword=$(grep "passwordAdmin" "${servercfgfullpath}" | grep -v "//" | sed -e 's/\passwordAdmin//g' | tr -d '=\"; ') - if [ ! -n "${adminpassword}" ]; then - adminpassword="NOT SET" - fi - else - adminpassword="\e[0;31mUNAVAILABLE\e[0m" - fi - - # server password - if [ -f "${servercfgfullpath}" ]; then - serverpassword=$(grep "password =" "${servercfgfullpath}" | grep -v "//" | sed -e 's/\password//g' | tr -d '=\"; ') - if [ ! -n "${serverpassword}" ]; then - serverpassword="NOT SET" - fi - else - serverpassword="\e[0;31mUNAVAILABLE\e[0m" - fi - - # slots - if [ -f "${servercfgfullpath}" ]; then - slots=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - if [ ! -n "${slots}" ]; then - slots="NOT SET" - fi - else - slots="\e[0;31mUNAVAILABLE\e[0m" - fi - - # port - if [ -f "${servercfgfullpath}" ]; then - port=$(grep "serverport=" "${servercfgfullpath}" | grep -v // | tr -d '\r' | tr -cd '[:digit:]') - fi - if [ ! -n "${port}" ]; then - port="0" - fi - - # query port - if [ -f "${servercfgfullpath}" ]; then - queryport=$(grep "steamqueryport=" "${servercfgfullpath}" | grep -v // | tr -d '\r' | tr -cd '[:digit:]') - fi - if [ ! -n "${queryport}" ]; then - queryport="0" - fi - - # master port - if [ -f "${servercfgfullpath}" ]; then - masterport=$(grep "steamport=" "${servercfgfullpath}" | grep -v // | tr -d '\r' | tr -cd '[:digit:]') - fi - if [ ! -n "${masterport}" ]; then - masterport="0" - fi - - fn_servercfgfullpath - -elif [ "${engine}" == "seriousengine35" ]; then - - # server name - if [ -f "${servercfgfullpath}" ]; then - servername=$(grep "prj_strMultiplayerSessionName" "${servercfgfullpath}" | sed 's/prj_strMultiplayerSessionName = //g' | tr -d '=\"; ') - if [ ! -n "${servername}" ]; then - servername="NOT SET" - fi - else - servername="\e[0;31mUNAVAILABLE\e[0m" - fi - - # rcon password - if [ -f "${servercfgfullpath}" ]; then - rconpassword=$(grep "rcts_strAdminPassword" "${servercfgfullpath}" | sed 's/rcts_strAdminPassword = //g' | tr -d '=\"; ') - if [ ! -n "${rconpassword}" ]; then - rconpassword="NOT SET" - fi - else - rconpassword="\e[0;31mUNAVAILABLE\e[0m" - fi - - # slots - if [ -f "${servercfgfullpath}" ]; then - slots=$(grep "gam_ctMaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - if [ ! -n "${slots}" ]; then - slots="NOT SET" - fi - else - slots="\e[0;31mUNAVAILABLE\e[0m" - fi - - # game mode - if [ -f "${servercfgfullpath}" ]; then - gamemode=$(grep "gam_idGameMode" "${servercfgfullpath}" | grep -v "#" | sed 's/gam_idGameMode//g' | tr -d '=\"; ') - if [ ! -n "${gamemode}" ]; then - gamemode="NOT SET" - fi - else - gamemode="\e[0;31mUNAVAILABLE\e[0m" - fi - - # port - if [ -f "${servercfgfullpath}" ]; then - port=$(grep "prj_uwPort" "${servercfgfullpath}" | tr -d '\r' | tr -cd '[:digit:]') - fi - if [ ! -n "${port}" ]; then - port="0" - fi - - # query port - if [ -f "${servercfgfullpath}" ]; then - queryport=$((${port} + 1)) - fi - if [ ! -n "${queryport}" ]; then - queryport="0" - fi - - fn_servercfgfullpath - -elif [ "${engine}" == "source" ] || [ "${engine}" == "goldsource" ]; then - - # server name - if [ -f "${servercfgfullpath}" ]; then - servername=$(grep "hostname" "${servercfgfullpath}" | sed 's/hostname //g' | sed 's/"//g') - if [ ! -n "${servername}" ]; then - servername="NOT SET" - fi - else - servername="\e[0;31mUNAVAILABLE\e[0m" - fi - - # server password - if [ -f "${servercfgfullpath}" ]; then - serverpassword=$(grep "sv_password" "${servercfgfullpath}" | sed 's/sv_password //g' | sed 's/"//g') - if [ ! -n "${serverpassword}" ]; then - serverpassword="NOT SET" - fi - else - serverpassword="\e[0;31mUNAVAILABLE\e[0m" - fi - - # rcon password - if [ -f "${servercfgfullpath}" ]; then - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed 's/rcon_password //g' | sed 's/"//g') - if [ ! -n "${rconpassword}" ]; then - rconpassword="NOT SET" - fi - else - rconpassword="\e[0;31mUNAVAILABLE\e[0m" - fi - - fn_servercfgfullpath - -elif [ "${engine}" == "spark" ]; then - - # query port - if [ -f "${servercfgfullpath}" ]; then - queryport=$((port + 1)) - fi - if [ ! -n "${queryport}" ]; then - queryport="0" - fi - - fn_servercfgfullpath - -elif [ "${gamename}" == "Teamspeak 3" ]; then - - # ip - if [ -f "${servercfgfullpath}" ]; then - # check if the ip exists in the config file. Failing this will fall back to the default. - configipcheck=$(grep "voice_ip=" "${servercfgfullpath}" | sed 's/\voice_ip=//g') - fi - if [ -n "${configipcheck}" ]; then - ip=$(grep "voice_ip=" "${servercfgfullpath}" | sed 's/\voice_ip=//g') - fi - - # dbplugin - if [ -f "${servercfgfullpath}" ]; then - dbplugin=$(grep "dbplugin=" "${servercfgfullpath}" | sed 's/\dbplugin=//g') - if [ ! -n "${dbplugin}" ]; then - dbplugin="NOT SET" - fi - else - dbplugin="\e[0;31mUNAVAILABLE\e[0m" - fi - - # port - if [ -f "${servercfgfullpath}" ]; then - port=$(grep "default_voice_port=" "${servercfgfullpath}" | tr -cd '[:digit:]') - fi - if [ ! -n "${port}" ]; then - port="9987" - fi - - # query port - if [ -f "${servercfgfullpath}" ]; then - queryport=$(grep "query_port=" "${servercfgfullpath}" | tr -cd '[:digit:]') - fi - if [ ! -n "${queryport}" ]; then - queryport="10011" - fi - - # file port - if [ -f "${servercfgfullpath}" ]; then - fileport=$(grep "filetransfer_port=" "${servercfgfullpath}" | tr -cd '[:digit:]') - fi - if [ ! -n "${fileport}" ]; then - fileport="30033" - fi - - fn_servercfgfullpath - -elif [ "${engine}" == "teeworlds" ]; then - - # server name - if [ -f "${servercfgfullpath}" ]; then - servername=$(grep "sv_name" "${servercfgfullpath}" | sed 's/sv_name //g' | sed 's/"//g') - if [ ! -n "${servername}" ]; then - servername="unnamed server" - fi - else - servername="unnamed server" - fi - - # server password - if [ -f "${servercfgfullpath}" ]; then - serverpassword=$(grep "password " "${servercfgfullpath}" | awk '!/sv_rcon_password/'| sed 's/password //g' | tr -d '=\"; ') - if [ ! -n "${serverpassword}" ]; then - serverpassword="NOT SET" - fi - else - serverpassword="\e[0;31mUNAVAILABLE\e[0m" - fi - - # rcon password - if [ -f "${servercfgfullpath}" ]; then - rconpassword=$(grep "sv_rcon_password" "${servercfgfullpath}" | sed 's/sv_rcon_password //g' | tr -d '=\"; ') - if [ ! -n "${rconpassword}" ]; then - rconpassword="NOT SET" - fi - else - rconpassword="\e[0;31mUNAVAILABLE\e[0m" - fi - - # port - if [ -f "${servercfgfullpath}" ]; then - port=$(grep "sv_port" "${servercfgfullpath}" | tr -cd '[:digit:]') - fi - if [ ! -n "${port}" ]; then - port="8303" - fi - - # slots - if [ -f "${servercfgfullpath}" ]; then - slots=$(grep "sv_max_clients" "${servercfgfullpath}" | tr -cd '[:digit:]') - if [ ! -n "${slots}" ]; then - slots="12" - fi - else - slots="12" - fi - - fn_servercfgfullpath - -elif [ "${engine}" == "terraria" ]; then - - # port - if [ -f "${servercfgfullpath}" ]; then - port=$(grep "port=" "${servercfgfullpath}" | tr -cd '[:digit:]') - fi - if [ ! -n "${port}" ]; then - port="0" - fi - -elif [ "${engine}" == "unity3d" ]; then - - # server name - if [ -f "${servercfgfullpath}" ]; then - servername=$(grep "ServerName" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - if [ ! -n "${servername}" ]; then - servername="NOT SET" - fi - else - servername="\e[0;31mUNAVAILABLE\e[0m" - fi - - # server password - if [ -f "${servercfgfullpath}" ]; then - serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - if [ ! -n "${serverpassword}" ]; then - serverpassword="NOT SET" - fi - else - serverpassword="\e[0;31mUNAVAILABLE\e[0m" - fi - - # webadmin enabled - if [ -f "${servercfgfullpath}" ]; then - webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - if [ ! -n "${webadminenabled}" ]; then - webadminenabled="NOT SET" - fi - else - webadminenabled="\e[0;31mUNAVAILABLE\e[0m" - fi - - # webadmin port - if [ -f "${servercfgfullpath}" ]; then - webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - fi - if [ ! -n "${webadminport}" ]; then - webadminport="0" - fi - - # webadmin enabled - if [ -f "${servercfgfullpath}" ]; then - webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - if [ ! -n "${webadminenabled}" ]; then - webadminenabled="NOT SET" - fi - else - webadminenabled="\e[0;31mUNAVAILABLE\e[0m" - fi - - # webadmin password - if [ -f "${servercfgfullpath}" ]; then - webadminpass=$(grep "ControlPanelPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - if [ ! -n "${webadminpass}" ]; then - webadminpass="NOT SET" - fi - else - webadminpass="\e[0;31mUNAVAILABLE\e[0m" - fi - - # telnet enabled - if [ -f "${servercfgfullpath}" ]; then - telnetenabled=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - if [ ! -n "${telnetenabled}" ]; then - telnetenabled="NOT SET" - fi - else - telnetenabled="\e[0;31mUNAVAILABLE\e[0m" - fi - - # telnet port - if [ -f "${servercfgfullpath}" ]; then - telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - fi - if [ ! -n "${telnetport}" ]; then - telnetport="0" - fi - - # telnet password - if [ -f "${servercfgfullpath}" ]; then - telnetpass=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - if [ ! -n "${telnetpass}" ]; then - telnetpass="NOT SET" - fi - else - telnetpass="\e[0;31mUNAVAILABLE\e[0m" - fi - - # slots - if [ -f "${servercfgfullpath}" ]; then - slots=$(grep "ServerMaxPlayerCount" "${servercfgfullpath}" | tr -cd '[:digit:]') - if [ ! -n "${slots}" ]; then - slots="NOT SET" - fi - else - slots="\e[0;31mUNAVAILABLE\e[0m" - fi - - # game mode - if [ -f "${servercfgfullpath}" ]; then - gamemode=$(grep "GameMode" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - if [ ! -n "${gamemode}" ]; then - gamemode="NOT SET" - fi - else - gamemode="\e[0;31mUNAVAILABLE\e[0m" - fi - - # game world - if [ -f "${servercfgfullpath}" ]; then - gameworld=$(grep "GameWorld" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - if [ ! -n "${gameworld}" ]; then - gameworld="NOT SET" - fi - else - gameworld="\e[0;31mUNAVAILABLE\e[0m" - fi - - # port - if [ -f "${servercfgfullpath}" ]; then - port=$(grep "sv_port" "${servercfgfullpath}" | tr -cd '[:digit:]') - fi - if [ ! -n "${port}" ]; then - port="0" - fi - - # query port - if [ -f "${servercfgfullpath}" ]; then - queryport=$((port + 1)) - fi - if [ ! -n "${queryport}" ]; then - queryport="0" - fi - - fn_servercfgfullpath - -elif [ "${engine}" == "unreal" ] || [ "${engine}" == "unreal2" ]; then - - # server name - if [ -f "${servercfgfullpath}" ]; then - servername=$(grep "ServerName=" "${servercfgfullpath}" | sed 's/ServerName=//g') - if [ ! -n "${servername}" ]; then - servername="NOT SET" - fi - else - servername="\e[0;31mUNAVAILABLE\e[0m" - fi - - # server password - if [ -f "${servercfgfullpath}" ]; then - serverpassword=$(grep "GamePassword=" "${servercfgfullpath}" | sed 's/GamePassword=//g') - if [ ! -n "${serverpassword}" ]; then - serverpassword="NOT SET" - fi - else - serverpassword="\e[0;31mUNAVAILABLE\e[0m" - fi - - # admin password - if [ -f "${servercfgfullpath}" ]; then - adminpassword=$(grep "AdminPassword=" "${servercfgfullpath}" | sed 's/AdminPassword=//g') - if [ ! -n "${adminpassword}" ]; then - adminpassword="NOT SET" - fi - else - adminpassword="\e[0;31mUNAVAILABLE\e[0m" - fi - - # port - if [ -f "${servercfgfullpath}" ]; then - port=$(grep "Port=" "${servercfgfullpath}" | grep -v "Master" | grep -v "LAN" | grep -v "Proxy" | grep -v "Listen" | tr -d '\r' | tr -cd '[:digit:]') - fi - if [ ! -n "${port}" ]; then - port="0" - fi - - # query port - if [ -f "${servercfgfullpath}" ]; then - queryport=$((port + 1)) - fi - if [ ! -n "${queryport}" ]; then - queryport="0" - fi - - # gamespy query port - if [ -f "${servercfgfullpath}" ]; then - gsqueryport=$(grep "OldQueryPortNumber=" "${servercfgfullpath}" | tr -d '\r' | tr -cd '[:digit:]') - fi - if [ ! -n "${gsqueryport}" ]; then - gsqueryport="0" - fi - - # query port - if [ -f "${servercfgfullpath}" ]; then - udplinkport=$((port + 2)) - fi - if [ ! -n "${udplinkport}" ]; then - udplinkport="0" - fi - - # webadmin enabled - if [ -f "${servercfgfullpath}" ]; then - webadminenabled=$(grep "bEnabled=" "${servercfgfullpath}" | sed 's/bEnabled=//g' | tr -d '\r') - if [ ! -n "${webadminenabled}" ]; then - webadminenabled="NOT SET" - fi - else - webadminenabled="\e[0;31mUNAVAILABLE\e[0m" - fi - - # webadmin port - if [ -f "${servercfgfullpath}" ]; then - webadminport=$(grep "ListenPort=" "${servercfgfullpath}" | tr -d '\r' | tr -cd '[:digit:]') - fi - if [ ! -n "${webadminport}" ]; then - webadminport="0" - fi - - if [ "${engine}" == "unreal" ]; then - - # webadmin user - if [ -f "${servercfgfullpath}" ]; then - webadminuser=$(grep "AdminUsername=" "${servercfgfullpath}" | sed 's/\AdminUsername=//g') - if [ ! -n "${webadminuser}" ]; then - webadminuser="NOT SET" - fi - else - webadminuser="\e[0;31mUNAVAILABLE\e[0m" - fi - - # webadmin password - if [ -f "${servercfgfullpath}" ]; then - webadminpass=$(grep "UTServerAdmin.UTServerAdmin" "${servercfgfullpath}" -A 2 | grep "AdminPassword=" | sed 's/\AdminPassword=//g') - if [ ! -n "${webadminpass}" ]; then - webadminpass="NOT SET" - fi - else - webadminpass="\e[0;31mUNAVAILABLE\e[0m" - fi - - else - - # webadmin user - if [ -f "${servercfgfullpath}" ]; then - webadminuser=$(grep "AdminName=" "${servercfgfullpath}" | sed 's/\AdminName=//g') - if [ ! -n "${webadminuser}" ]; then - webadminuser="NOT SET" - fi - else - webadminuser="\e[0;31mUNAVAILABLE\e[0m" - fi - - # webadmin password - if [ -f "${servercfgfullpath}" ]; then - webadminpass=$(grep "AdminPassword=" "${servercfgfullpath}" | sed 's/\AdminPassword=//g') - if [ ! -n "${webadminpass}" ]; then - webadminpass="NOT SET" - fi - else - webadminpass="\e[0;31mUNAVAILABLE\e[0m" - fi - - fi - - fn_servercfgfullpath - -elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then - - # server name - if [ -f "${servercfgfullpath}" ]; then - servername=$(grep "SessionName=" "${servercfgfullpath}" | sed 's/SessionName=//g') - if [ ! -n "${servername}" ]; then - servername="NOT SET" - fi - else - servername="\e[0;31mUNAVAILABLE\e[0m" - fi - - # server password - if [ -f "${servercfgfullpath}" ]; then - serverpassword=$(grep "ServerPassword=" "${servercfgfullpath}" | sed 's/ServerPassword=//g') - if [ ! -n "${serverpassword}" ]; then - serverpassword="NOT SET" - fi - else - serverpassword="\e[0;31mUNAVAILABLE\e[0m" - fi - - # admin password - if [ -f "${servercfgfullpath}" ]; then - adminpassword=$(grep "ServerAdminPassword=" "${servercfgfullpath}" | sed 's/ServerAdminPassword=//g') - if [ ! -n "${adminpassword}" ]; then - adminpassword="NOT SET" - fi - else - adminpassword="\e[0;31mUNAVAILABLE\e[0m" - fi - - # slots - if [ -f "${servercfgfullpath}" ]; then - slots=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') - if [ ! -n "${slots}" ]; then - slots="NOT SET" - fi - else - slots="\e[0;31mUNAVAILABLE\e[0m" - fi - - # port - if [ -f "${servercfgfullpath}" ]; then - port=$(grep "Port=" "${servercfgfullpath}" | grep -v "RCONPort=" | grep -v "QueryPort=" | tr -cd '[:digit:]') - fi - if [ ! -n "${port}" ]; then - port="0" - fi - - # rcon port - if [ -f "${servercfgfullpath}" ]; then - rconport=$(grep "RCONPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') - fi - if [ ! -n "${rconport}" ]; then - rconport="0" - fi - - # query port - if [ -f "${servercfgfullpath}" ]; then - queryport=$(grep "QueryPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') - fi - if [ ! -n "${queryport}" ]; then - queryport="0" - fi - - fn_servercfgfullpath - -fi diff --git a/functions/fn_details_distro b/functions/fn_details_distro deleted file mode 100644 index ff9856036..000000000 --- a/functions/fn_details_distro +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash -# LGSM fn_details_distro function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Variables providing useful info on the Operating System such as disk and performace info. -# Used for fn_details, fn_debug and fn_email. - -## Distro infomation -# Returns architecture, kernel and distro/os. -arch=$(uname -m) -kernel=$(uname -r) -if [ -n "$(command -v lsb_release)" ]; then - os=$(lsb_release -s -d) -elif [ -f /etc/debian_version ]; then - os="Debian $(cat /etc/debian_version)" -elif [ -f /etc/redhat-release ]; then - os=$(cat /etc/redhat-release) -else - os="$(uname -s) $(uname -r)" -fi - -# Glibc version number -# e.g: 1.17 -glibcv=$(ldd --version |grep ldd|awk '{print $NF}') - -# tmux version -# e.g: tmux 1.6 -if [ -z "$(command -v tmux)" ]; then - tmuxv="\e[0;31mNOT INSTALLED!\e[0m" -elif [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -lt "16" ]; then - tmuxv="$(tmux -V) (>= 1.6 required for console log)" -else - tmuxv=$(tmux -V) -fi - -## Performance - -# Average server load -load=$(uptime|awk -F 'load average: ' '{ print $2 }') - -# Memory - -# Older versions of free do not support -h option. -if [ "$(free -h > /dev/null 2>&1; echo $?)" -ne "0" ]; then - option="-m" -else - option="-h" -fi -physmemtotal=$(free ${option} | awk '/Mem:/ {print $2}') -physmemused=$(free ${option} | awk '/Mem:/ {print $3}') -physmemfree=$(free ${option} | awk '/Mem:/ {print $4}') -swaptotal=$(free ${option} | awk '/Swap:/ {print $2}') -swapused=$(free ${option} | awk '/Swap:/ {print $3}') -swapfree=$(free ${option} | awk '/Swap:/ {print $4}') - -# Uptime -uptime=$(> "${emaillog}" -if [ ! -z "${consolelog}" ]; then - echo -e "\n\nConsole log\n====================\n" >> "${emaillog}" - tail -25 "${consolelog}" >> "${emaillog}" -fi -if [ ! -z "${gamelogdir}" ]; then - echo -e "\n\nServer log\n====================\n" >> "${emaillog}" - tail "${gamelogdir}"/*|grep -v "==>"|sed '/^$/d'|tail -25 >> "${emaillog}" -fi -mail -s "${subject}" ${email} < "${emaillog}" -fn_printok "Sending notification to ${email}" -fn_scriptlog "Sent notification to ${email}" -sleep 1 -echo -en "\n" diff --git a/functions/fn_email_test b/functions/fn_email_test deleted file mode 100644 index f46924d53..000000000 --- a/functions/fn_email_test +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# LGSM fn_email_test function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Sends a test email notification. - -local modulename="Email" -fn_check_root -fn_check_systemdir -fn_details_config -if [ "${emailnotification}" = "on" ]; then - fn_scriptlog "Sending test notification" - subject="${servicename} Email Test Notification - Testing ${servername}" - failurereason="Testing ${servicename} email notification" - actiontaken="Sent test email...hello is this thing on?" - fn_email -else - fn_printfailnl "Notifications not enabled" - fn_scriptlog "Notifications not enabled" -fi \ No newline at end of file diff --git a/functions/fn_functions b/functions/fn_functions deleted file mode 100644 index 101354460..000000000 --- a/functions/fn_functions +++ /dev/null @@ -1,319 +0,0 @@ -#!/bin/bash -# LGSM fn_functions function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Defines all functions to allow download and execution of functions using fn_runfunction. -# This function is called first before any other function. Without this file other functions would not load. - -fn_backup(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_check_ip(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_check_logs(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_check_root(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_check_steamcmd(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_check_steamuser(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_check_systemdir(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_check_tmux(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_check_ts3status(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_console(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_compress_unreal2maps(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_compress_ut99maps(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_csgofix(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_debug(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_details(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_details_config(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_details_distro(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_details_glibc(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_deps_detect(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_email(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_email_test(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_getopt(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_insfix(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_logs(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_messages(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_monitor(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_monitor_query(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_restart(){ -local modulename="Restarting" -fn_details_config -fn_scriptlog "${servername}" -fn_stop -fn_start -} - -fn_start(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_stop(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_update_check(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_update_functions(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_update_dl(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_update_functions(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_validate(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -# -## Installer functions -# - -fn_autoinstall(){ -autoinstall=1 -fn_install -} - -fn_install(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_complete(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_config(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_glibcfix(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_gsquery(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_gslt(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_header(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_kffix(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_logs(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_retry(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_rofix(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_serverdir(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_serverfiles(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_steamcmd(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_steamfix(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_ts3(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_ut2k4(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_ut2k4filesdl(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_ut2k4fix(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_ut2k4key(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_ut99(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_ut99filesdl(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_install_ut99fix(){ -functionfile="${FUNCNAME}" -fn_runfunction -} - -fn_content_gmod(){ -functionfile="${FUNCNAME}" -fn_update_check -fn_runfunction -} - -# Calls on-screen messages -fn_messages diff --git a/functions/fn_getopt b/functions/fn_getopt deleted file mode 100644 index f35afa848..000000000 --- a/functions/fn_getopt +++ /dev/null @@ -1,449 +0,0 @@ -#!/bin/bash -# LGSM fn_getopt function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: getopt arguments. - -fn_getopt_generic(){ -case "$getopt" in - st|start) - fn_start;; - sp|stop) - fn_stop;; - r|restart) - fn_restart;; - u|update) - fn_update_check;; - fu|force-update|update-restart) - forceupdate=1; - fn_update_check;; - uf|update-functions) - fn_update_functions;; - v|validate) - fn_validate;; - m|monitor) - fn_monitor;; - et|email-test) - fn_email_test;; - d|details) - fn_details;; - b|backup) - fn_backup;; - c|console) - fn_console;; - d|debug) - fn_debug;; - i|install) - fn_install;; - ai|auto-install) - fn_autoinstall;; - dd|depsdetect) - fn_deps_detect;; - *) - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "http://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "\e[93mCommands\e[0m" - { - echo -e "\e[34mstart\t\e[0mStart the server." - echo -e "\e[34mstop\t\e[0mStop the server." - echo -e "\e[34mrestart\t\e[0mRestart the server." - echo -e "\e[34mupdate\t\e[0mChecks and applies updates from SteamCMD." - echo -e "\e[34mforce-update\t\e[0mBypasses the check and applies updates from SteamCMD." - echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." - echo -e "\e[34mvalidate\t\e[0mValidate server files with SteamCMD." - echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." - echo -e "\e[34memail-test\t\e[0mSends test monitor email." - echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." - echo -e "\e[34mbackup\t\e[0mCreate archive of the server." - echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." - echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." - echo -e "\e[34minstall\t\e[0mInstall the server." - echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts." - } | column -s $'\t' -t - esac -exit -} - -fn_getopt_teamspeak3(){ -case "$getopt" in - st|start) - fn_start;; - sp|stop) - fn_stop;; - r|restart) - fn_restart;; - u|update) - fn_update_check;; - uf|update-functions) - fn_update_functions;; - m|monitor) - fn_monitor;; - et|email-test) - fn_email_test;; - d|details) - fn_details;; - b|backup) - fn_backup;; - i|install) - fn_install;; - ai|auto-install) - fn_autoinstall;; - dd|depsdetect) - fn_deps_detect;; - *) - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "http://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "\e[93mCommands\e[0m" - { - echo -e "\e[34mstart\t\e[0mStart the server." - echo -e "\e[34mstop\t\e[0mStop the server." - echo -e "\e[34mrestart\t\e[0mRestart the server." - echo -e "\e[34mupdate\t\e[0mChecks and applies updates from teamspeak.com." - echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." - echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." - echo -e "\e[34memail-test\t\e[0mSends test monitor email." - echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." - echo -e "\e[34mbackup\t\e[0mCreate archive of the server." - echo -e "\e[34minstall\t\e[0mInstall the server." - echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts." - } | column -s $'\t' -t - esac -exit -} - -fn_getopt_mumble(){ -case "$getopt" in - st|start) - fn_start;; - sp|stop) - fn_stop;; - r|restart) - fn_restart;; - uf|update-functions) - fn_update_functions;; - m|monitor) - fn_monitor;; - et|email-test) - fn_email_test;; - b|backup) - fn_backup;; - console) - fn_console;; - d|debug) - fn_debug;; - dd|depsdetect) - fn_deps_detect;; - *) - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "http://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "\e[93mCommands\e[0m" - { - echo -e "\e[34mstart\t\e[0mStart the server." - echo -e "\e[34mstop\t\e[0mStop the server." - echo -e "\e[34mrestart\t\e[0mRestart the server." - echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." - echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." - echo -e "\e[34memail-test\t\e[0mSends test monitor email." - echo -e "\e[34mbackup\t\e[0mCreate archive of the server." - echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." - echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." - } | column -s $'\t' -t - esac -exit -} - -fn_getopt_gmodserver(){ -case "$getopt" in - st|start) - fn_start;; - sp|stop) - fn_stop;; - r|restart) - fn_restart;; - u|update) - fn_update_check;; - fu|force-update|update-restart) - forceupdate=1; - fn_update_check;; - uf|update-functions) - fn_update_functions;; - v|validate) - fn_validate;; - m|monitor) - fn_monitor;; - et|email-test) - fn_email_test;; - d|details) - fn_details;; - b|backup) - fn_backup;; - c|console) - fn_console;; - d|debug) - fn_debug;; - i|install) - fn_install;; - ai|auto-install) - fn_autoinstall;; - dd|depsdetect) - fn_deps_detect;; - co|content) - fn_content_gmod;; - ica|install-content-all) - gmod-content-mode=0 - fn_content_gmod;; - iccss|install-content-css) - gmod-content-mode=1 - fn_content_gmod;; - ictf2|install-content-tf2) - gmod-content-mode=2 - fn_content_gmod;; - icp2|install-content-p2) - gmod-content-mode=3 - fn_content_gmod;; - rca|remove-content-all) - gmod-content-mode=4 - fn_content_gmod;; - rccss|remove-content-css) - gmod-content-mode=5 - fn_content_gmod;; - rctf2|remove-content-tf2) - gmod-content-mode=6 - fn_content_gmod;; - rcp2|remove-content-p2) - gmod-content-mode=7 - fn_content_gmod;; - uc|update-content) - gmod-content-mode=7 - fn_content_gmod;; - vc|validate-content) - gmod-content-mode=8 - fn_content_gmod;; - *) - } | column -s $'\t' -t - esac -exit - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "http://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "\e[93mCommands\e[0m" - { - echo -e "\e[34mstart\t\e[0mStart the server." - echo -e "\e[34mstop\t\e[0mStop the server." - echo -e "\e[34mrestart\t\e[0mRestart the server." - echo -e "\e[34mupdate\t\e[0mChecks and applies updates from SteamCMD." - echo -e "\e[34mforce-update\t\e[0mBypasses the check and applies updates from SteamCMD." - echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." - echo -e "\e[34mvalidate\t\e[0mValidate server files with SteamCMD." - echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." - echo -e "\e[34memail-test\t\e[0mSends test monitor email." - echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." - echo -e "\e[34mbackup\t\e[0mCreate archive of the server." - echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." - echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." - echo -e "\e[34minstall\t\e[0mInstall the server." - echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts." - echo -e "\e[34mgmod-content\t\e[0mDownload gmod add-on content." - echo -e "\e[34mcontent\t\e[0mList options for content mounting on ${gamename} server." - } | column -s $'\t' -t - esac -exit -} - -fn_getopt_unreal(){ -case "$getopt" in - st|start) - fn_start;; - sp|stop) - fn_stop;; - r|restart) - fn_restart;; - uf|update-functions) - fn_update_functions;; - m|monitor) - fn_monitor;; - et|email-test) - fn_email_test;; - d|details) - fn_details;; - b|backup) - fn_backup;; - c|console) - fn_console;; - d|debug) - fn_debug;; - i|install) - fn_install;; - mc|map-compressor) - fn_compress_ut99maps;; - dd|depsdetect) - fn_deps_detect;; - *) - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "http://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "\e[93mCommands\e[0m" - { - echo -e "\e[34mstart\t\e[0mStart the server." - echo -e "\e[34mstop\t\e[0mStop the server." - echo -e "\e[34mrestart\t\e[0mRestart the server." - echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." - echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." - echo -e "\e[34memail-test\t\e[0mSends test monitor email." - echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." - echo -e "\e[34mbackup\t\e[0mCreate archive of the server." - echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." - echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." - echo -e "\e[34minstall\t\e[0mInstall the server." - echo -e "\e[34mmap-compressor\t\e[0mCompresses all ${gamename} server maps." - } | column -s $'\t' -t - esac -exit -} - - -fn_getopt_unreal2(){ -case "$getopt" in - st|start) - fn_start;; - sp|stop) - fn_stop;; - r|restart) - fn_restart;; - u|update) - fn_update_check;; - fu|force-update|update-restart) - forceupdate=1; - fn_update_check;; - uf|update-functions) - fn_update_functions;; - v|validate) - fn_validate;; - m|monitor) - fn_monitor;; - et|email-test) - fn_email_test;; - d|details) - fn_details;; - b|backup) - fn_backup;; - c|console) - fn_console;; - d|debug) - fn_debug;; - i|install) - fn_install;; - ai|auto-install) - fn_autoinstall;; - dd|depsdetect) - fn_deps_detect;; - mc|map-compressor) - fn_compress_unreal2maps;; - *) - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "http://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "\e[93mCommands\e[0m" - { - echo -e "\e[34mstart\t\e[0mStart the server." - echo -e "\e[34mstop\t\e[0mStop the server." - echo -e "\e[34mrestart\t\e[0mRestart the server." - echo -e "\e[34mupdate\t\e[0mChecks and applies updates from SteamCMD." - echo -e "\e[34mforce-update\t\e[0mBypasses the check and applies updates from SteamCMD." - echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." - echo -e "\e[34mvalidate\t\e[0mValidate server files with SteamCMD." - echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." - echo -e "\e[34memail-test\t\e[0mSends test monitor email." - echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." - echo -e "\e[34mbackup\t\e[0mCreate archive of the server." - echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." - echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." - echo -e "\e[34minstall\t\e[0mInstall the server." - echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts." - echo -e "\e[34mmap-compressor\t\e[0mCompresses all ${gamename} server maps." - } | column -s $'\t' -t - esac -exit -} - - -fn_getopt_ut2k4(){ -case "$getopt" in - st|start) - fn_start;; - sp|stop) - fn_stop;; - r|restart) - fn_restart;; - uf|update-functions) - fn_update_functions;; - m|monitor) - fn_monitor;; - et|email-test) - fn_email_test;; - d|details) - fn_details;; - b|backup) - fn_backup;; - c|console) - fn_console;; - d|debug) - fn_debug;; - i|install) - fn_install;; - mc|map-compressor) - fn_compress_ut99maps;; - dd|depsdetect) - fn_deps_detect;; - *) - echo "Usage: $0 [option]" - echo "${gamename} - Linux Game Server Manager - Version ${version}" - echo "http://gameservermanagers.com/${selfname}" - echo -e "" - echo -e "\e[93mCommands\e[0m" - { - echo -e "\e[34mstart\t\e[0mStart the server." - echo -e "\e[34mstop\t\e[0mStop the server." - echo -e "\e[34mrestart\t\e[0mRestart the server." - echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." - echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." - echo -e "\e[34memail-test\t\e[0mSends test monitor email." - echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." - echo -e "\e[34mbackup\t\e[0mCreate archive of the server." - echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." - echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." - echo -e "\e[34minstall\t\e[0mInstall the server." - echo -e "\e[34mmap-compressor\t\e[0mCompresses all ${gamename} server maps." - } | column -s $'\t' -t - esac -exit -} - -if [ "${gamename}" == "Mumble" ]; then - fn_getopt_mumble -elif [ "${gamename}" == "Teamspeak 3" ]; then - fn_getopt_teamspeak3 -elif [ "${engine}" == "unreal2" ]; then - if [ "${gamename}" == "Unreal Tournament 2004" ]; then - fn_getopt_ut2k4 - else - fn_getopt_unreal2 - fi -elif [ "${engine}" == "unreal" ]; then - fn_getopt_unreal -elif [ "$gamename" == "Garry's Mod" ]; then - fn_getopt_gmodserver -else - fn_getopt_generic -fi diff --git a/functions/fn_insfix b/functions/fn_insfix deleted file mode 100644 index 8a583078c..000000000 --- a/functions/fn_insfix +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# LGSM fn_insfix function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="110415" - -# Description: Resolves ./srcds_linux: error while loading shared libraries: libtier0.so: cannot open shared object file: No such file or directory - -export LD_LIBRARY_PATH=:${filesdir}:${filesdir}/bin:{$LD_LIBRARY_PATH} - -# fix for issue #529 - gamemode not passed to debug or start - -if [ "${getopt}" == "debug" ]; then - defaultmap="\"${defaultmap}\"" -else - defaultmap="\\\"${defaultmap}\\\"" -fi -fn_parms diff --git a/functions/fn_install b/functions/fn_install deleted file mode 100644 index 7c47a6b9b..000000000 --- a/functions/fn_install +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# LGSM fn_install function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -fn_check_root -fn_install_header -if [ -z "${autoinstall}" ]; then - fn_install_serverdir - fn_install_header -fi -# Download and install -if [ "${gamename}" == "Unreal Tournament 2004" ]; then - fn_install_ut2k4filesdl - fn_install_ut2k4 - fn_install_ut2k4key -elif [ "${gamename}" == "Unreal Tournament 99" ]; then - fn_install_ut99filesdl - fn_install_ut99 -elif [ "${gamename}" == "Teamspeak 3" ]; then - fn_install_ts3 -elif [ ! -z "${appid}" ]; then - fn_install_steamcmd - fn_install_serverfiles - fn_install_steamfix -fi - -# Configuration -fn_install_glibcfix -fn_install_logs -fn_install_gsquery -fn_install_config -if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then - fn_install_gslt - fn_csgofix -elif [ "${gamename}" == "Team Fortress 2" ]; then - fn_install_gslt -elif [ "${gamename}" == "Killing Floor" ]; then - fn_install_kffix -elif [ "${gamename}" == "Red Orchestra: Ostfront 41-45" ]; then - fn_install_rofix -elif [ "${gamename}" == "Unreal Tournament 2004" ]; then - fn_install_ut2k4fix -elif [ "${gamename}" == "Unreal Tournament 99" ]; then - fn_install_ut99fix -fi -fn_install_complete \ No newline at end of file diff --git a/functions/fn_install_complete b/functions/fn_install_complete deleted file mode 100644 index a9690d5ac..000000000 --- a/functions/fn_install_complete +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# LGSM fn_install_complete function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -if [ "${gamename}" == "Dont Starve Together" ]; then - echo "" - echo "An Authentication Token is required to run this server!" - echo "Follow the instructions in this link to obtain this key" - echo " http://gameservermanagers.com/dst-auth-token" -fi -echo "=================================" -echo "Install Complete!" -echo "" -echo "To start server type:" -echo "./${selfname} start" -echo "" diff --git a/functions/fn_install_config b/functions/fn_install_config deleted file mode 100644 index 39e95516f..000000000 --- a/functions/fn_install_config +++ /dev/null @@ -1,330 +0,0 @@ -#!/bin/bash -# LGSM fn_install_config function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -fn_defaultconfig(){ -echo "creating ${servercfg} config file." -cp -v "${servercfgdefault}" "${servercfgfullpath}" -sleep 1 -} - -fn_userinputconfig(){ -# allow user to input server name and password -if [ -z "${autoinstall}" ]; then - echo "" - echo "Configuring ${gamename} Server" - echo "=================================" - sleep 1 - read -p "Enter server name: " servername - read -p "Enter rcon password: " rconpass -else - servername="${servicename}" - rconpass="rconpassword" -fi -echo "changing hostname." -sed -i "s/\"\"/\"${servername}\"/g" "${servercfgfullpath}" -sleep 1 -echo "changing rconpassword." -sed -i "s/\"\"/\"${rconpass}\"/g" "${servercfgfullpath}" -sleep 1 -} - -fn_arma3config(){ -fn_defaultconfig -echo "creating ${networkcfg} config file." -cp -v "${networkcfgdefault}" "${networkcfgfullpath}" -sleep 1 -echo "" -} - -fn_goldsourceconfig(){ -fn_defaultconfig - -# server.cfg redirects to ${servercfg} for added security -echo "creating server.cfg." -touch "server.cfg" -sleep 1 -echo "creating redirect." -echo "server.cfg > ${servercfg}." -echo "exec ${servercfg}" > "server.cfg" -sleep 1 - -# creating other files required -echo "creating listip.cfg." -touch "${systemdir}/listip.cfg" -sleep 1 -echo "creating banned.cfg." -touch "${systemdir}/banned.cfg" -sleep 1 - -fn_userinputconfig -echo "" -} - -fn_serious3config(){ -fn_defaultconfig -echo "" -echo "To edit ${gamename} server config use SS3 Server GUI 3 tool" -echo "http://mrag.nl/sgui3/" -sleep 1 -echo "" -} - -fn_sourceconfig(){ -fn_defaultconfig - -# server.cfg redirects to ${servercfg} for added security -echo "creating server.cfg." -touch "server.cfg" -sleep 1 -echo "creating redirect." -echo "server.cfg > ${servercfg}." -echo "exec ${servercfg}" > "server.cfg" -sleep 1 - -fn_userinputconfig -echo "" -} - -fn_teeworldsconfig(){ -fn_defaultconfig - -echo "adding logfile location to config." -sed -i "s@\"\"@\"${gamelog}\"@g" "${servercfgfullpath}" -sleep 1 -echo "removing password holder." -sed -i "s///" "${servercfgfullpath}" -sleep 1 - -fn_userinputconfig -echo "" -} - -fn_ts3config(){ -echo "creating blank ${servercfg} config file." -sleep 1 -echo "${servercfg} can remain blank by default." -sleep 1 -echo "${servercfg} is located in ${servercfgfullpath}." -sleep 1 -touch "${servercfgfullpath}" -} - -fn_ut99config(){ -echo "${defaultcfg} > ${servercfgfullpath}" -tr -d '\r' < "${servercfgdefault}" > "${servercfgfullpath}" -sleep 1 -echo "" -echo "Configuring ${gamename} Server" -echo "=================================" -sleep 1 -echo "enabling WebAdmin." -sed -i 's/bEnabled=False/bEnabled=True/g' "${servercfgfullpath}" -sleep 1 -echo "setting WebAdmin port to 8076." -sed -i '467i\ListenPort=8076' "${servercfgfullpath}" -sleep 1 -echo "" -} - -fn_unreal2config(){ -fn_defaultconfig -echo "" -echo "Configuring ${gamename} Server" -echo "=================================" -sleep 1 -echo "setting WebAdmin username and password." -sed -i 's/AdminName=/AdminName=admin/g' "${servercfgfullpath}" -sed -i 's/AdminPassword=/AdminPassword=admin/g' "${servercfgfullpath}" -sleep 1 -echo "enabling WebAdmin." -sed -i 's/bEnabled=False/bEnabled=True/g' "${servercfgfullpath}" -if [ "${gamename}" == "Unreal Tournament 2004" ]; then - sleep 1 - echo "setting WebAdmin port to 8075." - sed -i 's/ListenPort=80/ListenPort=8075/g' "${servercfgfullpath}" -fi -sleep 1 -echo "" -} - -echo "" -echo "Creating Configs" -echo "=================================" -sleep 1 -if [ ! -d "${servercfgdir}" ]; then - echo -e "creating ${servercfgdir} dir...\c" - mkdir -pv "${servercfgdir}" - if [[ $? == 0 ]]; then - echo -e "OK" - else - echo -e "FAIL" - fi -fi - -cd "${servercfgdir}" - -githuburl="https://raw.githubusercontent.com/dgibbs64/linuxgsm/master" - -if [ "${gamename}" == "7 Days To Die" ]; then - fn_defaultconfig -elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then - wget -N /dev/null ${githuburl}/ARKSurvivalEvolved/cfg/lgsm-default.ini 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - echo -e "downloading lgsm-default.ini...\c" - fn_defaultconfig -elif [ "${gamename}" == "ARMA 3" ]; then - echo -e "downloading lgsm-default.server.cfg...\c" - wget -N /dev/null ${githuburl}/Arma3/cfg/lgsm-default.server.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - echo -e "downloading lgsm-default.network.cfg...\c" - wget -N /dev/null ${githuburl}/Arma3/cfg/lgsm-default.network.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_arma3config -elif [ "${gamename}" == "Black Mesa: Deathmatch" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/BlackMesa/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_sourceconfig -elif [ "${gamename}" == "Blade Symphony" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/BladeSymphony/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_goldsourceconfig -elif [ "${gamename}" == "Counter Strike 1.6" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/CounterStrike/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_goldsourceconfig -elif [ "${gamename}" == "Counter Strike: Condition Zero" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/CounterStrikeConditionZero/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_goldsourceconfig -elif [ "${gamename}" == "Counter Strike: Global Offensive" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/CounterStrikeGlobalOffensive/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_sourceconfig -elif [ "${gamename}" == "Counter Strike: Source" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/CounterStrikeSource/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_sourceconfig -elif [ "${gamename}" == "Day of Defeat" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/DayOfDefeat/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_goldsourceconfig -elif [ "${gamename}" == "Day of Defeat: Source" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/DayOfDefeatSource/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_sourceconfig -elif [ "${gamename}" == "Dont Starve Together" ]; then - echo -e "downloading lgsm-default.ini...\c" - wget -N /dev/null ${githuburl}/DontStarveTogether/lgsm-default.ini 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_defaultconfig -elif [ "${gamename}" == "Double Action: Boogaloo" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/DoubleActionBoogaloo/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_sourceconfig -elif [ "${gamename}" == "Fistful of Frags" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/FistfulOfFrags/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_sourceconfig -elif [ "${gamename}" == "Garry's Mod" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/GarrysMod/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_sourceconfig -elif [ "${gamename}" == "Half Life 2: Deathmatch" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/HalfLife2Deathmatch/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_sourceconfig -elif [ "${gamename}" == "Half Life: Deathmatch Classic" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/HalfLifeDeathmatchClassic/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_goldsourceconfig -elif [ "${gamename}" == "Insurgency" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/Insurgency/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_sourceconfig -elif [ "${gamename}" == "Just Cause 2" ]; then - fn_defaultconfig -elif [ "${gamename}" == "Killing Floor" ]; then - fn_unreal2config -elif [ "${gamename}" == "Left 4 Dead" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/Left4Dead/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_sourceconfig -elif [ "${gamename}" == "Left 4 Dead 2" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/Left4Dead2/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_sourceconfig -elif [ "${gamename}" == "No More Room in Hell" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/NoMoreRoomInHell/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_sourceconfig -elif [ "${gamename}" == "Natural Selection 2" ]; then - echo -e "no configs required." - sleep 1 - echo "" -elif [ "${gamename}" == "Pirates, Vikings, and Knights II" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/PiratesVikingandKnightsII/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_sourceconfig -elif [ "${gamename}" == "Red Orchestra: Ostfront 41-45" ]; then - fn_unreal2config -elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then - echo -e "downloading lgsm-default.ini...\c" - wget -N /dev/null ${githuburl}/SeriousSam3BFE/cfg/lgsm-default.ini 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_serious3config -elif [ "${gamename}" == "Teamspeak 3" ]; then - fn_ts3config -elif [ "${gamename}" == "Team Fortress 2" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/TeamFortress2/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_sourceconfig -elif [ "${gamename}" == "Team Fortress Classic" ]; then - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/TeamFortressClassic/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_goldsourceconfig -elif [ "${gamename}" == "Teeworlds" ]; then - echo -e "downloading ctf.cfg...\c" - wget -N /dev/null ${githuburl}/Teeworlds/cfg/ctf.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - echo -e "downloading dm.cfg...\c" - wget -N /dev/null ${githuburl}/Teeworlds/cfg/dm.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - echo -e "downloading duel.cfg...\c" - wget -N /dev/null ${githuburl}/Teeworlds/cfg/duel.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - echo -e "downloading tdm.cfg...\c" - wget -N /dev/null ${githuburl}/Teeworlds/cfg/tdm.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - echo -e "downloading lgsm-default.cfg...\c" - wget -N /dev/null ${githuburl}/Teeworlds/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_teeworldsconfig -elif [ "${gamename}" == "Terraria" ]; then - echo -e "downloading lgsm-default.txt...\c" - wget -N /dev/null ${githuburl}/Terraria/cfg/lgsm-default.txt 2>&1 | grep -F HTTP | cut -c45- | uniq - sleep 1 - fn_defaultconfig -elif [ "${gamename}" == "Unreal Tournament 2004" ]; then - fn_unreal2config -elif [ "${gamename}" == "Unreal Tournament 99" ]; then - fn_ut99config -fi diff --git a/functions/fn_install_glibcfix b/functions/fn_install_glibcfix deleted file mode 100644 index 0db2c48eb..000000000 --- a/functions/fn_install_glibcfix +++ /dev/null @@ -1,136 +0,0 @@ -#!/bin/bash -# LGSM fn_install_glibcfix function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -fn_glibcfixmsg(){ -echo "" -echo "GLIBC Fix required" -echo "============================" -sleep 1 -fn_printwarningnl "${gamename} requires GLIBC_${glibcversion} or above" -sleep 1 -echo "" -echo -e "Currently installed:\e[0;31m GLIBC_$(ldd --version |grep ldd|awk '{print $NF}')\e[0;39m" -echo -e "Required: =>\e[0;32m GLIBC_${glibcversion}\e[0;39m" -echo "" -sleep 1 -echo "The installer will now detect and download the required files to allow ${gamename} server to run on a distro with less than GLIBC_${glibcversion}." -echo "note: This will NOT upgrade GLIBC on your system." -echo "" -echo "http://gameservermanagers.com/glibcfix" -sleep 1 -echo "" -echo -en "loading required files.\r" -sleep 1 -echo -en "loading required files..\r" -sleep 1 -echo -en "loading required files...\r" -sleep 1 -echo -en "\n" -} - -# if ldd command not detected -if [ -z $(command -v ldd) ]; then - echo "" - fn_printfailurenl "GLIBC is not detected" - sleep 1 - echo "Install GLIBC and retry installation." - sleep 1 - echo "" - while true; do - read -e -i "y" -p "Continue install? [Y/n]" yn - case $yn in - [Yy]* ) break;; - [Nn]* ) echo Exiting; exit;; - * ) echo "Please answer yes or no.";; - esac - done -# if Glibc less than 1.15 -elif [ "$(ldd --version | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" -lt 215 ]; then - # Blade Symphony - if [ "${gamename}" == "Blade Symphony" ]; then - glibcversion="2.15" - fn_glibcfixmsg - cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" - # Double Action: Boogaloo - elif [ "${gamename}" == "Double Action: Boogaloo" ]; then - glibcversion="2.15" - fn_glibcfixmsg - cd "${filesdir}" - wget -nv -N https://github.com/dgibbs64/linuxgsm/blob/master/DoubleActionBoogaloo/dependencies/libm.so.6 - # Fistful of Frags - elif [ "${gamename}" == "Fistful of Frags" ]; then - glibcversion="2.15" - fn_glibcfixmsg - cd "${filesdir}" - wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/FistfulOfFrags/dependencies/libm.so.6 - # Garry's Mod - elif [ "${gamename}" == "Garry's Mod" ]; then - glibcversion="2.15" - fn_glibcfixmsg - cd "${filesdir}/bin" - wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/GarrysMod/dependencies/libc.so.6 - wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/GarrysMod/dependencies/libm.so.6 - wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/GarrysMod/dependencies/libpthread.so.0 - cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" - # Insurgency - elif [ "${gamename}" == "Insurgency" ]; then - glibcversion="2.15" - fn_glibcfixmsg - cd "${filesdir}/bin" - wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/libc.so.6 - wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/libm.so.6 - wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/librt.so.1 - wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/libpthread.so.0 - elif [ "${gamename}" == "Left 4 Dead" ]; then - glibcversion="2.07" - fn_glibcfixmsg - cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/bin/libstdc++.so.6" - # Natural Selection 2 - elif [ "${gamename}" == "Natural Selection 2" ]; then - glibcversion="2.15" - fn_glibcfixmsg - cd "${filesdir}" - wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/NaturalSelection2/dependencies/libm.so.6 - cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" - # NS2: Combat - elif [ "${gamename}" == "NS2: Combat" ]; then - glibcversion="2.15" - fn_glibcfixmsg - cd "${filesdir}" - wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/NS2Combat/dependencies/libm.so.6 - cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" - # No More Room in Hell - elif [ "${gamename}" == "No More Room in Hell" ]; then - glibcversion="2.15" - fn_glibcfixmsg - cd "${filesdir}" - wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/NoMoreRoomInHell/dependencies/libm.so.6 - cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" - # if Glibc less than 1.13 - elif [ "$(ldd --version | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" -lt 213 ]; then - # ARMA 3 - if [ "${gamename}" == "ARMA 3" ]; then - glibcversion="2.13" - fn_glibcfixmsg - cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" - # Just Cause 2 - elif [ "${gamename}" == "Just Cause 2" ]; then - glibcversion="2.13" - fn_glibcfixmsg - cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" - # Serious Sam 3: BFE - elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then - glibcversion="2.13" - fn_glibcfixmsg - cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/Bin/libstdc++.so.6" - else - : # Else glibcfix not required. - fi - else - : #Else glibcfix not required. - fi -fi -sleep 1 diff --git a/functions/fn_install_gslt b/functions/fn_install_gslt deleted file mode 100644 index e03b356b1..000000000 --- a/functions/fn_install_gslt +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# LGSM fn_install_gslt function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="091215" - -# Description: Configures GSLT. - -if [ -z "${autoinstall}" ]; then - echo "" - echo "Game Server Login Token" - echo "============================" - sleep 1 - if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then - echo "GSLT is required to run a public ${gamename} server" - else - echo "GSLT is an optional feature for ${gamename} server" - fi - - echo "Get more info and a token here:" - echo "http://gameservermanagers.com/gslt" - echo "" - echo "Enter token below (Can be blank)." - echo -n "GSLT TOKEN: " - read token - sed -i -e "s/gslt=\"\"/gslt=\"${token}\"/g" "${rootdir}/${selfname}" - sleep 1 - echo "The GSLT can be changed by editing ${selfname}." - echo "" -else - if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then - fn_printinfomationnl "GSLT is required to run a public ${gamename} server" - else - fn_printinfomationnl "GSLT is an optional feature for ${gamename} server" - fi - echo "Get more info and a token here:" - echo "http://gameservermanagers.com/gslt" - echo "" - sleep 1 - echo "The GSLT can be changed by editing ${selfname}." - sleep 1 -fi \ No newline at end of file diff --git a/functions/fn_install_gsquery b/functions/fn_install_gsquery deleted file mode 100644 index 3f5bfcebf..000000000 --- a/functions/fn_install_gsquery +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# LGSM fn_install_gsquery function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -fn_dlgsquery(){ -cd "${rootdir}" -echo -e "downloading gsquery.py...\c" -wget -N /dev/null "http://gameservermanagers.com/dl/gsquery.py" 2>&1 | grep -F "HTTP" | grep -v "Moved Permanently" | cut -c45- | uniq -chmod +x gsquery.py -} - -if [ "${engine}" == "avalanche" ]||[ "${engine}" == "goldsource" ]||[ "${engine}" == "realvirtuality" ]||[ "${engine}" == "source" ]||[ "${engine}" == "spark" ]||[ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then - echo "" - echo "GameServerQuery" - echo "============================" - if [ -z ${autoinstall} ]; then - while true; do - read -e -i "y" -p "Do you want to install GameServerQuery? [Y/n]" yn - case $yn in - [Yy]* ) fn_dlgsquery;break;; - [Nn]* ) echo ""; echo "Not installing GameServerQuery.";break;; - * ) echo "Please answer yes or no.";; - esac - done - else - fn_dlgsquery - fi -fi diff --git a/functions/fn_install_header b/functions/fn_install_header deleted file mode 100644 index 42daa46cd..000000000 --- a/functions/fn_install_header +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# LGSM fn_install_header function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -clear -echo "=================================" -echo "${gamename}" -echo "Linux Game Server Manager" -echo "by Daniel Gibbs" -if [ "${gamename}" == "ARMA 3" ]; then - echo "contributions by Scarsz" -elif [ "${gamename}" == "Left 4 Dead" ]; then - echo "contributions by Summit Singh Thakur" -fi -echo "http://gameservermanagers.com" -echo "=================================" \ No newline at end of file diff --git a/functions/fn_install_kffix b/functions/fn_install_kffix deleted file mode 100644 index b3e484a2f..000000000 --- a/functions/fn_install_kffix +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# LGSM fn_install_kffix function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -echo "Applying ${gamename} Server Fixes" -echo "=================================" -echo "Applying WebAdmin ROOst.css fix." -echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" -sed -i 's/none}/none;/g' "${filesdir}/Web/ServerAdmin/ROOst.css" -sed -i 's/underline}/underline;/g' "${filesdir}/Web/ServerAdmin/ROOst.css" -sleep 1 -echo "Applying WebAdmin CharSet fix." -echo "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" -sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/UWeb.int" -sleep 1 -echo "applying server name fix." -sleep 1 -echo "forcing server restart..." -sleep 1 -fn_start -sleep 5 -fn_stop -fn_start -sleep 5 -fn_stop \ No newline at end of file diff --git a/functions/fn_install_logs b/functions/fn_install_logs deleted file mode 100644 index 7cb81e9ab..000000000 --- a/functions/fn_install_logs +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# LGSM fn_install_logs function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -if [ "${checklogs}" != "1" ]; then - echo "" - echo "Creating log directorys" - echo "=================================" -fi -sleep 1 -# Create dir's for the script and console logs -mkdir -v "${rootdir}/log" -mkdir -v "${scriptlogdir}" -touch "${scriptlog}" -if [ -n "${consolelogdir}" ]; then - mkdir -v "${consolelogdir}" - touch "${consolelog}" -fi - -# If a server is source or goldsource, Teamspeak 3, Starbound, Project Zomhoid create a symbolic link to the game server logs. -if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]||[ "${gamename}" == "Teamspeak 3" ]||[ "${engine}" == "starbound" ]||[ "${engine}" == "projectzomboid" ]; then - if [ ! -h "${rootdir}/log/server" ]; then - ln -nfsv "${gamelogdir}" "${rootdir}/log/server" - fi -fi - -# If a server is unreal2 or unity3d create a dir. -if [ "${engine}" == "unreal2" ]||[ "${engine}" == "unity3d" ]||[ "${gamename}" == "Teeworlds" ]; then - mkdir -pv "${gamelogdir}" -fi - -# If a server is 7 Days to Die. -if [ "${gamename}" == "7 Days To Die" ]; then - if [ ! -h "${gamelogdir}/output_log.txt" ]; then - ln -nfsv "${filesdir}/7DaysToDie_Data/output_log.txt" "${gamelogdir}/output_log.txt" - fi -fi - -# If server uses SteamCMD create a symbolic link to the Steam logs. -if [ -d "${rootdir}/Steam/logs" ]; then - if [ ! -h "${rootdir}/log/steamcmd" ]; then - ln -nfsv "${rootdir}/Steam/logs" "${rootdir}/log/steamcmd" - fi -fi -sleep 1 \ No newline at end of file diff --git a/functions/fn_install_retry b/functions/fn_install_retry deleted file mode 100644 index e7a90cbb8..000000000 --- a/functions/fn_install_retry +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# LGSM fn_install_retry function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -while true; do - read -e -i "y" -p "Retry install? [Y/n]" yn - case $yn in - [Yy]* ) fn_install; exit;; - [Nn]* ) echo Exiting; exit;; - * ) echo "Please answer yes or no.";; - esac -done \ No newline at end of file diff --git a/functions/fn_install_rofix b/functions/fn_install_rofix deleted file mode 100644 index 9e636d50b..000000000 --- a/functions/fn_install_rofix +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# LGSM fn_install_rofix function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -echo "Applying ${gamename} Server Fixes" -echo "=================================" -echo "Applying WebAdmin ROOst.css fix!" -echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" -sed -i 's/none}/none;/g' "${filesdir}/Web/ServerAdmin/ROOst.css" -sed -i 's/underline}/underline;/g' "${filesdir}/Web/ServerAdmin/ROOst.css" -sleep 1 -echo "Applying WebAdmin CharSet fix!" -echo "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" -sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/uweb.int" -sleep 1 -echo "applying server name fix." -sleep 1 -echo "forcing server restart..." -sleep 1 -fn_start -sleep 5 -fn_stop -fn_start -sleep 5 -fn_stop \ No newline at end of file diff --git a/functions/fn_install_serverdir b/functions/fn_install_serverdir deleted file mode 100644 index 0a71af518..000000000 --- a/functions/fn_install_serverdir +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# LGSM fn_install_serverdir function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -echo "" -echo "Server Directory" -echo "=================================" -echo "" -pwd -echo "" -if [ -d "${filesdir}" ]; then - fn_printwarningnl "A server is already installed here." -fi -while true; do - read -p "Continue [y/N]" yn - case $yn in - [Yy]* ) break;; - [Nn]* ) exit;; - * ) echo "Please answer yes or no.";; - esac -done \ No newline at end of file diff --git a/functions/fn_install_serverfiles b/functions/fn_install_serverfiles deleted file mode 100644 index f75e14fe1..000000000 --- a/functions/fn_install_serverfiles +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash -# LGSM fn_install_serverfiles function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -fn_steaminstallcommand(){ -fn_check_steamuser -counter="0" -while [ "${counter}" == "0" ]||[ "$(grep -wc 0x402 .fn_install_serverfiles.tmp)" -ge "1" ]||[ "$(grep -wc 0x406 .fn_install_serverfiles.tmp)" -ge "1" ]||[ "$(grep -wc 0x6 .fn_install_serverfiles.tmp)" -ge "1" ]||[ "$(grep -wc 0x106 .fn_install_serverfiles.tmp)" -ge "1" ]; do - counter=$((counter+1)) - cd "${rootdir}/steamcmd" - ./steamcmd.sh +quit > /dev/null 2>&1 - if [[ $? != 0 ]]; then - fn_printfailurenl "Cannot start SteamCMD. Are dependencies installed?" - fi - if [ "${counter}" -le "10" ]; then - # Attempt 1-4: Standard attempt - # Attempt 5-6: Validate attempt - # Attempt 7-8: Validate, delete long name dir - # Attempt 9-10: Validate, delete long name dir, re-download SteamCMD - # Attempt 11: Failure - - if [ "${counter}" -ge "2" ]; then - fn_printwarningnl "SteamCMD did not complete the download, retrying: Attempt ${counter}:" - fi - - if [ "${counter}" -ge "7" ]; then - echo "Removing $(find ${filesdir} -type d -print0 | grep -Ez '[^/]{30}$')" - find ${filesdir} -type d -print0 | grep -Ez '[^/]{30}$' | xargs -0 rm -rf - fi - if [ "${counter}" -ge "9" ]; then - rm -rf "${rootdir}/steamcmd" - fn_check_steamcmd - fi - - # Detects if unbuffer command is available. - if [ $(command -v unbuffer) ]; then - unbuffer=unbuffer - fi - - if [ "${counter}" -le "4" ]; then - if [ "${engine}" == "goldsource" ]; then - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" +quit |tee .fn_install_serverfiles.tmp - else - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit |tee .fn_install_serverfiles.tmp - fi - elif [ "${counter}" -ge "5" ]; then - if [ "${engine}" == "goldsource" ]; then - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" -validate +quit |tee .fn_install_serverfiles.tmp - else - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" -validate +quit |tee .fn_install_serverfiles.tmp - fi - fi - elif [ "${counter}" -ge "11" ]; then - fn_printfailurenl "SteamCMD did not complete the download, too many retrys" - break - fi - -done - -# Goldsource servers commonly fail to download all the server files required. -# Validating a few of times may reduce the chance of this issue. -if [ "${engine}" == "goldsource" ]; then - counter="0" - while [ "${counter}" -le "4" ]; do - counter=$((counter+1)) - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" -validate +quit |tee .fn_install_serverfiles.tmp - done -fi -rm -f .fn_install_serverfiles.tmp -} - -echo "" -echo "Installing ${gamename} Server" -echo "=================================" -sleep 1 -mkdir -pv "${filesdir}" -cd "${rootdir}/steamcmd" -fn_steaminstallcommand -if [ -z "${autoinstall}" ]; then - echo "" - echo "=================================" - while true; do - read -e -i "y" -p "Was the install successful? [Y/n]" yn - case $yn in - [Yy]* ) break;; - [Nn]* ) fn_install_retry;; - * ) echo "Please answer yes or no.";; - esac - done -fi diff --git a/functions/fn_install_steamcmd b/functions/fn_install_steamcmd deleted file mode 100644 index 8709413b0..000000000 --- a/functions/fn_install_steamcmd +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# LGSM fn_check_steamcmd function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Downloads SteamCMD on install and checks if missing before running functions that require SteamCMD - -echo "" -echo "Installing SteamCMD" -echo "=================================" -cd "${rootdir}" -mkdir -pv "steamcmd" -sleep 1 -cd "steamcmd" -if [ ! -f steamcmd.sh ]; then - echo -e "downloading steamcmd_linux.tar.gz...\c" - wget -N /dev/null http://media.steampowered.com/client/steamcmd_linux.tar.gz 2>&1 | grep -F HTTP | cut -c45-| uniq - tar --verbose -zxf steamcmd_linux.tar.gz - rm -v steamcmd_linux.tar.gz - chmod +x steamcmd.sh - sleep 1 -else - echo "Steam already installed!" -fi -sleep 1 diff --git a/functions/fn_install_steamfix b/functions/fn_install_steamfix deleted file mode 100644 index 501ac2fa4..000000000 --- a/functions/fn_install_steamfix +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# LGSM fn_install_steamfix function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -fn_steamclientfix(){ -echo "" -echo "Applying steamclient.so fix" -echo "=================================" -sleep 1 -mkdir -pv "${HOME}/.steam" -mkdir -pv "${HOME}/.steam/sdk32" -cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so" - if [[ $? != 0 ]]; then - fn_printfailurenl "Cannot start apply steamclient.so fix." - fi -sleep 1 -} - -# Gary's Mod Specific -fn_libsteamfix(){ -echo "" -echo "Applying libsteam.so fix" -echo "=================================" -sleep 1 -mkdir -pv "${HOME}/.steam" -mkdir -pv "${HOME}/.steam/sdk32" -if [ "${gamename}" == "Garry's Mod" ]; then - cp -v "${filesdir}/bin/libsteam.so" "${HOME}/.steam/sdk32/libsteam.so" -elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then - mkdir "${HOME}/.steam/bin32" - cp -v "${filesdir}/Bin/libsteam.so" "${HOME}/.steam/bin32/libsteam.so" -fi -if [[ $? != 0 ]]; then - fn_printfailurenl "Cannot start apply libsteam.so fix." -fi -sleep 1 -} - -fn_steamclientfix -if [ "${gamename}" == "Garry's Mod" ]||[ "${gamename}" == "Serious Sam 3: BFE" ]; then - fn_libsteamfix -fi diff --git a/functions/fn_install_ts3 b/functions/fn_install_ts3 deleted file mode 100644 index 25605f588..000000000 --- a/functions/fn_install_ts3 +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/bash -# LGSM fn_install_ts3 function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -fn_details_distro -# Gets the teamspeak server architecture -if [ "${arch}" == "x86_64" ]; then - ts3arch="amd64" -elif [ "${arch}" == "i386" ]||[ "${arch}" == "i686" ]; then - ts3arch="x86" -else - fn_printfailure "${arch} is an unsupported architecture" - exit 1 -fi - -# Grabs all version numbers not in correct order -wget "http://dl.4players.de/ts/releases/?C=M;O=D" -q -O -| grep -i dir | egrep -o '
.*\/<\/a>' | egrep -o '[0-9\.?]+'|uniq > .ts3_version_numbers_unsorted.tmp - -# removes digits to allow sorting of numbers -cat .ts3_version_numbers_unsorted.tmp |tr -cd '[:digit:][*\n]' > .ts3_version_numbers_digit.tmp -# Sorts numbers in to correct order -# merges two files in to one with two columns sorts the numbers in to order then only outputs the second to the ts3_version_numbers.tmp -paste .ts3_version_numbers_digit.tmp .ts3_version_numbers_unsorted.tmp |sort -rn|awk '{ print $2 }' > .ts3_version_numbers.tmp - -# Finds directory with most recent server version. -while read ts3_version_number; do - wget --spider -q "http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux-${ts3arch}-${ts3_version_number}.tar.gz" - if [[ $? == 0 ]]; then - availablebuild="${ts3_version_number}" - echo "Latest Build: ${availablebuild}" - # Break while-loop, if the latest release could be found - echo "http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-66server_linux-${ts3arch}-${ts3_version_number}.tar.g" - break - fi -done < .ts3_version_numbers.tmp -rm -f .ts3_version_numbers_digit.tmp -rm -f .ts3_version_numbers_unsorted.tmp -rm -f .ts3_version_numbers.tmp - -# Checks availablebuild info is available -if [ -z "${availablebuild}" ]; then - fn_printfail "Checking for update: teamspeak.com" - sleep 1 - fn_printfail "Checking for update: teamspeak.com: Not returning version info" - sleep 2 - exit 1 -fi - -cd "${rootdir}" -mkdir "${filesdir}" -echo -e "downloading teamspeak3-server_linux-${ts3arch}-${availablebuild}.tar.gz...\c" -wget -N /dev/null http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux-${ts3arch}-${ts3_version_number}.tar.gz 2>&1 | grep -F HTTP | cut -c45-| uniq -sleep 1 -echo -e "extracting teamspeak3-server_linux-${ts3arch}-${availablebuild}.tar.gz...\c" -tar -xf "teamspeak3-server_linux-${ts3arch}-${availablebuild}.tar.gz" 2> ".${servicename}-tar-error.tmp" -local status=$? -if [ ${status} -eq 0 ]; then - echo "OK" -else - echo "FAIL - Exit status ${status}" - sleep 1 - cat ".${servicename}-tar-error.tmp" - rm ".${servicename}-tar-error.tmp" - exit $? -fi -echo -e "copying to ${filesdir}...\c" -cp -R "${rootdir}/teamspeak3-server_linux-${ts3arch}/"* "${filesdir}" 2> ".${servicename}-cp-error.tmp" -local status=$? -if [ ${status} -eq 0 ]; then - echo "OK" -else - echo "FAIL - Exit status ${status}" - sleep 1 - cat ".${servicename}-cp-error.tmp" - rm ".${servicename}-cp-error.tmp" - exit $? -fi -rm -f teamspeak3-server_linux-${ts3arch}-${availablebuild}.tar.gz -rm -rf "${rootdir}/teamspeak3-server_linux-${ts3arch}" - -## Get privilege key -echo "" -echo "Getting privilege key" -echo "=================================" -sleep 1 -echo "IMPORANT! Save these details for later." -sleep 1 -cd "${executabledir}" -./ts3server_startscript.sh start -sleep 5 -./ts3server_startscript.sh stop \ No newline at end of file diff --git a/functions/fn_install_ut2k4 b/functions/fn_install_ut2k4 deleted file mode 100644 index fc25a09a8..000000000 --- a/functions/fn_install_ut2k4 +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# LGSM fn_install_ut2k4 function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -echo "Installing ${gamename} Server" -echo "=================================" -sleep 1 -mkdir -pv "${filesdir}" -cd "${filesdir}" -echo "Extracting dedicatedserver3339-bonuspack.zip" -sleep 1 -unzip dedicatedserver3339-bonuspack.zip -echo "Extracting ut2004-lnxpatch3369-2.tar.bz2" -sleep 1 -tar -xvjf ut2004-lnxpatch3369-2.tar.bz2 UT2004-Patch/ --strip-components=1 -while true; do - read -p "Was the install successful? [y/N]" yn - case $yn in - [Yy]* ) break;; - [Nn]* ) fn_install_retry;; - * ) echo "Please answer yes or no.";; -esac -done -while true; do - read -p "Remove ut2004-lnxpatch3369-2.tar.bz2? [y/N]" yn - case $yn in - [Yy]* ) rm -fv ut2004-lnxpatch3369-2.tar.bz2; break;; - [Nn]* ) break;; - * ) echo "Please answer yes or no.";; - esac -done -while true; do - read -p "Remove dedicatedserver3339-bonuspack.zip? [y/N]" yn - case $yn in - [Yy]* ) rm -fv dedicatedserver3339-bonuspack.zip; break;; - [Nn]* ) break;; - * ) echo "Please answer yes or no.";; - esac -done -echo "" \ No newline at end of file diff --git a/functions/fn_install_ut2k4filesdl b/functions/fn_install_ut2k4filesdl deleted file mode 100644 index 8120b26aa..000000000 --- a/functions/fn_install_ut2k4filesdl +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# LGSM fn_install_ut2k4filesdl function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -echo "Downloading Server Files" -echo "=================================" -cd "${rootdir}" -mkdir -pv "${filesdir}" -cd "${filesdir}" -if [ ! -f dedicatedserver3339-bonuspack.zip ]; then - wget http://gameservermanagers.com/files/ut2004/dedicatedserver3339-bonuspack.zip -else - echo "dedicatedserver3339-bonuspack.zip already downloaded!" -fi -echo "Running MD5 checksum to verify the file" -sleep 1 -echo "MD5 checksum: d3f28c5245c4c02802d48e4f0ffd3e34" -md5check=$(md5sum dedicatedserver3339-bonuspack.zip|awk '{print $1;}') -echo "File returned: ${md5check}" -if [ "${md5check}" != "d3f28c5245c4c02802d48e4f0ffd3e34" ]; then - echo "MD5 checksum: FAILED!" - read -p "Retry download? [y/N]" yn - case $yn in - [Yy]* ) rm -fv dedicatedserver3339-bonuspack.zip; fn_install_ut2k4filesdl;; - [Nn]* ) echo Exiting; exit;; - * ) echo "Please answer yes or no.";; - esac -else - echo "MD5 checksum: PASSED" -fi -if [ ! -f ut2004-lnxpatch3369-2.tar.bz2 ]; then - wget http://gameservermanagers.com/files/ut2004/ut2004-lnxpatch3369-2.tar.bz2 -else - echo "ut2004-lnxpatch3369-2.tar.bz2 already downloaded!" -fi -echo "Running MD5 checksum to verify the file" -sleep 1 -echo "MD5 checksum: 0fa447e05fe5a38e0e32adf171be405e" -md5check=$(md5sum ut2004-lnxpatch3369-2.tar.bz2|awk '{print $1;}') -echo "File returned: ${md5check}" -if [ "${md5check}" != "0fa447e05fe5a38e0e32adf171be405e" ]; then - echo "MD5 checksum: FAILED!" - read -p "Retry download? [y/N]" yn - case $yn in - [Yy]* ) rm -fv ut2004-lnxpatch3369-2.tar.bz2; fn_install_ut2k4filesdl;; - [Nn]* ) echo Exiting; exit;; - * ) echo "Please answer yes or no.";; - esac -else - echo "MD5 checksum: PASSED" -fi -echo "" \ No newline at end of file diff --git a/functions/fn_install_ut2k4fix b/functions/fn_install_ut2k4fix deleted file mode 100644 index 825f4e703..000000000 --- a/functions/fn_install_ut2k4fix +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# LGSM fn_install_ut2k4fix function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -echo "Applying ${gamename} Server Fixes" -echo "=================================" -echo "applying WebAdmin ut2003.css fix." -echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" -sed -i 's/none}/none;/g' "${filesdir}/Web/ServerAdmin/ut2003.css" -sed -i 's/underline}/underline;/g' "${filesdir}/Web/ServerAdmin/ut2003.css" -sleep 1 -echo "applying WebAdmin CharSet fix." -echo "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" -sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/UWeb.int" -sleep 1 -echo "" -echo -en "forcing server restart.\r" -sleep 0.5 -echo -en "forcing server restart..\r" -sleep 0.5 -echo -en "forcing server restart...\r" -sleep 0.5 -echo -en "\n" -sleep 0.5 -fn_start -sleep 5 -fn_stop -fn_start -sleep 5 -fn_stop \ No newline at end of file diff --git a/functions/fn_install_ut2k4key b/functions/fn_install_ut2k4key deleted file mode 100644 index 63e7c58be..000000000 --- a/functions/fn_install_ut2k4key +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# LGSM fn_install_ut2k4key function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -echo "Enter ${gamename} CD Key" -echo "=================================" -sleep 1 -echo "To get your server listed on the Master Server list" -echo "you must get a free CD key. Get a key here:" -echo "http://www.unrealtournament.com/ut2004server/cdkey.php" -echo "" -echo "Once you have the key enter it below" -echo -n "KEY: " -read CODE -echo ""\""CDKey"\""="\""${CODE}"\""" > "${systemdir}/cdkey" -echo "" \ No newline at end of file diff --git a/functions/fn_install_ut99 b/functions/fn_install_ut99 deleted file mode 100644 index d27e41f4c..000000000 --- a/functions/fn_install_ut99 +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# LGSM fn_install_ut99 function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -echo "Installing ${gamename} Server" -echo "=================================" -sleep 1 -mkdir -pv "${filesdir}" -cd "${filesdir}" -echo "Extracting ut-server-436.tar.gz" -sleep 1 -tar -zxvf ut-server-436.tar.gz ut-server/ --strip-components=1 -echo "Extracting UTPGPatch451.tar.bz2" -sleep 1 -tar -jxvf UTPGPatch451.tar.bz2 -while true; do - read -p "Was the install successful? [y/N]" yn - case $yn in - [Yy]* ) break;; - [Nn]* ) fn_install_retry;; - * ) echo "Please answer yes or no.";; -esac -done -while true; do - read -p "Remove ut-server-436.tar.gz? [y/N]" yn - case $yn in - [Yy]* ) rm -fv ut-server-436.tar.gz; break;; - [Nn]* ) break;; - * ) echo "Please answer yes or no.";; - esac -done -while true; do - read -p "Remove UTPGPatch451.tar.bz2? [y/N]" yn - case $yn in - [Yy]* ) rm -fv UTPGPatch451.tar.bz2; break;; - [Nn]* ) break;; - * ) echo "Please answer yes or no.";; - esac -done -echo "" \ No newline at end of file diff --git a/functions/fn_install_ut99filesdl b/functions/fn_install_ut99filesdl deleted file mode 100644 index 265e60078..000000000 --- a/functions/fn_install_ut99filesdl +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# LGSM fn_install_ut99filesdl function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -echo "Downloading Server Files" -echo "=================================" -cd "${rootdir}" -mkdir -pv "${filesdir}" -cd "${filesdir}" -if [ ! -f ut-server-436.tar.gz ]; then - wget http://gameservermanagers.com/files/ut99/ut-server-436.tar.gz -else - echo "ut-server-436.tar.gz already downloaded!" -fi -echo "Running MD5 checksum to verify the file" -sleep 1 -echo "MD5 checksum: 10cd7353aa9d758a075c600a6dd193fd" -md5check=$(md5sum ut-server-436.tar.gz|awk '{print $1;}') -echo "File returned: ${md5check}" -if [ "${md5check}" != "10cd7353aa9d758a075c600a6dd193fd" ]; then - echo "MD5 checksum: FAILED!" - read -p "Retry download? [y/N]" yn - case $yn in - [Yy]* ) rm -fv ut-server-436.tar.gz; fn_filesdl;; - [Nn]* ) echo Exiting; exit;; - * ) echo "Please answer yes or no.";; - esac -else - echo "MD5 checksum: PASSED" -fi -if [ ! -f UTPGPatch451.tar.bz2 ]; then - wget http://gameservermanagers.com/files/ut99/UTPGPatch451.tar.bz2 -else - echo "UTPGPatch451.tar.bz2 already downloaded!" -fi -echo "Running MD5 checksum to verify the file" -sleep 1 -echo "MD5 checksum: 77a735a78b1eb819042338859900b83b" -md5check=$(md5sum UTPGPatch451.tar.bz2|awk '{print $1;}') -echo "File returned: ${md5check}" -if [ "${md5check}" != "77a735a78b1eb819042338859900b83b" ]; then - echo "MD5 checksum: FAILED!" - read -p "Retry download? [y/N]" yn - case $yn in - [Yy]* ) rm -fv UTPGPatch451.tar.bz2; fn_filesdl;; - [Nn]* ) echo Exiting; exit;; - * ) echo "Please answer yes or no.";; - esac -else - echo "MD5 checksum: PASSED" -fi -echo "" \ No newline at end of file diff --git a/functions/fn_install_ut99fix b/functions/fn_install_ut99fix deleted file mode 100644 index 1147934b0..000000000 --- a/functions/fn_install_ut99fix +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# LGSM fn_install_ut99fix function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -echo "Applying ${gamename} Server Fixes" -echo "=================================" -echo "enabling UdpServerUplink." -{ -echo "[IpServer.UdpServerUplink]" -echo "DoUplink=True" -echo "UpdateMinutes=1" -echo "MasterServerAddress=unreal.epicgames.com" -echo "MasterServerPort=27900" -echo "Region=0" -}|tee -a "${servercfgfullpath}" > /dev/null 2>&1 -sleep 1 -echo "removing dead gamespy.com master server." -sed -i '/master0.gamespy.com/d' "${servercfgfullpath}" -sleep 1 -echo "removing dead mplayer.com master server." -sed -i '/master.mplayer.com/d' "${servercfgfullpath}" -sleep 1 -echo "inserting qtracker.com master server." -sed -i '66i\ServerActors=IpServer.UdpServerUplink MasterServerAddress=master.qtracker.com MasterServerPort=27900' "${servercfgfullpath}" -echo "" \ No newline at end of file diff --git a/functions/fn_logs b/functions/fn_logs deleted file mode 100644 index d5b650bc0..000000000 --- a/functions/fn_logs +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -# LGSM fn_logs function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Acts as a log rotater, removing old logs. - -local modulename="Log Manager" - -if [ -n "${consolelog}" ]; then - if [ ! -e "${consolelog}" ]; then - touch "${consolelog}" - fi -fi -# log manager will active if finds logs older than ${logdays} -if [ $(find "${scriptlogdir}"/ -type f -mtime +${logdays}|wc -l) -ne "0" ]; then - fn_printdots "Starting" - sleep 1 - fn_printok "Starting" - fn_scriptlog "Starting" - sleep 1 - echo -en "\n" - fn_printinfo "Removing logs older than ${logdays} days" - fn_scriptlog "Removing logs older than ${logdays} days" - sleep 1 - echo -en "\n" - if [ "${engine}" == "unreal2" ]||[ "${engine}" == "source" ]; then - find "${gamelogdir}"/ -type f -mtime +${logdays}|tee >> "${scriptlog}" - fi - find "${scriptlogdir}"/ -type f -mtime +${logdays}|tee >> "${scriptlog}" - if [ -n "${consolelog}" ]; then - find "${consolelogdir}"/ -type f -mtime +${logdays}|tee >> "${scriptlog}" - fi - if [ "${engine}" == "unreal2" ]||[ "${engine}" == "source" ]; then - gamecount=$(find "${scriptlogdir}"/ -type f -mtime +${logdays}|wc -l) - fi - scriptcount=$(find "${scriptlogdir}"/ -type f -mtime +${logdays}|wc -l) - echo "${consolelog}" - if [ -n "${consolelog}" ]; then - consolecount=$(find "${consolelogdir}"/ -type f -mtime +${logdays}|wc -l) - else - consolecount=0 - fi - - count=$((${scriptcount} + ${consolecount})) - if [ "${engine}" == "unreal2" ]||[ "${engine}" == "source" ]; then - count=$((${scriptcount} + ${consolecount} + ${gamecount})) - else - count=$((${scriptcount} + ${consolecount})) - fi - - - if [ "${engine}" == "unreal2" ]||[ "${engine}" == "source" ]; then - find "${gamelogdir}"/ -mtime +${logdays} -type f -exec rm -f {} \; - fi - find "${scriptlogdir}"/ -mtime +${logdays} -type f -exec rm -f {} \; - if [ -n "${consolelog}" ]; then - find "${consolelogdir}"/ -mtime +${logdays} -type f -exec rm -f {} \; - fi - fn_printok "Removed ${count} log files" - fn_scriptlog "Removed ${count} log files" - sleep 1 - echo -en "\n" -fi diff --git a/functions/fn_messages b/functions/fn_messages deleted file mode 100644 index be23430b9..000000000 --- a/functions/fn_messages +++ /dev/null @@ -1,138 +0,0 @@ -#!/bin/bash -# LGSM fn_messages function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Defines on-screen messages such as [ OK ] and how script logs look. - -# Date and servicename for log files. -fn_scriptlog(){ - if [[ -n ${modulename} ]]; then - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${modulename}: ${1}" >> "${scriptlog}" - else - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}" - fi -} - -# [ FAIL ] -fn_printfail(){ - if [[ -n ${modulename} ]]; then - echo -en "\r\033[K[\e[0;31m FAIL \e[0m] ${modulename} ${servicename}: $@" - else - echo -en "\r\033[K[\e[0;31m FAIL \e[0m] $@" - fi -} - -fn_printfailnl(){ - if [[ -n ${modulename} ]]; then - echo -e "\r\033[K[\e[0;31m FAIL \e[0m] ${modulename} ${servicename}: $@" - else - echo -e "\r\033[K[\e[0;31m FAIL \e[0m] $@" - fi -} - -# [ OK ] -fn_printok(){ - if [[ -n ${modulename} ]]; then - echo -en "\r\033[K[\e[0;32m OK \e[0m] ${modulename} ${servicename}: $@" - else - echo -en "\r\033[K[\e[0;32m OK \e[0m] $@" - fi -} - -fn_printoknl(){ - if [[ -n ${modulename} ]]; then - echo -e "\r\033[K[\e[0;32m OK \e[0m] ${modulename} ${servicename}: $@" - else - echo -e "\r\033[K[\e[0;32m OK \e[0m] $@" - fi -} - -# [ INFO ] -fn_printinfo(){ - if [[ -n ${modulename} ]]; then - echo -en "\r\033[K[\e[0;36m INFO \e[0m] ${modulename} ${servicename}: $@" - else - echo -en "\r\033[K[\e[0;36m INFO \e[0m] $@" - fi -} - -fn_printinfonl(){ - if [[ -n ${modulename} ]]; then - echo -e "\r\033[K[\e[0;36m INFO \e[0m] ${modulename} ${servicename}: $@" - else - echo -e "\r\033[K[\e[0;36m INFO \e[0m] $@" - fi -} - -# [ WARN ] -fn_printwarn(){ - if [[ -n ${modulename} ]]; then - echo -en "\r\033[K[\e[1;33m WARN \e[0m] ${modulename} ${servicename}: $@" - else - echo -en "\r\033[K[\e[1;33m WARN \e[0m] $@" - fi -} - -fn_printwarnnl(){ - if [[ -n ${modulename} ]]; then - echo -e "\r\033[K[\e[1;33m WARN \e[0m] ${modulename} ${servicename}: $@" - else - echo -e "\r\033[K[\e[1;33m WARN \e[0m] $@" - fi -} - -# [ .... ] -fn_printdots(){ - if [[ -n ${modulename} ]]; then - echo -en "\r\033[K[ .... ] ${modulename} ${servicename}: $@" - else - echo -en "\r\033[K[ .... ] $@" - fi -} - -# Complete! -fn_printcomplete(){ - echo -en "\e[0;32mComplete!\e[0m $@" -} - -fn_printcompletenl(){ - echo -e "\e[0;32mComplete!\e[0m $@" -} - -# Warning! -fn_printwarning(){ - echo -en "\e[0;33mWarning!\e[0m $@" -} - -fn_printwarningnl(){ - echo -e "\e[0;33mWarning!\e[0m $@" -} - -# Failure! -fn_printfailure(){ - echo -en "\e[0;31mFailure!\e[0m $@" -} - -fn_printfailurenl(){ - echo -e "\e[0;31mFailure!\e[0m $@" -} - -# Error! -fn_printerror(){ - echo -en "\e[0;31mError!\e[0m $@" -} - -fn_printerrornl(){ - echo -e "\e[0;31mError!\e[0m $@" -} - -# Info! -fn_printinfomation(){ - echo -en "\e[0;36mInfo!\e[0m $@" -} - -fn_printinfomationnl(){ - echo -e "\e[0;36mInfo!\e[0m $@" -} diff --git a/functions/fn_monitor b/functions/fn_monitor deleted file mode 100644 index 02380440e..000000000 --- a/functions/fn_monitor +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/bash -# LGSM fn_monitor function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Monitors server by checking for running proccesses -# then passes to fn_monitor_query. - -local modulename="Monitor" - -fn_monitor_teamspeak3(){ -fn_check_root -fn_check_systemdir -fn_logs -fn_printdots "${servername}" -fn_scriptlog "${servername}" -sleep 1 -if [ ! -f "${rootdir}/${lockselfname}" ]; then - fn_printinfo "Disabled: No lock file found" - fn_scriptlog "Disabled: No lock file found" - sleep 1 - echo -en "\n" - echo "To enable monitor run ./${selfname} start" - exit 1 -fi -fn_printdots "Checking session: CHECKING" -fn_scriptlog "Checking session: CHECKING" -sleep 1 -fn_check_ts3status -if [ "${ts3status}" = "Server is running" ]; then - fn_printok "Checking session: OK" - fn_scriptlog "Checking session: OK" - sleep 1 - sleep 0.5 - echo -en "\n" - exit -else - fn_printfail "Checking session: FAIL" - fn_scriptlog "Checking session: FAIL" - sleep 1 - fn_printfail "Checking session: FAIL: ${ts3status}" - fn_scriptlog "Checking session: FAIL: ${ts3status}" - failurereason="${ts3status}" - if [ "${emailnotification}" = "on" ]; then - subject="${servicename} Monitor - Restarting ${servername}" - actiontaken="restarted ${servername}" - fn_emailnotification - fi -fi -sleep 0.5 -echo -en "\n" -fn_restart -} - -fn_monitor_tmux(){ -fn_check_root -fn_check_systemdir -fn_check_ip -fn_details_config -fn_printdots "${servername}" -fn_scriptlog "${servername}" -sleep 1 -if [ ! -f "${rootdir}/${lockselfname}" ]; then - fn_printinfo "Disabled: No lock file found" - fn_scriptlog "Disabled: No lock file found" - sleep 1 - echo -en "\n" - echo "To enable monitor run ./${selfname} start" - exit 1 -fi - -updatecheck=$(ps -ef|grep "${selfname} update"|grep -v grep|wc -l) -if [ "${updatecheck}" = "0" ]||[ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament 2004" ]; then - fn_printdots "Checking session: CHECKING" - fn_scriptlog "Checking session: CHECKING" - sleep 1 - tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:") - if [ "${tmuxwc}" -eq 1 ]; then - fn_printok "Checking session: OK" - fn_scriptlog "Checking session: OK" - sleep 1 - echo -en "\n" - - if [ "${engine}" == "avalanche" ]||[ "${engine}" == "goldsource" ]||[ "${engine}" == "realvirtuality" ]||[ "${engine}" == "source" ]||[ "${engine}" == "spark" ]||[ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then - fn_monitor_query - fi - exit $? - else - fn_printfail "Checking session: FAIL" - fn_scriptlog "Checking session: FAIL" - sleep 1 - echo -en "\n" - if [ "${emailnotification}" = "on" ]; then - subject="${servicename} Monitor - Starting ${servername}" - failurereason="${servicename} process not running" - actiontaken="${servicename} has been restarted" - fn_email - fi - fn_scriptlog "Monitor is starting ${servername}" - fn_start - fi -else - fn_printinfonl "SteamCMD is currently checking for updates" - fn_scriptlog "SteamCMD is currently checking for updates" - sleep 1 - fn_printinfonl "When update is complete ${servicename} will start" - fn_scriptlog "When update is complete ${servicename} will start" - sleep 1 -fi -} - -if [ "${gamename}" == "Teamspeak 3" ]; then - fn_monitor_teamspeak3 -else - fn_monitor_tmux -fi diff --git a/functions/fn_monitor_query b/functions/fn_monitor_query deleted file mode 100644 index 7f508cdf4..000000000 --- a/functions/fn_monitor_query +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/bash -# LGSM fn_monitor_query function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: uses gsquery.py to directly query the server. -# Detects if the server has frozen. - -local modulename="Monitor" -if [ -f "${rootdir}/gsquery.py" ]; then - if [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then - gameport=$(grep Port= "${servercfgfullpath}"|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|tr -d '\r'|tr -cd '[:digit:]') - port=$((${gameport} + 1)) - elif [ "${engine}" == "spark" ]; then - port=$((${port} + 1)) - elif [ "${engine}" == "realvirtuality" ]; then - queryport=$(grep -s steamqueryport= "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd '[:digit:]') - port=${queryport} - elif [ "${engine}" == "unity3d" ]; then - gameport=$(grep ServerPort "${servercfgfullpath}"|tr -cd '[:digit:]') - port=$((${gameport} + 1)) - fi - fn_printinfo "Detected gsquery.py" - fn_scriptlog "Detected gsquery.py" - sleep 1 - fn_printdots "Querying port: ${ip}:${port} : QUERYING" - fn_scriptlog "Querying port: ${ip}:${port} : QUERYING" - sleep 1 - serverquery=$(${rootdir}/gsquery.py -a ${ip} -p ${port} -e ${engine} 2>&1) - exitcode=$? - if [ "${exitcode}" == "1" ]||[ "${exitcode}" == "2" ]||[ "${exitcode}" == "3" ]||[ "${exitcode}" == "4" ]; then - fn_printfail "Querying port: ${ip}:${port} : ${serverquery}" - fn_scriptlog "Querying port: ${ip}:${port} : ${serverquery}" - sleep 1 - echo -en "\n" - if [[ -z "${secondquery}" ]]; then - if [ "${engine}" == "unreal2" ]; then - # unreal 2: Map change can take around 60 seconds - fn_printinfo "Waiting 60 seconds to re-query" - fn_scriptlog "Waiting 60 seconds to re-query" - sleep 60 - else - fn_printinfo "Waiting 30 seconds to re-query" - fn_scriptlog "Waiting 30 seconds to re-query" - sleep 30 - fi - secondquery=1 - fn_monitor_query - fi - if [ "${emailnotification}" = "on" ]; then - fn_details_config - subject="${servicename} Monitor - Starting ${servername}" - failurereason="Failed to query ${servicename}: ${serverquery}" - actiontaken="restarted ${servicename}" - fn_email - fi - fn_restart - exit 1 - elif [ "${exitcode}" == "0" ]; then - fn_printok "Querying port: ${ip}:${port} : OK" - fn_scriptlog "Querying port: ${ip}:${port} : OK" - sleep 1 - echo -en "\n" - exit - elif [ "${exitcode}" == "126" ]; then - fn_printfail "Querying port: ${ip}:${port} : ERROR: ${rootdir}/gsquery.py: Permission denied" - fn_scriptlog "Querying port: ${ip}:${port} : ERROR: ${rootdir}/gsquery.py: Permission denied" - sleep 1 - echo -en "\n" - echo "Attempting to resolve automatically" - chmod +x -v "${rootdir}/gsquery.py" - exitcode=$? - if [ "${exitcode}" == "0" ]; then - fn_monitor_query - else - fn_printfailure "Unable to resolve automatically. Please manually fix permissions.\n" - owner=$(ls -al ${rootdir}/gsquery.py|awk '{ print $3 }') - echo "As user ${owner} or root run the following command." - whoami=$(whoami) - echo -en "\nchown ${whoami}:${whoami} ${rootdir}/gsquery.py\n\n" - exit 1 - fi - else - fn_printfail "Querying port: ${ip}:${port} : UNKNOWN ERROR" - fn_scriptlog "Querying port: ${ip}:${port} : UNKNOWN ERROR" - sleep 1 - echo -en "\n" - ${rootdir}/gsquery.py -a ${ip} -p ${port} -e ${engine} - exit 1 - fi -else - fn_printfailnl "Could not find ${rootdir}/gsquery.py" - fn_scriptlog "Could not find ${rootdir}/gsquery.py" -fi diff --git a/functions/fn_start b/functions/fn_start deleted file mode 100644 index 3adfe77ab..000000000 --- a/functions/fn_start +++ /dev/null @@ -1,205 +0,0 @@ -#!/bin/bash -# LGSM fn_start function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Starts the server. - -local modulename="Starting" - -fn_start_teamspeak3(){ -fn_check_root -fn_check_systemdir -fn_check_logs -fn_check_ts3status - -if [ "${ts3status}" != "Server is running" ]; then - # Will check for updates is updateonstart is yes - if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateonstart}" == "on" ]; then - fn_update_check - fi -fi - -if [ ! -e "${servercfgfullpath}" ]; then - fn_printwarn "${servercfgfullpath} is missing" - fn_scriptlog "${servercfgfullpath} is missing" - sleep 2 - echo -en "\n" - echo " * Creating blank ${servercfg}" - fn_scriptlog "Creating blank ${servercfg}" - sleep 2 - echo " * ${servercfg} can remain blank by default." - fn_scriptlog "${servercfgfullpath} can remain blank by default." - sleep 2 - echo " * ${servercfg} is located in ${servercfgfullpath}." - fn_scriptlog "${servercfg} is located in ${servercfgfullpath}." - sleep 5 - touch "${servercfgfullpath}" -fi - -fn_logs - -fn_printdots "${servername}" -fn_scriptlog "${servername}" -sleep 1 - -if [ "${ts3status}" == "Server is running" ]; then - fn_printinfo "${servername} is already running" - fn_scriptlog "${servername} is already running" - sleep 1 - echo -en "\n" - exit -fi - -mv "${scriptlog}" "${scriptlogdate}" -# Create lock file -date > "${rootdir}/${lockselfname}" -cd "${executabledir}" -./ts3server_startscript.sh start inifile="${servercfgfullpath}" > /dev/null 2>&1 -sleep 1 -fn_check_ts3status -if [ "${ts3status}" = "Server seems to have died" ] || [ "${ts3status}" = "No server running (ts3server.pid is missing)" ];then - fn_printfailnl "Unable to start ${servername}" - fn_scriptlog "Unable to start ${servername}" - echo -e " Check log files: ${rootdir}/log" - exit 1 -else - fn_printok "${servername}" - fn_scriptlog "Started ${servername}" -fi -sleep 0.5 -echo -en "\n" -} - -fn_start_tmux(){ -fn_check_root -fn_check_systemdir -fn_check_ip -fn_check_logs -if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then - startfix=1 - fn_csgofix -fi -if [ "${gamename}" == "Insurgency" ]; then - fn_insfix -fi -fn_details_config -fn_parms -fn_logs - -tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:") -# Will check for updates if updateonstart is yes -if [ "${tmuxwc}" -eq 0 ]; then - if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateonstart}" == "on" ]; then - fn_update_check - fi -fi - -fn_printdots "${servername}" -fn_scriptlog "${servername}" -sleep 1 -fn_check_tmux - -if [ "${gamename}" != "Mumble" ]; then - fn_check_steamcmd -fi - -if [ "${tmuxwc}" -eq 0 ]; then - fn_scriptlog "Rotating log files" - if [ "${engine}" == "unreal2" ]; then - mv "${gamelog}" "${gamelogdate}" - fi - mv "${scriptlog}" "${scriptlogdate}" - mv "${consolelog}" "${consolelogdate}" -fi - -if [ "${tmuxwc}" -eq 1 ]; then - fn_printinfo "${servername} is already running" - fn_scriptlog "${servername} is already running" - sleep 1 - echo -en "\n" - exit -fi - -# Create lock file -date > "${rootdir}/${lockselfname}" -cd "${executabledir}" -tmux new-session -d -s "${servicename}" "${executable} ${parms}" 2> "${scriptlogdir}/.${servicename}-tmux-error.tmp" -# tmux pipe-pane not supported in tmux versions < 1.6 -if [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -lt "16" ]; then - echo "Console logging disabled: Tmux => 1.6 required" >> "${consolelog}" - echo "http://gameservermanagers.com/tmux-upgrade" >> "${consolelog}" - echo "Currently installed: $(tmux -V)" >> "${consolelog}" -elif [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -eq "18" ]; then - echo "Console logging disabled: Bug in tmux 1.8 breaks logging" >> "${consolelog}" - echo "http://gameservermanagers.com/tmux-upgrade" >> "${consolelog}" - echo "Currently installed: $(tmux -V)" >> "${consolelog}" -else - touch "${consolelog}" - tmux pipe-pane -o -t "${servicename}" "exec cat >> '${consolelog}'" -fi -sleep 1 -tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:") -# If the server fails to start -if [ "${tmuxwc}" -eq 0 ]; then - fn_printfail "Unable to start ${servername}" - fn_scriptlog "Unable to start ${servername}" - sleep 1 - if [ -s "${scriptlogdir}/.${servicename}-tmux-error.tmp" ]; then - fn_printfail "Unable to start ${servername}: Tmux error:" - fn_scriptlog "Tmux error" - sleep 1 - echo -en "\n" - echo "" - echo "Command" - echo "=================================" - echo "tmux new-session -d -s \"${servicename}\" \"${executable} ${parms}\"" - echo "tmux new-session -d -s \"${servicename}\" \"${executable} ${parms}\"" >> "${scriptlog}" - echo "" - echo "Error" - echo "=================================" - cat "${scriptlogdir}/.${servicename}-tmux-error.tmp" - cat "${scriptlogdir}/.${servicename}-tmux-error.tmp" >> "${scriptlog}" - - # Detected error http://gameservermanagers.com/issues - if [ $(grep -c "Operation not permitted" "${scriptlogdir}/.${servicename}-tmux-error.tmp") ];then - echo "" - echo "Fix" - echo "=================================" - if [ ! $(grep "tty:" /etc/group|grep "$(whoami)") ];then - echo "$(whoami) is not part of the tty group." - fn_scriptlog "$(whoami) is not part of the tty group." - group=$(grep tty /etc/group) - echo "" - echo " ${group}" - fn_scriptlog "${group}" - echo "" - echo "Run the following command with root privileges." - echo "" - echo " usermod -G tty $(whoami)" - echo "" - echo "http://gameservermanagers.com/tmux-op-perm" - fn_scriptlog "http://gameservermanagers.com/tmux-op-perm" - else - echo "No known fix currently. Please log an issue." - fn_scriptlog "No known fix currently. Please log an issue." - echo "http://gameservermanagers.com/issues" - fn_scriptlog "http://gameservermanagers.com/issues" - fi - fi - fi -exit 1 -else - fn_printok "${servername}" - fn_scriptlog "Started ${servername}" -fi -rm "${scriptlogdir}/.${servicename}-tmux-error.tmp" -echo -en "\n" -} - -if [ "${gamename}" == "Teamspeak 3" ]; then - fn_start_teamspeak3 -else - fn_start_tmux -fi diff --git a/functions/fn_stop b/functions/fn_stop deleted file mode 100644 index 2a02510c1..000000000 --- a/functions/fn_stop +++ /dev/null @@ -1,162 +0,0 @@ -#!/bin/bash -# LGSM fn_stop function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Stops the server. - -local modulename="Stopping" - -sdtd_telnet(){ - sdtdshutdown=$( expect -c ' - proc abort {} { - puts "Timeout or EOF\n" - exit 1 - } - spawn telnet '"${telnetip}"' '"${telnetport}"' - expect { - "password:" { send "'"${telnetpass}"'\r" } - default abort - } - expect { - "session." { send "shutdown\r" } - default abort - } - expect { eof } - puts "Completed.\n" - ') -} - -fn_stop_teamspeak3(){ -fn_check_root -fn_check_systemdir -fn_printdots "${servername}" -fn_scriptlog "${servername}" -sleep 1 -fn_check_ts3status -if [ "${ts3status}" = "No server running (ts3server.pid is missing)" ];then - fn_printfail "${servername} is already stopped" - fn_scriptlog "${servername} is already stopped" -else - ${filesdir}/ts3server_startscript.sh stop > /dev/null 2>&1 - fn_printok "${servername}" - fn_scriptlog "Stopped ${servername}" -fi -# Remove lock file -rm -f "${rootdir}/${lockselfname}" -sleep 1 -echo -en "\n" -} - -fn_stop_tmux(){ -fn_check_root -fn_check_systemdir -fn_details_config -fn_printdots "${servername}" -fn_scriptlog "${servername}" -sleep 1 -fn_check_tmux - -if [ "${gamename}" == "7 Days To Die" ] ; then - # if game is 7 Days To Die, we need special, graceful shutdown via telnet connection. - # Set below variable to be called for expect to operate correctly.. - fn_printdots "Attempting graceful shutdown via telnet" - fn_scriptlog "Attempting graceful shutdown via telnet" - sleep 1 - telnetip=127.0.0.1 - sdtd_telnet - - # If failed using localhost will use servers ip - refused=$(echo -en "\n ${sdtdshutdown}"| grep "Timeout or EOF") - if [ -n "${refused}" ]; then - fn_check_ip - telnetip=${ip} - fn_printwarn "Attempting graceful shutdown via telnet: localhost failed" - fn_scriptlog "Warning! Attempting graceful shutdown failed using localhost" - sleep 5 - echo -en "\n" - fn_printdots "Attempting graceful shutdown via telnet: using ${telnetip}" - fn_scriptlog "Attempting graceful shutdown via telnet using ${telnetip}" - sdtd_telnet - sleep 1 - fi - - refused=$(echo -en "\n ${sdtdshutdown}"| grep "Timeout or EOF") - completed=$(echo -en "\n ${sdtdshutdown}"| grep "Completed.") - if [ -n "${refused}" ]; then - fn_printfail "Attempting graceful shutdown via telnet" - fn_scriptlog "Attempting graceful shutdown failed" - fn_scriptlog "${refused}" - elif [ -n "${completed}" ]; then - fn_printok "Attempting graceful shutdown via telnet" - fn_scriptlog "Attempting graceful shutdown succeeded" - else - fn_printfail "Attempting graceful shutdown via telnet: Unknown error" - fn_scriptlog "Attempting graceful shutdown failed" - fn_scriptlog "Unknown error" - fi - sleep 1 - echo -en "\n\n" - echo -en "Telnet output:" - echo -en "\n ${sdtdshutdown}" - echo -en "\n\n" - sleep 1 - fn_printdots "${servername}" - fn_scriptlog "${servername}" - sleep 5 - pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:") - if [ "${pid}" == "0" ]; then - fn_printok "${servername} is already stopped using graceful shutdown" - fn_scriptlog "${servername} is already stopped using graceful shutdown" - else - tmux kill-session -t "${servicename}" - fn_printok "${servername}" - fn_scriptlog "Stopped ${servername}" - fi - -else - pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:") - if [ "${pid}" == "0" ]; then - fn_printfail "${servername} is already stopped" - fn_scriptlog "${servername} is already stopped" - else - - if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then - sleep 1 - fn_printdots "Attempting graceful shutdown" - fn_scriptlog "Attempting graceful shutdown" - tmux send -t "${servicename}" quit ENTER > /dev/null 2>&1 - counter=0 - while [ "${pid}" != "0" -a $counter -lt 30 ]; do - pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:") - sleep 1 - let counter=counter+1 - if [ "${counter}" -gt "1" ];then - fn_printdots "Attempting graceful shutdown: ${counter}" - fi - done - pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:") - if [ "${pid}" == "0" ];then - fn_printok "Attempting graceful shutdown" - else - fn_printfail "Attempting graceful shutdown" - fi - fi - - tmux kill-session -t "${servicename}" > /dev/null 2>&1 - fn_printok "${servername}" - fn_scriptlog "Stopped ${servername}" - fi -fi - # Remove lock file - rm -f "${rootdir}/${lockselfname}" - sleep 1 - echo -en "\n" -} - -if [ "${gamename}" == "Teamspeak 3" ]; then - fn_stop_teamspeak3 -else - fn_stop_tmux -fi \ No newline at end of file diff --git a/functions/fn_update_check b/functions/fn_update_check deleted file mode 100644 index 7f175ecc6..000000000 --- a/functions/fn_update_check +++ /dev/null @@ -1,319 +0,0 @@ -#!/bin/bash -# LGSM fn_update_check function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Checks if a server update is available. - -local modulename="Update" - -### SteamCMD Update Checker ### - -fn_appmanifestinfo(){ - appmanifestfile=$(find "${filesdir}" -type f -name "appmanifest_${appid}.acf") - appmanifestfilewc=$(find "${filesdir}" -type f -name "appmanifest_${appid}.acf"|wc -l) -} - -fn_appmanifestcheck(){ -fn_appmanifestinfo -# Multiple or no matching appmanifest files may sometimes be available. -# This is an error is corrected below if required. -if [ "${appmanifestfilewc}" -ge "2" ]; then - sleep 1 - fn_printwarn "Multiple appmanifest_${appid}.acf files found" - fn_scriptlog "Warning! Multiple appmanifest_${appid}.acf files found" - sleep 2 - fn_printdots "Removing x${appmanifestfilewc} appmanifest_${appid}.acf files" - sleep 1 - for appfile in ${appmanifestfile}; do - rm "${appfile}" - done - appmanifestfilewc1="${appmanifestfilewc}" - fn_appmanifestinfo - if [ "${appmanifestfilewc}" -ge "2" ]; then - fn_printfail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" - fn_scriptlog "Failure! Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" - sleep 1 - echo "" - echo " Check user permissions" - for appfile in ${appmanifestfile}; do - echo " ${appfile}" - done - exit 1 - else - sleep 1 - fn_printok "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files" - fn_scriptlog "Success! Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files" - sleep 1 - fn_printinfonl "Forcing update to correct issue" - fn_scriptlog "Forcing update to correct issue" - sleep 1 - fn_update_dl - fn_update_check - fi -elif [ "${appmanifestfilewc}" -eq "0" ]; then - if [ "${forceupdate}" == "1" ]; then - fn_printfail "Still no appmanifest_${appid}.acf found: Unable to update" - fn_scriptlog "Warning! Still no appmanifest_${appid}.acf found: Unable to update" - exit 1 - fi - forceupdate=1 - fn_printwarn "No appmanifest_${appid}.acf found" - fn_scriptlog "Warning! No appmanifest_${appid}.acf found" - sleep 2 - fn_printinfonl "Forcing update to correct issue" - fn_scriptlog "Forcing update to correct issue" - sleep 1 - fn_update_dl - fn_update_check -fi -} - -fn_logupdaterequest(){ -# Checks for server update requests from server logs. -fn_printdots "Checking for update: Server logs" -fn_scriptlog "Checking for update: Server logs" -sleep 1 -requestrestart=$(grep -Ec "MasterRequestRestart" "${consolelog}") -if [ "${requestrestart}" -ge "1" ]; then - fn_printoknl "Checking for update: Server logs: Update requested" - sleep 1 - echo "" - echo -ne "Applying update.\r" - sleep 1 - echo -ne "Applying update..\r" - sleep 1 - echo -ne "Applying update...\r" - sleep 1 - echo -ne "\n" - tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:") - if [ "${tmuxwc}" -eq 1 ]; then - fn_stop - fn_update_dl - fn_start - else - fn_update_dl - fi -else - fn_printok "Checking for update: Server logs: No update requested" - sleep 1 -fi -} - -fn_steamcmdcheck(){ -fn_check_steamcmd -fn_check_steamuser -fn_appmanifestcheck -# Checks for server update from SteamCMD -fn_printdots "Checking for update: SteamCMD" -fn_scriptlog "Checking for update: SteamCMD" -sleep 1 - -# Gets currentbuild -currentbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) - -# Gets availablebuild info -cd "${rootdir}/steamcmd" - -# Removes appinfo.vdf as a fix for not always getting up to date version info from SteamCMD - -if [ -f "${rootdir}/Steam/appcache/appinfo.vdf" ]; then - rm -f "${rootdir}/Steam/appcache/appinfo.vdf" -fi -availablebuild=$(./steamcmd.sh +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +app_info_print "${appid}" +quit | grep -EA 1000 "^\s+\"branches\"$" | grep -EA 5 "^\s+\"public\"$" | grep -m 1 -EB 10 "^\s+}$" | grep -E "^\s+\"buildid\"\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) -if [ -z "${availablebuild}" ]; then - fn_printfail "Checking for update: SteamCMD" - fn_scriptlog "Failure! Checking for update: SteamCMD" - sleep 1 - fn_printfailnl "Checking for update: SteamCMD: Not returning version info" - fn_scriptlog "Failure! Checking for update: SteamCMD: Not returning version info" - exit 1 -else - fn_printok "Checking for update: SteamCMD" - fn_scriptlog "Success! Checking for update: SteamCMD" - sleep 1 -fi - -if [ "${currentbuild}" != "${availablebuild}" ]; then - echo -e "\n" - echo -e "Update available:" - sleep 1 - echo -e " Current build: \e[0;31m${currentbuild}\e[0;39m" - echo -e " Available build: \e[0;32m${availablebuild}\e[0;39m" - echo -e "" - echo -e " https://steamdb.info/app/${appid}/" - sleep 1 - echo "" - echo -en "Applying update.\r" - sleep 1 - echo -en "Applying update..\r" - sleep 1 - echo -en "Applying update...\r" - sleep 1 - echo -en "\n" - fn_scriptlog "Update available" - fn_scriptlog "Current build: ${currentbuild}" - fn_scriptlog "Available build: ${availablebuild}" - fn_scriptlog "${currentbuild} > ${availablebuild}" - - tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:") - if [ "${tmuxwc}" -eq 1 ]; then - fn_stop - fn_update_dl - fn_start - else - fn_update_dl - fi -else - echo -e "\n" - echo -e "No update available:" - echo -e " Current version: \e[0;32m${currentbuild}\e[0;39m" - echo -e " Available version: \e[0;32m${availablebuild}\e[0;39m" - echo -e " https://steamdb.info/app/${appid}/" - echo -e "" - fn_printoknl "No update available" - fn_scriptlog "Current build: ${currentbuild}" - fn_scriptlog "Available build: ${availablebuild}" -fi -} - -### END SteamCMD Update Checker ### - -fn_teamspeak3_check(){ -# Checks for server update from teamspeak.com using a mirror dl.4players.de -fn_printdots "Checking for update: teamspeak.com" -fn_scriptlog "Checking for update: teamspeak.com" -sleep 1 - -# Gets currentbuild info -# Checks currentbuild info is available, if fails a server restart will be forced to generate logs -if [ -z "$(find ./* -name 'ts3server*_0.log')" ]; then - fn_printfail "Checking for update: teamspeak.com" - fn_scriptlog "Checking for update: teamspeak.com" - sleep 1 - fn_printfailnl "Checking for update: teamspeak.com: No logs with server version found" - fn_scriptlog "Failure! Checking for update: teamspeak.com: No logs with server version found" - sleep 2 - fn_printinfonl "Checking for update: teamspeak.com: Forcing server restart" - fn_scriptlog "Checking for update: teamspeak.com: Forcing server restart" - sleep 2 - fn_stop - fn_start - sleep 2 - # If still failing will exit - if [ -z "$(find ./* -name 'ts3server*_0.log')" ]; then - fn_printfailnl "Checking for update: teamspeak.com: Still No logs with server version found" - fn_scriptlog "Failure! Checking for update: teamspeak.com: Still No logs with server version found" - exit 1 - fi -fi -currentbuild=$(cat $(find ./* -name 'ts3server*_0.log' 2> /dev/null | sort | egrep -E -v '${rootdir}/.ts3version' | tail -1) | egrep -o 'TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | egrep -o '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}') - -# Gets the teamspeak server architecture -ts3arch=$(ls $(find ${filesdir}/ -name 'ts3server_*_*' 2> /dev/null | grep -v 'ts3server_minimal_runscript.sh' | sort | tail -1) | egrep -o '(amd64|x86)' | tail -1) - -# Gets availablebuild info - -# Grabs all version numbers not in correct order -wget "http://dl.4players.de/ts/releases/?C=M;O=D" -q -O -| grep -i dir | egrep -o '.*\/<\/a>' | egrep -o '[0-9\.?]+'|uniq > .ts3_version_numbers_unsorted.tmp - -# removes digits to allow sorting of numbers -cat .ts3_version_numbers_unsorted.tmp |tr -cd '[:digit:][*\n]' > .ts3_version_numbers_digit.tmp -# Sorts numbers in to correct order -# merges two files in to one with two columns sorts the numbers in to order then only outputs the second to the ts3_version_numbers.tmp -paste .ts3_version_numbers_digit.tmp .ts3_version_numbers_unsorted.tmp |sort -rn|awk '{ print $2 }' > .ts3_version_numbers.tmp - -# Finds directory with most recent server version. -while read ts3_version_number; do - wget --spider -q "http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux-${ts3arch}-${ts3_version_number}.tar.gz" - if [[ $? == 0 ]]; then - availablebuild="${ts3_version_number}" - # Break while-loop, if the latest release could be found - break - fi -done < .ts3_version_numbers.tmp -rm -f .ts3_version_numbers_digit.tmp -rm -f .ts3_version_numbers_unsorted.tmp -rm -f .ts3_version_numbers.tmp - -# Checks availablebuild info is available -if [ -z "${availablebuild}" ]; then - fn_printfail "Checking for update: teamspeak.com" - fn_scriptlog "Checking for update: teamspeak.com" - sleep 1 - fn_printfail "Checking for update: teamspeak.com: Not returning version info" - fn_scriptlog "Failure! Checking for update: teamspeak.com: Not returning version info" - sleep 2 - exit 1 -else - fn_printok "Checking for update: teamspeak.com" - fn_scriptlog "Success! Checking for update: teamspeak.com" - sleep 1 -fi - -# Removes dots so if can compare version numbers -currentbuilddigit=$(echo "${currentbuild}"|tr -cd '[:digit:]') -availablebuilddigit=$(echo "${availablebuild}"|tr -cd '[:digit:]') -if [ "${currentbuilddigit}" -ne "${availablebuilddigit}" ]; then - echo -e "\n" - echo -e "Update available:" - sleep 1 - echo -e " Current build: \e[0;31m${currentbuild} ${architecture}\e[0;39m" - echo -e " Available build: \e[0;32m${availablebuild} ${architecture}\e[0;39m" - echo -e "" - sleep 1 - echo "" - echo -en "Applying update.\r" - sleep 1 - echo -en "Applying update..\r" - sleep 1 - echo -en "Applying update...\r" - sleep 1 - echo -en "\n" - fn_scriptlog "Update available" - fn_scriptlog "Current build: ${currentbuild}" - fn_scriptlog "Available build: ${availablebuild}" - fn_scriptlog "${currentbuild} > ${availablebuild}" - fn_check_ts3status - if [ "${ts3status}" = "No server running (ts3server.pid is missing)" ];then - fn_update_dl - fn_start - sleep 5 - fn_stop - else - fn_stop - fn_update_dl - fn_start - fi -else - echo -e "\n" - echo -e "No update available:" - echo -e " Current version: \e[0;32m${currentbuild}\e[0;39m" - echo -e " Available version: \e[0;32m${availablebuild}\e[0;39m" - echo -e "" - fn_printoknl "No update available" - fn_scriptlog "Current build: ${currentbuild}" - fn_scriptlog "Available build: ${availablebuild}" -fi -} - -fn_check_logs -fn_printdots "Checking for update" -if [ "${gamename}" == "Teamspeak 3" ]; then - fn_teamspeak3_check -elif [ "${engine}" == "goldsource" ]||[ "${forceupdate}" == "1" ]; then - # Goldsource servers bypass checks as fn_steamcmdcheck does not work for appid 90 servers. - # forceupdate bypasses checks - tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:") - if [ "${tmuxwc}" -eq 1 ]; then - fn_stop - fn_update_dl - fn_start - else - fn_update_dl - fi -else - fn_logupdaterequest - fn_steamcmdcheck -fi diff --git a/functions/fn_update_dl b/functions/fn_update_dl deleted file mode 100644 index 835727cd0..000000000 --- a/functions/fn_update_dl +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/bash -# LGSM fn_update_dl function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Runs a server update. - -local modulename="Update" - -fn_steamcmd_dl(){ -fn_check_root -fn_check_systemdir -fn_details_config -fn_printdots "Updating ${servername}" -sleep 1 -fn_printoknl "Updating ${servername}" -fn_scriptlog "Updating ${servername}" -sleep 1 -cd "${rootdir}" -cd "steamcmd" - -# Detects if unbuffer command is available. -if [ $(command -v unbuffer) ]; then - unbuffer=unbuffer -fi - -if [ "${engine}" == "goldsource" ]; then - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" +quit|tee -a "${scriptlog}" -else - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit|tee -a "${scriptlog}" -fi - - -if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then - echo -e '\n' - fn_csgofix -fi -} - -fn_teamspeak3_dl(){ -fn_check_root -fn_check_systemdir -fn_details_config -fn_printdots "Updating ${servername}" -sleep 1 -fn_printoknl "Updating ${servername}" -fn_scriptlog "Updating ${servername}" -sleep 1 -cd "${rootdir}" -echo -e "downloading teamspeak3-server_linux-${ts3arch}-${availablebuild}.tar.gz...\c" -fn_scriptlog "Downloading teamspeak3-server_linux-${ts3arch}-${availablebuild}.tar.gz" -wget -N /dev/null http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux-${ts3arch}-${ts3_version_number}.tar.gz 2>&1 | grep -F HTTP | cut -c45-| uniq -sleep 1 -echo -e "extracting teamspeak3-server_linux-${ts3arch}-${availablebuild}.tar.gz...\c" -fn_scriptlog "Extracting teamspeak3-server_linux-${ts3arch}-${availablebuild}.tar.gz" -tar -xf "teamspeak3-server_linux-${ts3arch}-${availablebuild}.tar.gz" 2> "${scriptlogdir}/.${servicename}-tar-error.tmp" -local status=$? -if [ ${status} -eq 0 ]; then - echo "OK" -else - echo "FAIL - Exit status ${status}" - fn_scriptlog "Failed to extract - Exit status ${status}" - sleep 1 - cat "${scriptlogdir}/.${servicename}-tar-error.tmp" - cat "${scriptlogdir}/.${servicename}-tar-error.tmp" >> "${scriptlog}" - rm "${scriptlogdir}/.${servicename}-tar-error.tmp" - fn_scriptlog "Failure! Unable to update" - exit ${status} -fi -echo -e "copying to ${filesdir}...\c" -fn_scriptlog "Copying to ${filesdir}" -cp -R "${rootdir}/teamspeak3-server_linux-${ts3arch}/"* "${filesdir}" 2> "${scriptlogdir}/.${servicename}-cp-error.tmp" -local status=$? -if [ ${status} -eq 0 ]; then - echo "OK" -else - echo "FAIL - Exit status ${status}" - fn_scriptlog "Failed to copy - Exit status ${status}" - sleep 1 - cat "${scriptlogdir}/.${servicename}-cp-error.tmp" - cat "${scriptlogdir}/.${servicename}-cp-error.tmp" >> "${scriptlog}" - rm "${scriptlogdir}/.${servicename}-cp-error.tmp" - fn_scriptlog "Failure! Unable to update" - exit ${status} -fi -rm -f teamspeak3-server_linux-${ts3arch}-${availablebuild}.tar.gz -rm -rf "${rootdir}/teamspeak3-server_linux-${ts3arch}" -} - -if [ "${gamename}" == "Teamspeak 3" ]; then - fn_teamspeak3_dl -else - fn_steamcmd_dl -fi diff --git a/functions/fn_update_functions b/functions/fn_update_functions deleted file mode 100644 index c000578d0..000000000 --- a/functions/fn_update_functions +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# LGSM fn_update_functions function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Deletes the functions dir to allow re-downloading of functions from GitHub. - -fn_printdots "Updating functions" -fn_scriptlog "Updating functions" -sleep 1 -echo -ne "\n" -rm -rfv "${rootdir}/functions/"* -exitcode=$? -if [ "${exitcode}" == "0" ]; then - fn_printok "Updating functions" - fn_scriptlog "Successfull! Updating functions" -else - fn_printokfail "Updating functions" - fn_scriptlog "Failure! Updating functions" -fi -echo -ne "\n" \ No newline at end of file diff --git a/functions/fn_validate b/functions/fn_validate deleted file mode 100644 index 238640958..000000000 --- a/functions/fn_validate +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# LGSM fn_validate function -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -lgsm_version="061115" - -# Description: Runs a server validation. - -local modulename="Validate" - -fn_validation(){ -fn_printwarn "Validating may overwrite some customised files." -sleep 1 -echo -en "\n" -echo -en "https://developer.valvesoftware.com/wiki/SteamCMD#Validate" -sleep 5 -echo -en "\n" -fn_printdots "Checking server files" -sleep 1 -fn_printok "Checking server files" -fn_scriptlog "Checking server files" -sleep 1 -cd "${rootdir}" -cd "steamcmd" -fn_check_steamcmd -fn_check_steamuser - -if [ $(command -v unbuffer) ]; then - unbuffer=unbuffer -fi - -if [ "${engine}" == "goldsource" ]; then - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" +app_update "${appid}" validate +quit|tee -a "${scriptlog}" -else - ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" validate +quit|tee -a "${scriptlog}" -fi - -if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then - echo -e '\n' - fn_csgofix -fi -fn_scriptlog "Checking complete" -} - -fn_check_root -fn_check_systemdir -tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:") -if [ "${tmuxwc}" -eq 1 ]; then - fn_stop - fn_validation - fn_start -else - fn_validation -fi diff --git a/images/icons/centos-icon-32.png b/images/icons/centos-icon-32.png deleted file mode 100644 index fb03f304e..000000000 Binary files a/images/icons/centos-icon-32.png and /dev/null differ diff --git a/images/icons/debian-icon-32.png b/images/icons/debian-icon-32.png deleted file mode 100644 index 93650c5d0..000000000 Binary files a/images/icons/debian-icon-32.png and /dev/null differ diff --git a/images/icons/ubuntu-icon-32.png b/images/icons/ubuntu-icon-32.png deleted file mode 100644 index 92be4b5a1..000000000 Binary files a/images/icons/ubuntu-icon-32.png and /dev/null differ diff --git a/images/logo/README.md b/images/logo/README.md deleted file mode 100644 index ef9c9c3f7..000000000 --- a/images/logo/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# LGSM - Official Logos -For Reference the original design can be found here. -http://twolofbees.com/artwork.php?iid=870 \ No newline at end of file diff --git a/images/logo/assets/lgsm-font-pt_sans.zip b/images/logo/assets/lgsm-font-pt_sans.zip deleted file mode 100644 index 15d1b0ff3..000000000 Binary files a/images/logo/assets/lgsm-font-pt_sans.zip and /dev/null differ diff --git a/images/logo/assets/lgsm-square.xcf b/images/logo/assets/lgsm-square.xcf deleted file mode 100644 index 478dec256..000000000 Binary files a/images/logo/assets/lgsm-square.xcf and /dev/null differ diff --git a/images/logo/assets/lgsm.xcf b/images/logo/assets/lgsm.xcf deleted file mode 100644 index 87edc3a86..000000000 Binary files a/images/logo/assets/lgsm.xcf and /dev/null differ diff --git a/images/logo/assets/lgsm_full.xcf b/images/logo/assets/lgsm_full.xcf deleted file mode 100644 index a48824b93..000000000 Binary files a/images/logo/assets/lgsm_full.xcf and /dev/null differ diff --git a/images/logo/lgsm-250x143-dark.png b/images/logo/lgsm-250x143-dark.png deleted file mode 100644 index 6d87e0e2b..000000000 Binary files a/images/logo/lgsm-250x143-dark.png and /dev/null differ diff --git a/images/logo/lgsm-250x143-light.png b/images/logo/lgsm-250x143-light.png deleted file mode 100644 index 7b85f4f80..000000000 Binary files a/images/logo/lgsm-250x143-light.png and /dev/null differ diff --git a/images/logo/lgsm-full-dark.png b/images/logo/lgsm-full-dark.png deleted file mode 100644 index 3be3323d1..000000000 Binary files a/images/logo/lgsm-full-dark.png and /dev/null differ diff --git a/images/logo/lgsm-full-light.png b/images/logo/lgsm-full-light.png deleted file mode 100644 index 7dcb7c341..000000000 Binary files a/images/logo/lgsm-full-light.png and /dev/null differ diff --git a/images/logo/lgsm-site-foot.png b/images/logo/lgsm-site-foot.png deleted file mode 100644 index 3eab7d7b8..000000000 Binary files a/images/logo/lgsm-site-foot.png and /dev/null differ diff --git a/images/logo/lgsm-site-head.png b/images/logo/lgsm-site-head.png deleted file mode 100644 index fe32ed131..000000000 Binary files a/images/logo/lgsm-site-head.png and /dev/null differ diff --git a/images/logo/lgsm-square-114-dark.png b/images/logo/lgsm-square-114-dark.png deleted file mode 100644 index 7e1f6a3f6..000000000 Binary files a/images/logo/lgsm-square-114-dark.png and /dev/null differ diff --git a/images/logo/lgsm-square-114-light.png b/images/logo/lgsm-square-114-light.png deleted file mode 100644 index 02e8f6620..000000000 Binary files a/images/logo/lgsm-square-114-light.png and /dev/null differ diff --git a/images/logo/lgsm-square-16-dark.png b/images/logo/lgsm-square-16-dark.png deleted file mode 100644 index 5e279d80a..000000000 Binary files a/images/logo/lgsm-square-16-dark.png and /dev/null differ diff --git a/images/logo/lgsm-square-16-light.png b/images/logo/lgsm-square-16-light.png deleted file mode 100644 index 141f5de59..000000000 Binary files a/images/logo/lgsm-square-16-light.png and /dev/null differ diff --git a/images/logo/lgsm-square-184-dark.png b/images/logo/lgsm-square-184-dark.png deleted file mode 100644 index e012b0f48..000000000 Binary files a/images/logo/lgsm-square-184-dark.png and /dev/null differ diff --git a/images/logo/lgsm-square-184-light.png b/images/logo/lgsm-square-184-light.png deleted file mode 100644 index 11245350f..000000000 Binary files a/images/logo/lgsm-square-184-light.png and /dev/null differ diff --git a/images/logo/lgsm-square-24-dark.png b/images/logo/lgsm-square-24-dark.png deleted file mode 100644 index b9405b00a..000000000 Binary files a/images/logo/lgsm-square-24-dark.png and /dev/null differ diff --git a/images/logo/lgsm-square-24-light.png b/images/logo/lgsm-square-24-light.png deleted file mode 100644 index 3ea1c1d6f..000000000 Binary files a/images/logo/lgsm-square-24-light.png and /dev/null differ diff --git a/images/logo/lgsm-square-32-dark.png b/images/logo/lgsm-square-32-dark.png deleted file mode 100644 index 2dcaa6d00..000000000 Binary files a/images/logo/lgsm-square-32-dark.png and /dev/null differ diff --git a/images/logo/lgsm-square-32-light.png b/images/logo/lgsm-square-32-light.png deleted file mode 100644 index 8fa3b6362..000000000 Binary files a/images/logo/lgsm-square-32-light.png and /dev/null differ diff --git a/images/logo/lgsm-square-512-dark.png b/images/logo/lgsm-square-512-dark.png deleted file mode 100644 index 662bcb66c..000000000 Binary files a/images/logo/lgsm-square-512-dark.png and /dev/null differ diff --git a/images/logo/lgsm-square-512-light.png b/images/logo/lgsm-square-512-light.png deleted file mode 100644 index 22ea1d32f..000000000 Binary files a/images/logo/lgsm-square-512-light.png and /dev/null differ diff --git a/images/logo/lgsm-square-64-dark.png b/images/logo/lgsm-square-64-dark.png deleted file mode 100644 index 96656d6c1..000000000 Binary files a/images/logo/lgsm-square-64-dark.png and /dev/null differ diff --git a/images/logo/lgsm-square-64-light.png b/images/logo/lgsm-square-64-light.png deleted file mode 100644 index e8e3d1cfc..000000000 Binary files a/images/logo/lgsm-square-64-light.png and /dev/null differ diff --git a/images/screens/DSTconsole.png b/images/screens/DSTconsole.png deleted file mode 100644 index 964481a51..000000000 Binary files a/images/screens/DSTconsole.png and /dev/null differ diff --git a/images/screens/DSTconsolecommand.png b/images/screens/DSTconsolecommand.png deleted file mode 100644 index 9f95d35dc..000000000 Binary files a/images/screens/DSTconsolecommand.png and /dev/null differ diff --git a/images/screens/Tmux.png b/images/screens/Tmux.png deleted file mode 100644 index 1d676ef3f..000000000 Binary files a/images/screens/Tmux.png and /dev/null differ diff --git a/lgsm/config-default/config-lgsm/acserver/_default.cfg b/lgsm/config-default/config-lgsm/acserver/_default.cfg new file mode 100644 index 000000000..56034419a --- /dev/null +++ b/lgsm/config-default/config-lgsm/acserver/_default.cfg @@ -0,0 +1,180 @@ +################################## +######## 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 + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-c ${servercfgfullpath}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="302550" +steamcmdforcewindows="yes" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="5" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Assetto Corsa" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./acServer" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server_cfg.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ahl2server/_default.cfg b/lgsm/config-default/config-lgsm/ahl2server/_default.cfg new file mode 100644 index 000000000..a3810daed --- /dev/null +++ b/lgsm/config-default/config-lgsm/ahl2server/_default.cfg @@ -0,0 +1,186 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login +steamuser="username" +steampass='password' + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="act_airport" +maxplayers="20" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game ahl2 -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="985050" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Action: Source" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/ahl2" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ahlserver/_default.cfg b/lgsm/config-default/config-lgsm/ahlserver/_default.cfg new file mode 100644 index 000000000..dfaea449c --- /dev/null +++ b/lgsm/config-default/config-lgsm/ahlserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="ahl_hydro" +maxplayers="16" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game action -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers} " + +#### LinuxGSM Settings #### + +## 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". +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="90" +steamcmdforcewindows="no" +appidmod="cstrike" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="9" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Action Half-Life" +engine="goldsrc" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/action" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/arkserver/_default.cfg b/lgsm/config-default/config-lgsm/arkserver/_default.cfg new file mode 100644 index 000000000..e9498565d --- /dev/null +++ b/lgsm/config-default/config-lgsm/arkserver/_default.cfg @@ -0,0 +1,184 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="7777" +queryport="27015" +rconport="27020" +# Default Map: TheIsland, Ragnarok, CrystalIsles, Aberration_P, ScorchedEarth_P +defaultmap="TheIsland" +altsavedirectoryname="${defaultmap}" +maxplayers="70" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="${defaultmap}?AltSaveDirectoryName=${altsavedirectoryname}?listen?MultiHome=${ip}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port} -automanagedmods -crossplay -PublicIPForEpic=${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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="5" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="376030" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="no" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="ARK: Survival Evolved" +engine="unreal4" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/ShooterGame" +executabledir="${systemdir}/Binaries/Linux" +executable="./ShooterGameServer" +servercfgdir="${systemdir}/Saved/Config/LinuxServer" +servercfg="GameUserSettings.ini" +servercfgdefault="GameUserSettings.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" diff --git a/lgsm/config-default/config-lgsm/arma3server/_default.cfg b/lgsm/config-default/config-lgsm/arma3server/_default.cfg new file mode 100644 index 000000000..26cbd8d93 --- /dev/null +++ b/lgsm/config-default/config-lgsm/arma3server/_default.cfg @@ -0,0 +1,200 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login +steamuser="username" +steampass='password' + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="2302" + +## ARMA 3 Modules +# Add mods with relative paths: +# mods/@cba_a3 +# To load the "Community Base Addons v3" module found in the +# directory serverfiles/mods/@cba_a3. Load several mods as: +# mods="mods/@ace\;mods/@acex\;mods/@cba_a3" +mods="" + +## Server-side Mods +servermods="" + +## Path to BattlEye +# Leave empty for default +bepath="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-ip=${ip} -port=${port} -cfg=${networkcfgfullpath} -config=${servercfgfullpath} -mod=${mods} -servermod=${servermods} -bepath=${bepath} -autoinit -loadmissiontomemory" + +#### 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="5" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="233780" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="ARMA 3" +engine="realvirtuality" +glibc="2.13" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./arma3server_64" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.server.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +networkcfgdir="${systemdir}/cfg" +networkcfg="${selfname}.network.cfg" +networkcfgdefault="network.cfg" +networkcfgfullpath="${networkcfgdir}/${networkcfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/avserver/_default.cfg b/lgsm/config-default/config-lgsm/avserver/_default.cfg new file mode 100644 index 000000000..2cfa69d1c --- /dev/null +++ b/lgsm/config-default/config-lgsm/avserver/_default.cfg @@ -0,0 +1,179 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +port="27000" +# https://steamidfinder.com +adminsteamid="" +if [ -n "${adminsteamid}" ]; then + admincmd="--admin ${adminsteamid}" +fi + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters + +startparameters="--galaxy-name ${selfname} --ip ${ip} --datapath ${avdatapath} ${admincmd}" + +#### 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". +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="565060" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## 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="10" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="5" +querytype="" + +## Game Server Details +# Do not edit +gamename="Avorion" +engine="avorion" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +avdatapath="${serverfiles}/galaxy" +avgalaxypath="${avdatapath}/${selfname}" +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./server.sh" +servercfgdir="${avgalaxypath}" +servercfg="server.ini" +servercfgdefault="server.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/ServerLogs" +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" diff --git a/lgsm/config-default/config-lgsm/bb2server/_default.cfg b/lgsm/config-default/config-lgsm/bb2server/_default.cfg new file mode 100644 index 000000000..fd77d0af8 --- /dev/null +++ b/lgsm/config-default/config-lgsm/bb2server/_default.cfg @@ -0,0 +1,187 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="bba_barracks" +maxplayers="20" + +## Game Server Login Token (GSLT): Optional +# GSLT can be used for running a public server. +# More info: https://docs.linuxgsm.com/steamcmd/gslt +gslt="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game brainbread2 -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="475370" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="BrainBread 2" +engine="source" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/brainbread2" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/bbserver/_default.cfg b/lgsm/config-default/config-lgsm/bbserver/_default.cfg new file mode 100644 index 000000000..7179efc2e --- /dev/null +++ b/lgsm/config-default/config-lgsm/bbserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="bb_chp4_slaywatch" +maxplayers="16" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game brainbread -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="90" +steamcmdforcewindows="no" +appidmod="cstrike" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="9" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="BrainBread" +engine="goldsrc" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/brainbread" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/bdserver/_default.cfg b/lgsm/config-default/config-lgsm/bdserver/_default.cfg new file mode 100644 index 000000000..4abccbb9e --- /dev/null +++ b/lgsm/config-default/config-lgsm/bdserver/_default.cfg @@ -0,0 +1,181 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="pve_tomb" +maxplayers="3" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game bdef -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="817300" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="9" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Base Defense" +engine="goldsrc" +glibc="2.14" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/bdef" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/bf1942server/_default.cfg b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg new file mode 100644 index 000000000..841fd6ff8 --- /dev/null +++ b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg @@ -0,0 +1,164 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+hostServer 1 +dedicated 1" + +#### 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". +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" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-gamespy1" + +## Console type +consoleverbose="no" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Battlefield: 1942" +engine="refractor" +glibc="2.0" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./start.sh" +servercfgdir="${systemdir}/mods/bf1942/settings" +servercfg="serversettings.con" +servercfgdefault="serversettings.con" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/bfvserver/_default.cfg b/lgsm/config-default/config-lgsm/bfvserver/_default.cfg new file mode 100644 index 000000000..b900bc4f8 --- /dev/null +++ b/lgsm/config-default/config-lgsm/bfvserver/_default.cfg @@ -0,0 +1,164 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+statusMonitor 1" + +#### 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". +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" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Battlefield: Vietnam" +engine="refractor" +glibc="2.2.4" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./start.sh" +servercfgdir="${systemdir}/mods/bfvietnam/settings" +servercfg="serversettings.con" +servercfgdefault="serversettings.con" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/mods/bfvietnam/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" diff --git a/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg new file mode 100644 index 000000000..0530b3377 --- /dev/null +++ b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg @@ -0,0 +1,187 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="dm_bounce" +maxplayers="16" + +## Game Server Login Token (GSLT): Optional +# GSLT can be used for running a public server. +# More info: https://docs.linuxgsm.com/steamcmd/gslt +gslt="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game bms -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="346680" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Black Mesa: Deathmatch" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/bms" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/boserver/_default.cfg b/lgsm/config-default/config-lgsm/boserver/_default.cfg new file mode 100644 index 000000000..d37d3894e --- /dev/null +++ b/lgsm/config-default/config-lgsm/boserver/_default.cfg @@ -0,0 +1,180 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Game Server Login Token (GSLT): Optional +# GSLT can be used for running a public server. +# More info: https://docs.linuxgsm.com/steamcmd/gslt +gslt="" +ip="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-batchmode -nographics -dedicated -configfile=${servercfgfullpath}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="416880" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Ballistic Overkill" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./BODS.x86_64" +servercfgdir="${systemdir}" +servercfg="${selfname}.txt" +servercfgdefault="config.txt" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/bsserver/_default.cfg b/lgsm/config-default/config-lgsm/bsserver/_default.cfg new file mode 100644 index 000000000..00a0b2e18 --- /dev/null +++ b/lgsm/config-default/config-lgsm/bsserver/_default.cfg @@ -0,0 +1,191 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login +steamuser="username" +steampass='password' + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="duel_winter" +maxplayers="16" + +## Game Server Login Token (GSLT): Required +# GSLT is required for running a public server. +# More info: https://docs.linuxgsm.com/steamcmd/gslt +gslt="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game "${serverfiles}/berimbau" -autoupdate -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="228780" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Blade Symphony" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/berimbau" +executabledir="${serverfiles}/bin" +executable="./srcds_run.sh" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/bt1944server/_default.cfg b/lgsm/config-default/config-lgsm/bt1944server/_default.cfg new file mode 100644 index 000000000..7f066accf --- /dev/null +++ b/lgsm/config-default/config-lgsm/bt1944server/_default.cfg @@ -0,0 +1,178 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="7777" +queryport="7780" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="/Game/Maps/Final_Maps/Derailed?Game=/Script/ShooterGame.WartideGameMode?listen -log -broadcastip=\"${extip}\" -PORT=${port} -QueryPort=${queryport} -defgameini=\"${servercfgfullpath}\"" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="805140" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="no" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Battalion 1944" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/Linux/Battalion" +executabledir="${systemdir}/Binaries/Linux" +executable="./BattalionServer" +servercfgdir="${systemdir}/Saved/Config/LinuxServer" +servercfg="${selfname}.ini" +servercfgdefault="DefaultGame.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" diff --git a/lgsm/config-default/config-lgsm/btserver/_default.cfg b/lgsm/config-default/config-lgsm/btserver/_default.cfg new file mode 100644 index 000000000..92c65e1ce --- /dev/null +++ b/lgsm/config-default/config-lgsm/btserver/_default.cfg @@ -0,0 +1,174 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="" + +#### 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". +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="1026340" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="7" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Barotrauma" +engine="barotrauma" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./DedicatedServer.exe" +servercfgdir="${systemdir}" +servercfg="serversettings.xml" +servercfgdefault="serversettings.xml" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/ServerLogs" +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" diff --git a/lgsm/config-default/config-lgsm/ccserver/_default.cfg b/lgsm/config-default/config-lgsm/ccserver/_default.cfg new file mode 100644 index 000000000..ef9433aff --- /dev/null +++ b/lgsm/config-default/config-lgsm/ccserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="cbe_bunker" +maxplayers="6" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game cure -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="383410" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Codename CURE" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/cure" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/cmwserver/_default.cfg b/lgsm/config-default/config-lgsm/cmwserver/_default.cfg new file mode 100644 index 000000000..cb259c2a9 --- /dev/null +++ b/lgsm/config-default/config-lgsm/cmwserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="7777" +queryport="7779" +defaultmap="AOCTD-Frigid_p" + + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="${defaultmap}?steamsockets -multihome=${ip} -Port=${port} -QueryPort=${queryport} -seekfreeloadingserver -configsubdir=${gamelogdir} -log=${gamelog}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="220070" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Chivalry: Medieval Warfare" +engine="unreal3" +glibc="2.15" + +#### Directories #### +# Edit with care +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}/Binaries/Linux" +executable="./UDKGameServer-Linux" +servercfgdir="${systemdir}/UDKGame/Config/${selfname}" +servercfg="PCServer-UDKGame.ini" +servercfgdefault="PCServer-UDKGame.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" +gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/cod2server/_default.cfg b/lgsm/config-default/config-lgsm/cod2server/_default.cfg new file mode 100644 index 000000000..53a4521dc --- /dev/null +++ b/lgsm/config-default/config-lgsm/cod2server/_default.cfg @@ -0,0 +1,167 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="28960" +defaultmap="mp_leningrad" +maxplayers="20" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +exec ${servercfg} +map ${defaultmap}" + +#### 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-quake3" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Call of Duty 2" +engine="iw2.0" +glibc="2.1.3" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./cod2_lnxded" +servercfgdir="${systemdir}/main" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/cod4server/_default.cfg b/lgsm/config-default/config-lgsm/cod4server/_default.cfg new file mode 100644 index 000000000..8cde67086 --- /dev/null +++ b/lgsm/config-default/config-lgsm/cod4server/_default.cfg @@ -0,0 +1,167 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="28960" +defaultmap="mp_crossfire" +maxplayers="32" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set fs_homepath ${serverfiles} +set sv_authorizemode "-1" +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +exec ${servercfg} +map ${defaultmap}" + +#### 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-quake3" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Call of Duty 4" +engine="iw3.0" +glibc="2.12" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./cod4x18_dedrun" +servercfgdir="${systemdir}/main" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/codserver/_default.cfg b/lgsm/config-default/config-lgsm/codserver/_default.cfg new file mode 100644 index 000000000..487edbeaf --- /dev/null +++ b/lgsm/config-default/config-lgsm/codserver/_default.cfg @@ -0,0 +1,167 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="28960" +defaultmap="mp_neuville" +maxplayers="20" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +exec ${servercfg} +map ${defaultmap}" + +#### 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-quake3" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Call of Duty" +engine="idtech3" +glibc="2.1" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./cod_lnxded" +servercfgdir="${systemdir}/main" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/coduoserver/_default.cfg b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg new file mode 100644 index 000000000..d6a9d2a5d --- /dev/null +++ b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg @@ -0,0 +1,167 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="28960" +defaultmap="mp_cassino" +maxplayers="20" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +exec ${servercfg} +map ${defaultmap}" + +#### 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-quake3" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Call of Duty: United Offensive" +engine="idtech3" +glibc="2.1" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./coduo_lnxded" +servercfgdir="${systemdir}/uo" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/codwawserver/_default.cfg b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg new file mode 100644 index 000000000..2efd85826 --- /dev/null +++ b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg @@ -0,0 +1,167 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="28960" +defaultmap="mp_castle" +maxplayers="20" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +set sv_maxclients ${maxplayers} +exec ${servercfg} +map ${defaultmap}" + +#### 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-quake3" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Call of Duty: World at War" +engine="iw3.0" +glibc="2.3.2" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./codwaw_lnxded" +servercfgdir="${systemdir}/main" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/colserver/_default.cfg b/lgsm/config-default/config-lgsm/colserver/_default.cfg new file mode 100644 index 000000000..c0cdf7892 --- /dev/null +++ b/lgsm/config-default/config-lgsm/colserver/_default.cfg @@ -0,0 +1,177 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +# Edit with care | https://colonysurvival.gamepedia.com/Dedicated_Server#Installation_.28Linux.29 +startparameters="-batchmode -nographics +server.config ${servercfgfullpath}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="748090" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="no" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Colony Survival" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./colonyserver.x86_64" +servercfgdir="${systemdir}/gamedata/settings" +servercfg="${selfname}.json" +servercfgdefault="colserver.json" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/gamedata/logs/server/" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/common-template.cfg b/lgsm/config-default/config-lgsm/common-template.cfg new file mode 100644 index 000000000..e050a945e --- /dev/null +++ b/lgsm/config-default/config-lgsm/common-template.cfg @@ -0,0 +1,5 @@ +################################## +######## Common Settings ######### +################################## +# PLACE GLOBAL SETTINGS HERE +## These settings will apply to all instances. diff --git a/lgsm/config-default/config-lgsm/csczserver/_default.cfg b/lgsm/config-default/config-lgsm/csczserver/_default.cfg new file mode 100644 index 000000000..559fc1fb5 --- /dev/null +++ b/lgsm/config-default/config-lgsm/csczserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="de_dust2" +maxplayers="16" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game czero -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="90" +steamcmdforcewindows="no" +appidmod="czero" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="9" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Counter-Strike: Condition Zero" +engine="goldsrc" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/czero" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg new file mode 100644 index 000000000..41eb3e251 --- /dev/null +++ b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg @@ -0,0 +1,207 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +# https://docs.linuxgsm.com/game-servers/counter-strike-global-offensive +# [Game Modes] gametype gamemode mapgroup (you can mix these across all Game Modes except Danger Zone, but use only one) +# Arms Race 1 0 mg_armsrace +# Classic Casual 0 0 mg_casualsigma, mg_casualdelta +# Classic Competitive 0 1 mg_active, mg_reserves, mg_hostage, mg_de_dust2 +# Custom 3 0 +# Deathmatch 1 2 mg_deathmatch +# Demolition 1 1 mg_demolition +# Wingman 0 2 +# Danger Zone 6 0 mg_dz_blacksite (map: dz_blacksite), mg_dz_sirocco (map: dz_sirocco) +gametype="0" +gamemode="0" +mapgroup="mg_active" +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="de_mirage" +maxplayers="16" +tickrate="64" + +## Game Server Login Token (GSLT): Required +# GSLT is required for running a public server. +# More info: https://docs.linuxgsm.com/steamcmd/gslt +gslt="" + +## Workshop Parameters | https://developer.valvesoftware.com/wiki/CSGO_Workshop_For_Server_Operators +# To get an API key visit - https://steamcommunity.com/dev/apikey +wsapikey="" +wscollectionid="" +wsstartmap="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +mapgroup ${mapgroup} +game_type ${gametype} +game_mode ${gamemode} +host_workshop_collection ${wscollectionid} +workshop_start_map ${wsstartmap} -authkey ${wsapikey} -nobreakpad" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="740" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="9" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Counter-Strike: Global Offensive" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/csgo" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/csserver/_default.cfg b/lgsm/config-default/config-lgsm/csserver/_default.cfg new file mode 100644 index 000000000..4e79e4e52 --- /dev/null +++ b/lgsm/config-default/config-lgsm/csserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="de_dust2" +maxplayers="16" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game cstrike -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="90" +steamcmdforcewindows="no" +appidmod="cstrike" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="9" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Counter-Strike 1.6" +engine="goldsrc" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/cstrike" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/cssserver/_default.cfg b/lgsm/config-default/config-lgsm/cssserver/_default.cfg new file mode 100644 index 000000000..dcdb9ab8a --- /dev/null +++ b/lgsm/config-default/config-lgsm/cssserver/_default.cfg @@ -0,0 +1,187 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="de_dust2" +maxplayers="16" + +## Game Server Login Token (GSLT): Required +# GSLT is required for running a public server. +# More info: https://docs.linuxgsm.com/steamcmd/gslt +gslt="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game cstrike -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="232330" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Counter-Strike: Source" +engine="source" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/cstrike" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/dabserver/_default.cfg b/lgsm/config-default/config-lgsm/dabserver/_default.cfg new file mode 100644 index 000000000..ee2bacca2 --- /dev/null +++ b/lgsm/config-default/config-lgsm/dabserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="da_rooftops" +maxplayers="10" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="317800" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Double Action: Boogaloo" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/dab" +executabledir="${serverfiles}" +executable="./dabds.sh" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/dmcserver/_default.cfg b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg new file mode 100644 index 000000000..71e670d77 --- /dev/null +++ b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="dcdm5" +maxplayers="16" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game dmc -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="90" +steamcmdforcewindows="no" +appidmod="dmc" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="9" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Deathmatch Classic" +engine="goldsrc" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/dmc" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/dodserver/_default.cfg b/lgsm/config-default/config-lgsm/dodserver/_default.cfg new file mode 100644 index 000000000..2685d0077 --- /dev/null +++ b/lgsm/config-default/config-lgsm/dodserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="dod_Anzio" +maxplayers="16" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game dod -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="90" +steamcmdforcewindows="no" +appidmod="dod" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="9" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Day of Defeat" +engine="goldsrc" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/dod" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/dodsserver/_default.cfg b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg new file mode 100644 index 000000000..a92c46091 --- /dev/null +++ b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="dod_Anzio" +maxplayers="16" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game dod -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="232290" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Day of Defeat: Source" +engine="source" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/dod" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/doiserver/_default.cfg b/lgsm/config-default/config-lgsm/doiserver/_default.cfg new file mode 100644 index 000000000..4caa856f3 --- /dev/null +++ b/lgsm/config-default/config-lgsm/doiserver/_default.cfg @@ -0,0 +1,183 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="bastogne stronghold" +maxplayers="32" +tickrate="64" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game doi -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers} -workshop -norestart" + +#### LinuxGSM Settings #### + +## 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". +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="462310" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Day of Infamy" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/doi" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/dstserver/_default.cfg b/lgsm/config-default/config-lgsm/dstserver/_default.cfg new file mode 100644 index 000000000..2ab6fdde1 --- /dev/null +++ b/lgsm/config-default/config-lgsm/dstserver/_default.cfg @@ -0,0 +1,189 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +sharding="false" +master="true" +shard="Master" +cluster="Cluster_1" +cave="false" + +# Edit with care +persistentstorageroot="${HOME}/.klei" +confdir="DoNotStarveTogether" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-persistent_storage_root ${persistentstorageroot} -conf_dir ${confdir} -cluster ${cluster} -shard ${shard}" + +#### LinuxGSM Settings #### + +## 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". +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="343050" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## 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="yes" + +## Game Server Details +# Do not edit +gamename="Don't Starve Together" +engine="dontstarve" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}/bin" +executable="./dontstarve_dedicated_server_nullrenderer" +clustercfgdir="${persistentstorageroot}/${confdir}/${cluster}" +clustercfg="cluster.ini" +clustercfgdefault="cluster.ini" +clustercfgfullpath="${clustercfgdir}/${clustercfg}" +servercfgdir="${clustercfgdir}/${shard}" +servercfg="server.ini" +servercfgdefault="server.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/dysserver/_default.cfg b/lgsm/config-default/config-lgsm/dysserver/_default.cfg new file mode 100644 index 000000000..1cef60f0d --- /dev/null +++ b/lgsm/config-default/config-lgsm/dysserver/_default.cfg @@ -0,0 +1,187 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="dys_broadcast" +maxplayers="16" + +## Game Server Login Token (GSLT): Optional +# GSLT can be used for running a public server. +# More info: https://docs.linuxgsm.com/steamcmd/gslt +gslt="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game "${serverfiles}/dystopia" -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="17585" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Dystopia" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/dystopia" +executabledir="${serverfiles}/bin" +executable="./srcds_run.sh" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg new file mode 100644 index 000000000..f929b64d9 --- /dev/null +++ b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg @@ -0,0 +1,175 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-nogui" + +#### 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". +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="739590" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## 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="" +consoleinteract="" + +## Game Server Details +# Do not edit +gamename="Eco" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./EcoServer" +servercfgdir="${systemdir}/Configs" +servercfg="Network.eco" +servercfgdefault="Network.eco" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +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" +gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/emserver/_default.cfg b/lgsm/config-default/config-lgsm/emserver/_default.cfg new file mode 100644 index 000000000..99e1cd44a --- /dev/null +++ b/lgsm/config-default/config-lgsm/emserver/_default.cfg @@ -0,0 +1,187 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="emp_district" +maxplayers="62" + +## Game Server Login Token (GSLT): Optional +# GSLT can be used for running a public server. +# More info: https://docs.linuxgsm.com/steamcmd/gslt +gslt="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game empires -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="460040" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Empires Mod" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/empires" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/etlserver/_default.cfg b/lgsm/config-default/config-lgsm/etlserver/_default.cfg new file mode 100644 index 000000000..b1db388c0 --- /dev/null +++ b/lgsm/config-default/config-lgsm/etlserver/_default.cfg @@ -0,0 +1,161 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set net_strict 1 +set fs_homepath ${serverfiles} +exec ${servercfg}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-quake3" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="ET: Legacy" +engine="idtech3" +glibc="2.7" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./etlded" +servercfgdir="${systemdir}/etmain" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg new file mode 100644 index 000000000..de0b5f3d7 --- /dev/null +++ b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg @@ -0,0 +1,172 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="34197" +rconport="34198" +rconpassword="CHANGE_ME" +# (stable|experimental) +branch="stable" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="--bind ${ip} --start-server ${serverfiles}/save1.zip --server-settings ${servercfgfullpath} --port ${port} --rcon-port ${rconport} --rcon-password ${rconpassword}" + +#### LinuxGSM Settings #### + +## 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". +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" + +## 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="yes" + +## Game Server Details +# Do not edit +gamename="Factorio" +engine="factorio" +glibc="2.18" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}/bin/x64" +executable="./factorio" +servercfgdir="${systemdir}/data" +servercfg="${selfname}.json" +servercfgdefault="server-settings.json" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}" +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" diff --git a/lgsm/config-default/config-lgsm/fofserver/_default.cfg b/lgsm/config-default/config-lgsm/fofserver/_default.cfg new file mode 100644 index 000000000..b89c58e3c --- /dev/null +++ b/lgsm/config-default/config-lgsm/fofserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="fof_depot" +maxplayers="20" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game fof -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="295230" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Fistful of Frags" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/fof" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/gmodserver/_default.cfg b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg new file mode 100644 index 000000000..3aa8d948b --- /dev/null +++ b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg @@ -0,0 +1,195 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="gm_construct" +maxplayers="16" +tickrate="66" +gamemode="sandbox" + +## Workshop Parameters | https://wiki.facepunch.com/gmod/Workshop_for_Dedicated_Servers +# To get an API key visit - https://steamcommunity.com/dev/apikey +wsapikey="" +wscollectionid="" + +## Game Server Login Token (GSLT): Optional +# GSLT can be used for running a public server. +# More info: https://docs.linuxgsm.com/steamcmd/gslt +gslt="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game garrysmod -strictportbind -ip ${ip} -port ${port} -tickrate ${tickrate} +host_workshop_collection ${wscollectionid} -authkey ${wsapikey} +clientport ${clientport} +tv_port ${sourcetvport} +gamemode ${gamemode} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers} -disableluarefresh" + +#### 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="5" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="4020" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Garry's Mod" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/garrysmod" +addonsdir="${systemdir}/addons" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg new file mode 100644 index 000000000..a2c36586d --- /dev/null +++ b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="dm_lockdown" +maxplayers="16" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game hl2mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="232370" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Half Life 2: Deathmatch" +engine="source" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/hl2mp" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/hldmserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg new file mode 100644 index 000000000..4543b9e2b --- /dev/null +++ b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg @@ -0,0 +1,181 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="crossfire" +maxplayers="16" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game valve -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="90" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="9" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Half Life: Deathmatch" +engine="goldsrc" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/valve" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg new file mode 100644 index 000000000..f4d8ee17b --- /dev/null +++ b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="crossfire" +maxplayers="16" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game hl1mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="255470" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Half-Life Deathmatch: Source" +engine="source" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/hl1mp" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/hwserver/_default.cfg b/lgsm/config-default/config-lgsm/hwserver/_default.cfg new file mode 100644 index 000000000..97de06bcb --- /dev/null +++ b/lgsm/config-default/config-lgsm/hwserver/_default.cfg @@ -0,0 +1,191 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +servername="LinuxGSM Server" +ip="0.0.0.0" +port="12871" +queryport="12881" +maxplayers="20" +defaultmap="" # Optional +creativemode="0" # Free Build: creativemode="1" +gamelog="gamelog.txt" + +## Add admins using STEAMID64 +# Example : addadmin 012345678901234567; addadmin 987654321098765432 +admins="" + +## Advanced Server Start Settings +# Rollback server state (remove after start command) +loadsave="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +# Edit with care | http://hurtworld.wikia.com/wiki/Hosting_A_Server +startparameters="-batchmode -nographics -exec \"host ${port} ${defaultmap} ${loadsave};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${admins}\"" + +#### 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". +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="405100" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="no" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Hurtworld" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./Hurtworld.x86_64" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/insserver/_default.cfg b/lgsm/config-default/config-lgsm/insserver/_default.cfg new file mode 100644 index 000000000..6231501df --- /dev/null +++ b/lgsm/config-default/config-lgsm/insserver/_default.cfg @@ -0,0 +1,188 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="embassy_coop checkpoint" +maxplayers="32" +tickrate="64" + +## Game Server Login Token (GSLT): Optional +# GSLT can be used for running a public server. +# More info: https://docs.linuxgsm.com/steamcmd/gslt +gslt="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game insurgency -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers} -workshop -norestart" + +#### LinuxGSM Settings #### + +## 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". +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="237410" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Insurgency" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/insurgency" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/inssserver/_default.cfg b/lgsm/config-default/config-lgsm/inssserver/_default.cfg new file mode 100644 index 000000000..b89d446ba --- /dev/null +++ b/lgsm/config-default/config-lgsm/inssserver/_default.cfg @@ -0,0 +1,185 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27102" +queryport="27131" +servername="LinuxGSM Server" +defaultmap="Canyon" +defaultscenario="Scenario_Crossing_Push_Security" +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 +# To allows serverpassword to work with parameters edit as follows +startparameters="${defaultmap}?Scenario=${defaultscenario}?MaxPlayers=${maxplayers} -Port=${port} -QueryPort=${queryport} -hostname='${servername}' -log" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="581330" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Insurgency: Sandstorm" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/Insurgency" +executabledir="${systemdir}/Binaries/Linux" +executable="./InsurgencyServer-Linux-Shipping" +servercfgdir="${systemdir}/Saved/Config/LinuxServer" +servercfg="Game.ini" +servercfgdefault="Game.ini" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/instance-template.cfg b/lgsm/config-default/config-lgsm/instance-template.cfg new file mode 100644 index 000000000..162b176a6 --- /dev/null +++ b/lgsm/config-default/config-lgsm/instance-template.cfg @@ -0,0 +1,5 @@ +################################## +####### Instance Settings ######## +################################## +# PLACE INSTANCE SETTINGS HERE +## These settings will apply to a specific instance. diff --git a/lgsm/config-default/config-lgsm/iosserver/_default.cfg b/lgsm/config-default/config-lgsm/iosserver/_default.cfg new file mode 100644 index 000000000..f02f9d903 --- /dev/null +++ b/lgsm/config-default/config-lgsm/iosserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="8v8_vienna" +maxplayers="32" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game iosoccer -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="673990" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="IOSoccer" +engine="source" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/iosoccer" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/jc2server/_default.cfg b/lgsm/config-default/config-lgsm/jc2server/_default.cfg new file mode 100644 index 000000000..ba6f19e96 --- /dev/null +++ b/lgsm/config-default/config-lgsm/jc2server/_default.cfg @@ -0,0 +1,181 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="" + +#### 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="" + +# Sendgrid Email Alerts | https://docs.linuxgsm.com/alerts/sendgrid +sendgridalert="off" +sendgridtoken="accesstoken" +sendgriddomain="example.com" +sendgridemailfrom="alert@example.com" +sendgridemail="email@myemail.com" + +# 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". +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="261140" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="jc2mp" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Just Cause 2" +engine="avalanche2.0" +glibc="2.13" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./Jcmp-Server" +servercfgdir="${systemdir}" +servercfg="config.lua" +servercfgdefault="config.lua" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +#gamelogdir="" # No server logs available +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" diff --git a/lgsm/config-default/config-lgsm/jc3server/_default.cfg b/lgsm/config-default/config-lgsm/jc3server/_default.cfg new file mode 100644 index 000000000..b671533de --- /dev/null +++ b/lgsm/config-default/config-lgsm/jc3server/_default.cfg @@ -0,0 +1,174 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="" + +#### 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". +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="619960" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Just Cause 3" +engine="avalanche3.0" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./Server" +servercfgdir="${systemdir}" +servercfg="config.json" +servercfgdefault="config.json" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +#gamelogdir="" # No server logs available +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" diff --git a/lgsm/config-default/config-lgsm/jk2server/_default.cfg b/lgsm/config-default/config-lgsm/jk2server/_default.cfg new file mode 100644 index 000000000..fdb3317e8 --- /dev/null +++ b/lgsm/config-default/config-lgsm/jk2server/_default.cfg @@ -0,0 +1,175 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login +steamuser="username" +steampass='password' + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27960" +defaultmap="ffa_bespin" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set net_ip ${ip} +set net_port ${port} +exec ${servercfg} +map ${defaultmap}" + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +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="" + +# 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-quake3" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## SteamCMD Settings +# Server appid +appid="6030" +steamcmdforcewindows="yes" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## LinuxGSM Server Details +# Do not edit +gamename="Jedi Knight II: Jedi Outcast" +engine="idtech3" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/GameData" +executabledir="${systemdir}" +executable="./jk2mvded" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgdir="${systemdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/kf2server/_default.cfg b/lgsm/config-default/config-lgsm/kf2server/_default.cfg new file mode 100644 index 000000000..2c2770394 --- /dev/null +++ b/lgsm/config-default/config-lgsm/kf2server/_default.cfg @@ -0,0 +1,179 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +queryport="27015" +defaultmap="KF-BioticsLab" +gamemode="KFGameContent.KFGameInfo_VersusSurvival" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="\"${defaultmap}?Game=${gamemode}?ConfigSubDir=${selfname} -QueryPort=${queryport}\"" + +#### 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". +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="232130" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Killing Floor 2" +engine="unreal3" +glibc="2.3.2" + +#### Directories #### +# Edit with care +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}/Binaries/Win64" +executable="./KFGameSteamServer.bin.x86_64" +servercfgdir="${systemdir}/KFGame/Config/${selfname}" +servercfg="LinuxServer-KFGame.ini" +servercfgdefault="LinuxServer-KFGame.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" diff --git a/lgsm/config-default/config-lgsm/kfserver/_default.cfg b/lgsm/config-default/config-lgsm/kfserver/_default.cfg new file mode 100644 index 000000000..f582cf1f0 --- /dev/null +++ b/lgsm/config-default/config-lgsm/kfserver/_default.cfg @@ -0,0 +1,190 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login +steamuser="username" +steampass='password' + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +defaultmap="KF-BioticsLab.rom" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="server ${defaultmap}?game=KFmod.KFGameType?VACSecured=true -nohomedir ini=${servercfg} log=${gamelog}" + +## Server Parameters for Objective mode +#defaultmap="KFO-Steamland" +#startparameters="server ${defaultmap}?Game=KFStoryGame.KFStoryGame?VACSecured=true -nohomedir ini=${servercfg} log=${gamelog}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="215360" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-unreal2" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Killing Floor" +engine="unreal2" +glibc="2.4" + +#### Directories #### +# Edit with care + +## Game Server Directories +serverfiles="${rootdir}/serverfiles" +systemdir="${serverfiles}/System" +executabledir="${systemdir}" +executable="./ucc-bin" +servercfgdir="${systemdir}" +servercfg="${selfname}.ini" +servercfgdefault="Default.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" +compressedmapsdir="${rootdir}/Maps-Compressed" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" +gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/l4d2server/_default.cfg b/lgsm/config-default/config-lgsm/l4d2server/_default.cfg new file mode 100644 index 000000000..adfb6c42c --- /dev/null +++ b/lgsm/config-default/config-lgsm/l4d2server/_default.cfg @@ -0,0 +1,181 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="c5m1_waterfront" +maxplayers="8" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game left4dead2 -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="222860" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Left 4 Dead 2" +engine="source" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/left4dead2" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/l4dserver/_default.cfg b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg new file mode 100644 index 000000000..24521fb2a --- /dev/null +++ b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg @@ -0,0 +1,181 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="l4d_hospital01_apartment" +maxplayers="8" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game left4dead -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="222840" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Left 4 Dead" +engine="source" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/left4dead" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="server.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg new file mode 100644 index 000000000..4c8e3c2ae --- /dev/null +++ b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg @@ -0,0 +1,164 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="" + +#### 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". +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" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="5" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="4" +querytype="minecraftbe" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Minecraft Bedrock" +engine="bedrock" +glibc="2.27" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="${serverfiles}/bedrock_server" +servercfgdir="${systemdir}" +servercfg="server.properties" +servercfgdefault="server.properties" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}" +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" diff --git a/lgsm/config-default/config-lgsm/mcserver/_default.cfg b/lgsm/config-default/config-lgsm/mcserver/_default.cfg new file mode 100644 index 000000000..b2b053490 --- /dev/null +++ b/lgsm/config-default/config-lgsm/mcserver/_default.cfg @@ -0,0 +1,174 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +javaram="1024" # -Xmx$1024M + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="nogui" + +## Release Settings | https://docs.linuxgsm.com/game-servers/minecraft#release-settings +# Branch (release|snapshot) +branch="release" +# Version (latest|1.16) +mcversion="latest" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="5" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="minecraft" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Minecraft" +engine="lwjgl2" +glibc="null" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +preexecutable="java -Xmx${javaram}M -jar" +executable="./minecraft_server.jar" +servercfgdir="${systemdir}" +servercfg="server.properties" +servercfgdefault="server.properties" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/mhserver/_default.cfg b/lgsm/config-default/config-lgsm/mhserver/_default.cfg new file mode 100644 index 000000000..85a487a81 --- /dev/null +++ b/lgsm/config-default/config-lgsm/mhserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="7777" +beaconport="15000" +queryport="27015" +# Maps: FFA_Camp, FFA_Contraband, FFA_Grad, FFA_MountainPeak, FFA_Taiga, FFA_ThePit, FFA_Tourney, SKM_Camp, SKM_Contraband, SKM_Grad, SKM_MountainPeak, SKM_Taiga, SKM_ThePit, SKM_Tourney, TDM_Camp, TDM_Contraband, TDM_Grad, TDM_MountainPeak, TDM_Taiga, TDM_ThePit, TDM_Tourney +defaultmap="FFA_ThePit" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="Mordhau ${defaultmap} -log -MultiHome=${ip} -Port=${port} -BeaconPort=${beaconport} -QueryPort=${queryport}" + +#### 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". +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="629800" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="MORDHAU" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/Mordhau" +executabledir="${systemdir}/Binaries/Linux" +executable="./MordhauServer-Linux-Shipping" +servercfgdir="${systemdir}/Saved/Config/LinuxServer" +servercfg="Game.ini" +servercfgdefault="Game.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg new file mode 100644 index 000000000..6742f18ed --- /dev/null +++ b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg @@ -0,0 +1,166 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="12203" +defaultmap="dm/mohdm1" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set fs_outputpath ${gamelogdir} +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +exec ${servercfg} +map ${defaultmap}" + +#### 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-quake3" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Medal of Honor: Allied Assault" +engine="idtech3" +glibc="2.3" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/main" +executabledir="${serverfiles}" +executable="./mohaa_lnxded" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/momserver/_default.cfg b/lgsm/config-default/config-lgsm/momserver/_default.cfg new file mode 100644 index 000000000..d5df8fd59 --- /dev/null +++ b/lgsm/config-default/config-lgsm/momserver/_default.cfg @@ -0,0 +1,176 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="7777" +beaconport="15000" +maxplayers="32" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-port="${port}" -beaconport="${beaconport}" -MULTIHOME="${ip}" -maxplayers=${maxplayers}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="897590" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="" + +## Game Server Details +# Do not edit +gamename="Memories of Mars" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/Game" +executabledir="${systemdir}/Binaries/Linux" +executable="./MemoriesOfMarsServer" +servercfgdir="${serverfiles}" +servercfg="DedicatedServerConfig.cfg" +servercfgdefault="DedicatedServerConfig.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/Game/Saved/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg new file mode 100644 index 000000000..75aa660dd --- /dev/null +++ b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg @@ -0,0 +1,166 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +# Edit with care +startparameters="" + +#### 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="4" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="3" +querytype="protocol-ase" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Multi Theft Auto" +engine="renderware" +glibc="2.7" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +resourcesdir="${systemdir}/mods/deathmatch/resources" +executabledir="${systemdir}" +executable="./mta-server64" +servercfgdir="${systemdir}/mods/deathmatch" +servercfg="mtaserver.conf" +servercfgdefault="mtaserver.conf" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/mods/deathmatch/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" diff --git a/lgsm/config-default/config-lgsm/mumbleserver/_default.cfg b/lgsm/config-default/config-lgsm/mumbleserver/_default.cfg new file mode 100644 index 000000000..bfe847135 --- /dev/null +++ b/lgsm/config-default/config-lgsm/mumbleserver/_default.cfg @@ -0,0 +1,164 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-fg -ini ${servercfgfullpath}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="mumbleping" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Mumble" +engine="null" +glibc="null" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./murmur.x86" +servercfgdir="${systemdir}" +servercfg="${selfname}.ini" +servercfgdefault="murmur.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +#gamelogdir="" # No server logs available +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" diff --git a/lgsm/config-default/config-lgsm/ndserver/_default.cfg b/lgsm/config-default/config-lgsm/ndserver/_default.cfg new file mode 100644 index 000000000..45bb4da1a --- /dev/null +++ b/lgsm/config-default/config-lgsm/ndserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="hydro" +maxplayers="32" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game nucleardawn -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="111710" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Nuclear Dawn" +engine="source" +glibc="2.3.6" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/nucleardawn" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg new file mode 100644 index 000000000..67b7d6a15 --- /dev/null +++ b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg @@ -0,0 +1,187 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="nmo_broadway" +maxplayers="8" + +## Game Server Login Token (GSLT): Optional +# GSLT can be used for running a public server. +# More info: https://docs.linuxgsm.com/steamcmd/gslt +gslt="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game nmrih -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="317670" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="No More Room in Hell" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/nmrih" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg new file mode 100644 index 000000000..42ba79464 --- /dev/null +++ b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg @@ -0,0 +1,187 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +defaultmap="co_core" +maxplayers="24" +servername="LinuxGSM Server" +webadminuser="admin" +webadminpass="admin" +webadminport="8080" +mods="" +serverpassword="" +# Add the following line to the parms if you want a private server. Ensuring +# that the password variable above is not left empty. +# -password \"${serverpassword}\" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${servercfgdir}\" -modstorage \"${modstoragedir}\" -mods \"${mods}\"" + +#### 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". +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="313900" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## 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="6" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="NS2: Combat" +engine="spark" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}/ia32" +executable="./ns2combatserver_linux32" +servercfgdir="${systemdir}/${selfname}" +modstoragedir="${servercfgdir}/Workshop" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ns2server/_default.cfg b/lgsm/config-default/config-lgsm/ns2server/_default.cfg new file mode 100644 index 000000000..d407c8a80 --- /dev/null +++ b/lgsm/config-default/config-lgsm/ns2server/_default.cfg @@ -0,0 +1,191 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login +steamuser="username" +steampass='password' + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +defaultmap="ns2_summit" +maxplayers="24" +servername="LinuxGSM Server" +webadminuser="admin" +webadminpass="admin" +webadminport="8080" +mods="" +serverpassword="" +# Add the following line to the parms if you want a private server. Ensuring +# that the password variable above is not left empty. +# -password \"${serverpassword}\" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${servercfgdir}\" -logdir \"${gamelogdir}\" -modstorage \"${modstoragedir}\" -mods \"${mods}\"" + +#### 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". +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="4940" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## 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="6" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Natural Selection 2" +engine="spark" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}/x64" +executable="./server_linux" +servercfgdir="${systemdir}/${selfname}" +modstoragedir="${servercfgdir}/Workshop" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/nsserver/_default.cfg b/lgsm/config-default/config-lgsm/nsserver/_default.cfg new file mode 100644 index 000000000..282052139 --- /dev/null +++ b/lgsm/config-default/config-lgsm/nsserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="ns_hera" +maxplayers="16" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game ns -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="90" +steamcmdforcewindows="no" +appidmod="cstrike" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="9" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Natural Selection" +engine="goldsrc" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/ns" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/onsetserver/_default.cfg b/lgsm/config-default/config-lgsm/onsetserver/_default.cfg new file mode 100644 index 000000000..eaabae6cd --- /dev/null +++ b/lgsm/config-default/config-lgsm/onsetserver/_default.cfg @@ -0,0 +1,174 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="--config ${servercfgfullpath}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="1204170" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## 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="Onset" +engine="unreal4" +glibc="2.24" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./OnsetServer" +servercfgdir="${systemdir}" +servercfg="server_config.json" +servercfgdefault="server_config.json" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/opforserver/_default.cfg b/lgsm/config-default/config-lgsm/opforserver/_default.cfg new file mode 100644 index 000000000..a72dab526 --- /dev/null +++ b/lgsm/config-default/config-lgsm/opforserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="op4_bootcamp" +maxplayers="16" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game gearbox -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="90" +steamcmdforcewindows="no" +appidmod="gearbox" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="9" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Half-Life: Opposing Force" +engine="goldsrc" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/gearbox" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/pcserver/_default.cfg b/lgsm/config-default/config-lgsm/pcserver/_default.cfg new file mode 100644 index 000000000..9255cd0d7 --- /dev/null +++ b/lgsm/config-default/config-lgsm/pcserver/_default.cfg @@ -0,0 +1,174 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="--config ${servercfg}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="332670" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Project Cars" +engine="madness" +glibc="2.4" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./DedicatedServerCmd" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg b/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg new file mode 100644 index 000000000..7c672d2b2 --- /dev/null +++ b/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg @@ -0,0 +1,185 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="10027" +queryport="10037" +rconport="21114" +randommap="NONE" +#servername="LinuxGSM Server" +maxplayers="40" +reservedslots="0" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="MULTIHOME=${ip} RANDOM=${randommap} Port=${port} QueryPort=${queryport} RCONPORT=${rconport} FIXEDMAXPLAYERS=${maxplayers} NumReservedSlots=${reservedslots}" + +#### 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". +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="746200" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="pstbsserver" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/PostScriptum" +executabledir="${serverfiles}" +executable="./PostScriptumServer.sh" +servercfgdir="${systemdir}/ServerConfig" +servercfg="Server.cfg" +servercfgdefault="Server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg new file mode 100644 index 000000000..7cd158fb9 --- /dev/null +++ b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="bt_island" +maxplayers="24" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game pvkii -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="17575" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Pirates, Vikings, and Knights II" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/pvkii" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg new file mode 100644 index 000000000..2c19f47cf --- /dev/null +++ b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg @@ -0,0 +1,181 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="7777" + +# Maps: bridge, datacenter, sand +defaultmap="datacenter" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="${defaultmap} -log -MultiHome=${ip} -Port=${port}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="622970" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="" + +## Console type +consoleverbose="no" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Pavlov VR" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/Pavlov" +executabledir="${systemdir}/Binaries/Linux" +executable="./PavlovServer" +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" diff --git a/lgsm/config-default/config-lgsm/pzserver/_default.cfg b/lgsm/config-default/config-lgsm/pzserver/_default.cfg new file mode 100644 index 000000000..0dd761a86 --- /dev/null +++ b/lgsm/config-default/config-lgsm/pzserver/_default.cfg @@ -0,0 +1,178 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +adminpassword="CHANGE_ME" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-ip ${ip} -adminpassword \"${adminpassword}\" -servername ${selfname}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="380870" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Project Zomboid" +engine="projectzomboid" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./start-server.sh" +servercfgdir="${HOME}/Zomboid/Server" +servercfg="${selfname}.ini" +servercfgdefault="server.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${HOME}/Zomboid/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" diff --git a/lgsm/config-default/config-lgsm/q2server/_default.cfg b/lgsm/config-default/config-lgsm/q2server/_default.cfg new file mode 100644 index 000000000..3e6615789 --- /dev/null +++ b/lgsm/config-default/config-lgsm/q2server/_default.cfg @@ -0,0 +1,166 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27910" +defaultmap="q2dm1" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set dedicated 1 +set ip ${ip} +set port ${port} +exec ${servercfg} +set deathmatch 1 +map ${defaultmap}" + +#### LinuxGSM Settings #### + +## 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-quake2" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Quake 2" +engine="idtech2" +glibc="null" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/baseq2" +executabledir="${serverfiles}" +executable="./quake2" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/q3server/_default.cfg b/lgsm/config-default/config-lgsm/q3server/_default.cfg new file mode 100644 index 000000000..af107b398 --- /dev/null +++ b/lgsm/config-default/config-lgsm/q3server/_default.cfg @@ -0,0 +1,166 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27960" +defaultmap="q3dm17" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 2 +set com_hunkMegs 32 +set net_ip ${ip} +set net_port ${port} +exec ${servercfg} +map ${defaultmap}" + +#### 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-quake3" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Quake 3: Arena" +engine="idtech3" +glibc="2.1" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/baseq3" +executabledir="${serverfiles}" +executable="./q3ded" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/qlserver/_default.cfg b/lgsm/config-default/config-lgsm/qlserver/_default.cfg new file mode 100644 index 000000000..8d06fac7f --- /dev/null +++ b/lgsm/config-default/config-lgsm/qlserver/_default.cfg @@ -0,0 +1,175 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+exec ${servercfg}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="349090" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Quake Live" +engine="idtech3_ql" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable=$([ "$(uname -m)" == "x86_64" ] && echo -e "./run_server_x64.sh" || echo -e "./run_server_x86.sh") +servercfgdir="${systemdir}/baseq3" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/qwserver/_default.cfg b/lgsm/config-default/config-lgsm/qwserver/_default.cfg new file mode 100644 index 000000000..0aade5c5e --- /dev/null +++ b/lgsm/config-default/config-lgsm/qwserver/_default.cfg @@ -0,0 +1,165 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27500" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-port ${port} -game ktx +exec ${servercfg}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-quake1" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="QuakeWorld" +engine="quake" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/ktx" +executabledir="${serverfiles}" +executable="./mvdsv" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg new file mode 100644 index 000000000..f1c3db9af --- /dev/null +++ b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="rc_arena" +maxplayers="16" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game ricochet -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="90" +steamcmdforcewindows="no" +appidmod="ricochet" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="9" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Ricochet" +engine="goldsrc" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/ricochet" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/roserver/_default.cfg b/lgsm/config-default/config-lgsm/roserver/_default.cfg new file mode 100644 index 000000000..61824aa42 --- /dev/null +++ b/lgsm/config-default/config-lgsm/roserver/_default.cfg @@ -0,0 +1,186 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login +steamuser="username" +steampass='password' + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +defaultmap="RO-Arad.rom" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="server ${defaultmap}?game=ROGame.ROTeamGame?VACSecured=true -nohomedir ini=${servercfg} log=${gamelog}" + +#### LinuxGSM Settings #### + +## 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". +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="223250" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-unreal2" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Red Orchestra: Ostfront 41-45" +engine="unreal2" +glibc="2.4" + +#### Directories #### +# Edit with care + +## Game Server Directories +serverfiles="${rootdir}/serverfiles" +systemdir="${serverfiles}/system" +executabledir="${systemdir}" +executable="./ucc-bin" +servercfgdir="${systemdir}" +servercfg="${selfname}.ini" +servercfgdefault="default.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" +compressedmapsdir="${rootdir}/Maps-Compressed" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" +gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg b/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg new file mode 100644 index 000000000..781ecf5a0 --- /dev/null +++ b/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg @@ -0,0 +1,166 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27960" +defaultmap="mp_beach" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set fs_basepath ${serverfiles} +set dedicated 1 +set net_ip ${ip} +set net_port ${port} +exec ${servercfg} +map ${defaultmap}" + +#### LinuxGSM Settings #### + +## 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-quake3" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Return to Castle Wolfenstein" +engine="ioquake3" +glibc="2.1" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/main" +executabledir="${serverfiles}" +executable="./iowolfded.x86_64" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/rustserver/_default.cfg b/lgsm/config-default/config-lgsm/rustserver/_default.cfg new file mode 100644 index 000000000..4d695f7d1 --- /dev/null +++ b/lgsm/config-default/config-lgsm/rustserver/_default.cfg @@ -0,0 +1,191 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="28015" +rconport="28016" +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" +maxplayers="50" +seed="" # range: 1-2147483647, used to reproduce a procedural map. +salt="" # range: unknown, used to recover a known setting from an existing map. +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.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 #### + +## 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="5" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="258550" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Rust" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./RustDedicated" +serveridentitydir="${systemdir}/server/${selfname}" +servercfgdir="${serveridentitydir}/cfg" +servercfg="server.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +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" +gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/rwserver/_default.cfg b/lgsm/config-default/config-lgsm/rwserver/_default.cfg new file mode 100644 index 000000000..98b79596f --- /dev/null +++ b/lgsm/config-default/config-lgsm/rwserver/_default.cfg @@ -0,0 +1,178 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +javaram="2048" # -Xmx$2048M + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="" + +#### 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". +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="339010" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Rising World" +engine="risingworld" +glibc="null" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +preexecutable="java -Xmx${javaram}M -jar" +executable="./server.jar" +servercfgdir="${systemdir}" +servercfg="server.properties" +servercfgdefault="server.properties" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/sampserver/_default.cfg b/lgsm/config-default/config-lgsm/sampserver/_default.cfg new file mode 100644 index 000000000..aab4adf45 --- /dev/null +++ b/lgsm/config-default/config-lgsm/sampserver/_default.cfg @@ -0,0 +1,165 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="7777" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="" + +#### 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="3" +querytype="samp" + +## Console type +consoleverbose="" +consoleinteract="" + +## Game Server Details +# Do not edit +gamename="San Andreas Multiplayer" +engine="renderware" +glibc="2.3" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}/samp03" +executable="./samp03svr" +servercfgdir="${systemdir}/samp03" +servercfg="server.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/samp03" +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" diff --git a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg new file mode 100644 index 000000000..a944cd1a7 --- /dev/null +++ b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +port="7777" +queryport="27015" +defaultmap="StationKappa" +servername="LinuxGSM Server" +serverpassword="NOT SET" # Can't be adjusted currently +maxplayers="8" # Can't be adjusted currently + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="Port=${port}?QueryPort=${queryport} -startup_map ${defaultmap} -server_name \"${servername}\"" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="974130" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="StickyBots" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}/blank1/Binaries/Linux" +executable="./blank1Server-Linux-Shipping" +servercfgdir="${systemdir}/blank1/Saved/Config/LinuxServer" +servercfg="Game.ini" +servercfgdefault="Game.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/sbserver/_default.cfg b/lgsm/config-default/config-lgsm/sbserver/_default.cfg new file mode 100644 index 000000000..8570eea1c --- /dev/null +++ b/lgsm/config-default/config-lgsm/sbserver/_default.cfg @@ -0,0 +1,181 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login +steamuser="username" +steampass='password' + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="" + +#### 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". +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="211820" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Starbound" +engine="starbound" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}/linux" +executable="./starbound_server" +servercfgdir="${systemdir}/storage" +servercfg="starbound_server.config" +servercfgdefault="starbound_server.config" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/storage" +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" diff --git a/lgsm/config-default/config-lgsm/scpslserver/_default.cfg b/lgsm/config-default/config-lgsm/scpslserver/_default.cfg new file mode 100644 index 000000000..aa4ac41bc --- /dev/null +++ b/lgsm/config-default/config-lgsm/scpslserver/_default.cfg @@ -0,0 +1,167 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## All server settings except the server port are done in the config file: +## Docs: https://en.scpslgame.com/index.php?title=Docs:Server_Config +port="7777" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="${port}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="7" + +## Query mode +# 1: session only +# 2: gamedig + gsquery +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## SteamCMD Settings +# Server appid +appid="996560" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="" + +## LinuxGSM Server Details +# Do not edit +gamename="SCP: Secret Laboratory" +engine="unity3d" +glibc="2.27" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./LocalAdmin" +servercfg="config_gameplay.txt" +servercfgdefault="config_gameplay.txt" +servercfgdir="${HOME}/.config/SCP Secret Laboratory/config/${port}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${HOME}/.config/SCP Secret Laboratory/LocalAdminLogs/${port}" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg b/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg new file mode 100644 index 000000000..0180753a8 --- /dev/null +++ b/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg @@ -0,0 +1,167 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT WILL BE OVERWRITTEN! +# Copy settings from here and use them in either +# common.cfg - applies settings to every instance +# [instance].cfg - applies settings to a specific instance + +#### Server Settings #### + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## All server settings except the server port are done in the config file: +## Docs: https://en.scpslgame.com/index.php?title=Docs:Server_Config +port="7777" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="${port}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# any custom string in curl - simple ignore this parameter. +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: Gold Source +# 10: Teamspeak 3 +stopmode="7" + +## Query mode +# 1: session only +# 2: gamedig + gsquery +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## SteamCMD Settings +# Server appid +appid="786920" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="" + +## LinuxGSM Server Details +# Do not edit +gamename="SCP: Secret Laboratory ServerMod" +engine="unity3d" +glibc="2.27" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./LocalAdmin" +servercfg="config_gameplay.txt" +servercfgdefault="config_gameplay.txt" +servercfgdir="${HOME}/.config/SCP Secret Laboratory/config/${port}" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${rootdir}/backups" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${HOME}/.config/SCP Secret Laboratory/LocalAdminLogs/${port}" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg new file mode 100644 index 000000000..29e89e984 --- /dev/null +++ b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg @@ -0,0 +1,179 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-quit -batchmode -nographics -dedicated -configfile=${servercfgfullpath}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="294420" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## 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="8" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="7 Days To Die" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./7DaysToDieServer.x86_64" +servercfgdir="${systemdir}" +servercfg="${selfname}.xml" +servercfgdirdefault="${serverfiles}" +servercfgdefault="serverconfig.xml" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/secrets-common-template.cfg b/lgsm/config-default/config-lgsm/secrets-common-template.cfg new file mode 100644 index 000000000..d8ded6aa9 --- /dev/null +++ b/lgsm/config-default/config-lgsm/secrets-common-template.cfg @@ -0,0 +1,5 @@ +################################## +######## Common Secrets ########## +################################## +# PLACE GLOBAL SECRET SETTINGS HERE +## These settings will apply to all instances. diff --git a/lgsm/config-default/config-lgsm/secrets-instance-template.cfg b/lgsm/config-default/config-lgsm/secrets-instance-template.cfg new file mode 100644 index 000000000..5446d3718 --- /dev/null +++ b/lgsm/config-default/config-lgsm/secrets-instance-template.cfg @@ -0,0 +1,5 @@ +################################## +####### Instance Secrets ######### +################################## +# PLACE INSTANCE SECRET SETTINGS HERE +## These settings will apply to a specific instance. diff --git a/lgsm/config-default/config-lgsm/sfcserver/_default.cfg b/lgsm/config-default/config-lgsm/sfcserver/_default.cfg new file mode 100644 index 000000000..e5ea17bac --- /dev/null +++ b/lgsm/config-default/config-lgsm/sfcserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="sf_astrodome" +maxplayers="32" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game sfclassic -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="244310" # Source 2013 SDK +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="SourceForts Classic" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/sfclassic" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/sof2server/_default.cfg b/lgsm/config-default/config-lgsm/sof2server/_default.cfg new file mode 100644 index 000000000..1c84e0d90 --- /dev/null +++ b/lgsm/config-default/config-lgsm/sof2server/_default.cfg @@ -0,0 +1,166 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="20100" +defaultmap="mp_shop" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set sv_punkbuster 0 +set dedicated 2 +set net_ip ${ip} +set net_port ${port} +exec ${servercfg} +map ${defaultmap}" + +#### LinuxGSM Settings #### + +## 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-quake3" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Soldier Of Fortune 2: Gold Edition" +engine="idtech3" +glibc="2.1" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/main" +executabledir="${serverfiles}" +executable="./sof2ded" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/solserver/_default.cfg b/lgsm/config-default/config-lgsm/solserver/_default.cfg new file mode 100644 index 000000000..b1da65c26 --- /dev/null +++ b/lgsm/config-default/config-lgsm/solserver/_default.cfg @@ -0,0 +1,173 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +maplist="mapslist.txt" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-b ${ip} -m ${maplist} -c ${servercfg}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## 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="638500" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="4" +querytype="soldat" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Soldat" +engine="soldat" +glibc="2.1" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./soldatserver" +servercfgdir="${systemdir}" +servercfg="soldat.ini" +servercfgdefault="soldat.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/squadserver/_default.cfg b/lgsm/config-default/config-lgsm/squadserver/_default.cfg new file mode 100644 index 000000000..09ac039e4 --- /dev/null +++ b/lgsm/config-default/config-lgsm/squadserver/_default.cfg @@ -0,0 +1,180 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +port="7787" +queryport="27165" +randommap="ALWAYS" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="MULTIHOME=${ip} RANDOM=${randommap} Port=${port} QueryPort=${queryport}" + +#### 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". +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="403240" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Squad" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/SquadGame" +executabledir="${serverfiles}" +executable="./SquadGameServer.sh" +servercfgdir="${systemdir}/ServerConfig" +servercfg="${selfname}.cfg" +servercfgdefault="Server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/stserver/_default.cfg b/lgsm/config-default/config-lgsm/stserver/_default.cfg new file mode 100644 index 000000000..60f42f63b --- /dev/null +++ b/lgsm/config-default/config-lgsm/stserver/_default.cfg @@ -0,0 +1,184 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27500" +queryport="27015" +worldtype="Moon" +autosaveinterval=300 +clearinterval=60 +worldname="moon_save" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +# Edit with care +startparameters="-batchmode -nographics -autostart -gameport=${port} -updateport=${queryport} -worldtype=${worldtype} -loadworld=${worldname} -worldname=${worldname} -autosaveinterval=${autosaveinterval} -clearallinterval=${clearinterval}" + +#### 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". +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="600760" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="vo" + +## Game Server Details +# Do not edit +gamename="Stationeers" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./rocketstation_DedicatedServer.x86_64" +servercfgdir="${systemdir}" +servercfg="default.ini" +servercfgdefault="default.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${HOME}/.config/unity3d/Rocketwerkz/Stationeers" +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" diff --git a/lgsm/config-default/config-lgsm/svenserver/_default.cfg b/lgsm/config-default/config-lgsm/svenserver/_default.cfg new file mode 100644 index 000000000..aaf2c2de2 --- /dev/null +++ b/lgsm/config-default/config-lgsm/svenserver/_default.cfg @@ -0,0 +1,181 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="svencoop1" +maxplayers="16" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game svencoop -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} +maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="276060" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="9" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Sven Co-op" +engine="goldsrc" +glibc="2.24" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/svencoop" +executabledir="${serverfiles}" +executable="./svends_run" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg new file mode 100644 index 000000000..68bed7cdb --- /dev/null +++ b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg @@ -0,0 +1,181 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login +steamuser="username" +steampass='password' + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-config ${servercfgfullpath}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="105600" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="7" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="5" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Terraria" +engine="terraria" +glibc="2.7" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./TerrariaServer" +servercfgdir="${systemdir}" +servercfg="${selfname}.txt" +servercfgdefault="serverconfig.txt" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +#gamelogdir="" # No server logs available +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" diff --git a/lgsm/config-default/config-lgsm/tf2server/_default.cfg b/lgsm/config-default/config-lgsm/tf2server/_default.cfg new file mode 100644 index 000000000..25dd6b32a --- /dev/null +++ b/lgsm/config-default/config-lgsm/tf2server/_default.cfg @@ -0,0 +1,187 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="cp_badlands" +maxplayers="16" + +## Game Server Login Token (GSLT): Optional +# GSLT can be used for running a public server. +# More info: https://docs.linuxgsm.com/steamcmd/gslt +gslt="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game tf -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="232250" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Team Fortress 2" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/tf" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/tfcserver/_default.cfg b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg new file mode 100644 index 000000000..b4d88ece1 --- /dev/null +++ b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="dustbowl" +maxplayers="16" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game tfc -strictportbind _ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="90" +steamcmdforcewindows="no" +appidmod="tfc" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="9" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Team Fortress Classic" +engine="goldsrc" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/tfc" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ts3server/_default.cfg b/lgsm/config-default/config-lgsm/ts3server/_default.cfg new file mode 100644 index 000000000..f3344e87c --- /dev/null +++ b/lgsm/config-default/config-lgsm/ts3server/_default.cfg @@ -0,0 +1,165 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="inifile=${servercfgfullpath} pid_file=ts3server.pid" + +#### 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". +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" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="5" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="TeamSpeak 3" +servername="TeamSpeak 3 Server" +engine="null" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./ts3server" +servercfgdir="${systemdir}" +servercfg="${selfname}.ini" +servercfgdefault="ts3server.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/tsserver/_default.cfg b/lgsm/config-default/config-lgsm/tsserver/_default.cfg new file mode 100644 index 000000000..f39d23eb5 --- /dev/null +++ b/lgsm/config-default/config-lgsm/tsserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="ts_neobaroque" +maxplayers="32" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game ts -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers} " + +#### LinuxGSM Settings #### + +## 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". +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="90" +steamcmdforcewindows="no" +appidmod="cstrike" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="9" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="The Specialists" +engine="goldsrc" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/ts" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/tuserver/_default.cfg b/lgsm/config-default/config-lgsm/tuserver/_default.cfg new file mode 100644 index 000000000..42f750fd9 --- /dev/null +++ b/lgsm/config-default/config-lgsm/tuserver/_default.cfg @@ -0,0 +1,184 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="7777" +queryport="27015" + +## Game Server Login Token (GSLT): Optional +# GSLT can be used for running a public server. +# More info: https://docs.linuxgsm.com/steamcmd/gslt +gslt="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-log -MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -TowerServerINI=${selfname}.ini" + +#### 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". +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="439660" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Tower Unite" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/Tower" +executabledir="${systemdir}/Binaries/Linux" +executable="./TowerServer-Linux-Shipping" +servercfgdir="${systemdir}/Binaries/Linux" +servercfg="${selfname}.ini" +servercfgdefault="TowerServer.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" diff --git a/lgsm/config-default/config-lgsm/twserver/_default.cfg b/lgsm/config-default/config-lgsm/twserver/_default.cfg new file mode 100644 index 000000000..19d4467eb --- /dev/null +++ b/lgsm/config-default/config-lgsm/twserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login +steamuser="username" +steampass='password' + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-f ${servercfg}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="380840" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="4" +querytype="teeworlds" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Teeworlds" +engine="teeworlds" +glibc="2.14" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/tw" +executabledir="${systemdir}" +executable="./teeworlds_srv" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" # Teeworlds can also auto load any config if an autoexec.cfg file is present in the server dir +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/untserver/_default.cfg b/lgsm/config-default/config-lgsm/untserver/_default.cfg new file mode 100644 index 000000000..f923a1446 --- /dev/null +++ b/lgsm/config-default/config-lgsm/untserver/_default.cfg @@ -0,0 +1,180 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +maxplayers="20" +defaultmap="pei" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-port:${port} -players:${maxplayers} --nographics -${defaultmap} -batchmode +secureserver/${selfname}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="1110390" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Unturned" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./Unturned_Headless.x86_64" +servercfgdir="${systemdir}/Servers/${selfname}" +servercfg="Config.json" +servercfgdefault="Config.json" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +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" diff --git a/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg new file mode 100644 index 000000000..450cc53e7 --- /dev/null +++ b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg @@ -0,0 +1,168 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +defaultmap="DM-Rankin" +ip="0.0.0.0" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="server ${defaultmap}?game=XGame.xDeathMatch -nohomedir ini=${servercfg} log=${gamelog}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-unreal2" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Unreal Tournament 2004" +engine="unreal2" +glibc="2.4" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/System" +executabledir="${systemdir}" +executable="./ucc-bin" +servercfgdir="${systemdir}" +servercfg="${selfname}.ini" +servercfgdefault="UT2004.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" +compressedmapsdir="${rootdir}/Maps-Compressed" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" +gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ut3server/_default.cfg b/lgsm/config-default/config-lgsm/ut3server/_default.cfg new file mode 100644 index 000000000..90469ffa5 --- /dev/null +++ b/lgsm/config-default/config-lgsm/ut3server/_default.cfg @@ -0,0 +1,183 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="7777" +queryport="6500" +defaultmap="VCTF-Suspense" +game="UTGameContent.UTVehicleCTFGame_Content" +# Example: mutators="UTGame.UTMutator_Instagib,UTGame.UTMutator_LowGrav" +mutators="" +isdedicated="true" +islanmatch="false" +usesstats="false" +shouldadvertise="true" +pureserver="1" +allowjoininprogress="true" +# Required: GameSpy Username and password +# https://docs.linuxgsm.com/game-servers/unreal-tournament-3#server-gamespy-login +gsusername="" +gspassword="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +# Edit with care | List of game types and mutators: https://docs.linuxgsm.com/game-servers/unreal-tournament-3 +startparameters="server ${defaultmap}?Game=${game}?bIsDedicated=${isdedicated}?bIsLanMatch=${islanmatch}?bUsesStats=${usesstats}?bShouldAdvertise=${shouldadvertise}?PureServer=${pureserver}?bAllowJoinInProgress=${allowjoininprogress}?Mutator=${mutators}?ConfigSubDir=${selfname} -login=${gsusername} -password=${gspassword} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="ut3" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Unreal Tournament 3" +engine="unreal3" +glibc="2.3.2" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}/Binaries" +executable="./ut3" +servercfgdir="${systemdir}/UTGame/Config/${selfname}" +servercfg="UTGame.ini" +servercfgdefault="UTGame.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" +gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ut99server/_default.cfg b/lgsm/config-default/config-lgsm/ut99server/_default.cfg new file mode 100644 index 000000000..16e0c205d --- /dev/null +++ b/lgsm/config-default/config-lgsm/ut99server/_default.cfg @@ -0,0 +1,166 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +defaultmap="DM-Deck16][" +ip="0.0.0.0" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="server ${defaultmap}.unr ini=${servercfgfullpath}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-gamespy1" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Unreal Tournament 99" +engine="unreal" +glibc="2.1" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/System" +executabledir="${systemdir}" +executable="./ucc-bin" +servercfgdir="${systemdir}" +servercfg="${selfname}.ini" +servercfgdefault="Default.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" +compressedmapsdir="${rootdir}/Maps-Compressed" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/utserver/_default.cfg b/lgsm/config-default/config-lgsm/utserver/_default.cfg new file mode 100644 index 000000000..1e974c2f1 --- /dev/null +++ b/lgsm/config-default/config-lgsm/utserver/_default.cfg @@ -0,0 +1,169 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +# For CTF: defaultmap="CTF-Face" gametype="CTF" +ip="0.0.0.0" +port="7777" +defaultmap="DM-Underland" +gametype="DM" +timelimit="10" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="UnrealTournament ${defaultmap}?Game=${gametype}?TimeLimit=${timelimit} -port=${port}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Unreal Tournament" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/LinuxServer" +executabledir="${systemdir}/Engine/Binaries/Linux" +executable="./UE4Server-Linux-Shipping" +servercfgdir="${systemdir}/UnrealTournament/Saved/Config/LinuxServer" +servercfg="Game.ini" +servercfgdefault="Game.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/vintsserver/_default.cfg b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg new file mode 100644 index 000000000..e23baf8af --- /dev/null +++ b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg @@ -0,0 +1,171 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="--datapath ${servercfgdir}" +} + +## Release Settings | https://docs.linuxgsm.com/game-servers/vintagestory#release-settings +# Branch (stable|unstable) +branch="stable" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="5" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Vintage Story" +engine="vintagestory" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +preexecutable="mono" +executable="./VintagestoryServer.exe" +servercfgdir="${serverfiles}/data/${selfname}" +servercfg="serverconfig.json" +servercfgdefault="serverconfig.json" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${vsdataworld}/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" diff --git a/lgsm/config-default/config-lgsm/vsserver/_default.cfg b/lgsm/config-default/config-lgsm/vsserver/_default.cfg new file mode 100644 index 000000000..3ddab5cbb --- /dev/null +++ b/lgsm/config-default/config-lgsm/vsserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +defaultmap="vs_frost" +maxplayers="16" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game vs -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="90" +steamcmdforcewindows="no" +appidmod="cstrike" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="9" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Vampire Slayer" +engine="goldsrc" +glibc="2.3.4" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/vs" +executabledir="${serverfiles}" +executable="./hlds_run" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/wetserver/_default.cfg b/lgsm/config-default/config-lgsm/wetserver/_default.cfg new file mode 100644 index 000000000..b5f243046 --- /dev/null +++ b/lgsm/config-default/config-lgsm/wetserver/_default.cfg @@ -0,0 +1,161 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+set net_strict 1 +set fs_homepath ${serverfiles} +exec ${servercfg}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-quake3" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Wolfenstein: Enemy Territory" +engine="idtech3" +glibc="2.2.4" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./etded" +servercfgdir="${systemdir}/etmain" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/wfserver/_default.cfg b/lgsm/config-default/config-lgsm/wfserver/_default.cfg new file mode 100644 index 000000000..ef9964c28 --- /dev/null +++ b/lgsm/config-default/config-lgsm/wfserver/_default.cfg @@ -0,0 +1,177 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="44400" +httpport="44444" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="+exec ${servercfg} +sv_http_ip ${ip} +set sv_http_port ${httpport} +sv_ip ${ip} +sv_port ${port}" + +#### LinuxGSM Settings #### + +## 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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-quake3" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="1136510" +steamcmdforcewindows="no" +appidmod="warfork" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Warfork" +engine="qfusion" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/Warfork.app/Contents/Resources" +executabledir="${systemdir}" +executable="./wf_server.x86_64" +servercfgdir="${systemdir}/basewf" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg new file mode 100644 index 000000000..5d5ba9790 --- /dev/null +++ b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg @@ -0,0 +1,174 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +# Parameters are edited in the game server config file. +startparameters="ADMINPWD=\"$ADMINPWD\" EPICSETTINGS=\"$EPICSETTINGS\" EXTERNALPORT=\"$EXTERNALPORT\" HOMESERVER=\"$HOMESERVER\" HOMEKINGDOM=\"$HOMEKINGDOM\" LOGINSERVER=\"$LOGINSERVER\" MAXPLAYERS=\"$MAXPLAYERS\" QUERYPORT=\"$QUERYPORT\" SERVERNAME=\"$SERVERNAME\" SERVERPASSWORD=\"$SERVERPASSWORD\" START=\"$START\" IP=\"$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". +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## 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="402370" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="" +consoleinteract="" + +## Game Server Details +# Do not edit +gamename="Wurm Unlimited" +engine="wurm" +glibc="2.14" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +preexecutable="xvfb-run" +executable="./WurmServerLauncher" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +source "${servercfgfullpath}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/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" diff --git a/lgsm/config-default/config-lgsm/zmrserver/_default.cfg b/lgsm/config-default/config-lgsm/zmrserver/_default.cfg new file mode 100644 index 000000000..f9b4bbb38 --- /dev/null +++ b/lgsm/config-default/config-lgsm/zmrserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="zm_docksofthedead" +maxplayers="16" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game zombie_master_reborn -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## 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". +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="244310" # Source 2013 SDK +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Zombie Master: Reborn" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/zombie_master_reborn" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/zpsserver/_default.cfg b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg new file mode 100644 index 000000000..178548eb0 --- /dev/null +++ b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg @@ -0,0 +1,187 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="27015" +clientport="27005" +sourcetvport="27020" +defaultmap="zps_deadend" +maxplayers="20" + +## Game Server Login Token (GSLT): Optional +# GSLT can be used for running a public server. +# More info: https://docs.linuxgsm.com/steamcmd/gslt +gslt="" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game zps -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# 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". +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="17505" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Zombie Panic! Source" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/zps" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/data/alert_discord_logo.jpg b/lgsm/data/alert_discord_logo.jpg new file mode 100644 index 000000000..db94b295e Binary files /dev/null and b/lgsm/data/alert_discord_logo.jpg differ diff --git a/lgsm/data/name-left.csv b/lgsm/data/name-left.csv new file mode 100644 index 000000000..9a47b4baf --- /dev/null +++ b/lgsm/data/name-left.csv @@ -0,0 +1,108 @@ +admiring +adoring +affectionate +agitated +amazing +angry +awesome +beautiful +blissful +bold +boring +brave +busy +charming +clever +cool +compassionate +competent +condescending +confident +cranky +crazy +dazzling +determined +distracted +dreamy +eager +ecstatic +elastic +elated +elegant +eloquent +epic +exciting +fervent +festive +flamboyant +focused +friendly +frosty +funny +gallant +gifted +goofy +gracious +great +happy +hardcore +heuristic +hopeful +hungry +infallible +inspiring +interesting +intelligent +jolly +jovial +keen +kind +laughing +loving +lucid +magical +mystifying +modest +musing +naughty +nervous +nice +nifty +nostalgic +objective +optimistic +peaceful +pedantic +pensive +practical +priceless +quirky +quizzical +recursing +relaxed +reverent +romantic +sad +serene +sharp +silly +sleepy +stoic +strange +stupefied +suspicious +sweet +tender +thirsty +trusting +unruffled +upbeat +vibrant +vigilant +vigorous +wizardly +wonderful +xenodochial +youthful +zealous +zen \ No newline at end of file diff --git a/lgsm/data/name-right.csv b/lgsm/data/name-right.csv new file mode 100644 index 000000000..8e04d85b4 --- /dev/null +++ b/lgsm/data/name-right.csv @@ -0,0 +1,237 @@ +albattani +allen +almeida +antonelli +agnesi +archimedes +ardinghelli +aryabhata +austin +babbage +banach +banzai +bardeen +bartik +bassi +beaver +bell +benz +bhabha +bhaskara +black +blackburn +blackwell +bohr +booth +borg +bose +bouman +boyd +brahmagupta +brattain +brown +buck +burnell +cannon +carson +cartwright +carver +cerf +chandrasekhar +chaplygin +chatelet +chatterjee +chebyshev +cohen +chaum +clarke +colden +cori +cray +curran +curie +darwin +davinci +dewdney +dhawan +diffie +dijkstra +dirac +driscoll +dubinsky +easley +edison +einstein +elbakyan +elgamal +elion +ellis +engelbart +euclid +euler +faraday +feistel +fermat +fermi +feynman +franklin +gagarin +galileo +galois +ganguly +gates +gauss +germain +goldberg +goldstine +goldwasser +golick +goodall +gould +greider +grothendieck +haibt +hamilton +haslett +hawking +hellman +heisenberg +hermann +herschel +hertz +heyrovsky +hodgkin +hofstadter +hoover +hopper +hugle +hypatia +ishizaka +jackson +jang +jemison +jennings +jepsen +johnson +joliot +jones +kalam +kapitsa +kare +keldysh +keller +kepler +khayyam +khorana +kilby +kirch +knuth +kowalevski +lalande +lamarr +lamport +leakey +leavitt +lederberg +lehmann +lewin +lichterman +liskov +lovelace +lumiere +mahavira +margulis +matsumoto +maxwell +mayer +mccarthy +mcclintock +mclaren +mclean +mcnulty +mendel +mendeleev +meitner +meninsky +merkle +mestorf +mirzakhani +moore +morse +murdock +moser +napier +nash +neumann +newton +nightingale +nobel +noether +northcutt +noyce +panini +pare +pascal +pasteur +payne +perlman +pike +poincare +poitras +proskuriakova +ptolemy +raman +ramanujan +ride +montalcini +ritchie +rhodes +robinson +roentgen +rosalind +rubin +saha +sammet +sanderson +satoshi +shamir +shannon +shaw +shirley +shockley +shtern +sinoussi +snyder +solomon +spence +stonebraker +sutherland +swanson +swartz +swirles +taussig +tereshkova +tesla +tharp +thompson +torvalds +tu +turing +varahamihira +vaughan +visvesvaraya +volhard +villani +wescoff +wilbur +wiles +williams +williamson +wilson +wing +wozniak +wright +wu +yalow +yonath +zhukovsky \ No newline at end of file diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv new file mode 100644 index 000000000..79139f680 --- /dev/null +++ b/lgsm/data/serverlist.csv @@ -0,0 +1,114 @@ +ac,acserver,Assetto Corsa +ahl,ahlserver,Action Half-Life +ahl2,ahl2server,Action: Source +ark,arkserver,ARK: Survival Evolved +arma3,arma3server,ARMA 3 +av,avserver,Avorion +bb,bbserver,BrainBread +bb2,bb2server,BrainBread 2 +bd,bdserver,Base Defense +bf1942,bf1942server,Battlefield 1942 +bfv,bfvserver,Battlefield: Vietnam +bmdm,bmdmserver,Black Mesa: Deathmatch +bo,boserver,Ballistic Overkill +bs,bsserver,Blade Symphony +bt,btserver,Barotrauma +bt1944,bt1944server,Battalion 1944 +cc,ccserver,Codename CURE +cmw,cmwserver,Chivalry: Medieval Warfare +cod,codserver,Call of Duty +cod2,cod2server,Call of Duty 2 +cod4,cod4server,Call of Duty 4 +coduo,coduoserver,Call of Duty: United Offensive +codwaw,codwawserver,Call of Duty: World at War +col,colserver,Colony Survival +cs,csserver,Counter-Strike 1.6 +cscz,csczserver,Counter-Strike: Condition Zero +csgo,csgoserver,Counter-Strike: Global Offensive +css,cssserver,Counter-Strike: Source +dab,dabserver,Double Action: Boogaloo +dmc,dmcserver,Deathmatch Classic +dod,dodserver,Day of Defeat +dods,dodsserver,Day of Defeat: Source +doi,doiserver,Day of Infamy +dst,dstserver,Don't Starve Together +dys,dysserver,Dystopia +eco,ecoserver,Eco +em,emserver,Empires Mod +etl,etlserver,ET: Legacy +fctr,fctrserver,Factorio +fof,fofserver,Fistful of Frags +gmod,gmodserver,Garrys Mod +hl2dm,hl2dmserver,Half-Life 2: Deathmatch +hldm,hldmserver,Half-Life: Deathmatch +hldms,hldmsserver,Half-Life Deathmatch: Source +hw,hwserver,Hurtworld +ins,insserver,Insurgency +inss,inssserver,Insurgency: Sandstorm +ios,iosserver,IOSoccer +jc2,jc2server,Just Cause 2 +jc3,jc3server,Just Cause 3 +jk2,jk2server,Jedi Knight II: Jedi Outcast +kf,kfserver,Killing Floor +kf2,kf2server,Killing Floor 2 +l4d,l4dserver,Left 4 Dead +l4d2,l4d2server,Left 4 Dead 2 +mc,mcserver,Minecraft +mcb,mcbserver,Minecraft Bedrock +mh,mhserver,MORDHAU +mohaa,mohaaserver,Medal of Honor: Allied Assault +mom,momserver,Memories of Mars +mta,mtaserver,Multi Theft Auto +mumble,mumbleserver,Mumble +nd,ndserver,Nuclear Dawn +nmrih,nmrihserver,No More Room in Hell +ns,nsserver,Natural Selection +ns2,ns2server,Natural Selection 2 +ns2c,ns2cserver,NS2: Combat +onset,onsetserver,Onset +opfor,opforserver,Opposing Force +pc,pcserver,Project Cars +pstbs,pstbsserver,Post Scriptum: The Bloody Seventh +pvkii,pvkiiserver,Pirates Vikings & Knights II +pvr,pvrserver,Pavlov VR +pz,pzserver,Project Zomboid +q2,q2server,Quake 2 +q3,q3server,Quake 3: Arena +ql,qlserver,Quake Live +qw,qwserver,Quake World +ricochet,ricochetserver,Ricochet +ro,roserver,Red Orchestra: Ostfront 41-45 +rtcw,rtcwserver,Return to Castle Wolfenstein +rust,rustserver,Rust +rw,rwserver,Rising World +samp,sampserver,San Andreas Multiplayer +sb,sbserver,Starbound +sbots,sbotsserver,StickyBots +scpsl,scpslserver,SCP: Secret Laboratory +scpslsm,scpslsmserver,SCP: Secret Laboratory ServerMod +sdtd,sdtdserver,7 Days to Die +sfc,sfcserver,SourceForts Classic +sof2,sof2server,Soldier Of Fortune 2: Gold Edition +sol,solserver,Soldat +squad,squadserver,Squad +st,stserver,Stationeers +sven,svenserver,Sven Co-op +terraria,terrariaserver,Terraria +tf2,tf2server,Team Fortress 2 +tfc,tfcserver,Team Fortress Classic +ts,tsserver,The Specialists +ts3,ts3server,Teamspeak 3 +tu,tuserver,Tower Unite +tw,twserver,Teeworlds +unt,untserver,Unturned +ut,utserver,Unreal Tournament +ut2k4,ut2k4server,Unreal Tournament 2004 +ut3,ut3server,Unreal Tournament 3 +ut99,ut99server,Unreal Tournament 99 +vs,vsserver,Vampire Slayer +vints,vintsserver,Vintage Story +wet,wetserver,Wolfenstein: Enemy Territory +wf,wfserver,Warfork +wurm,wurmserver,Wurm Unlimited +zmr,zmrserver,Zombie Master: Reborn +zps,zpsserver,Zombie Panic! Source diff --git a/lgsm/functions/README.md b/lgsm/functions/README.md new file mode 100755 index 000000000..c1c823fac --- /dev/null +++ b/lgsm/functions/README.md @@ -0,0 +1,16 @@ +# LinuxGSM - Modules + +These modules are scripts that are called upon by the primary script linuxgsm.sh + +## Module Names +Modules have been named to give an idea of what the function does. + +* core: Essential modules that will always run first. +* command: Primary command function. +* check: Runs checks that will either halt on or fix an issue. +* dev: development modules. +* fix: Applies a game server specific fix. +* info: retrieves information from a source such as config file or the OS. +* install: modules related to the installer. +* monitor: modules related to monitor. +* update: modules that update the game server. diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh new file mode 100755 index 000000000..45c7bae41 --- /dev/null +++ b/lgsm/functions/alert.sh @@ -0,0 +1,232 @@ +#!/bin/bash +# LinuxGSM alert.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Overall function for managing alerts. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_alert_log(){ + info_distro.sh + info_config.sh + info_messages.sh + if [ -f "${alertlog}" ]; then + rm -f "${alertlog:?}" + fi + + { + fn_info_message_head + fn_info_message_distro + fn_info_message_server_resource + fn_info_message_gameserver_resource + fn_info_message_gameserver + fn_info_logs + } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${alertlog}" > /dev/null 2>&1 +} + +fn_alert_test(){ + fn_script_log_info "Sending test alert" + alertsubject="Alert - ${selfname} - Test" + alertemoji="🚧" + alertsound="1" + alerturl="not enabled" + alertbody="Testing LinuxGSM Alert. No action to be taken." +} + +fn_alert_restart(){ + fn_script_log_info "Sending alert: Restarted: ${executable} not running" + alertsubject="Alert - ${selfname} - Restarted" + alertemoji="🚨" + alertsound="2" + alerturl="not enabled" + alertbody="${selfname} ${executable} not running" +} + +fn_alert_restart_query(){ + fn_script_log_info "Sending alert: Restarted: ${selfname}" + alertsubject="Alert - ${selfname} - Restarted" + alertemoji="🚨" + alertsound="2" + alerturl="not enabled" + alertbody="Unable to query: ${selfname}" +} + +fn_alert_update(){ + fn_script_log_info "Sending alert: Updated" + alertsubject="Alert - ${selfname} - Updated" + alertemoji="🎮" + alertsound="1" + alerturl="not enabled" + alertbody="${gamename} received update" +} + +fn_alert_check_update(){ + fn_script_log_info "Sending alert: Update available" + alertsubject="Alert - ${selfname} - Update available" + alertemoji="🎮" + alertsound="1" + alerturl="not enabled" + alertbody="${gamename} update available" +} + +fn_alert_permissions(){ + fn_script_log_info "Sending alert: Permissions error" + alertsubject="Alert - ${selfname}: Permissions error" + alertemoji="❗" + alertsound="2" + alerturl="not enabled" + alertbody="${selfname} has permissions issues" +} + +fn_alert_config(){ + fn_script_log_info "Sending alert: New _default.cfg" + alertsubject="Alert - ${selfname} - New _default.cfg" + alertemoji="🎮" + alertsound="1" + alerturl="not enabled" + alertbody="${selfname} has received a new _default.cfg. Check file for changes." +} + +if [ "${alert}" == "permissions" ]; then + fn_alert_permissions +elif [ "${alert}" == "restart" ]; then + fn_alert_restart +elif [ "${alert}" == "restartquery" ]; then + fn_alert_restart_query +elif [ "${alert}" == "test" ]; then + fn_alert_test +elif [ "${alert}" == "update" ]; then + fn_alert_update +elif [ "${alert}" == "check-update" ]; then + fn_alert_check_update +elif [ "${alert}" == "config" ]; then + fn_alert_config +fi + +# Generate alert log. +fn_alert_log + +# Generates the more info link. +if [ "${postalert}" == "on" ]&&[ -n "${postalert}" ]; then + exitbypass=1 + command_postdetails.sh + fn_firstcommand_reset + unset exitbypass +elif [ "${postalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "More Info not enabled" + fn_script_log_warn "More Info alerts not enabled" +fi + +if [ "${discordalert}" == "on" ]&&[ -n "${discordalert}" ]; then + alert_discord.sh +elif [ "${discordalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "Discord alerts not enabled" + fn_script_log_warn "Discord alerts not enabled" +elif [ -z "${discordtoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Discord token not set" + echo -e "* https://docs.linuxgsm.com/alerts/discord" + fn_script_error "Discord token not set" +fi + +if [ "${emailalert}" == "on" ]&&[ -n "${email}" ]; then + alert_email.sh +elif [ "${emailalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "Email alerts not enabled" + fn_script_log_warn "Email alerts not enabled" +elif [ -z "${email}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Email not set" + fn_script_log_error "Email not set" +fi + +if [ "${iftttalert}" == "on" ]&&[ -n "${iftttalert}" ]; then + alert_ifttt.sh +elif [ "${iftttalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "IFTTT alerts not enabled" + fn_script_log_warn "IFTTT alerts not enabled" +elif [ -z "${ifttttoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "IFTTT token not set" + echo -e "* https://docs.linuxgsm.com/alerts/ifttt" + fn_script_error "IFTTT token not set" +fi + +if [ "${mailgunalert}" == "on" ]&&[ -n "${mailgunalert}" ]; then + alert_mailgun.sh +elif [ "${mailgunalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "Mailgun alerts not enabled" + fn_script_log_warn "Mailgun alerts not enabled" +elif [ -z "${mailguntoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Mailgun token not set" + echo -e "* https://docs.linuxgsm.com/alerts/mailgun" + fn_script_error "Mailgun token not set" +fi + +if [ "${pushbulletalert}" == "on" ]&&[ -n "${pushbullettoken}" ]; then + alert_pushbullet.sh +elif [ "${pushbulletalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "Pushbullet alerts not enabled" + fn_script_log_warn "Pushbullet alerts not enabled" +elif [ -z "${pushbullettoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Pushbullet token not set" + echo -e "* https://docs.linuxgsm.com/alerts/pushbullet" + fn_script_error "Pushbullet token not set" +fi + +if [ "${pushoveralert}" == "on" ]&&[ -n "${pushoveralert}" ]; then + alert_pushover.sh +elif [ "${pushoveralert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "Pushover alerts not enabled" + fn_script_log_warn "Pushover alerts not enabled" +elif [ -z "${pushovertoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Pushover token not set" + echo -e "* https://docs.linuxgsm.com/alerts/pushover" + fn_script_error "Pushover token not set" +fi + +if [ "${sendgridalert}" == "on" ]&&[ -n "${sendgridalert}" ]; then + alert_sendgrid.sh +elif [ "${sendgridalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "SendGrid alerts not enabled" + fn_script_log_warn "SendGrid alerts not enabled" +elif [ -z "${sendgridtoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "SendGrid token not set" + echo -e "* https://docs.linuxgsm.com/alerts/sendgrid" + fn_script_error "SendGrid token not set" +fi + +if [ "${telegramalert}" == "on" ]&&[ -n "${telegramtoken}" ]; then + alert_telegram.sh +elif [ "${telegramalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "Telegram Messages not enabled" + fn_script_log_warn "Telegram Messages not enabled" +elif [ -z "${telegramtoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Telegram token not set." + echo -e "* https://docs.linuxgsm.com/alerts/telegram" + fn_script_error "Telegram token not set." +elif [ -z "${telegramchatid}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Telegram chat id not set." + echo -e "* https://docs.linuxgsm.com/alerts/telegram" + fn_script_error "Telegram chat id not set." +fi + +if [ "${rocketchatalert}" == "on" ]&&[ -n "${rocketchatalert}" ]; then + alert_rocketchat.sh +elif [ "${rocketchatalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "Rocketchat alerts not enabled" + fn_script_log_warn "Rocketchat alerts not enabled" +elif [ -z "${rocketchattoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Rocketchat token not set" + #echo -e "* https://docs.linuxgsm.com/alerts/slack" + fn_script_error "Rocketchat token not set" +fi + +if [ "${slackalert}" == "on" ]&&[ -n "${slackalert}" ]; then + alert_slack.sh +elif [ "${slackalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_warn_nl "Slack alerts not enabled" + fn_script_log_warn "Slack alerts not enabled" +elif [ -z "${slacktoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then + fn_print_error_nl "Slack token not set" + echo -e "* https://docs.linuxgsm.com/alerts/slack" + fn_script_error "Slack token not set" +fi diff --git a/lgsm/functions/alert_discord.sh b/lgsm/functions/alert_discord.sh new file mode 100755 index 000000000..b8467eecc --- /dev/null +++ b/lgsm/functions/alert_discord.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# LinuxGSM alert_discord.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends Discord alert. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if ! command -v jq > /dev/null; then + fn_print_fail_nl "Sending Discord alert: jq is missing." + fn_script_log_fatal "Sending Discord alert: jq is missing." +fi + +json=$(cat < /dev/null; then + fn_print_fail_nl "Sending Rocketchat alert: jq is missing." + fn_script_log_fatal "Sending Rocketchat alert: jq is missing." +fi + +json=$(cat < /dev/null; then + fn_print_fail_nl "Sending Slack alert: jq is missing." + fn_script_log_fatal "Sending Slack alert: jq is missing." +fi + +json=$(cat <${alertemoji} ${alertsubject} ${alertemoji}\n\nServer name\n${servername}\n\nMessage\n${alertbody}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}", + "disable_web_page_preview": "yes", +EOF +) + +fn_print_dots "Sending Telegram alert" +telegramsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d """${json}""" ${curlcustomstring} "https://api.telegram.org/bot${telegramtoken}/sendMessage" | grep "error_code") + +if [ -n "${telegramsend}" ]; then + fn_print_fail_nl "Sending Telegram alert: ${telegramsend}" + fn_script_log_fatal "Sending Telegram alert: ${telegramsend}" +else + fn_print_ok_nl "Sending Telegram alert" + fn_script_log_pass "Sent Telegram alert" +fi diff --git a/lgsm/functions/check.sh b/lgsm/functions/check.sh new file mode 100755 index 000000000..523445c5d --- /dev/null +++ b/lgsm/functions/check.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# LinuxGSM check.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Overall function for managing checks. +# Runs checks that will either halt on or fix an issue. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Every command that requires checks just references check.sh. +# check.sh selects which checks to run by using arrays. + +if [ "${commandname}" != "INSTALL" ]; then + check_root.sh +fi + +if [ "${commandname}" != "UPDATE-LGSM" ]; then + check_version.sh +fi + +check_tmuxception.sh + +if [ "$(whoami)" != "root" ]; then + if [ "${commandname}" != "MONITOR" ]; then + check_permissions.sh + fi +fi + +if [ "${commandname}" != "INSTALL" ]&&[ "${commandname}" != "UPDATE-LGSM" ]&&[ "${commandname}" != "DETAILS" ]&&[ "${commandname}" != "POST-DETAILS" ]; then + check_system_dir.sh +fi + +allowed_commands_array=( START DEBUG ) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + check_executable.sh + fi +done + +if [ "$(whoami)" != "root" ]; then + allowed_commands_array=( DEBUG START INSTALL ) + for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + check_glibc.sh + fi + done +fi + +allowed_commands_array=( BACKUP CONSOLE DEBUG DETAILS MAP-COMPRESSOR FASTDL MODS-INSTALL MODS-REMOVE MODS-UPDATE MONITOR POST-DETAILS RESTART START STOP TEST-ALERT CHANGE-PASSWORD UPDATE UPDATE-LGSM VALIDATE WIPE ) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + check_logs.sh + fi +done + +allowed_commands_array=( DEBUG START STOP ) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + check_deps.sh + fi +done + +allowed_commands_array=( CONSOLE DEBUG MONITOR START STOP ) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + check_config.sh + fi +done + +allowed_commands_array=( DEBUG DETAILS DEV-QUERY-RAW MONITOR POST_DETAILS START STOP POST-DETAILS ) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + if [ -z "${installflag}" ]; then + check_ip.sh + fi + fi +done + +allowed_commands_array=( DEBUG START UPDATE VALIDATE ) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + if [ "${appid}" ]; then + check_steamcmd.sh + fi + fi +done + +allowed_commands_array=( CHANGE-PASSWORD DETAILS MONITOR START STOP UPDATE VALIDATE POST-DETAILS ) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + check_status.sh + fi +done + +allowed_commands_array=( DEBUG START INSTALL ) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + check_system_requirements.sh + fi +done diff --git a/lgsm/functions/check_config.sh b/lgsm/functions/check_config.sh new file mode 100755 index 000000000..5b8d51691 --- /dev/null +++ b/lgsm/functions/check_config.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# LinuxGSM check_config.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if the server config is missing and warns the user if needed. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ -n "${servercfgfullpath}" ]&&[ ! -f "${servercfgfullpath}" ]; then + fn_print_dots "" + fn_print_warn_nl "Configuration file missing!" + echo -e "${servercfgfullpath}" + fn_script_log_warn "Configuration file missing!" + fn_script_log_warn "${servercfgfullpath}" + install_config.sh +fi + +if [ "${shortname}" == "rust" ]&&[ -v rconpassword ]&&[ -z "${rconpassword}" ]; then + fn_print_dots "" + fn_print_fail_nl "RCON password is not set" + fn_script_log_warn "RCON password is not set" +elif [ -v rconpassword ]&&[ "${rconpassword}" == "CHANGE_ME" ]; then + fn_print_dots "" + fn_print_warn_nl "Default RCON Password detected" + fn_script_log_warn "Default RCON Password detected" +fi diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh new file mode 100755 index 000000000..3dd58cdd8 --- /dev/null +++ b/lgsm/functions/check_deps.sh @@ -0,0 +1,611 @@ +#!/bin/bash +# LinuxGSM check_deps.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if required dependencies are installed for LinuxGSM. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_install_mono_repo(){ + if [ "${monostatus}" != "0" ]; then + fn_print_dots "Adding Mono repository" + if [ "${autoinstall}" == "1" ]; then + sudo -n true > /dev/null 2>&1 + else + sudo -v > /dev/null 2>&1 + fi + if [ $? -eq 0 ]; then + fn_print_info_nl "Automatically adding Mono repository." + fn_script_log_info "Automatically adding Mono repository." + echo -en ".\r" + sleep 1 + echo -en "..\r" + sleep 1 + echo -en "...\r" + sleep 1 + echo -en " \r" + if [ "${distroid}" == "ubuntu" ]; then + if [ "${distroversion}" == "18.04" ]; then + cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-bionic main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt-get update" + eval "${cmd}" + elif [ "${distroversion}" == "16.04" ]; then + cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt-get install apt-transport-https;echo 'deb https://download.mono-project.com/repo/ubuntu stable-xenial main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt-get update" + eval "${cmd}" + elif [ "${distroversion}" == "14.04" ]; then + cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt-get install apt-transport-https;echo 'deb https://download.mono-project.com/repo/ubuntu stable-trusty main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt-get update" + eval "${cmd}" + else + fn_print_warn_nl "Installing Mono repository." + echo -e "Mono auto install not available for ${distroname}" + echo -e " Follow instructions on mono site to install the latest version of Mono." + echo -e " https://www.mono-project.com/download/stable/#download-lin" + monoautoinstall="1" + fi + elif [ "${distroid}" == "debian" ]; then + if [ "${distroversion}" == "10" ]; then + cmd="sudo apt-get install apt-transport-https dirmngr;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-buster main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt-get update" + eval "${cmd}" + elif [ "${distroversion}" == "9" ]; then + cmd="sudo apt-get install apt-transport-https dirmngr;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-stretch main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt-get update" + eval "${cmd}" + elif [ "${distroversion}" == "8" ]; then + cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt-get install apt-transport-https;echo 'deb https://download.mono-project.com/repo/debian stable-jessie main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt-get update" + eval "${cmd}" + else + echo -e "Mono auto install not available for ${distroname}" + echo -e " Follow instructions on mono site to install the latest version of Mono." + echo -e " https://www.mono-project.com/download/stable/#download-lin" + monoautoinstall="1" + fi + elif [ "${distroid}" == "centos" ]; then + if [ "${distroversion}" == "8" ]; then + cmd="rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo'" + eval "${cmd}" + elif [ "${distroversion}" == "7" ]; then + cmd="rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'" + eval "${cmd}" + else + echo -e "Mono auto install not available for ${distroname}" + echo -e " Follow instructions on mono site to install the latest version of Mono." + echo -e " https://www.mono-project.com/download/stable/#download-lin" + monoautoinstall="1" + fi + elif [ "${distroid}" == "fedora" ]; then + cmd="rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF'; su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'; dnf update" + eval "${cmd}" + else + echo -e "Mono auto install not available for ${distroname}" + echo -e " Follow instructions on mono site to install the latest version of Mono." + echo -e " https://www.mono-project.com/download/stable/#download-lin" + monoautoinstall="1" + fi + if [ "${monoautoinstall}" != "1" ]; then + if [ $? != 0 ]; then + fn_print_failure_nl "Unable to install Mono repository." + fn_script_log_fatal "Unable to installMono repository." + monoautoinstall=1 + else + fn_print_complete_nl "Installing Mono repository completed." + fn_script_log_pass "Installing Mono repository completed." + monoautoinstall=0 + fi + fi + else + fn_print_information_nl "Installing Mono repository." + echo -e "" + fn_print_warning_nl "$(whoami) does not have sudo access. Manually install Mono repository." + fn_script_log_warn "$(whoami) does not have sudo access. Manually install Mono repository." + echo -e "* Follow instructions on mono site to install the latest version of Mono." + echo -e " https://www.mono-project.com/download/stable/#download-lin" + fi + fi +} + +fn_install_universe_repo(){ + # Defensive coding - As this is an ubuntu only issue then check to make sure this fix is needed, and we are using ubuntu. + if [ "${jquniversemissing}" != "0" ]&&[ "${distroid}" == "ubuntu" ]; then + fn_print_warning_nl "Ubuntu 18.04.1 contains a bug which means the sources.list file does not populate with the Ubuntu universe repository." + fn_print_information_nl "Attempting to add universe repository." + if [ "${autoinstall}" == "1" ]; then + sudo -n true > /dev/null 2>&1 + else + sudo -v > /dev/null 2>&1 + fi + if [ $? -eq 0 ]; then + echo -en ".\r" + sleep 1 + echo -en "..\r" + sleep 1 + echo -en "...\r" + sleep 1 + echo -en " \r" + cmd="sudo apt-add-repository universe" + eval "${cmd}" + if [ $? -eq 0 ]; then + fn_print_complete_nl "Installing universe repository completed." + fn_script_log_pass "Installing universe repository completed." + else + fn_print_failure_nl "Unable to install universe repository." + fn_script_log_fatal "Unable to install universe repository." + fi + else + fn_print_warning_nl "$(whoami) does not have sudo access. Manually add Universe repository." + fn_script_log_warn "$(whoami) does not have sudo access. Manually add Universe repository." + echo -e "* Please run the following command as a user with sudo access, and re-run the installation" + echo -e "" + echo -e " sudo apt-add-repository universe" + fi + fi +} + +fn_deps_detector(){ + # Checks if dependency is missing. +if [ "${javacheck}" == "1" ]; then + # Added for users using Oracle JRE to bypass check. + depstatus=0 + deptocheck="${javaversion}" + unset javacheck + + elif [ "${deptocheck}" == "jq" ]&&[ "${distroid}" == "ubuntu" ]&&[ "${distroversion}" == "18.04" ]&& ! grep -qE "^deb .*universe" /etc/apt/sources.list; then + # #1985 ubuntu 18.04.1 bug does not set sources.list correctly which means universe is not active by default + # If the universe repo does not exist, mark as dependency missing and universe missing. + depstatus=1 + jquniversemissing=1 + elif [ "${deptocheck}" == "mono-complete" ]; then + if [ "$(command -v mono 2>/dev/null)" ]&&[ "$(mono --version 2>&1 | grep -Po '(?<=version )\d')" -ge 5 ]; then + # Mono >= 5.0.0 already installed. + depstatus=0 + else + # Mono not installed or installed Mono < 5.0.0. + depstatus=1 + monostatus=1 + fi + elif [ "$(command -v dpkg-query 2>/dev/null)" ]; then + dpkg-query -W -f='${Status}' "${deptocheck}" 2>/dev/null | grep -q -P '^install ok installed' + depstatus=$? + elif [ "$(command -v rpm 2>/dev/null)" ]; then + rpm -q "${deptocheck}" > /dev/null 2>&1 + depstatus=$? + fi + + if [ "${depstatus}" == "0" ]; then + # If dependency is found. + missingdep=0 + if [ "${commandname}" == "INSTALL" ]; then + echo -e "${green}${deptocheck}${default}" + fn_sleep_time + fi + else + # If dependency is not found. + missingdep=1 + if [ "${commandname}" == "INSTALL" ]; then + echo -e "${red}${deptocheck}${default}" + fn_sleep_time + fi + # Define required dependencies for SteamCMD. + if [ "${appid}" ]; then + # lib32gcc1 is now called lib32gcc-s1 in debian 11 + if { [ "${distroid}" == "debian" ]&&[ "${distroversion}" == "11" ]; }||{ [ "${distroid}" == "ubuntu" ]&&[ "${distroversion}" == "20.10" ]; }; then + if [ "${deptocheck}" == "glibc.i686" ]||[ "${deptocheck}" == "libstdc++64.i686" ]||[ "${deptocheck}" == "lib32gcc-s1" ]||[ "${deptocheck}" == "lib32stdc++6" ]; then + steamcmdfail=1 + fi + else + if [ "${deptocheck}" == "glibc.i686" ]||[ "${deptocheck}" == "libstdc++64.i686" ]||[ "${deptocheck}" == "lib32gcc1" ]||[ "${deptocheck}" == "lib32stdc++6" ]; then + steamcmdfail=1 + fi + fi + fi + fi + + # Missing dependencies are added to array_deps_missing. + if [ "${missingdep}" == "1" ]; then + array_deps_missing+=("${deptocheck}") + fi +} + +fn_deps_email(){ + # Adds postfix to required dependencies if email alert is enabled. + if [ "${emailalert}" == "on" ]; then + if [ -f /usr/bin/mailx ]; then + if [ -d /etc/exim4 ]; then + array_deps_required+=( exim4 ) + elif [ -d /etc/sendmail ]; then + array_deps_required+=( sendmail ) + elif [ "$(command -v dpkg-query 2>/dev/null)" ]; then + array_deps_required+=( mailutils postfix ) + elif [ "$(command -v rpm 2>/dev/null)" ]; then + array_deps_required+=( mailx postfix ) + fi + else + if [ "$(command -v dpkg-query 2>/dev/null)" ]; then + array_deps_required+=( mailutils postfix ) + elif [ "$(command -v rpm 2>/dev/null)" ]; then + array_deps_required+=( mailx postfix ) + fi + fi + fi +} + +fn_found_missing_deps(){ + if [ "${#array_deps_missing[*]}" != "0" ]; then + + fn_print_warning_nl "Missing dependencies: ${red}${array_deps_missing[*]}${default}" + fn_script_log_warn "Missing dependencies: ${array_deps_missing[*]}" + fn_sleep_time + if [ "${monostatus}" ]; then + fn_install_mono_repo + fi + if [ "${jqstatus}" ]; then + fn_print_warning_nl "jq is not available in the ${distroname} repository." + echo -e " * https://docs.linuxgsm.com/requirements/jq" + fi + if [ "${autoinstall}" == "1" ]; then + sudo -n true > /dev/null 2>&1 + else + sudo -v > /dev/null 2>&1 + fi + if [ $? -eq 0 ]; then + fn_print_information_nl "Automatically installing missing dependencies." + fn_script_log_info "Automatically installing missing dependencies." + echo -en ".\r" + sleep 1 + echo -en "..\r" + sleep 1 + echo -en "...\r" + sleep 1 + echo -en " \r" + if [ "$(command -v dpkg-query 2>/dev/null)" ]; then + cmd="echo steamcmd steam/question select \"I AGREE\" | sudo debconf-set-selections; echo steamcmd steam/license note '' | sudo debconf-set-selections; sudo dpkg --add-architecture i386; sudo apt-get update; sudo apt-get -y install ${array_deps_missing[*]}" + eval "${cmd}" + elif [ "$(command -v dnf 2>/dev/null)" ]; then + cmd="sudo dnf -y install ${array_deps_missing[*]}" + eval "${cmd}" + elif [ "$(command -v yum 2>/dev/null)" ]; then + cmd="sudo yum -y install ${array_deps_missing[*]}" + eval "${cmd}" + fi + if [ $? != 0 ]; then + fn_print_failure_nl "Unable to install dependencies." + fn_script_log_fatal "Unable to install dependencies." + echo -e "" + fn_print_warning_nl "Manually install dependencies." + fn_script_log_warn "Manually install dependencies." + if [ "$(command -v dpkg-query 2>/dev/null)" ]; then + echo -e " sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[*]}" + elif [ "$(command -v dnf 2>/dev/null)" ]; then + echo -e " sudo dnf install ${array_deps_missing[*]}" + elif [ "$(command -v yum 2>/dev/null)" ]; then + echo -e " sudo yum install ${array_deps_missing[*]}" + fi + if [ "${steamcmdfail}" ]; then + echo -e "" + if [ "${commandname}" == "INSTALL" ]; then + fn_print_failure_nl "Missing dependencies required to run SteamCMD." + fn_script_log_fatal "Missing dependencies required to run SteamCMD." + core_exit.sh + else + fn_print_error_nl "Missing dependencies required to run SteamCMD." + fn_script_log_error "Missing dependencies required to run SteamCMD." + fi + fi + else + fn_print_complete_nl "Install dependencies completed." + fn_script_log_pass "Install dependencies completed." + fi + else + fn_print_warning_nl "$(whoami) does not have sudo access. Manually install dependencies." + fn_script_log_warn "$(whoami) does not have sudo access. Manually install dependencies." + echo -e "" + if [ "$(command -v dpkg-query 2>/dev/null)" ]; then + echo -e "sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[*]}" + elif [ "$(command -v dnf 2>/dev/null)" ]; then + echo -e "sudo dnf install ${array_deps_missing[*]}" + elif [ "$(command -v yum 2>/dev/null)" ]; then + echo -e "sudo yum install ${array_deps_missing[*]}" + fi + if [ "${steamcmdfail}" ]; then + echo -e "" + if [ "${commandname}" == "INSTALL" ]; then + fn_print_failure_nl "Missing dependencies required to run SteamCMD." + fn_script_log_fatal "Missing dependencies required to run SteamCMD." + core_exit.sh + else + fn_print_error_nl "Missing dependencies required to run SteamCMD." + fn_script_log_error "Missing dependencies required to run SteamCMD." + fi + fi + echo -e "" + fi + if [ "${commandname}" == "INSTALL" ]; then + sleep 5 + fi + else + if [ "${commandname}" == "INSTALL" ]; then + fn_print_information_nl "Required dependencies already installed." + fn_script_log_info "Required dependencies already installed." + fi + fi +} + +fn_check_loop(){ + # Loop though required depenencies. + for deptocheck in ${array_deps_required[*]}; do + fn_deps_detector + done + + # user to be informed of any missing dependencies. + fn_found_missing_deps +} + +# Generate require dependencies for debian based systems. +fn_deps_build_debian(){ + # Generate array of missing deps. + array_deps_missing=() + + # LinuxGSM requirements. + array_deps_required=( curl wget ca-certificates file bsdmainutils util-linux python3 tar bzip2 gzip unzip binutils bc jq tmux netcat cpio ) + + # All servers except ts3, mumble, GTA and minecraft servers require lib32stdc++6 and lib32gcc1. + if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${shortname}" != "mc" ]&&[ "${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" ]; }; then + array_deps_required+=( lib32gcc-s1 lib32stdc++6 ) + else + array_deps_required+=( lib32gcc1 lib32stdc++6 ) + fi + else + array_deps_required+=( lib32stdc++6 ) + fi + fi + # If requires steamcmd. + if [ "${appid}" ]; then + # Will not use apt if non-free repo is missing or Ubuntu 14.04 + if [ "${distroversion}" == "14.04" ]||[ "${distroid}" == "debian" ]&& ! grep -qE "^deb .*non-free" /etc/apt/sources.list; then + : + else + array_deps_required+=( steamcmd libsdl2-2.0-0:i386 ) + fi + fi + + # Game Specific requirements. + + # Natural Selection 2 (x64 only) + if [ "${shortname}" == "ns2" ]; then + array_deps_required+=( speex libtbb2 ) + # NS2: Combat + elif [ "${shortname}" == "ns2c" ]; then + array_deps_required+=( speex:i386 libtbb2 ) + # 7 Days to Die + elif [ "${shortname}" == "sdtd" ]; then + array_deps_required+=( telnet expect ) + # Battlefield: Vietnam + elif [ "${shortname}" == "bfv" ]; then + array_deps_required+=( libncurses5:i386 libstdc++5:i386 ) + # Battlefield 1942 + elif [ "${shortname}" == "bf1942" ]; then + array_deps_required+=( libncurses5:i386 libtinfo5:i386 ) + # Black Mesa: Death Match + elif [ "${shortname}" == "bmdm" ]; then + array_deps_required+=( libncurses5:i386 ) + # Counter-Strike: Source, Garry's Mod, No More Room in Hell, Source Forts Classic, Zombie Master Reborn and Zombie Panic: Source + elif [ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "nmrih" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "zmr" ]||[ "${shortname}" == "zps" ]; then + if [ "${arch}" == "x86_64" ]; then + array_deps_required+=( libtinfo5:i386 ) + else + array_deps_required+=( libtinfo5 ) + fi + # Brainbread 2, Don't Starve Together & Team Fortress 2 + elif [ "${shortname}" == "bb2" ]||[ "${shortname}" == "dst" ]||[ "${shortname}" == "tf2" ]; then + array_deps_required+=( libcurl4-gnutls-dev:i386 ) + # Call of Duty & Medal of Honor: Allied Assault + elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]||[ "${shortname}" == "mohaa" ]; then + array_deps_required+=( libstdc++5:i386 ) + # Barotrauma + elif [ "${shortname}" == "bt" ]; then + array_deps_required+=( libicu-dev ) + # Ecoserver + elif [ "${shortname}" == "eco" ]; then + array_deps_required+=( libgdiplus ) + # Factorio + elif [ "${shortname}" == "fctr" ]; then + array_deps_required+=( xz-utils ) + # Hurtword/Rust + elif [ "${shortname}" == "hw" ]||[ "${shortname}" == "rust" ]; then + array_deps_required+=( lib32z1 ) + # Minecraft, Rising World, Wurm + elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "rw" ]; then + javaversion=$(java -version 2>&1 | grep "version") + if [ "${javaversion}" ]; then + # Added for users using Oracle JRE to bypass the check. + javacheck=1 + else + array_deps_required+=( default-jre ) + fi + # Onset + elif [ "${shortname}" == "onset" ]; then + array_deps_required+=( libmariadbclient-dev ) + # Project Zomboid + elif [ "${shortname}" == "pz" ]; then + if java -version 2>&1 | grep "version"; then + # Added for users using Oracle JRE to bypass the check. + javacheck=1 + array_deps_required+=( rng-tools ) + else + array_deps_required+=( default-jre rng-tools ) + fi + # SCP: Secret Laboratory, SCP: Secret Laboratory ServerMod + elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then + array_deps_required+=( mono-complete ) + # Sven Co-op + elif [ "${shortname}" == "sven" ]; then + array_deps_required+=( libssl1.1:i386 zlib1g:i386 ) + # Unreal Engine + elif [ "${executable}" == "./ucc-bin" ]; then + # UT2K4 + if [ -f "${executabledir}/ut2004-bin" ]; then + array_deps_required+=( libsdl1.2debian libstdc++5:i386 ) + # UT99 + else + array_deps_required+=( libsdl1.2debian ) + fi + # Unreal Tournament + elif [ "${shortname}" == "ut" ]; then + array_deps_required+=( unzip ) + # Vintage Story + elif [ "${shortname}" == "vints" ]; then + array_deps_required+=( mono-complete ) + # Wurm: Unlimited + elif [ "${shortname}" == "wurm" ]; then + array_deps_required+=( xvfb ) + # Post Scriptum + elif [ "${shortname}" == "pstbs" ]; then + array_deps_required+=( libgconf-2-4 ) + # Pavlov VR + elif [ "${shortname}" == "pvr" ]; then + array_deps_required+=( libc++1 ) + fi + fn_deps_email + fn_check_loop +} + +fn_deps_build_redhat(){ + # Generate array of missing deps. + array_deps_missing=() + + # LinuxGSM requirements. + # CentOS + if [ "${distroversion}" == "7" ]; then + array_deps_required=( epel-release curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat cpio ) + elif [ "${distroversion}" == "8" ]; then + array_deps_required=( epel-release curl wget util-linux python36 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat cpio ) + elif [ "${distroid}" == "fedora" ]; then + array_deps_required=( curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat cpio ) + elif [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then + array_deps_required=( curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat cpio ) + else + array_deps_required=( curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat cpio ) + fi + + # All servers except ts3, mumble, multi theft auto and minecraft servers require glibc.i686 and libstdc++.i686. + if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${shortname}" != "mc" ]&&[ "${engine}" != "renderware" ]; then + if [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then + array_deps_required+=( glibc.i686 libstdc++64.i686 ) + else + array_deps_required+=( glibc.i686 libstdc++.i686 ) + fi + fi + + # Game Specific requirements. + + # Natural Selection 2 (x64 only) + if [ "${shortname}" == "ns2" ]; then + array_deps_required+=( speex tbb ) + # NS2: Combat + elif [ "${shortname}" == "ns2c" ]; then + array_deps_required+=( speex.i686 tbb.i686 ) + # 7 Days to Die + elif [ "${shortname}" == "sdtd" ]; then + array_deps_required+=( telnet expect ) + # Barotrauma + elif [ "${shortname}" == "bt" ]; then + array_deps_required+=( libicu ) + # Battlefield: Vietnam + elif [ "${shortname}" == "bfv" ]; then + array_deps_required+=( compat-libstdc++-33.i686 glibc.i686 ) + # Battlefield 1942, Black Mesa: Deathmatch, Counter-Strike: Source, Garry's Mod, No More Room in Hell, Source Forts Classic, Zombie Master Reborn and Zombie Panic: Source + elif [ "${shortname}" == "bf1942" ]||[ "${shortname}" == "bmdm" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "nmrih" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "zmr" ]||[ "${shortname}" == "zps" ]; then + array_deps_required+=( ncurses-libs.i686 ) + # Brainbread 2, Don't Starve Together & Team Fortress 2 + elif [ "${shortname}" == "bb2" ]||[ "${shortname}" == "dst" ]||[ "${shortname}" == "tf2" ]; then + array_deps_required+=( libcurl.i686 ) + # Call of Duty & Medal of Honor: Allied Assault + elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]||[ "${shortname}" == "mohaa" ]; then + array_deps_required+=( compat-libstdc++-33.i686 ) + # Ecoserver + elif [ "${shortname}" == "eco" ]; then + array_deps_required+=( libgdiplus ) + # Factorio + elif [ "${shortname}" == "fctr" ]; then + array_deps_required+=( xz ) + # Hurtword/Rust + elif [ "${shortname}" == "hw" ]||[ "${shortname}" == "rust" ]; then + array_deps_required+=( zlib-devel ) + # Minecraft, Rising World, Wurm + elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "rw" ]; then + javaversion=$(java -version 2>&1 | grep "version") + if [ "${javaversion}" ]; then + # Added for users using Oracle JRE to bypass the check. + javacheck=1 + else + array_deps_required+=( java-11-openjdk ) + fi + # Onset + elif [ "${shortname}" == "onset" ]; then + array_deps_required+=( mariadb-connector-c ) + # Project Zomboid + elif [ "${shortname}" == "pz" ]; then + if java -version 2>&1 | grep "version"; then + # Added for users using Oracle JRE to bypass the check. + javacheck=1 + array_deps_required+=( rng-tools ) + else + array_deps_required+=( java-11-openjdk rng-tools ) + fi + # Sven Co-op + elif [ "${shortname}" == "sven" ]; then + : # not compatible + # Unreal Engine + elif [ "${executable}" == "./ucc-bin" ]; then + # UT2K4 + if [ -f "${executabledir}/ut2004-bin" ]; then + array_deps_required+=( compat-libstdc++-33.i686 SDL.i686 bzip2 ) + # UT99 + else + array_deps_required+=( SDL.i686 bzip2 ) + fi + # Unreal Tournament + elif [ "${shortname}" == "ut" ]; then + array_deps_required+=( unzip ) + # Vintage Story + elif [ "${shortname}" == "vints" ]; then + array_deps_required+=( mono-complete ) + # Wurm: Unlimited + elif [ "${shortname}" == "wurm" ]; then + array_deps_required+=( xorg-x11-server-Xvfb ) + # Post Scriptum + elif [ "${shortname}" == "pstbs" ]; then + array_deps_required+=( GConf2 ) + # Pavlov VR + elif [ "${shortname}" == "pvr" ]; then + array_deps_required+=( libcxx ) + fi + fn_deps_email + fn_check_loop +} + +if [ "${commandname}" == "INSTALL" ]; then + if [ "$(whoami)" == "root" ]; then + echo -e "" + echo -e "${lightyellow}Checking Dependencies as root${default}" + echo -e "=================================" + fn_print_information_nl "Checking any missing dependencies for ${gamename} server only." + fn_print_information_nl "This will NOT install a ${gamename} server." + fn_sleep_time + else + echo -e "" + echo -e "${lightyellow}Checking Dependencies${default}" + echo -e "=================================" + fi +fi + +# Filter checking in to Debian or Red Hat Based. +info_distro.sh +if [ -f "/etc/debian_version" ]; then + fn_deps_build_debian +elif [ -f "/etc/redhat-release" ]; then + fn_deps_build_redhat +else + fn_print_warning_nl "${distroname} dependency checking unavailable." +fi diff --git a/lgsm/functions/check_executable.sh b/lgsm/functions/check_executable.sh new file mode 100755 index 000000000..252c6c8d2 --- /dev/null +++ b/lgsm/functions/check_executable.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LinuxGSM check_executable.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if server executable exists. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Check if executable exists +if [ ! -f "${executabledir}/${execname}" ]; then + fn_print_fail_nl "executable was not found" + echo -e "* ${executabledir}/${execname}" + if [ -d "${lgsmlogdir}" ]; then + fn_script_log_fatal "Executable was not found: ${executabledir}/${execname}" + fi + unset exitbypass + core_exit.sh +fi diff --git a/lgsm/functions/check_glibc.sh b/lgsm/functions/check_glibc.sh new file mode 100755 index 000000000..b1a959f5b --- /dev/null +++ b/lgsm/functions/check_glibc.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# LinuxGSM check_glibc.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if the server has the correct Glibc version. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +info_distro.sh + +if [ "${glibc}" == "null" ]; then + # Glibc is not required. + : +elif [ -z "${glibc}" ]; then + fn_print_dots "glibc" + fn_print_error_nl "glibc requirement unknown" + fn_script_log_error "glibc requirement unknown" +elif [ "$(printf '%s\n'${glibc}'\n' "${glibcversion}" | sort -V | head -n 1)" != "${glibc}" ]; then + fn_print_dots "glibc" + fn_print_error_nl "glibc requirements not met" + fn_script_log_error "glibc requirements not met" + echo -en "\n" + echo -e " * glibc required: ${glibc}" + echo -e " * glibc installed: ${red}${glibcversion}${default}" + echo -en "\n" + fn_print_information_nl "distro upgrade is required" + fn_script_log_info "distro upgrade is required" +fi diff --git a/lgsm/functions/check_ip.sh b/lgsm/functions/check_ip.sh new file mode 100755 index 000000000..ae1b99b77 --- /dev/null +++ b/lgsm/functions/check_ip.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# LinuxGSM check_ip.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Automatically identifies the server interface IP. +# If multiple interfaces are detected the user will need to manually set using ip="0.0.0.0". + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +info_config.sh +info_parms.sh + +if [ ! -f "/bin/ip" ]; then + ipcommand="/sbin/ip" +else + ipcommand="ip" +fi +getip=$(${ipcommand} -o -4 addr | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -v 127.0.0) +getipwc=$(${ipcommand} -o -4 addr | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -vc 127.0.0) + +# Check if server has multiple IP addresses + +# If the IP variable has been set by user. +if [ -n "${ip}" ]&&[ "${ip}" != "0.0.0.0" ]; then + queryips=( "${ip}" ) + webadminip=( "${ip}" ) + telnetip=( "${ip}" ) +# If game config does have an IP set. +elif [ -n "${configip}" ]&&[ "${configip}" != "0.0.0.0" ];then + queryips=( "${configip}" ) + ip="${configip}" + webadminip=( "${configip}" ) + telnetip=( "${configip}" ) +# If there is only 1 server IP address. +# Some IP details can automaticly use the one IP +elif [ "${getipwc}" == "1" ]; then + queryips=( $(echo "${getip}") ) + ip="0.0.0.0" + webadminip=( "${getip}" ) + telnetip=( "${getip}" ) +# If no ip is set by the user and server has more than one IP. +else + queryips=( $(echo "${getip}") ) + ip="0.0.0.0" + webadminip=( "${ip}" ) + telnetip=( "${ip}" ) +fi diff --git a/lgsm/functions/check_last_update.sh b/lgsm/functions/check_last_update.sh new file mode 100755 index 000000000..07e9d3883 --- /dev/null +++ b/lgsm/functions/check_last_update.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# LinuxGSM check_last_update.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks lock file to see when last update happened. +# Will reboot server if instance not rebooted since update. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ -f "${lockdir}/${selfname}-laststart.lock" ]; then + laststart=$(cat "${lockdir}/${selfname}-laststart.lock") +fi +if [ -f "${lockdir}/lastupdate.lock" ]; then + lastupdate=$(cat "${lockdir}/lastupdate.lock") +fi + +check_status.sh +if [ -f "${lockdir}/lastupdate.lock" ]&&[ "${status}" != "0" ]; then + if [ ! -f "${lockdir}/${selfname}-laststart.lock" ]||[ "${laststart}" -lt "${lastupdate}" ]; then + fn_print_info "${selfname} has not been restarted since last update" + fn_script_log_info "${selfname} has not been restarted since last update" + command_restart.sh + fn_firstcommand_reset + fi +fi diff --git a/lgsm/functions/check_logs.sh b/lgsm/functions/check_logs.sh new file mode 100755 index 000000000..b8dad203c --- /dev/null +++ b/lgsm/functions/check_logs.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# LinuxGSM check_logs.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if log files exist. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_check_logs(){ + fn_print_dots "Checking for log files" + fn_print_info_nl "Checking for log files: Creating log files" + checklogs=1 + install_logs.sh +} + +# Create directories for the script and console logs. +if [ ! -d "${lgsmlogdir}" ]||[ ! -d "${consolelogdir}" ]; then + fn_check_logs +fi + +# Create gamelogdir. +# If variable exists gamelogdir exists and log/server does not. +if [ "${gamelogdir}" ]&&[ -d "${gamelogdir}" ]&&[ ! -d "${logdir}/server" ]; then + fn_check_logs +fi diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh new file mode 100755 index 000000000..d4421dba1 --- /dev/null +++ b/lgsm/functions/check_permissions.sh @@ -0,0 +1,235 @@ +#!/bin/bash +# LinuxGSM check_permissions.sh +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks ownership & permissions of scripts, files and directories. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_check_ownership(){ + if [ -f "${rootdir}/${selfname}" ]; then + if [ "$(find "${rootdir}/${selfname}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then + selfownissue=1 + fi + fi + if [ -d "${functionsdir}" ]; then + if [ "$(find "${functionsdir}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then + funcownissue=1 + fi + fi + if [ -d "${serverfiles}" ]; then + if [ "$(find "${serverfiles}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then + filesownissue=1 + fi + fi + if [ "${selfownissue}" == "1" ]||[ "${funcownissue}" == "1" ]||[ "${filesownissue}" == "1" ]; then + fn_print_fail_nl "Ownership issues found" + fn_script_log_fatal "Ownership issues found" + fn_print_information_nl "The current user ($(whoami)) does not have ownership of the following files:" + fn_script_log_info "The current user ($(whoami)) does not have ownership of the following files:" + { + echo -e "User\tGroup\tFile\n" + if [ "${selfownissue}" == "1" ]; then + find "${rootdir}/${selfname}" -not -user "$(whoami)" -printf "%u\t\t%g\t%p\n" + fi + if [ "${funcownissue}" == "1" ]; then + find "${functionsdir}" -not -user "$(whoami)" -printf "%u\t\t%g\t%p\n" + fi + if [ "${filesownissue}" == "1" ]; then + find "${serverfiles}" -not -user "$(whoami)" -printf "%u\t\t%g\t%p\n" + fi + + } | column -s $'\t' -t | tee -a "${lgsmlog}" + echo -e "" + fn_print_information_nl "please see https://docs.linuxgsm.com/support/faq#fail-starting-game-server-permission-issues-found" + fn_script_log "For more information, please see https://docs.linuxgsm.com/support/faq#fail-starting-game-server-permission-issues-found" + if [ "${monitorflag}" == 1 ]; then + alert="permissions" + alert.sh + fi + core_exit.sh + fi +} + +fn_check_permissions(){ + if [ -d "${functionsdir}" ]; then + if [ "$(find "${functionsdir}" -type f -not -executable | wc -l)" -ne "0" ]; then + fn_print_fail_nl "Permissions issues found" + fn_script_log_fatal "Permissions issues found" + fn_print_information_nl "The following files are not executable:" + fn_script_log_info "The following files are not executable:" + { + echo -e "File\n" + find "${functionsdir}" -type f -not -executable -printf "%p\n" + } | column -s $'\t' -t | tee -a "${lgsmlog}" + if [ "${monitorflag}" == 1 ]; then + alert="permissions" + alert.sh + fi + core_exit.sh + fi + fi + + # Check rootdir permissions. + if [ "${rootdir}" ]; then + # Get permission numbers on directory under the form 775. + rootdirperm=$(stat -c %a "${rootdir}") + # Grab the first and second digit for user and group permission. + userrootdirperm="${rootdirperm:0:1}" + grouprootdirperm="${rootdirperm:1:1}" + if [ "${userrootdirperm}" != "7" ]&&[ "${grouprootdirperm}" != "7" ]; then + fn_print_fail_nl "Permissions issues found" + fn_script_log_fatal "Permissions issues found" + fn_print_information_nl "The following directory does not have the correct permissions:" + fn_script_log_info "The following directory does not have the correct permissions:" + fn_script_log_info "${rootdir}" + ls -l "${rootdir}" + if [ "${monitorflag}" == 1 ]; then + alert="permissions" + alert.sh + fi + core_exit.sh + fi + fi + # Check if executable is executable and attempt to fix it. + # First get executable name. + execname=$(basename "${executable}") + if [ -f "${executabledir}/${execname}" ]; then + # Get permission numbers on file under the form 775. + execperm=$(stat -c %a "${executabledir}/${execname}") + # Grab the first and second digit for user and group permission. + userexecperm="${execperm:0:1}" + groupexecperm="${execperm:1:1}" + # Check for invalid user permission. + if [ "${userexecperm}" == "0" ]||[ "${userexecperm}" == "2" ]||[ "${userexecperm}" == "4" ]||[ "${userexecperm}" == "6" ]; then + # If user permission is invalid, then check for invalid group permissions. + if [ "${groupexecperm}" == "0" ]||[ "${groupexecperm}" == "2" ]||[ "${groupexecperm}" == "4" ]||[ "${groupexecperm}" == "6" ]; then + # If permission issues are found. + fn_print_warn_nl "Permissions issue found" + fn_script_log_warn "Permissions issue found" + fn_print_information_nl "The following file is not executable:" + ls -l "${executabledir}/${execname}" + fn_script_log_info "The following file is not executable:" + fn_script_log_info "${executabledir}/${execname}" + fn_print_information_nl "Applying chmod u+x,g+x ${executabledir}/${execname}" + fn_script_log_info "Applying chmod u+x,g+x ${execperm}" + # Make the executable executable. + chmod u+x,g+x "${executabledir}/${execname}" + # Second check to see if it's been successfully applied. + # Get permission numbers on file under the form 775. + execperm=$(stat -c %a "${executabledir}/${execname}") + # Grab the first and second digit for user and group permission. + userexecperm="${execperm:0:1}" + groupexecperm="${execperm:1:1}" + if [ "${userexecperm}" == "0" ]||[ "${userexecperm}" == "2" ]||[ "${userexecperm}" == "4" ]||[ "${userexecperm}" == "6" ]; then + if [ "${groupexecperm}" == "0" ]||[ "${groupexecperm}" == "2" ]||[ "${groupexecperm}" == "4" ]||[ "${groupexecperm}" == "6" ]; then + # If errors are still found. + fn_print_fail_nl "The following file could not be set executable:" + ls -l "${executabledir}/${execname}" + fn_script_log_warn "The following file could not be set executable:" + fn_script_log_info "${executabledir}/${execname}" + if [ "${monitorflag}" == "1" ]; then + alert="permissions" + alert.sh + fi + core_exit.sh + fi + fi + fi + fi + fi +} + +## The following fn_sys_perm_* functions checks for permission errors in /sys directory. + +# Checks for permission errors in /sys directory. +fn_sys_perm_errors_detect(){ + # Reset test variables. + sysdirpermerror="0" + classdirpermerror="0" + netdirpermerror="0" + # Check permissions. + # /sys, /sys/class and /sys/class/net should be readable & executable. + if [ ! -r "/sys" ]||[ ! -x "/sys" ]; then + sysdirpermerror="1" + fi + if [ ! -r "/sys/class" ]||[ ! -x "/sys/class" ]; then + classdirpermerror="1" + fi + if [ ! -r "/sys/class/net" ]||[ ! -x "/sys/class/net" ]; then + netdirpermerror="1" + fi +} + +# Display a message on how to fix the issue manually. +fn_sys_perm_fix_manually_msg(){ + echo -e "" + fn_print_information_nl "This error causes servers to fail starting properly" + fn_script_log_info "This error causes servers to fail starting properly." + echo -e " * To fix this issue, run the following command as root:" + fn_script_log_info "To fix this issue, run the following command as root:" + echo -e " chmod a+rx /sys /sys/class /sys/class/net" + fn_script_log "chmod a+rx /sys /sys/class /sys/class/net" + fn_sleep_time + if [ "${monitorflag}" == 1 ]; then + alert="permissions" + alert.sh + fi + core_exit.sh +} + +# Attempt to fix /sys related permission errors if sudo is available, exits otherwise. +fn_sys_perm_errors_fix(){ + if sudo -n true > /dev/null 2>&1; then + fn_print_dots "Automatically fixing /sys permissions" + fn_script_log_info "Automatically fixing /sys permissions." + if [ "${sysdirpermerror}" == "1" ]; then + sudo chmod a+rx "/sys" + fi + if [ "${classdirpermerror}" == "1" ]; then + sudo chmod a+rx "/sys/class" + fi + if [ "${netdirpermerror}" == "1" ]; then + sudo chmod a+rx "/sys/class/net" + fi + # Run check again to see if it's fixed. + fn_sys_perm_errors_detect + if [ "${sysdirpermerror}" == "1" ]||[ "${classdirpermerror}" == "1" ]||[ "${netdirpermerror}" == "1" ]; then + fn_print_error "Could not fix /sys permissions" + fn_script_log_error "Could not fix /sys permissions." + fn_sleep_time + # Show the user how to fix. + fn_sys_perm_fix_manually_msg + else + fn_print_ok_nl "Automatically fixing /sys permissions" + fn_script_log_pass "Permissions in /sys fixed" + fi + else + # Show the user how to fix. + fn_sys_perm_fix_manually_msg + fi +} + +# Processes to the /sys related permission errors check & fix/info. +fn_sys_perm_error_process(){ + fn_sys_perm_errors_detect + # If any error was found. + if [ "${sysdirpermerror}" == "1" ]||[ "${classdirpermerror}" == "1" ]||[ "${netdirpermerror}" == "1" ]; then + fn_print_error_nl "Permission error(s) found in /sys" + fn_script_log_error "Permission error(s) found in /sys" + # Run the fix + fn_sys_perm_errors_fix + fi +} + +# Run perm error detect & fix/alert functions on /sys directories. + +## Run checks. +if [ "$(whoami)" != "root" ]; then + fn_check_ownership + fn_check_permissions + if [ "${commandname}" == "START" ]; then + fn_sys_perm_error_process + fi +fi diff --git a/lgsm/functions/check_root.sh b/lgsm/functions/check_root.sh new file mode 100755 index 000000000..1eb6309cb --- /dev/null +++ b/lgsm/functions/check_root.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# LinuxGSM check_root.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if the user tried to run the script as root. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ "$(whoami)" = "root" ]; then + if [ "${commandname}" != "INSTALL" ]; then + fn_print_fail_nl "Do NOT run this script as root!" + if [ -d "${lgsmlogdir}" ]; then + fn_script_log_fatal "${selfname} attempted to run as root." + fi + core_exit.sh + fi +fi diff --git a/lgsm/functions/check_status.sh b/lgsm/functions/check_status.sh new file mode 100755 index 000000000..670669e50 --- /dev/null +++ b/lgsm/functions/check_status.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM check_status.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks the process status of the server. Either online or offline. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +status=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | grep -Ecx "^${sessionname}") diff --git a/lgsm/functions/check_steamcmd.sh b/lgsm/functions/check_steamcmd.sh new file mode 100755 index 000000000..9b84686dc --- /dev/null +++ b/lgsm/functions/check_steamcmd.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# LinuxGSM check_steamcmd.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if SteamCMD is installed correctly. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# init steamcmd functions +core_steamcmd.sh + +fn_check_steamcmd_clear +fn_check_steamcmd +if [ ${shortname} == "ark" ]; then + fn_check_steamcmd_ark +fi +fn_check_steamcmd_dir +fn_check_steamcmd_dir_legacy +fn_check_steamcmd_user +fn_check_steamcmd_exec diff --git a/lgsm/functions/check_system_dir.sh b/lgsm/functions/check_system_dir.sh new file mode 100755 index 000000000..0a732d6d1 --- /dev/null +++ b/lgsm/functions/check_system_dir.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# LinuxGSM check_system_dir.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if systemdir/serverfiles is accessible. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ "${commandname}" != "VALIDATE" ]; then + checkdir="${serverfiles}" +else + checkdir="${systemdir}" +fi + +if [ ! -d "${checkdir}" ]; then + fn_print_fail_nl "Cannot access ${checkdir}: No such directory" + if [ -d "${lgsmlogdir}" ]; then + fn_script_log_fatal "Cannot access ${checkdir}: No such directory." + fi + core_exit.sh +fi diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/functions/check_system_requirements.sh new file mode 100755 index 000000000..758d558a6 --- /dev/null +++ b/lgsm/functions/check_system_requirements.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# LinuxGSM check_system_requirements.sh +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks RAM requirements. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +info_distro.sh + +# RAM requirements in megabytes for each game or engine. + +if [ "${shortname}" == "ark" ]; then + ramrequirementmb="4000" + ramrequirementgb="4" +elif [ "${shortname}" == "bt" ]; then + ramrequirementmb="1000" + ramrequirementgb="1" +elif [ "${shortname}" == "mh" ]; then + ramrequirementmb="4000" + ramrequirementgb="4" +elif [ "${shortname}" == "arma3" ]; then + ramrequirementmb="1000" + ramrequirementgb="1" +elif [ "${shortname}" == "rust" ]; then + ramrequirementmb="4000" + ramrequirementgb="4" +elif [ "${shortname}" == "mc" ]; then + ramrequirementmb="1000" + ramrequirementgb="1" +elif [ "${shortname}" == "pstbs" ]; then + ramrequirementmb="2000" + ramrequirementgb="2" +elif [ "${shortname}" == "ns2" ]||[ "${shortname}" == "ns2c" ]; then + ramrequirementmb="1000" + ramrequirementgb="1" +elif [ "${shortname}" == "st" ]; then + ramrequirementmb="1000" + ramrequirementgb="1" +elif [ "${shortname}" == "pvr" ];then + ramrequirementmb="2000" + ramrequirementgb="2" +fi + +# If the game or engine has a minimum RAM Requirement, compare it to system's available RAM. +if [ "${ramrequirementmb}" ]; then + if [ "${physmemtotalmb}" -lt "${ramrequirementmb}" ]; then + fn_print_dots "Check RAM" + # Warn the user. + fn_print_warn_nl "Check RAM: ${ramrequirementgb}G required, ${physmemtotal} available" + echo " * ${gamename} server may fail to run or experience poor performance." + fn_sleep_time + fi +fi diff --git a/lgsm/functions/check_tmuxception.sh b/lgsm/functions/check_tmuxception.sh new file mode 100755 index 000000000..e11b55861 --- /dev/null +++ b/lgsm/functions/check_tmuxception.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# LinuxGSM check_config.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if run from tmux or screen. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_check_is_in_tmux(){ + if [ "${TMUX}" ]; then + fn_print_fail_nl "tmuxception error: Sorry Cobb you cannot start a tmux session inside of a tmux session." + fn_script_log_fatal "Tmuxception error: Attempted to start a tmux session inside of a tmux session." + fn_print_information_nl "LinuxGSM creates a tmux session when starting the server." + echo -e "It is not possible to run a tmux session inside another tmux session" + echo -e "https://docs.linuxgsm.com/requirements/tmux#tmuxception" + core_exit.sh + fi +} + +fn_check_is_in_screen(){ + if [ "${STY}" ]; then + fn_print_fail_nl "tmuxception error: Sorry Cobb you cannot start a tmux session inside of a screen session." + fn_script_log_fatal "Tmuxception error: Attempted to start a tmux session inside of a screen session." + fn_print_information_nl "LinuxGSM creates a tmux session when starting the server." + echo -e "It is not possible to run a tmux session inside screen session" + echo -e "https://docs.linuxgsm.com/requirements/tmux#tmuxception" + core_exit.sh + fi +} + +fn_check_is_in_tmux +fn_check_is_in_screen diff --git a/lgsm/functions/check_version.sh b/lgsm/functions/check_version.sh new file mode 100755 index 000000000..a0f3d4435 --- /dev/null +++ b/lgsm/functions/check_version.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LinuxGSM command_version.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Will run update-lgsm if gameserver.sh and modules version does not match +# this will allow gameserver.sh to update - useful for multi instance servers. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ -n "${modulesversion}" ]&&[ -n "${version}" ]&&[ "${version}" != "${modulesversion}" ]; then + exitbypass=1 + echo -e "" + fn_print_error_nl "LinuxGSM version mismatch" + echo -e "" + echo -e "* ${selfname}: ${version}" + echo -e "* modules: ${modulesversion}" + echo -e "" + fn_sleep_time + fn_script_log_error "LinuxGSM Version mismatch: ${selfname}: ${version}: modules: ${modulesversion}" + command_update_linuxgsm.sh + fn_firstcommand_reset +fi diff --git a/lgsm/functions/command_backup.sh b/lgsm/functions/command_backup.sh new file mode 100644 index 000000000..e04318c85 --- /dev/null +++ b/lgsm/functions/command_backup.sh @@ -0,0 +1,267 @@ +#!/bin/bash +# LinuxGSM command_backup.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Creates a .tar.gz file in the backup directory. + +commandname="BACKUP" +commandaction="Backing up" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh + +# Trap to remove lockfile on quit. +fn_backup_trap(){ + echo -e "" + echo -en "backup ${backupname}.tar.gz..." + fn_print_canceled_eol_nl + fn_script_log_info "Backup ${backupname}.tar.gz: CANCELED" + rm -f "${backupdir:?}/${backupname}.tar.gz" | tee -a "${lgsmlog}" + echo -en "backup ${backupname}.tar.gz..." + fn_print_removed_eol_nl + fn_script_log_info "Backup ${backupname}.tar.gz: REMOVED" + # Remove lock file. + rm -f "${lockdir:?}/backup.lock" + fn_backup_start_server + unset exitbypass + core_exit.sh +} + +# Check if a backup is pending or has been aborted using backup.lock. +fn_backup_check_lockfile(){ + if [ -f "${lockdir}/backup.lock" ]; then + fn_print_info_nl "Lock file found: Backup is currently running" + fn_script_log_error "Lock file found: Backup is currently running: ${lockdir}/backup.lock" + core_exit.sh + fi +} + +# Initialisation. +fn_backup_init(){ + # Backup file name with selfname and current date. + backupname="${selfname}-$(date '+%Y-%m-%d-%H%M%S')" + + info_distro.sh + fn_print_dots "Backup starting" + fn_script_log_info "Backup starting" + fn_print_ok_nl "Backup starting" + if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then + fn_print_info_nl "There are no previous backups" + else + if [ "${lastbackupdaysago}" == "0" ]; then + daysago="less than 1 day ago" + elif [ "${lastbackupdaysago}" == "1" ]; then + daysago="1 day ago" + else + daysago="${lastbackupdaysago} days ago" + fi + echo -e "* Previous backup was created ${daysago}, total size ${lastbackupsize}" + fi +} + +# Check if server is started and whether to stop it. +fn_backup_stop_server(){ + check_status.sh + # Server is running but will not be stopped. + if [ "${stoponbackup}" == "off" ]; then + fn_print_warn_nl "${selfname} is currently running" + echo -e "* Although unlikely; creating a backup while ${selfname} is running might corrupt the backup." + fn_script_log_warn "${selfname} is currently running" + fn_script_log_warn "Although unlikely; creating a backup while ${selfname} is running might corrupt the backup" + # Server is running and will be stopped if stoponbackup=on or unset. + # If server is started + elif [ "${status}" != "0" ]; then + fn_print_restart_warning + startserver="1" + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fi +} + +# Create required folders. +fn_backup_dir(){ + # Create backupdir if it doesn't exist. + if [ ! -d "${backupdir}" ]; then + mkdir -p "${backupdir}" + fi +} + +# Migrate Backups from old dir before refactor +fn_backup_migrate_olddir(){ + # Check if old backup dir is there before the refactor and move the backups + if [ -d "${rootdir}/backups" ]; then + if [ "${rootdir}/backups" != "${backupdir}" ]; then + fn_print_dots "Backup directory is being migrated" + fn_script_log_info "Backup directory is being migrated" + fn_script_log_info "${rootdir}/backups > ${backupdir}" + mv "${rootdir}/backups/"* "${backupdir}" 2>/dev/null + exitcode=$? + if [ "${exitcode}" -eq 0 ]; then + rmdir "${rootdir}/backups" 2>/dev/null + exitcode=$? + fi + if [ "${exitcode}" -eq 0 ]; then + fn_print_ok_nl "Backup directory is being migrated" + fn_script_log_pass "Backup directory is being migrated" + else + fn_print_error_nl "Backup directory is being migrated" + fn_script_log_error "Backup directory is being migrated" + fi + fi + fi +} + +fn_backup_create_lockfile(){ + # Create lockfile. + date '+%s' > "${lockdir}/backup.lock" + fn_script_log_info "Lockfile generated" + fn_script_log_info "${lockdir}/backup.lock" + # trap to remove lockfile on quit. + trap fn_backup_trap INT +} + +# Compressing files. +fn_backup_compression(){ + # Tells how much will be compressed using rootdirduexbackup value from info_distro and prompt for continue. + fn_print_info "A total of ${rootdirduexbackup} will be compressed." + fn_script_log_info "A total of ${rootdirduexbackup} will be compressed: ${backupdir}/${backupname}.tar.gz" + fn_print_dots "Backup (${rootdirduexbackup}) ${backupname}.tar.gz, in progress..." + fn_script_log_info "backup ${rootdirduexbackup} ${backupname}.tar.gz, in progress" + excludedir=$(fn_backup_relpath) + + # Check that excludedir is a valid path. + if [ ! -d "${excludedir}" ] ; then + fn_print_fail_nl "Problem identifying the previous backup directory for exclusion." + fn_script_log_fatal "Problem identifying the previous backup directory for exclusion" + core_exit.sh + fi + + tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}/backup.lock" ./. + local exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol + fn_script_log_fatal "Backup in progress: FAIL" + echo -e "${extractcmd}" | tee -a "${lgsmlog}" + fn_print_fail_nl "Starting backup" + fn_script_log_fatal "Starting backup" + else + fn_print_ok_eol + fn_print_ok_nl "Completed: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" + fn_script_log_pass "Backup created: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" + fi + # Remove lock file + rm -f "${lockdir:?}/backup.lock" +} + +# Clear old backups according to maxbackups and maxbackupdays variables. +fn_backup_prune(){ + # Clear if backup variables are set. + if [ "${maxbackups}" ]&&[ -n "${maxbackupdays}" ]; then + # How many backups there are. + info_distro.sh + # How many backups exceed maxbackups. + backupquotadiff=$((backupcount-maxbackups)) + # How many backups exceed maxbackupdays. + backupsoudatedcount=$(find "${backupdir}"/ -type f -name "*.tar.gz" -mtime +"${maxbackupdays}"|wc -l) + # If anything can be cleared. + if [ "${backupquotadiff}" -gt "0" ]||[ "${backupsoudatedcount}" -gt "0" ]; then + fn_print_dots "Pruning" + fn_script_log_info "Backup pruning activated" + fn_print_ok_nl "Pruning" + # If maxbackups greater or equal to backupsoutdatedcount, then it is over maxbackupdays. + if [ "${backupquotadiff}" -ge "${backupsoudatedcount}" ]; then + # Display how many backups will be cleared. + echo -e "* Pruning: ${backupquotadiff} backup(s) has exceeded the ${maxbackups} backups limit" + fn_script_log_info "Pruning: ${backupquotadiff} backup(s) has exceeded the ${maxbackups} backups limit" + fn_sleep_time + fn_print_dots "Pruning: Clearing ${backupquotadiff} backup(s)" + fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)" + # Clear backups over quota. + find "${backupdir}"/ -type f -name "*.tar.gz" -printf '%T@ %p\n' | sort -rn | tail -${backupquotadiff} | cut -f2- -d" " | xargs rm + fn_print_ok_nl "Pruning: Clearing ${backupquotadiff} backup(s)" + fn_script_log_pass "Pruning: Cleared ${backupquotadiff} backup(s)" + # If maxbackupdays is used over maxbackups. + elif [ "${backupquotadiff}" -lt "${backupsoudatedcount}" ]; then + # Display how many backups will be cleared. + echo -e "* Pruning: ${backupsoudatedcount} backup(s) are older than ${maxbackupdays} days." + fn_script_log_info "Pruning: ${backupsoudatedcount} backup(s) older than ${maxbackupdays} days." + fn_sleep_time + fn_print_dots "Pruning: Clearing ${backupquotadiff} backup(s)." + fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)" + # Clear backups over quota + find "${backupdir}"/ -type f -mtime +"${maxbackupdays}" -exec rm -f {} \; + fn_print_ok_nl "Pruning: Clearing ${backupquotadiff} backup(s)" + fn_script_log_pass "Pruning: Cleared ${backupquotadiff} backup(s)" + fi + fi + fi +} + +fn_backup_relpath() { + # Written by CedarLUG as a "realpath --relative-to" alternative in bash. + # Populate an array of tokens initialized from the rootdir components. + declare -a rdirtoks=($(readlink -f "${rootdir}" | sed "s/\// /g")) + if [ ${#rdirtoks[@]} -eq 0 ]; then + fn_print_fail_nl "Problem assessing rootdir during relative path assessment" + fn_script_log_fatal "Problem assessing rootdir during relative path assessment: ${rootdir}" + core_exit.sh + fi + + # Populate an array of tokens initialized from the backupdir components. + declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g")) + if [ ${#bdirtoks[@]} -eq 0 ]; then + fn_print_fail_nl "Problem assessing backupdir during relative path assessment" + fn_script_log_fatal "Problem assessing backupdir during relative path assessment: ${rootdir}" + core_exit.sh + fi + + # Compare the leading entries of each array. These common elements will be clipped off. + # for the relative path output. + for ((base=0; base<${#rdirtoks[@]}; base++)); do + [[ "${rdirtoks[$base]}" != "${bdirtoks[$base]}" ]] && break + done + + # Next, climb out of the remaining rootdir location with updir references. + for ((x=base;x<${#rdirtoks[@]};x++)); do + echo -n "../" + done + + # Climb down the remaining components of the backupdir location. + for ((x=base;x<$(( ${#bdirtoks[@]} - 1 ));x++)); do + echo -n "${bdirtoks[$x]}/" + done + + # In the event there were no directories left in the backupdir above to + # traverse down, just add a newline. Otherwise at this point, there is + # one remaining directory component in the backupdir to navigate. + if (( "$base" < "${#bdirtoks[@]}" )) ; then + echo -e "${bdirtoks[ $(( ${#bdirtoks[@]} - 1)) ]}" + else + echo + fi +} + +# Start the server if it was stopped for the backup. +fn_backup_start_server(){ + if [ -n "${startserver}" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi +} + +# Run functions. +fn_backup_create_lockfile +fn_backup_init +fn_backup_stop_server +fn_backup_dir +fn_backup_migrate_olddir +fn_backup_check_lockfile +fn_backup_compression +fn_backup_prune +fn_backup_start_server + +core_exit.sh diff --git a/lgsm/functions/command_check_update.sh b/lgsm/functions/command_check_update.sh new file mode 100755 index 000000000..9648dd49e --- /dev/null +++ b/lgsm/functions/command_check_update.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# LinuxGSM command_check_update.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of servers. + +commandname="CHECK-UPDATE" +commandaction="check for Update" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_dots "" +check.sh +core_logs.sh + +core_steamcmd.sh + +check_steamcmd.sh + +fn_update_steamcmd_localbuild +fn_update_steamcmd_remotebuild +fn_update_steamcmd_compare + +core_exit.sh diff --git a/lgsm/functions/command_console.sh b/lgsm/functions/command_console.sh new file mode 100755 index 000000000..5b84789e6 --- /dev/null +++ b/lgsm/functions/command_console.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# LinuxGSM command_console.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Gives access to the server tmux console. + +commandname="CONSOLE" +commandaction="Access console" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +fn_print_header + +if [ "${consoleverbose}" == "yes" ]; then + echo -e "* Verbose output: ${lightgreen}yes${default}" +elif [ "${consoleverbose}" == "no" ]; then + echo -e "* Verbose output: ${red}no${default}" +else + echo -e "* Verbose output: ${red}unknown${default}" +fi + +if [ "${consoleinteract}" == "yes" ]; then + echo -e "* Interactive output: ${lightgreen}yes${default}" +elif [ "${consoleinteract}" == "no" ]; then + echo -e "* Interactive output: ${red}no${default}" +else + echo -e "* Interactive output: ${red}unknown${default}" +fi +echo "" +fn_print_information_nl "Press \"CTRL+b\" then \"d\" to exit console." +fn_print_warning_nl "Do NOT press CTRL+c to exit." +echo -e "* https://docs.linuxgsm.com/commands/console" +echo -e "" +if ! fn_prompt_yn "Continue?" Y; then + exitcode=0 + core_exit.sh +fi +fn_print_dots "Accessing console" +check_status.sh +if [ "${status}" != "0" ]; then + fn_print_ok_nl "Accessing console" + fn_script_log_pass "Console accessed" + tmux attach-session -t "${sessionname}" + fn_print_ok_nl "Closing console" + fn_script_log_pass "Console closed" +else + fn_print_error_nl "Server not running" + fn_script_log_error "Failed to access: Server not running" + if fn_prompt_yn "Do you want to start the server?" Y; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi +fi + +core_exit.sh diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh new file mode 100755 index 000000000..07871ce00 --- /dev/null +++ b/lgsm/functions/command_debug.sh @@ -0,0 +1,128 @@ +#!/bin/bash +# LinuxGSM command_debug.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Runs the server without tmux and directly from the terminal. + +commandname="DEBUG" +commandaction="Debuging" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +# Trap to remove lockfile on quit. +fn_lockfile_trap(){ + # Remove lockfile. + rm -f "${lockdir:?}/${selfname}.lock" + # resets terminal. Servers can sometimes mess up the terminal on exit. + reset + fn_print_dots "Stopping debug" + fn_print_ok_nl "Stopping debug" + fn_script_log_pass "Stopping debug" + # remove trap. + trap - INT + core_exit.sh +} + +check.sh +fix.sh +info_distro.sh +info_config.sh +# NOTE: Check if works with server without parms. Could be intergrated in to info_parms.sh. +fn_parms +fn_print_header +{ + echo -e "${lightblue}Distro:\t\t${default}${distroname}" + echo -e "${lightblue}Arch:\t\t${default}${arch}" + echo -e "${lightblue}Kernel:\t\t${default}${kernel}" + echo -e "${lightblue}Hostname:\t\t${default}${HOSTNAME}" + echo -e "${lightblue}tmux:\t\t${default}${tmuxv}" + echo -e "${lightblue}Avg Load:\t\t${default}${load}" + echo -e "${lightblue}Free Memory:\t\t${default}${physmemfree}" + echo -e "${lightblue}Free Disk:\t\t${default}${availspace}" +} | column -s $'\t' -t +# glibc required. +if [ "${glibc}" ]; then + if [ "${glibc}" == "null" ]; then + # Glibc is not required. + : + elif [ -z "${glibc}" ]; then + echo -e "${lightblue}glibc required:\t${red}UNKNOWN${default}" + elif [ "$(printf '%s\n'${glibc}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibc}" ]; then + echo -e "${lightblue}glibc required:\t${red}${glibc} ${default}(${red}distro glibc ${glibcversion} too old${default})" + else + echo -e "${lightblue}glibc required:\t${green}${glibc}${default}" + fi +fi + +# Server IP +echo -e "${lightblue}Game Server IP:\t${default}${ip}:${port}" + +# External server IP. +if [ "${extip}" ]; then + if [ "${ip}" != "${extip}" ]; then + echo -e "${lightblue}Internet IP:\t${default}${extip}:${port}" + fi +fi +# Server password. +if [ "${serverpassword}" ]; then + echo -e "${lightblue}Server password:\t${default}${serverpassword}" +fi +echo -e "${lightblue}Start parameters:${default}" +if [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then + echo -e "${executable} ${parms} -debug" +elif [ "${engine}" == "quake" ]; then + echo -e "${executable} ${parms} -condebug" +else + echo -e "${preexecutable} ${executable} ${parms}" +fi +echo -e "" +echo -e "Use for identifying server issues only!" +echo -e "Press CTRL+c to drop out of debug mode." +fn_print_warning_nl "If ${selfname} is already running it will be stopped." +echo -e "" +if ! fn_prompt_yn "Continue?" Y; then + exitcode=0 + core_exit.sh +fi + +fn_print_info_nl "Stopping any running servers" +fn_script_log_info "Stopping any running servers" +exitbypass=1 +command_stop.sh +fn_firstcommand_reset +unset exitbypass +fn_print_dots "Starting debug" +fn_script_log_info "Starting debug" +fn_print_ok_nl "Starting debug" + +# Create lockfile. +date '+%s' > "${lockdir}/${selfname}.lock" +echo "${version}" >> "${lockdir}/${selfname}.lock" +echo "${port}" >> "${lockdir}/${selfname}.lock" +fn_script_log_info "Lockfile generated" +fn_script_log_info "${lockdir}/${selfname}.lock" + +cd "${executabledir}" || exit +# Note: do not add double quotes to ${executable} ${parms}. +if [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then + ${executable} ${parms} -debug +elif [ "${shortname}" == "arma3" ]; then + # Arma3 requires semicolons in the module list, which need to + # be escaped for regular (tmux) loading, but need to be + # stripped when loading straight from the console. + ${executable} ${parms//\\;/;} +elif [ "${engine}" == "quake" ]; then + ${executable} ${parms} -condebug +else + # shellcheck disable=SC2086 + ${preexecutable} ${executable} ${parms} +fi + +fn_lockfile_trap + +fn_print_dots "Stopping debug" +fn_print_ok_nl "Stopping debug" +fn_script_log_info "Stopping debug" + +core_exit.sh diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh new file mode 100755 index 000000000..8f2a03a98 --- /dev/null +++ b/lgsm/functions/command_details.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# LinuxGSM command_details.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Displays server information. + +commandname="DETAILS" +commandaction="Viewing details" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +# Run checks and gathers details to display. +check.sh +info_config.sh +info_parms.sh +info_distro.sh +info_messages.sh +if [ "${querymode}" == "2" ]||[ "${querymode}" == "3" ]; then + for queryip in "${queryips[@]}"; do + query_gamedig.sh + if [ "${querystatus}" == "0" ]; then + break + fi + done +fi +fn_info_message_distro +fn_info_message_server_resource +fn_info_message_gameserver_resource +fn_info_message_gameserver +fn_info_message_script +fn_info_message_backup +# Some game servers do not have parms. +if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "jc2" ]&&[ "${shortname}" != "dst" ]&&[ "${shortname}" != "pz" ]&&[ "${engine}" != "renderware" ]; then + fn_parms + fn_info_message_commandlineparms +fi +fn_info_message_ports +fn_info_message_select_engine +fn_info_message_statusbottom + +core_exit.sh diff --git a/lgsm/functions/command_dev_clear_functions.sh b/lgsm/functions/command_dev_clear_functions.sh new file mode 100755 index 000000000..87c77515d --- /dev/null +++ b/lgsm/functions/command_dev_clear_functions.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# LinuxGSM command_dev_clear_functions.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Deletes the contents of the functions dir. + +commandname="DEV-CLEAR-MODULES" +commandaction="Clearing modules" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +echo -e "=================================" +echo -e "Clear Functions" +echo -e "=================================" +echo -e "" +if fn_prompt_yn "Do you want to delete all functions?" Y; then + rm -rfv "${functionsdir:?}/"* + rm -rfv "${configdirdefault:?}/"* + fn_script_log_info "Cleared modules directory" + fn_script_log_info "Cleared default config directory" +fi + +core_exit.sh diff --git a/lgsm/functions/command_dev_debug.sh b/lgsm/functions/command_dev_debug.sh new file mode 100755 index 000000000..957709898 --- /dev/null +++ b/lgsm/functions/command_dev_debug.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LinuxGSM command_dev_debug.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Dev only: Enables debugging log to be saved to dev-debug.log. + +commandname="DEV-DEBUG" +commandaction="Developer debug" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_reset + +if [ -f "${rootdir}/.dev-debug" ]; then + rm "${rootdir:?}/.dev-debug" + fn_print_ok_nl "Disabled dev-debug" + fn_script_log_info "Disabled dev-debug" +else + date '+%s' > "${rootdir}/.dev-debug" + fn_print_ok_nl "Enabled dev-debug" + fn_script_log_info "Enabled dev-debug" +fi + +core_exit.sh diff --git a/lgsm/functions/command_dev_detect_deps.sh b/lgsm/functions/command_dev_detect_deps.sh new file mode 100755 index 000000000..976bf94dc --- /dev/null +++ b/lgsm/functions/command_dev_detect_deps.sh @@ -0,0 +1,231 @@ +#!/bin/bash +# LinuxGSM command_dev_detect_deps.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Detects dependencies the server binary requires. + +commandname="DEV-DETECT-DEPS" +commandaction="Developer detect deps" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +echo -e "=================================" +echo -e "Dependencies Checker" +echo -e "=================================" +echo -e "Checking directory: " +echo -e "${serverfiles}" +if [ "$(command -v eu-readelf 2>/dev/null)" ]; then + readelf=eu-readelf +elif [ "$(command -v readelf 2>/dev/null)" ]; then + readelf=readelf +else + echo -e "readelf/eu-readelf not installed" +fi +files=$(find "${serverfiles}" | wc -l) +find "${serverfiles}" -type f -print0 | +while IFS= read -r -d $'\0' line; do + if [ "${readelf}" == "eu-readelf" ]; then + ${readelf} -d "${line}" 2>/dev/null | grep NEEDED| awk '{ print $4 }' | sed 's/\[//g;s/\]//g' >> "${tmpdir}/.depdetect_readelf" + else + ${readelf} -d "${line}" 2>/dev/null | grep NEEDED | awk '{ print $5 }' | sed 's/\[//g;s/\]//g' >> "${tmpdir}/.depdetect_readelf" + fi + echo -n "${i} / ${files}" $'\r' + ((i++)) +done + +sort "${tmpdir}/.depdetect_readelf" |uniq >"${tmpdir}/.depdetect_readelf_uniq" + +touch "${tmpdir}/.depdetect_centos_list" +touch "${tmpdir}/.depdetect_ubuntu_list" +touch "${tmpdir}/.depdetect_debian_list" + +while read -r lib; do + echo -e "${lib}" + libs_array=( libm.so.6 libc.so.6 libtcmalloc_minimal.so.4 libpthread.so.0 libdl.so.2 libnsl.so.1 libgcc_s.so.1 librt.so.1 ld-linux.so.2 libdbus-glib-1.so.2 libgio-2.0.so.0 libglib-2.0.so.0 libGL.so.1 libgobject-2.0.so.0 libnm-glib.so.4 libnm-util.so.2 ) + for lib_file in "${libs_array[@]}"; do + if [ "${lib}" == "${lib_file}" ]; then + echo -e "glibc.i686" >> "${tmpdir}/.depdetect_centos_list" + echo -e "lib32gcc1" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "lib32gcc1" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + fi + done + + libs_array=( libawt.so libjava.so libjli.so libjvm.so libnet.so libnio.so libverify.so ) + for lib_file in "${libs_array[@]}"; do + if [ "${lib}" == "${lib_file}" ]; then + echo -e "java-1.8.0-openjdk" >> "${tmpdir}/.depdetect_centos_list" + echo -e "default-jre" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "default-jre" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + fi + done + + libs_array=( libtier0.so libtier0_srv.so libvstdlib_srv.so Core.so libvstdlib.so libtier0_s.so Editor.so Engine.so liblua.so libsteam_api.so ld-linux-x86-64.so.2 libPhysX3_x86.so libPhysX3Common_x86.so libPhysX3Cooking_x86.so) + for lib_file in "${libs_array[@]}"; do + # Known shared libs what dont requires dependencies. + if [ "${lib}" == "${lib_file}" ]; then + libdetected=1 + fi + done + + if [ "${lib}" == "libstdc++.so.6" ]; then + echo -e "libstdc++.i686" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libstdc++6:i386" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libstdc++6:i386" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libstdc++.so.5" ]; then + echo -e "compat-libstdc++-33.i686" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libstdc++5:i386" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libstdc++5:i386" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libcurl-gnutls.so.4" ]; then + echo -e "libcurl.i686" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libcurl4-gnutls-dev:i386" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libcurl4-gnutls-dev:i386" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libspeex.so.1" ]||[ "${lib}" == "libspeexdsp.so.1" ]; then + echo -e "speex.i686" >> "${tmpdir}/.depdetect_centos_list" + echo -e "speex:i386" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "speex:i386" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "./libSDL-1.2.so.0" ]||[ "${lib}" == "libSDL-1.2.so.0" ]; then + echo -e "SDL.i686" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libsdl1.2debian" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libsdl1.2debian" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libtbb.so.2" ]; then + echo -e "tbb.i686" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libtbb2" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libtbb2" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + + elif [ "${lib}" == "libXrandr.so.2" ]; then + echo -e "libXrandr" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libxrandr2" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libxrandr2" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libXext.so.6" ]; then + echo -e "libXext" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libxext6" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libxext6" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libXtst.so.6" ]; then + echo -e "libXtst" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libxtst6" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libxtst6" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libpulse.so.0" ]; then + echo -e "pulseaudio-libs" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libpulse0" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libpulse0" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libopenal.so.1" ]; then + echo -e "" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libopenal1" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libopenal1" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libgconf-2.so.4" ]; then + echo -e "GConf2" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libgconf2-4" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libgconf2-4" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libz.so.1" ]; then + echo -e "zlib" >> "${tmpdir}/.depdetect_centos_list" + echo -e "zlib1g" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "zlib1g" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libatk-1.0.so.0" ]; then + echo -e "atk" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libatk1.0-0" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libatk1.0-0" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libcairo.so.2" ]; then + echo -e "cairo" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libcairo2" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libcairo2" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libfontconfig.so.1" ]; then + echo -e "fontconfig" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libfontconfig1" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libfontconfig1" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libfreetype.so.6" ]; then + echo -e "freetype" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libfreetype6" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libfreetype6" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libc++.so.1" ]; then + echo -e "libcxx" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libc++1" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libc++1" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + fi + + if [ "${libdetected}" != "1" ]; then + unknownlib=1 + echo -e "${lib}" >> "${tmpdir}/.depdetect_unknown" + fi + unset libdetected +done < "${tmpdir}/.depdetect_readelf_uniq" + +sort "${tmpdir}/.depdetect_centos_list" | uniq >> "${tmpdir}/.depdetect_centos_list_uniq" +sort "${tmpdir}/.depdetect_ubuntu_list" | uniq >> "${tmpdir}/.depdetect_ubuntu_list_uniq" +sort "${tmpdir}/.depdetect_debian_list" | uniq >> "${tmpdir}/.depdetect_debian_list_uniq" +if [ "${unknownlib}" == "1" ]; then + sort "${tmpdir}/.depdetect_unknown" | uniq >> "${tmpdir}/.depdetect_unknown_uniq" +fi + +awk -vORS='' '{ print $1,$2 }' "${tmpdir}/.depdetect_centos_list_uniq" > "${tmpdir}/.depdetect_centos_line" +awk -vORS='' '{ print $1,$2 }' "${tmpdir}/.depdetect_ubuntu_list_uniq" > "${tmpdir}/.depdetect_ubuntu_line" +awk -vORS='' '{ print $1,$2 }' "${tmpdir}/.depdetect_debian_list_uniq" > "${tmpdir}/.depdetect_debian_line" +echo -e "" +echo -e "" +echo -e "Required Dependencies" +echo -e "=================================" +echo -e "${executable}" +echo -e "" +echo -e "CentOS" +echo -e "=================================" +cat "${tmpdir}/.depdetect_centos_line" +echo -e "" +echo -e "" +echo -e "Ubuntu" +echo -e "=================================" +cat "${tmpdir}/.depdetect_ubuntu_line" +echo -e "" +echo -e "" +echo -e "Debian" +echo -e "=================================" +cat "${tmpdir}/.depdetect_debian_line" +echo -e "" +if [ "${unknownlib}" == "1" ]; then + echo -e "" + echo -e "Unknown shared Library" + echo -e "=================================" + cat "${tmpdir}/.depdetect_unknown" +fi +echo -e "" +echo -e "Required Librarys" +echo -e "=================================" +sort "${tmpdir}/.depdetect_readelf" | uniq +echo -en "\n" +rm -f "${tmpdir:?}/.depdetect_centos_line" +rm -f "${tmpdir:?}/.depdetect_centos_list" +rm -f "${tmpdir:?}/.depdetect_centos_list_uniq" + +rm -f "${tmpdir:?}/.depdetect_debian_line" +rm -f "${tmpdir:?}/.depdetect_debian_list" +rm -f "${tmpdir:?}/.depdetect_debian_list_uniq" + +rm -f "${tmpdir:?}/.depdetect_ubuntu_line" +rm -f "${tmpdir:?}/.depdetect_ubuntu_list" +rm -f "${tmpdir:?}/.depdetect_ubuntu_list_uniq" + +rm -f "${tmpdir:?}/.depdetect_readelf" +rm -f "${tmpdir:?}/.depdetect_readelf_uniq" +rm -f "${tmpdir:?}/.depdetect_unknown" +rm -f "${tmpdir:?}/.depdetect_unknown_uniq" + +core_exit.sh diff --git a/lgsm/functions/command_dev_detect_glibc.sh b/lgsm/functions/command_dev_detect_glibc.sh new file mode 100755 index 000000000..304d255fd --- /dev/null +++ b/lgsm/functions/command_dev_detect_glibc.sh @@ -0,0 +1,93 @@ +#!/bin/bash +# LinuxGSM command_dev_detect_glibc.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Automatically detects the version of GLIBC that is required. +# Can check a file or directory recursively. + +commandname="DEV-DETECT-GLIBC" +commandaction="Developer detect glibc" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +echo -e "=================================" +echo -e "glibc Requirements Checker" +echo -e "=================================" + +if [ ! "$(command -v objdump)" ]; then + fn_print_failure_nl "objdump is missing" + fn_script_log_fatal "objdump is missing" + core_exit.sh +fi + +if [ -z "${serverfiles}" ]; then + dir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") +fi + +if [ -d "${serverfiles}" ]; then + echo -e "Checking directory: " + echo -e "${serverfiles}" +elif [ -f "${serverfiles}" ]; then + echo -e "Checking file: " + echo -e "${serverfiles}" +fi +echo -e "" + + +glibc_check_dir_array=( steamcmddir serverfiles ) +for glibc_check_var in "${glibc_check_dir_array[@]}"; do + if [ "${glibc_check_var}" == "serverfiles" ]; then + glibc_check_dir="${serverfiles}" + glibc_check_name="${gamename}" + elif [ "${glibc_check_var}" == "steamcmddir" ]; then + glibc_check_dir="${steamcmddir}" + glibc_check_name="SteamCMD" + fi + + if [ -d "${glibc_check_dir}" ]; then + glibc_check_files=$(find "${glibc_check_dir}" | wc -l) + find "${glibc_check_dir}" -type f -print0 | + while IFS= read -r -d $'\0' line; do + glibcversion=$(objdump -T "${line}" 2>/dev/null | grep -oP "GLIBC[^ ]+" | grep -v GLIBCXX | sort | uniq | sort -r --version-sort | head -n 1) + if [ "${glibcversion}" ]; then + echo -e "${glibcversion}: ${line}" >>"${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" + fi + objdump -T "${line}" 2>/dev/null | grep -oP "GLIBC[^ ]+" >>"${tmpdir}/detect_glibc_${glibc_check_var}.tmp" + echo -n "${i} / ${glibc_check_files}" $'\r' + ((i++)) + done + echo -e "" + echo -e "" + echo -e "${glibc_check_name} glibc Requirements" + echo -e "=================================" + if [ -f "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" ]; then + echo -e "Required glibc" + cat "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" | sort | uniq | sort -r --version-sort | head -1 |tee -a "${tmpdir}/detect_glibc_highest.tmp" + echo -e "" + echo -e "Files requiring GLIBC" + echo -e "Highest verion required: filename" + cat "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" + echo -e "" + echo -e "All required GLIBC versions" + cat "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" | sort | uniq | sort -r --version-sort + rm -f "${tmpdir:?}/detect_glibc_${glibc_check_var}.tmp" + rm -f "${tmpdir:?}/detect_glibc_files_${glibc_check_var}.tmp" + else + fn_print_information_nl "glibc is not required" + fi + else + fn_print_information_nl "${glibc_check_name} is not installed" + fi +done +echo -e "" +echo -e "Final glibc Requirement" +echo -e "=================================" +if [ -f "${tmpdir}/detect_glibc_highest.tmp" ]; then + cat "${tmpdir}/detect_glibc_highest.tmp" | sort | uniq | sort -r --version-sort | head -1 + rm -f "${tmpdir:?}/detect_glibc_highest.tmp" +else + fn_print_information_nl "glibc is not required" +fi + +core_exit.sh diff --git a/lgsm/functions/command_dev_detect_ldd.sh b/lgsm/functions/command_dev_detect_ldd.sh new file mode 100755 index 000000000..7d6e942a1 --- /dev/null +++ b/lgsm/functions/command_dev_detect_ldd.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# LinuxGSM command_dev_detect_ldd.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Automatically detects required deps using ldd. +# Can check a file or directory recursively. + +commandname="DEV-DETECT-LDD" +commandaction="Developer detect ldd" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +echo -e "=================================" +echo -e "Shared Object dependencies Checker" +echo -e "=================================" + +if [ -z "${serverfiles}" ]; then + dir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") +fi + +if [ -d "${serverfiles}" ]; then + echo -e "Checking directory: " + echo -e "${serverfiles}" +elif [ -f "${serverfiles}" ]; then + echo -e "Checking file: " + echo -e "${serverfiles}" +fi +echo -e "" +touch "${tmpdir}/detect_ldd.tmp" +touch "${tmpdir}/detect_ldd_not_found.tmp" + +files=$(find "${serverfiles}" | wc -l) +find "${serverfiles}" -type f -print0 | +while IFS= read -r -d $'\0' line; do + if ldd "${line}" 2>/dev/null | grep -v "not a dynamic executable" + then + echo -e "${line}" >> "${tmpdir}/detect_ldd.tmp" + ldd "${line}" 2>/dev/null | grep -v "not a dynamic executable" >> "${tmpdir}/detect_ldd.tmp" + if ldd "${line}" 2>/dev/null | grep -v "not a dynamic executable" | grep "not found" + then + echo -e "${line}" >> "${tmpdir}/detect_ldd_not_found.tmp" + ldd "${line}" 2>/dev/null | grep -v "not a dynamic executable" | grep "not found" >> "${tmpdir}/detect_ldd_not_found.tmp" + fi + fi + echo -n "$i / $files" $'\r' + ((i++)) +done +echo -e "" +echo -e "" +echo -e "All" +echo -e "=================================" +cat "${tmpdir}/detect_ldd.tmp" + +echo -e "" +echo -e "Not Found" +echo -e "=================================" +cat "${tmpdir}/detect_ldd_not_found.tmp" + +rm -f "${tmpdir:?}/detect_ldd.tmp" +rm -f "${tmpdir:?}/detect_ldd_not_found.tmp" + +core_exit.sh diff --git a/lgsm/functions/command_dev_query_raw.sh b/lgsm/functions/command_dev_query_raw.sh new file mode 100755 index 000000000..306dc681d --- /dev/null +++ b/lgsm/functions/command_dev_query_raw.sh @@ -0,0 +1,95 @@ +#!/bin/bash +# LinuxGSM command_dev_query_raw.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Raw gamedig output of the server. + +commandname="DEV-QUERY-RAW" +commandaction="Developer query raw" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +info_config.sh +info_parms.sh + +echo -e "" +echo -e "Query Port - Raw Output" +echo -e "==================================================================" +echo -e "" +echo -e "QUERY IP" +for queryip in "${queryips[@]}"; do + echo -e "${queryip}" +done +echo -e "=================================" +echo -e "Ports" +echo -e "=================================" +echo -e "" +echo -e "PORT: ${port}" +echo -e "QUERY PORT: ${queryport}" +echo -e "" +echo -e "Gamedig Raw Output" +echo -e "=================================" +echo -e "" +if [ ! "$(command -v gamedig 2>/dev/null)" ]; then + fn_print_failure_nl "gamedig not installed" +fi +if [ ! "$(command -v jq 2>/dev/null)" ]; then + fn_print_failure_nl "jq not installed" +fi +for queryip in "${queryips[@]}"; do + query_gamedig.sh + echo -e "${gamedigcmd}" + echo"" + echo "${gamedigraw}" | jq +done +echo -e "" +echo -e "gsquery Raw Output" +echo -e "=================================" +echo -e "" +for queryip in "${queryips[@]}"; do + echo -e "./query_gsquery.py -a \"${queryip}\" -p \"${queryport}\" -e \"${querytype}\"" + echo -e "" + if [ ! -f "${functionsdir}/query_gsquery.py" ]; then + fn_fetch_file_github "lgsm/functions" "query_gsquery.py" "${functionsdir}" "chmodx" "norun" "noforce" "nomd5" + fi + "${functionsdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}" +done +echo -e "" +echo -e "TCP Raw Output" +echo -e "=================================" +echo -e "" +for queryip in "${queryips[@]}"; do + echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}''" + echo -e "" + timeout 3 bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}'' + querystatus="$?" + echo -e "" + if [ "${querystatus}" == "0" ]; then + echo -e "TCP query PASS" + else + echo -e "TCP query FAIL" + fi +done +echo -e "" +echo -e "Game Port - Raw Output" +echo -e "==================================================================" +echo -e "" +echo -e "TCP Raw Output" +echo -e "=================================" +echo -e "" +for queryip in "${queryips[@]}"; do + echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}''" + echo -e "" + timeout 3 bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}'' + querystatus="$?" + echo -e "" + if [ "${querystatus}" == "0" ]; then + echo -e "TCP query PASS" + else + echo -e "TCP query FAIL" + fi +done +exitcode=0 +core_exit.sh diff --git a/lgsm/functions/command_donate.sh b/lgsm/functions/command_donate.sh new file mode 100755 index 000000000..f00a4d702 --- /dev/null +++ b/lgsm/functions/command_donate.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# LinuxGSM command_donate.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Shows ways to donate. + +commandname="DONATE" +commandaction="Donate" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_ascii_logo +echo -e "${lightyellow}Support LinuxGSM${default}" +echo -e "=================================" +echo -e "" +echo -e "Been using LinuxGSM?" +echo -e "Consider donating to support development." +echo -e "" +echo -e "* ${lightblue}Patreon:${default} https://linuxgsm.com/patreon" +echo -e "* ${lightblue}GitHub:${default} https://github.com/sponsors/dgibbs64" +echo -e "* ${lightblue}PayPal:${default} https://linuxgsm.com/paypal" +echo -e "" +echo -e "LinuxGSM est. 2012" + +core_exit.sh diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh new file mode 100755 index 000000000..2474ffd47 --- /dev/null +++ b/lgsm/functions/command_fastdl.sh @@ -0,0 +1,437 @@ +#!/bin/bash +# LinuxGSM command_fastdl.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Creates a FastDL directory. + +commandname="FASTDL" +commandaction="Fastdl" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh + +# Directories. +if [ -z "${webdir}" ]; then + webdir="${rootdir}/public_html" +fi +fastdldir="${webdir}/fastdl" +addonsdir="${systemdir}/addons" +# Server lua autorun dir, used to autorun lua on client connect to the server. +luasvautorundir="${systemdir}/lua/autorun/server" +luafastdlfile="lgsm_cl_force_fastdl.lua" +luafastdlfullpath="${luasvautorundir}/${luafastdlfile}" + +# Check if bzip2 is installed. +if [ ! "$(command -v bzip2 2>/dev/null)" ]; then + fn_print_fail "bzip2 is not installed" + fn_script_log_fatal "bzip2 is not installed" + core_exit.sh +fi + +# Header +fn_print_header +echo -e "More info: https://docs.linuxgsm.com/commands/fastdl" +echo -e "" + +# Prompts user for FastDL creation settings. +echo -e "${commandaction} setup" +echo -e "=================================" + +# Prompt for clearing old files if directory was already here. +if [ -d "${fastdldir}" ]; then + fn_print_warning_nl "FastDL directory already exists." + echo -e "${fastdldir}" + echo -e "" + if fn_prompt_yn "Overwrite existing directory?" Y; then + fn_script_log_info "Overwrite existing directory: YES" + else + core_exit.sh + fi +fi + +# Garry's Mod Specific. +if [ "${shortname}" == "gmod" ]; then + # Prompt for download enforcer, which is using a .lua addfile resource generator. + if fn_prompt_yn "Force clients to download files?" Y; then + luaresource="on" + fn_script_log_info "Force clients to download files: YES" + else + luaresource="off" + fn_script_log_info "Force clients to download filesr: NO" + fi +fi + +# Clears any fastdl directory content. +fn_clear_old_fastdl(){ + # Clearing old FastDL. + if [ -d "${fastdldir}" ]; then + echo -en "clearing existing FastDL directory ${fastdldir}..." + rm -fR "${fastdldir:?}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Clearing existing FastDL directory ${fastdldir}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Clearing existing FastDL directory ${fastdldir}" + fi + fi +} + +fn_fastdl_dirs(){ + # Check and create directories. + if [ ! -d "${webdir}" ]; then + echo -en "creating web directory ${webdir}..." + mkdir -p "${webdir}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Creating web directory ${webdir}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Creating web directory ${webdir}" + fi + fi + if [ ! -d "${fastdldir}" ]; then + echo -en "creating fastdl directory ${fastdldir}..." + mkdir -p "${fastdldir}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Creating fastdl directory ${fastdldir}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Creating fastdl directory ${fastdldir}" + fi + fi +} + +# Using this gist https://gist.github.com/agunnerson-ibm/efca449565a3e7356906 +fn_human_readable_file_size(){ + local abbrevs=( + $((1 << 60)):ZB + $((1 << 50)):EB + $((1 << 40)):TB + $((1 << 30)):GB + $((1 << 20)):MB + $((1 << 10)):KB + $((1)):bytes + ) + + local bytes="${1}" + local precision="${2}" + + if [[ "${bytes}" == "1" ]]; then + echo -e "1 byte" + else + for item in "${abbrevs[@]}"; do + local factor="${item%:*}" + local abbrev="${item#*:}" + if [[ "${bytes}" -ge "${factor}" ]]; then + size=$(bc -l <<< "${bytes} / ${factor}") + printf "%.*f %s\n" "${precision}" "${size}" "${abbrev}" + break + fi + done + fi +} + +# Provides info about the fastdl directory content and prompts for confirmation. +fn_fastdl_preview(){ + # Remove any file list. + if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then + rm -f "${tmpdir:?}/fastdl_files_to_compress.txt" + fi + echo -e "analysing required files" + fn_script_log_info "Analysing required files" + # Garry's Mod + if [ "${shortname}" == "gmod" ]; then + cd "${systemdir}" || exit + allowed_extentions_array=( "*.ain" "*.bsp" "*.mdl" "*.mp3" "*.ogg" "*.otf" "*.pcf" "*.phy" "*.png" "*.svg" "*.vtf" "*.vmt" "*.vtx" "*.vvd" "*.ttf" "*.wav" ) + for allowed_extention in "${allowed_extentions_array[@]}"; do + fileswc=0 + tput sc + while read -r ext; do + ((fileswc++)) + tput rc; tput el + echo -e "gathering ${allowed_extention} : ${fileswc}..." + echo -e "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" + done < <(find . -type f -iname "${allowed_extention}") + if [ ${fileswc} != 0 ]; then + fn_print_ok_eol_nl + else + fn_print_info_eol_nl + fi + done + # Source engine + else + fastdl_directories_array=( "maps" "materials" "models" "particles" "sound" "resources" ) + for directory in "${fastdl_directories_array[@]}"; do + if [ -d "${systemdir}/${directory}" ]; then + if [ "${directory}" == "maps" ]; then + local allowed_extentions_array=( "*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt" ) + elif [ "${directory}" == "materials" ]; then + local allowed_extentions_array=( "*.vtf" "*.vmt" "*.vbf" "*.png" "*.svg" ) + elif [ "${directory}" == "models" ]; then + local allowed_extentions_array=( "*.vtx" "*.vvd" "*.mdl" "*.phy" "*.jpg" "*.png" ) + elif [ "${directory}" == "particles" ]; then + local allowed_extentions_array=( "*.pcf" ) + elif [ "${directory}" == "sound" ]; then + local allowed_extentions_array=( "*.wav" "*.mp3" "*.ogg" ) + fi + for allowed_extention in "${allowed_extentions_array[@]}"; do + fileswc=0 + tput sc + while read -r ext; do + ((fileswc++)) + tput rc; tput el + echo -e "gathering ${directory} ${allowed_extention} : ${fileswc}..." + echo -e "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" + done < <(find "${systemdir}/${directory}" -type f -iname "${allowed_extention}") + tput rc; tput el + echo -e "gathering ${directory} ${allowed_extention} : ${fileswc}..." + if [ ${fileswc} != 0 ]; then + fn_print_ok_eol_nl + else + fn_print_info_eol_nl + fi + done + fi + done + fi + if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then + echo -e "calculating total file size..." + fn_sleep_time + totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt") + # Calculates total file size. + while read -r dufile; do + filesize=$(stat -c %s "${dufile}") + filesizetotal=$(( filesizetotal+filesize )) + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Calculating total file size." + core_exit.sh + fi + done <"${tmpdir}/fastdl_files_to_compress.txt" + else + fn_print_fail_eol_nl "generating file list" + fn_script_log_fatal "Generating file list." + core_exit.sh + fi + echo -e "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" + fn_script_log_info "${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" + rm -f "${tmpdir:?}/fastdl_files_to_compress.txt" + if ! fn_prompt_yn "Continue?" Y; then + fn_script_log "User exited" + core_exit.sh + fi +} + +# Builds Garry's Mod fastdl directory content. +fn_fastdl_gmod(){ + cd "${systemdir}" || exit + for allowed_extention in "${allowed_extentions_array[@]}"; do + fileswc=0 + tput sc + while read -r fastdlfile; do + ((fileswc++)) + tput rc; tput el + echo -e "copying ${allowed_extention} : ${fileswc}..." + cp --parents "${fastdlfile}" "${fastdldir}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Copying ${fastdlfile} > ${fastdldir}" + core_exit.sh + else + fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}" + fi + done < <(find . -type f -iname "${allowed_extention}") + if [ ${fileswc} != 0 ]; then + fn_print_ok_eol_nl + fi + done + # Correct addons directory structure for FastDL. + if [ -d "${fastdldir}/addons" ]; then + echo -en "updating addons file structure..." + cp -Rf "${fastdldir}"/addons/*/* "${fastdldir}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Updating addons file structure" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Updating addons file structure" + fi + # Clear addons directory in fastdl. + echo -en "clearing addons dir from fastdl dir..." + fn_sleep_time + rm -fR "${fastdldir:?}/addons" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Clearing addons dir from fastdl dir" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Clearing addons dir from fastdl dir" + fi + fi + # Correct content that may be into a lua directory by mistake like some darkrpmodification addons. + if [ -d "${fastdldir}/lua" ]; then + echo -en "correcting DarkRP files..." + fn_sleep_time + cp -Rf "${fastdldir}/lua/"* "${fastdldir}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Correcting DarkRP files" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Correcting DarkRP files" + fi + fi + if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then + totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt") + # Calculates total file size. + while read -r dufile; do + filesize=$(du -b "${dufile}" | awk '{ print $1 }') + filesizetotal=$((filesizetotal + filesize)) + done <"${tmpdir}/fastdl_files_to_compress.txt" + fi +} + +fn_fastdl_source(){ + for directory in "${fastdl_directories_array[@]}"; do + if [ -d "${systemdir}/${directory}" ]; then + if [ "${directory}" == "maps" ]; then + local allowed_extentions_array=( "*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt" ) + elif [ "${directory}" == "materials" ]; then + local allowed_extentions_array=( "*.vtf" "*.vmt" "*.vbf" "*.png" "*.svg" ) + elif [ "${directory}" == "models" ]; then + local allowed_extentions_array=( "*.vtx" "*.vvd" "*.mdl" "*.phy" "*.jpg" "*.png" ) + elif [ "${directory}" == "particles" ]; then + local allowed_extentions_array=( "*.pcf" ) + elif [ "${directory}" == "sound" ]; then + local allowed_extentions_array=( "*.wav" "*.mp3" "*.ogg" ) + fi + for allowed_extention in "${allowed_extentions_array[@]}"; do + fileswc=0 + tput sc + while read -r fastdlfile; do + ((fileswc++)) + tput rc; tput el + echo -e "copying ${directory} ${allowed_extention} : ${fileswc}..." + fn_sleep_time + # get relative path of file in the dir + tmprelfilepath="${fastdlfile#"${systemdir}/"}" + copytodir="${tmprelfilepath%/*}" + # create relative path for fastdl + if [ ! -d "${fastdldir}/${copytodir}" ]; then + mkdir -p "${fastdldir}/${copytodir}" + fi + cp "${fastdlfile}" "${fastdldir}/${copytodir}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Copying ${fastdlfile} > ${fastdldir}/${copytodir}" + core_exit.sh + else + fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}/${copytodir}" + fi + done < <(find "${systemdir}/${directory}" -type f -iname "${allowed_extention}") + if [ ${fileswc} != 0 ]; then + fn_print_ok_eol_nl + fi + done + fi + done +} + +# Builds the fastdl directory content. +fn_fastdl_build(){ + # Copy all needed files for FastDL. + echo -e "copying files to ${fastdldir}" + fn_script_log_info "Copying files to ${fastdldir}" + if [ "${shortname}" == "gmod" ]; then + fn_fastdl_gmod + fn_fastdl_gmod_dl_enforcer + else + fn_fastdl_source + fi +} + +# Generate lua file that will force download any file into the FastDL directory. +fn_fastdl_gmod_dl_enforcer(){ + # Clear old lua file. + if [ -f "${luafastdlfullpath}" ]; then + echo -en "removing existing download enforcer: ${luafastdlfile}..." + rm -f "${luafastdlfullpath:?}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Removing existing download enforcer ${luafastdlfullpath}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Removing existing download enforcer ${luafastdlfullpath}" + fi + fi + # Generate new one if user said yes. + if [ "${luaresource}" == "on" ]; then + echo -en "creating new download enforcer: ${luafastdlfile}..." + touch "${luafastdlfullpath}" + # Read all filenames and put them into a lua file at the right path. + while read -r line; do + echo -e "resource.AddFile( \"${line}\" )" >> "${luafastdlfullpath}" + done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -printf '%P\n') + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Creating new download enforcer ${luafastdlfullpath}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Creating new download enforcer ${luafastdlfullpath}" + fi + fi +} + +# Compresses FastDL files using bzip2. +fn_fastdl_bzip2(){ + while read -r filetocompress; do + echo -en "\r\033[Kcompressing ${filetocompress}..." + bzip2 -f "${filetocompress}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Compressing ${filetocompress}" + core_exit.sh + else + fn_script_log_pass "Compressing ${filetocompress}" + fi + done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \)) + fn_print_ok_eol_nl +} + +# Run functions. +fn_fastdl_preview +fn_clear_old_fastdl +fn_fastdl_dirs +fn_fastdl_build +fn_fastdl_bzip2 +# Finished message. +echo -e "FastDL files are located in:" +echo -e "${fastdldir}" +echo -e "FastDL completed" +fn_script_log_info "FastDL completed" + +core_exit.sh diff --git a/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh new file mode 100755 index 000000000..e56890b4d --- /dev/null +++ b/lgsm/functions/command_install.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# LinuxGSM command_install.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Overall function for the installer. + +commandname="INSTALL" +commandaction="Installing" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +if [ "$(whoami)" = "root" ]; then + check_deps.sh +else + install_header.sh + install_server_dir.sh + install_logs.sh + check_deps.sh + installflag=1 + # Download and install. + if [ "${shortname}" == "ut2k4" ]; then + install_server_files.sh + install_ut2k4_key.sh + elif [ -z "${appid}" ]; then + install_server_files.sh + elif [ "${appid}" ]; then + install_steamcmd.sh + install_server_files.sh + fi + + # Configuration. + install_config.sh + if [ -v gslt ]; then + install_gslt.sh + elif [ "${shortname}" == "dst" ]; then + install_dst_token.sh + elif [ "${shortname}" == "squad" ]; then + install_squad_license.sh + elif [ "${shortname}" == "ts3" ]; then + install_ts3db.sh + elif [ "${shortname}" == "mta" ]; then + command_install_resources_mta.sh + fn_firstcommand_reset + fi + + fix.sh + install_stats.sh + install_complete.sh +fi +core_exit.sh diff --git a/lgsm/functions/command_install_resources_mta.sh b/lgsm/functions/command_install_resources_mta.sh new file mode 100755 index 000000000..6800932e1 --- /dev/null +++ b/lgsm/functions/command_install_resources_mta.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# LinuxGSM command_install_resources_mta.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Installs the default resources for Multi Theft Auto. + +commandname="DEFAULT-RESOURCES" +commandaction="Default Resources" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_install_resources(){ + echo -e "" + echo -e "Installing Default Resources" + echo -e "=================================" + fn_fetch_file "http://mirror.mtasa.com/mtasa/resources/mtasa-resources-latest.zip" "" "" "" "${tmpdir}" "mtasa-resources-latest.zip" "nochmodx" "norun" "noforce" "nomd5" + fn_dl_extract "${tmpdir}" "mtasa-resources-latest.zip" "${resourcesdir}" + echo -e "Default Resources Installed." +} + +fn_print_header + +if [ -z "${autoinstall}" ]; then + fn_print_warning_nl "Installing the default resources with existing resources may cause issues." + if fn_prompt_yn "Do you want to install MTA default resources?" Y; then + fn_install_resources + fi +else + fn_print_warning_nl "Default resources are not installed when using ./${selfname} auto-install." + fn_print_information_nl "To install default resources use ./${selfname} install" +fi + +core_exit.sh diff --git a/lgsm/functions/command_mods_install.sh b/lgsm/functions/command_mods_install.sh new file mode 100755 index 000000000..a5eaaf83c --- /dev/null +++ b/lgsm/functions/command_mods_install.sh @@ -0,0 +1,135 @@ +#!/bin/bash +# LinuxGSM command_mods_install.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: List and installs available mods along with mods_list.sh and mods_core.sh. + +commandname="MODS-INSTALL" +commandaction="Installing mods" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +mods_core.sh + +fn_print_header + +# Displays a list of installed mods. +fn_mods_installed_list +if [ "${installedmodscount}" -gt "0" ]; then + echo -e "Installed addons/mods" + echo -e "=================================" + # Go through all available commands, get details and display them to the user. + for ((llindex=0; llindex < ${#installedmodslist[@]}; llindex++)); do + # Current mod is the "llindex" value of the array we're going through. + currentmod="${installedmodslist[llindex]}" + fn_mod_get_info + # Display mod info to the user. + echo -e " * ${green}${modcommand}${default}${default}" + done + echo -e "" +fi + +echo -e "Available addons/mods" +echo -e "=================================" +# Display available mods from mods_list.sh. +# Set and reset vars +compatiblemodslistindex=0 +# As long as we're within index values. +while [ "${compatiblemodslistindex}" -lt "${#compatiblemodslist[@]}" ]; do + # Set values for convenience. + displayedmodname="${compatiblemodslist[compatiblemodslistindex]}" + displayedmodcommand="${compatiblemodslist[compatiblemodslistindex+1]}" + displayedmodsite="${compatiblemodslist[compatiblemodslistindex+2]}" + displayedmoddescription="${compatiblemodslist[compatiblemodslistindex+3]}" + # Output mods to the user. + echo -e "${displayedmodname} - ${displayedmoddescription} - ${displayedmodsite}" + echo -e " * ${cyan}${displayedmodcommand}${default}" + # Increment index from the amount of values we just displayed. + let "compatiblemodslistindex+=4" + ((totalmodsavailable++)) +done + +# If no mods are available for a specific game. +if [ -z "${compatiblemodslist}" ]; then + fn_print_fail_nl "No mods are currently available for ${gamename}." + fn_script_log_info "No mods are currently available for ${gamename}." + core_exit.sh +fi +fn_script_log_info "${totalmodsavailable} addons/mods are available for install" + +## User selects a mod. +echo -e "" +while [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; do + echo -en "Enter an ${cyan}addon/mod${default} to ${green}install${default} (or exit to abort): " + read -r usermodselect + # Exit if user says exit or abort. + if [ "${usermodselect}" == "exit" ]||[ "${usermodselect}" == "abort" ]; then + core_exit.sh + # Supplementary output upon invalid user input. + elif [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; then + fn_print_error2_nl "${usermodselect} is not a valid addon/mod." + fi +done +# Get mod info. +currentmod="${usermodselect}" +fn_mod_get_info + +echo -e "" +echo -e "Installing ${modprettyname}" +echo -e "=================================" +fn_script_log_info "${modprettyname} selected for install" + +# Check if the mod is already installed and warn the user. +if [ -f "${modsinstalledlistfullpath}" ]; then + if [ "$(sed -n "/^${modcommand}$/p" "${modsinstalledlistfullpath}")" ]; then + fn_print_warning_nl "${modprettyname} is already installed" + fn_script_log_warn "${modprettyname} is already installed" + echo -e " * Any configs may be overwritten." + if ! fn_prompt_yn "Continue?" Y; then + core_exit.sh + fi + fn_script_log_info "User selected to continue" + fi +fi + +## Installation. +# If amxmodx check if metamod exists first +if [ "${modcommand}" == "amxmodx" ]; then + fn_mod_exist "metamod" +fi + +if [ "${modcommand}" == "amxmodxcs" ] || + [ "${modcommand}" == "amxmodxdod" ] || + [ "${modcommand}" == "amxmodxtfc" ] || + [ "${modcommand}" == "amxmodxns" ] || + [ "${modcommand}" == "amxmodxts" ]; then + fn_mod_exist "amxmodx" +fi + +fn_create_mods_dir +fn_mods_clear_tmp_dir +fn_mods_create_tmp_dir +fn_mod_install_files +fn_mod_lowercase +fn_mod_create_filelist +fn_mod_copy_destination +fn_mod_add_list +fn_mod_tidy_files_list +fn_mods_clear_tmp_dir + +# Create/modify existing liblist.gam file for Metamod +if [ "${modcommand}" == "metamod" ]; then + fn_mod_install_liblist_gam_file +fi + +# Create/modify plugins.ini file for Metamod +if [ "${modcommand}" == "amxmodx" ]; then + fn_mod_install_amxmodx_file +fi + +echo -e "${modprettyname} installed" +fn_script_log_pass "${modprettyname} installed." + +core_exit.sh diff --git a/lgsm/functions/command_mods_remove.sh b/lgsm/functions/command_mods_remove.sh new file mode 100755 index 000000000..8647a21ed --- /dev/null +++ b/lgsm/functions/command_mods_remove.sh @@ -0,0 +1,152 @@ +#!/bin/bash +# LinuxGSM command_mods_uninstall.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Uninstall mods along with mods_list.sh and mods_core.sh. + +commandname="MODS-REMOVE" +commandaction="Removing mods" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +mods_core.sh +fn_mods_check_installed + +fn_print_header +echo -e "Remove addons/mods" +echo -e "=================================" + +# Displays list of installed mods. +# Generates list to display to user. +fn_mods_installed_list +for ((mlindex=0; mlindex < ${#installedmodslist[@]}; mlindex++)); do + # Current mod is the "mlindex" value of the array we are going through. + currentmod="${installedmodslist[mlindex]}" + # Get mod info. + fn_mod_get_info + # Display mod info to the user. + echo -e "${red}${modcommand}${default} - ${modprettyname} - ${moddescription}" +done + +echo -e "" +# Keep prompting as long as the user input doesn't correspond to an available mod. +while [[ ! " ${installedmodslist[@]} " =~ " ${usermodselect} " ]]; do + echo -en "Enter an ${cyan}addon/mod${default} to ${red}remove${default} (or exit to abort): " + read -r usermodselect + # Exit if user says exit or abort. + if [ "${usermodselect}" == "exit" ]||[ "${usermodselect}" == "abort" ]; then + core_exit.sh + # Supplementary output upon invalid user input. + elif [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; then + fn_print_error2_nl "${usermodselect} is not a valid addon/mod." + fi +done + +fn_print_warning_nl "You are about to remove ${cyan}${usermodselect}${default}." +echo -e " * Any custom files/configuration will be removed." +if ! fn_prompt_yn "Continue?" Y; then + core_exit.sh +fi + +currentmod="${usermodselect}" +fn_mod_get_info +fn_check_mod_files_list + +# Uninstall the mod. +fn_script_log_info "Removing ${modsfilelistsize} files from ${modprettyname}" +echo -e "removing ${modprettyname}" +echo -e "* ${modsfilelistsize} files to be removed" +echo -e "* location: ${modinstalldir}" +fn_sleep_time +# Go through every file and remove it. +modfileline="1" +tput sc +while [ "${modfileline}" -le "${modsfilelistsize}" ]; do + # Current line defines current file to remove. + currentfileremove=$(sed "${modfileline}q;d" "${modsdir}/${modcommand}-files.txt") + # If file or directory exists, then remove it. + + if [ -f "${modinstalldir}/${currentfileremove}" ]||[ -d "${modinstalldir}/${currentfileremove}" ]; then + rm -rf "${modinstalldir:?}/${currentfileremove:?}" + ((exitcode=$?)) + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "Removing ${modinstalldir}/${currentfileremove}" + break + else + fn_script_log_pass "Removing ${modinstalldir}/${currentfileremove}" + fi + fi + tput rc; tput el + echo -e "removing ${modprettyname} ${modfileline} / ${modsfilelistsize} : ${currentfileremove}..." + ((modfileline++)) +done + +# Added logic not to fail since removing game specific mods (amxmodxcs) removes files that will +# not be found when removing the base (amxmodx) mod +if [ "${modcommand}" != "amxmodx" ]; then + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi +else + fn_print_ok_eol_nl +fi + +# Remove file list. +echo -en "removing ${modcommand}-files.txt..." +fn_sleep_time +rm -rf "${modsdir:?}/${modcommand}-files.txt" +exitcode=$? +if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "Removing ${modsdir}/${modcommand}-files.txt" + fn_print_fail_eol_nl + core_exit.sh +else + fn_script_log_pass "Removing ${modsdir}/${modcommand}-files.txt" + fn_print_ok_eol_nl +fi + +# Remove mods from installed mods list. +echo -en "removing ${modcommand} from ${modsinstalledlist}..." +fn_sleep_time + +sed -i "/^${modcommand}$/d" "${modsinstalledlistfullpath}" +exitcode=$? +if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "Removing ${modcommand} from ${modsinstalledlist}" + fn_print_fail_eol_nl + core_exit.sh +else + fn_script_log_pass "Removing ${modcommand} from ${modsinstalledlist}" + fn_print_ok_eol_nl +fi + +# Oxide fix +# Oxide replaces server files, so a validate is required after uninstall. +if [ "${engine}" == "unity3d" ]&&[[ "${modprettyname}" == *"Oxide"* ]]; then + fn_print_information_nl "Validating to restore original ${gamename} files replaced by Oxide" + fn_script_log "Validating to restore original ${gamename} files replaced by Oxide" + exitbypass="1" + command_validate.sh + fn_firstcommand_reset + unset exitbypass +fi + +# Remove/modify existing liblist.gam file for Metamod +if [ "${modcommand}" == "metamod" ]; then + fn_mod_remove_liblist_gam_file +fi + +# Remove/modify plugins.ini file for AMX Mod X +if [ "${modcommand}" == "amxmodx" ]; then + fn_mod_remove_amxmodx_file +fi + +echo -e "${modprettyname} removed" +fn_script_log "${modprettyname} removed" + +core_exit.sh diff --git a/lgsm/functions/command_mods_update.sh b/lgsm/functions/command_mods_update.sh new file mode 100755 index 000000000..50bbf9d67 --- /dev/null +++ b/lgsm/functions/command_mods_update.sh @@ -0,0 +1,109 @@ +#!/bin/bash +# LinuxGSM command_mods_update.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Updates installed mods along with mods_list.sh and mods_core.sh. + +commandname="MODS-UPDATE" +commandaction="Updating mods" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +mods_core.sh + +# Prevents specific files being overwritten upon update (set by ${modkeepfiles}). +# For that matter, remove cfg files after extraction before copying them to destination. +fn_remove_cfg_files(){ + if [ "${modkeepfiles}" != "OVERWRITE" ]&&[ "${modkeepfiles}" != "NOUPDATE" ]; then + echo -e "the following files/directories will be preserved:" + fn_sleep_time + # Count how many files there are to remove. + filestopreserve=$(echo -e "${modkeepfiles}" | awk -F ';' '{ print NF }') + # Test all subvalues of "modkeepfiles" using the ";" separator. + for ((preservefilesindex=1; preservefilesindex < filestopreserve; preservefilesindex++)); do + # Put the current file we are looking for into a variable. + filetopreserve=$(echo -e "${modkeepfiles}" | awk -F ';' -v x=${preservefilesindex} '{ print $x }' ) + echo -e " * serverfiles/${filetopreserve}" + # If it matches an existing file that have been extracted delete the file. + if [ -f "${extractdir}/${filetopreserve}" ]||[ -d "${extractdir}/${filetopreserve}" ]; then + rm -r "${extractdir:?}/${filetopreserve}" + # Write the file path in a tmp file, to rebuild a full file list as it is rebuilt upon update. + if [ ! -f "${modsdir}/.removedfiles.tmp" ]; then + touch "${modsdir}/.removedfiles.tmp" + fi + echo -e "${filetopreserve}" >> "${modsdir}/.removedfiles.tmp" + fi + done + fi +} + +fn_print_dots "Update addons/mods" +fn_mods_check_installed +fn_print_info_nl "Update addons/mods: ${installedmodscount} addons/mods will be updated" +fn_script_log_info "${installedmodscount} mods or addons will be updated" +fn_mods_installed_list +# Go through all available commands, get details and display them to the user. +for ((ulindex=0; ulindex < ${#installedmodslist[@]}; ulindex++)); do + # Current mod is the "ulindex" value of the array we're going through. + currentmod="${installedmodslist[ulindex]}" + fn_mod_get_info + # Display installed mods and the update policy. + if [ -z "${modkeepfiles}" ]; then + # If modkeepfiles is not set for some reason, that's a problem. + fn_script_log_error "Could not find update policy for ${modprettyname}" + fn_print_error_nl "Could not find update policy for ${modprettyname}" + exitcode="1" + core_exit.sh + # If the mod won't get updated. + elif [ "${modkeepfiles}" == "NOUPDATE" ]; then + echo -e " * ${red}{modprettyname}${default} (won't be updated)" + # If the mode is just overwritten. + elif [ "${modkeepfiles}" == "OVERWRITE" ]; then + echo -e " * ${modprettyname} (overwrite)" + else + echo -e " * ${yellow}${modprettyname}${default} (retain common custom files)" + fi +done + +## Update +# List all installed mods and apply update. +# Reset line value. +installedmodsline="1" +while [ "${installedmodsline}" -le "${installedmodscount}" ]; do + currentmod=$(sed "${installedmodsline}q;d" "${modsinstalledlistfullpath}") + if [ "${currentmod}" ]; then + fn_mod_get_info + # Don not update mod if the policy is set to "NOUPDATE". + if [ "${modkeepfiles}" == "NOUPDATE" ]; then + fn_print_info "${modprettyname} will not be updated to preserve custom files" + fn_script_log_info "${modprettyname} will not be updated to preserve custom files" + else + echo -e "" + echo -e "==> Updating ${modprettyname}" + fn_create_mods_dir + fn_mods_clear_tmp_dir + fn_mods_create_tmp_dir + fn_mod_install_files + fn_mod_lowercase + fn_remove_cfg_files + fn_mod_create_filelist + fn_mod_copy_destination + fn_mod_add_list + fn_mod_tidy_files_list + fn_mods_clear_tmp_dir + fi + ((installedmodsline++)) + else + fn_print_fail "No mod was selected" + fn_script_log_fatal "No mod was selected" + exitcode="1" + core_exit.sh + fi +done +echo -e "" +fn_print_ok_nl "Mods update complete" +fn_script_log_info "Mods update complete" + +core_exit.sh diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh new file mode 100755 index 000000000..2cd07ed58 --- /dev/null +++ b/lgsm/functions/command_monitor.sh @@ -0,0 +1,248 @@ +#!/bin/bash +# LinuxGSM command_monitor.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Monitors server by checking for running processes +# then passes to gamedig and gsquery. + +commandname="MONITOR" +commandaction="Monitoring" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_monitor_check_lockfile(){ + # Monitor does not run it lockfile is not found. + if [ ! -f "${lockdir}/${selfname}.lock" ]; then + fn_print_dots "Checking lockfile: " + fn_print_checking_eol + fn_script_log_info "Checking lockfile: CHECKING" + fn_print_error "Checking lockfile: No lockfile found: " + fn_print_error_eol_nl + fn_script_log_error "Checking lockfile: No lockfile found: ERROR" + echo -e "* Start ${selfname} to run monitor." + core_exit.sh + fi + + # Fix if lockfile is not unix time or contains letters + if [ -f "${lockdir}/${selfname}.lock" ]&&[[ "$(head -n 1 "${lockdir}/${selfname}.lock")" =~ [A-Za-z] ]]; then + date '+%s' > "${lockdir}/${selfname}.lock" + echo "${version}" >> "${lockdir}/${selfname}.lock" + echo "${port}" >> "${lockdir}/${selfname}.lock" + fi +} + +fn_monitor_check_update(){ + # Monitor will check if update is already running. + if [ "$(pgrep "${selfname} update" | wc -l)" != "0" ]; then + fn_print_dots "Checking active updates: " + fn_print_checking_eol + fn_script_log_info "Checking active updates: CHECKING" + fn_print_error_nl "Checking active updates: SteamCMD is currently checking for updates: " + fn_print_error_eol + fn_script_log_error "Checking active updates: SteamCMD is currently checking for updates: ERROR" + core_exit.sh + fi +} + +fn_monitor_check_session(){ + fn_print_dots "Checking session: " + fn_print_checking_eol + fn_script_log_info "Checking session: CHECKING" + # uses status var from check_status.sh + if [ "${status}" != "0" ]; then + fn_print_ok "Checking session: " + fn_print_ok_eol_nl + fn_script_log_pass "Checking session: OK" + else + fn_print_error "Checking session: " + fn_print_fail_eol_nl + fn_script_log_fatal "Checking session: FAIL" + alert="restart" + alert.sh + fn_script_log_info "Checking session: Monitor is restarting ${selfname}" + command_restart.sh + core_exit.sh + fi +} + +fn_monitor_check_queryport(){ + # Monitor will check queryport is set before continuing. + if [ -z "${queryport}" ]||[ "${queryport}" == "0" ]; then + fn_print_dots "Checking port: " + fn_print_checking_eol + fn_script_log_info "Checking port: CHECKING" + if [ -n "${rconenabled}" ]&&[ "${rconenabled}" != "true" ]&&[ ${shortname} == "av" ]; then + fn_print_warn "Checking port: Unable to query, 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 +} + +fn_query_gsquery(){ + if [ ! -f "${functionsdir}/query_gsquery.py" ]; then + fn_fetch_file_github "lgsm/functions" "query_gsquery.py" "${functionsdir}" "chmodx" "norun" "noforce" "nomd5" + fi + "${functionsdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}" > /dev/null 2>&1 + querystatus="$?" +} + +fn_query_tcp(){ + bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}'' > /dev/null 2>&1 + querystatus="$?" +} + +fn_monitor_query(){ +# Will loop and query up to 5 times every 15 seconds. +# Query will wait up to 60 seconds to confirm server is down as server can become non-responsive during map changes. +totalseconds=0 +for queryattempt in {1..5}; do + for queryip in "${queryips[@]}"; do + fn_print_dots "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_querying_eol + fn_script_log_info "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : QUERYING" + # querydelay + if [ "$(head -n 1 "${lockdir}/${selfname}.lock")" -gt "$(date "+%s" -d "${querydelay} mins ago")" ]; then + fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_delay_eol_nl + fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt} : DELAY" + fn_script_log_info "Query bypassed: ${gameservername} started less than ${querydelay} minutes ago" + fn_script_log_info "Server started: $(date -d @$(head -n 1 "${lockdir}/${selfname}.lock"))" + fn_script_log_info "Current time: $(date)" + monitorpass=1 + core_exit.sh + # will use query method selected in fn_monitor_loop + # gamedig + elif [ "${querymethod}" == "gamedig" ]; then + query_gamedig.sh + # gsquery + elif [ "${querymethod}" == "gsquery" ]; then + fn_query_gsquery + #tcp query + elif [ "${querymethod}" == "tcp" ]; then + fn_query_tcp + fi + + if [ "${querystatus}" == "0" ]; then + # Server query OK. + fn_print_ok "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_ok_eol_nl + fn_script_log_pass "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt}: OK" + monitorpass=1 + if [ "${querystatus}" == "0" ]; then + # Add query data to log. + if [ "${gdname}" ]; then + fn_script_log_info "Server name: ${gdname}" + fi + if [ "${gdplayers}" ]; then + fn_script_log_info "Players: ${gdplayers}/${gdmaxplayers}" + fi + if [ "${gdbots}" ]; then + fn_script_log_info "Bots: ${gdbots}" + fi + if [ "${gdmap}" ]; then + fn_script_log_info "Map: ${gdmap}" + fi + if [ "${gdgamemode}" ]; then + fn_script_log_info "Game Mode: ${gdgamemode}" + fi + + # send LinuxGSM stats if monitor is OK. + if [ "${stats}" == "on" ]||[ "${stats}" == "y" ]; then + info_stats.sh + fi + fi + core_exit.sh + else + # Server query FAIL. + fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_fail_eol + fn_script_log_warn "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt}: FAIL" + # Monitor will try gamedig (if supported) for first 30s then gsquery before restarting. + # gsquery will fail if longer than 60s + if [ "${totalseconds}" -ge "59" ]; then + # Monitor will FAIL if over 60s and trigger gane server reboot. + fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_fail_eol_nl + fn_script_log_warn "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt}: FAIL" + # Send alert if enabled. + alert="restartquery" + alert.sh + command_restart.sh + fn_firstcommand_reset + core_exit.sh + fi + fi + done + # Second counter will wait for 15s before breaking loop. + for seconds in {1..15}; do + fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: ${cyan}WAIT${default}" + sleep 0.5 + totalseconds=$((totalseconds + 1)) + if [ "${seconds}" == "15" ]; then + break + fi + done +done +} + +fn_monitor_loop(){ + # loop though query methods selected by querymode. + totalseconds=0 + if [ "${querymode}" == "2" ]; then + local query_methods_array=( gamedig gsquery ) + elif [ "${querymode}" == "3" ]; then + local query_methods_array=( gamedig ) + elif [ "${querymode}" == "4" ]; then + local query_methods_array=( gsquery ) + elif [ "${querymode}" == "5" ]; then + local query_methods_array=( tcp ) + fi + for querymethod in "${query_methods_array[@]}"; do + # Will check if gamedig is installed and bypass if not. + if [ "${querymethod}" == "gamedig" ]; then + if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; then + if [ -z "${monitorpass}" ]; then + fn_monitor_query + fi + else + fn_script_log_info "gamedig is not installed" + fn_script_log_info "https://docs.linuxgsm.com/requirements/gamedig" + fi + else + # will not query if query already passed. + if [ -z "${monitorpass}" ]; then + fn_monitor_query + fi + fi + done +} + +monitorflag=1 +check.sh +core_logs.sh +info_config.sh +info_parms.sh + +# query pre-checks +fn_monitor_check_lockfile +fn_monitor_check_update +fn_monitor_check_session +# Monitor will not continue if session only check. +if [ "${querymode}" != "1" ]; then + fn_monitor_check_queryport + + # Add a querydelay of 1 min if var missing. + if [ -z "${querydelay}" ]; then + querydelay="1" + fi + + fn_monitor_loop +fi +core_exit.sh diff --git a/lgsm/functions/command_postdetails.sh b/lgsm/functions/command_postdetails.sh new file mode 100755 index 000000000..811938380 --- /dev/null +++ b/lgsm/functions/command_postdetails.sh @@ -0,0 +1,80 @@ +#!/bin/bash +# LinuxGSM command_postdetails.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Strips sensitive information out of Details output. + +commandname="POST-DETAILS" +commandaction="Posting details" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +posttarget="https://termbin.com" + +# source all of the functions defined in the details command. +info_messages.sh + +fn_bad_postdetailslog() { + fn_print_fail_nl "Unable to create temporary file ${postdetailslog}." + core_exit.sh +} + +# Remove any existing postdetails.log file. +if [ -f "${postdetailslog}" ]; then + rm -f "${postdetailslog:?}" +fi + +# Rather than a one-pass sed parser, default to using a temporary directory. +if [ "${exitbypass}" ]; then + postdetailslog="${alertlog}" +else + # Run checks and gathers details to display. + check.sh + info_config.sh + info_parms.sh + info_distro.sh + info_messages.sh + for queryip in "${queryips[@]}" + do + query_gamedig.sh + if [ "${querystatus}" == "0" ]; then + break + fi + done + touch "${postdetailslog}" || fn_bad_postdetailslog + { + fn_info_message_distro + fn_info_message_server_resource + fn_info_message_gameserver_resource + fn_info_message_gameserver + fn_info_message_script + fn_info_message_backup + # Some game servers do not have parms. + if [ "${shortname}" != "jc2" ]&&[ "${shortname}" != "jc3" ]&&[ "${shortname}" != "dst" ]&&[ "${shortname}" != "pz" ]&&[ "${engine}" != "renderware" ]; then + fn_parms + fn_info_message_commandlineparms + fi + fn_info_message_ports + fn_info_message_select_engine + fn_info_message_statusbottom + } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | tee -a "${postdetailslog}" > /dev/null 2>&1 +fi + +fn_print_dots "termbin.com" +link=$(cat "${postdetailslog}" | nc termbin.com 9999 | tr -d '\n\0') +fn_print_ok_nl "termbin.com for 30D" +fn_script_log_pass "termbin.com for 30D" +pdurl="${link}" + +if [ "${firstcommandname}" == "POST-DETAILS" ]; then + echo -e "" + echo -e "Please share the following url for support: " + echo -e "${pdurl}" +fi +fn_script_log_info "${pdurl}" +alerturl="${pdurl}" + +if [ -z "${exitbypass}" ]; then + core_exit.sh +fi diff --git a/lgsm/functions/command_restart.sh b/lgsm/functions/command_restart.sh new file mode 100755 index 000000000..47a6b904c --- /dev/null +++ b/lgsm/functions/command_restart.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# LinuxGSM command_restart.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Restarts the server. + +commandname="MODS-INSTALL" +commandaction="Restarting" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +info_config.sh +exitbypass=1 +command_stop.sh +command_start.sh +fn_firstcommand_reset +core_exit.sh diff --git a/lgsm/functions/command_skeleton.sh b/lgsm/functions/command_skeleton.sh new file mode 100644 index 000000000..7b7d67d5f --- /dev/null +++ b/lgsm/functions/command_skeleton.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LinuxGSM command_skeleton.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Creates an copy of a game servers directorys. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_print_dots "Creating skeleton directory" +check.sh + +# Find all directorys and create them in the skel directory +find "${rootdir}" -type d -not \( -path ./skel -prune \) | cpio -pdvm skel 2>/dev/null +exitcode=$? +if [ "${exitcode}" != 0 ]; then + fn_print_fail_nl "Creating skeleton directory" + fn_script_log_fatal "Creating skeleton directory" +else + fn_print_ok_nl "Creating skeleton directory: ./skel" + fn_script_log_pass "Creating skeleton directory: ./skel" +fi +core_exit.sh diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh new file mode 100755 index 000000000..cc79613fb --- /dev/null +++ b/lgsm/functions/command_start.sh @@ -0,0 +1,214 @@ +#!/bin/bash +# LinuxGSM command_start.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Starts the server. + +commandname="START" +commandaction="Starting" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_start_teamspeak3(){ + if [ ! -f "${servercfgfullpath}" ]; then + fn_print_warn_nl "${servercfgfullpath} is missing" + fn_script_log_warn "${servercfgfullpath} is missing" + echo " * Creating blank ${servercfg}" + fn_script_log_info "Creating blank ${servercfg}" + fn_sleep_time + echo " * ${servercfg} can remain blank by default." + fn_script_log_info "${servercfgfullpath} can remain blank by default." + fn_sleep_time + echo " * ${servercfg} is located in ${servercfgfullpath}." + fn_script_log_info "${servercfg} is located in ${servercfgfullpath}." + sleep 5 + touch "${servercfgfullpath}" + fi + # Accept license. + if [ ! -f "${executabledir}/.ts3server_license_accepted" ]; then + install_eula.sh + fi + fn_start_tmux +} + +# This will allow the Jedi Knight 2 version to be printed in console on start. +# Used to allow update to detect JK2MV server version. +fn_start_jk2(){ + fn_start_tmux + tmux send -t "${sessionname}" version ENTER > /dev/null 2>&1 +} + +fn_start_tmux(){ + if [ "${parmsbypass}" ]; then + parms="" + else + fn_parms + fi + # check for tmux size variables. + if [[ "${servercfgtmuxwidth}" =~ ^[0-9]+$ ]]; then + sessionwidth="${servercfgtmuxwidth}" + else + sessionwidth="80" + fi + if [[ "${servercfgtmuxheight}" =~ ^[0-9]+$ ]]; then + sessionheight="${servercfgtmuxheight}" + else + sessionheight="23" + fi + + # Log rotation. + fn_script_log_info "Rotating log files" + if [ "${engine}" == "unreal2" ]&&[ -f "${gamelog}" ]; then + mv "${gamelog}" "${gamelogdate}" + fi + if [ -f "${lgsmlog}" ]; then + mv "${lgsmlog}" "${lgsmlogdate}" + fi + if [ -f "${consolelog}" ]; then + mv "${consolelog}" "${consolelogdate}" + fi + + # Create lockfile + date '+%s' > "${lockdir}/${selfname}.lock" + echo "${version}" >> "${lockdir}/${selfname}.lock" + echo "${port}" >> "${lockdir}/${selfname}.lock" + cd "${executabledir}" || exit + tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${preexecutable} ${executable} ${parms}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" + + # Create logfile. + touch "${consolelog}" + + # Create last start lock file + date +%s > "${lockdir}/${selfname}-laststart.lock" + + # Get tmux version. + tmuxversion=$(tmux -V | sed "s/tmux //" | sed -n '1 p') + # Tmux compiled from source will return "master", therefore ignore it. + if [ "$(tmux -V | sed "s/tmux //" | sed -n '1 p')" == "master" ]; then + fn_script_log "Tmux version: master (user compiled)" + echo -e "Tmux version: master (user compiled)" >> "${consolelog}" + if [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then + tmux pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" + fi + elif [ "${tmuxversion}" ]; then + # Get the digit version of tmux. + tmuxversion=$(tmux -V | sed "s/tmux //" | sed -n '1 p' | tr -cd '[:digit:]') + # tmux pipe-pane not supported in tmux versions < 1.6. + if [ "${tmuxversion}" -lt "16" ]; then + echo -e "Console logging disabled: Tmux => 1.6 required + https://linuxgsm.com/tmux-upgrade + Currently installed: $(tmux -V)" > "${consolelog}" + + # Console logging disabled: Bug in tmux 1.8 breaks logging. + elif [ "${tmuxversion}" -eq "18" ]; then + echo -e "Console logging disabled: Bug in tmux 1.8 breaks logging + https://linuxgsm.com/tmux-upgrade + Currently installed: $(tmux -V)" > "${consolelog}" + # Console logging enable or not set. + elif [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then + tmux pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" + fi + else + echo -e "Unable to detect tmux version" >> "${consolelog}" + fn_script_log_warn "Unable to detect tmux version" + fi + + # Console logging disabled. + if [ "${consolelogging}" == "off" ]; then + echo -e "Console logging disabled by user" >> "${consolelog}" + fn_script_log_info "Console logging disabled by user" + fi + fn_sleep_time + + # If the server fails to start. + check_status.sh + if [ "${status}" == "0" ]; then + fn_print_fail_nl "Unable to start ${servername}" + fn_script_log_fatal "Unable to start ${servername}" + if [ -s "${lgsmlogdir}/.${selfname}-tmux-error.tmp" ]; then + fn_print_fail_nl "Unable to start ${servername}: Tmux error:" + fn_script_log_fatal "Unable to start ${servername}: Tmux error:" + echo -e "" + echo -e "Command" + echo -e "=================================" + echo -e "tmux new-session -d -s \"${sessionname}\" \"${preexecutable} ${executable} ${parms}\"" | tee -a "${lgsmlog}" + echo -e "" + echo -e "Error" + echo -e "=================================" + cat "${lgsmlogdir}/.${selfname}-tmux-error.tmp" | tee -a "${lgsmlog}" + + # Detected error https://linuxgsm.com/support + if grep -c "Operation not permitted" "${lgsmlogdir}/.${selfname}-tmux-error.tmp" + then + echo -e "" + echo -e "Fix" + echo -e "=================================" + if ! grep "tty:" /etc/group | grep "$(whoami)"; then + echo -e "$(whoami) is not part of the tty group." + fn_script_log_info "$(whoami) is not part of the tty group." + group=$(grep tty /etc/group) + echo -e "" + echo -e " ${group}" + fn_script_log_info "${group}" + echo -e "" + echo -e "Run the following command with root privileges." + echo -e "" + echo -e " usermod -G tty $(whoami)" + echo -e "" + echo -e "https://linuxgsm.com/tmux-op-perm" + fn_script_log_info "https://linuxgsm.com/tmux-op-perm" + else + echo -e "No known fix currently. Please log an issue." + fn_script_log_info "No known fix currently. Please log an issue." + echo -e "https://linuxgsm.com/support" + fn_script_log_info "https://linuxgsm.com/support" + fi + fi + fi + core_exit.sh + else + fn_print_ok "${servername}" + fn_script_log_pass "Started ${servername}" + fi + rm "${lgsmlogdir:?}/.${selfname}-tmux-error.tmp" + echo -en "\n" +} + +check.sh + +# Is the server already started. +# $status comes from check_status.sh, which is run by check.sh for this command +if [ "${status}" != "0" ]; then + fn_print_dots "${servername}" + fn_print_info_nl "${servername} is already running" + fn_script_log_error "${servername} is already running" + if [ -z "${exitbypass}" ]; then + core_exit.sh + fi +fi +if [ -z "${fixbypass}" ]; then + fix.sh +fi +info_config.sh +core_logs.sh + +# Will check for updates is updateonstart is yes. +if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateonstart}" == "on" ]; then + exitbypass=1 + unset updateonstart + command_update.sh + fn_firstcommand_reset +fi + +fn_print_dots "${servername}" + +if [ "${shortname}" == "ts3" ]; then + fn_start_teamspeak3 +elif [ "${shortname}" == "jk2" ]; then + fn_start_jk2 +else + fn_start_tmux +fi + +core_exit.sh diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh new file mode 100644 index 000000000..f0a0bf92c --- /dev/null +++ b/lgsm/functions/command_stop.sh @@ -0,0 +1,281 @@ +#!/bin/bash +# LinuxGSM command_stop.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Stops the server. + +commandname="STOP" +commandaction="Stopping" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +# Attempts graceful shutdown by sending 'CTRL+c'. +fn_stop_graceful_ctrlc(){ + fn_print_dots "Graceful: CTRL+c" + fn_script_log_info "Graceful: CTRL+c" + # Sends quit. + tmux send-keys -t "${sessionname}" C-c > /dev/null 2>&1 + # Waits up to 30 seconds giving the server time to shutdown gracefuly. + for seconds in {1..30}; do + check_status.sh + if [ "${status}" == "0" ]; then + fn_print_ok "Graceful: CTRL+c: ${seconds}: " + fn_print_ok_eol_nl + fn_script_log_pass "Graceful: CTRL+c: OK: ${seconds} seconds" + break + fi + sleep 1 + fn_print_dots "Graceful: CTRL+c: ${seconds}" + done + check_status.sh + if [ "${status}" != "0" ]; then + fn_print_error "Graceful: CTRL+c: " + fn_print_fail_eol_nl + fn_script_log_error "Graceful: CTRL+c: FAIL" + fi +} + +# Attempts graceful shutdown by sending a specified command. +# Usage: fn_stop_graceful_cmd "console_command" "timeout_in_seconds" +# e.g.: fn_stop_graceful_cmd "quit" "30" +fn_stop_graceful_cmd(){ + fn_print_dots "Graceful: sending \"${1}\"" + fn_script_log_info "Graceful: sending \"${1}\"" + # Sends specific stop command. + tmux send -t "${sessionname}" ENTER "${1}" ENTER > /dev/null 2>&1 + # Waits up to ${seconds} seconds giving the server time to shutdown gracefully. + for ((seconds=1; seconds<=${2}; seconds++)); do + check_status.sh + if [ "${status}" == "0" ]; then + fn_print_ok "Graceful: sending \"${1}\": ${seconds}: " + fn_print_ok_eol_nl + fn_script_log_pass "Graceful: sending \"${1}\": OK: ${seconds} seconds" + break + fi + sleep 1 + fn_print_dots "Graceful: sending \"${1}\": ${seconds}" + done + check_status.sh + if [ "${status}" != "0" ]; then + fn_print_error "Graceful: sending \"${1}\": " + fn_print_fail_eol_nl + fn_script_log_error "Graceful: sending \"${1}\": FAIL" + fi +} + +# Attempts graceful shutdown of goldsrc using rcon 'quit' command. +# There is only a 3 second delay before a forced a tmux shutdown +# as GoldSrc servers 'quit' command does a restart rather than shutdown. +fn_stop_graceful_goldsrc(){ + fn_print_dots "Graceful: sending \"quit\"" + fn_script_log_info "Graceful: sending \"quit\"" + # sends quit + tmux send -t "${sessionname}" quit ENTER > /dev/null 2>&1 + # Waits 3 seconds as goldsrc servers restart with the quit command. + for seconds in {1..3}; do + sleep 1 + fn_print_dots "Graceful: sending \"quit\": ${seconds}" + done + fn_print_ok "Graceful: sending \"quit\": ${seconds}: " + fn_print_ok_eol_nl + fn_script_log_pass "Graceful: sending \"quit\": OK: ${seconds} seconds" +} + +# telnet command for sdtd graceful shutdown. +fn_stop_graceful_sdtd_telnet(){ + if [ -z "${telnetpass}" ]||[ "${telnetpass}" == "NOT SET" ]; then + sdtd_telnet_shutdown=$( expect -c ' + proc abort {} { + puts "Timeout or EOF\n" + exit 1 + } + spawn telnet '"${telnetip}"' '"${telnetport}"' + expect { + "session." { send "shutdown\r" } + default abort + } + expect { eof } + puts "Completed.\n" + ') + else + sdtd_telnet_shutdown=$( expect -c ' + proc abort {} { + puts "Timeout or EOF\n" + exit 1 + } + spawn telnet '"${telnetip}"' '"${telnetport}"' + expect { + "password:" { send "'"${telnetpass}"'\r" } + default abort + } + expect { + "session." { send "shutdown\r" } + default abort + } + expect { eof } + puts "Completed.\n" + ') + fi +} + +# Attempts graceful shutdown of 7 Days To Die using telnet. +fn_stop_graceful_sdtd(){ + fn_print_dots "Graceful: telnet" + fn_script_log_info "Graceful: telnet" + if [ "${telnetenabled}" == "false" ]; then + fn_print_info_nl "Graceful: telnet: DISABLED: Enable in ${servercfg}" + elif [ "$(command -v expect 2>/dev/null)" ]; then + # Tries to shutdown with both localhost and server IP. + for telnetip in 127.0.0.1 ${ip}; do + fn_print_dots "Graceful: telnet: ${telnetip}:${telnetport}" + fn_script_log_info "Graceful: telnet: ${telnetip}:${telnetport}" + fn_stop_graceful_sdtd_telnet + completed=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Completed.") + refused=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Timeout or EOF") + if [ "${refused}" ]; then + fn_print_error "Graceful: telnet: ${telnetip}:${telnetport} : " + fn_print_fail_eol_nl + fn_script_log_error "Graceful: telnet: ${telnetip}:${telnetport} : FAIL" + elif [ "${completed}" ]; then + break + fi + done + + # If telnet shutdown was successful will use telnet again to check + # the connection has closed, confirming that the tmux session can now be killed. + if [ "${completed}" ]; then + for seconds in {1..30}; do + fn_stop_graceful_sdtd_telnet + refused=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Timeout or EOF") + if [ "${refused}" ]; then + fn_print_ok "Graceful: telnet: ${telnetip}:${telnetport} : " + fn_print_ok_eol_nl + fn_script_log_pass "Graceful: telnet: ${telnetip}:${telnetport} : ${seconds} seconds" + break + fi + sleep 1 + fn_print_dots "Graceful: telnet: ${seconds}" + done + # If telnet shutdown fails tmux shutdown will be used, this risks loss of world save. + else + if [ "${refused}" ]; then + fn_print_error "Graceful: telnet: " + fn_print_fail_eol_nl + fn_script_log_error "Graceful: telnet: ${telnetip}:${telnetport} : FAIL" + else + fn_print_error_nl "Graceful: telnet: Unknown error" + fn_script_log_error "Graceful: telnet: Unknown error" + fi + echo -en "\n" | tee -a "${lgsmlog}" + echo -en "Telnet output:" | tee -a "${lgsmlog}" + echo -en "\n ${sdtd_telnet_shutdown}" | tee -a "${lgsmlog}" + echo -en "\n\n" | tee -a "${lgsmlog}" + fi + else + fn_print_warn "Graceful: telnet: expect not installed: " + fn_print_fail_eol_nl + fn_script_log_warn "Graceful: telnet: expect not installed: FAIL" + fi +} + +# Attempts graceful shutdown by sending /save /stop. +fn_stop_graceful_avorion(){ + fn_print_dots "Graceful: /save /stop" + fn_script_log_info "Graceful: /save /stop" + # Sends /save. + tmux send-keys -t "${sessionname}" /save ENTER > /dev/null 2>&1 + sleep 5 + # Sends /quit. + tmux send-keys -t "${sessionname}" /stop ENTER > /dev/null 2>&1 + # Waits up to 30 seconds giving the server time to shutdown gracefuly. + for seconds in {1..30}; do + check_status.sh + if [ "${status}" == "0" ]; then + fn_print_ok "Graceful: /save /stop: ${seconds}: " + fn_print_ok_eol_nl + fn_script_log_pass "Graceful: /save /stop: OK: ${seconds} seconds" + break + fi + sleep 1 + fn_print_dots "Graceful: /save /stop: ${seconds}" + done + check_status.sh + if [ "${status}" != "0" ]; then + fn_print_error "Graceful: /save /stop: " + fn_print_fail_eol_nl + fn_script_log_error "Graceful: /save /stop: FAIL" + fi +} + +fn_stop_graceful_select(){ + if [ "${stopmode}" == "1" ]; then + fn_stop_tmux + elif [ "${stopmode}" == "2" ]; then + fn_stop_graceful_ctrlc + elif [ "${stopmode}" == "3" ]; then + fn_stop_graceful_cmd "quit" 30 + elif [ "${stopmode}" == "4" ]; then + fn_stop_graceful_cmd "quit" 120 + elif [ "${stopmode}" == "5" ]; then + fn_stop_graceful_cmd "stop" 30 + elif [ "${stopmode}" == "6" ]; then + fn_stop_graceful_cmd "q" 30 + elif [ "${stopmode}" == "7" ]; then + fn_stop_graceful_cmd "exit" 30 + elif [ "${stopmode}" == "8" ]; then + fn_stop_graceful_sdtd + elif [ "${stopmode}" == "9" ]; then + fn_stop_graceful_goldsrc + elif [ "${stopmode}" == "10" ]; then + fn_stop_graceful_avorion + elif [ "${stopmode}" == "11" ]; then + fn_stop_graceful_cmd "end" 30 + fi +} + +fn_stop_tmux(){ + fn_print_dots "${servername}" + fn_script_log_info "tmux kill-session: ${sessionname}: ${servername}" + # Kill tmux session. + tmux kill-session -t "${sessionname}" > /dev/null 2>&1 + sleep 0.5 + check_status.sh + if [ "${status}" == "0" ]; then + fn_print_ok_nl "${servername}" + fn_script_log_pass "Stopped ${servername}" + else + fn_print_fail_nl "Unable to stop ${servername}" + fn_script_log_fatal "Unable to stop ${servername}" + fi +} + +# Checks if the server is already stopped. +fn_stop_pre_check(){ + if [ "${status}" == "0" ]; then + fn_print_info_nl "${servername} is already stopped" + fn_script_log_error "${servername} is already stopped" + else + # Select graceful shutdown. + fn_stop_graceful_select + fi + # Check status again, a kill tmux session if graceful shutdown failed. + check_status.sh + if [ "${status}" != "0" ]; then + fn_stop_tmux + fi +} + +check.sh +fn_print_dots "${servername}" + +info_config.sh +fn_stop_pre_check +# Remove lockfile. +if [ -f "${lockdir}/${selfname}.lock" ]; then + rm -f "${lockdir:?}/${selfname}.lock" +fi + +if [ -z "${exitbypass}" ]; then + core_exit.sh +fi diff --git a/lgsm/functions/command_test_alert.sh b/lgsm/functions/command_test_alert.sh new file mode 100755 index 000000000..9397a445c --- /dev/null +++ b/lgsm/functions/command_test_alert.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LinuxGSM command_test_alert.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends a test alert. + +commandname="TEST-ALERT" +commandaction="Sending Alert" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_dots "${servername}" +check.sh +info_config.sh +alert="test" +alert.sh + +core_exit.sh diff --git a/lgsm/functions/command_ts3_server_pass.sh b/lgsm/functions/command_ts3_server_pass.sh new file mode 100755 index 000000000..1e227f3de --- /dev/null +++ b/lgsm/functions/command_ts3_server_pass.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# LinuxGSM command_ts3_server_pass.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Changes TS3 serveradmin password. + +commandname="CHANGE-PASSWORD" +commandaction="Changing password" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_serveradmin_password_prompt(){ + fn_print_header + fn_print_information_nl "You are about to change the ${gamename} ServerAdmin password." + fn_print_warning_nl "${gamename} will restart during this process." + echo -e "" + if ! fn_prompt_yn "Continue?" Y; then + exitcode=0 + core_exit.sh + fi + fn_script_log_info "Initiating ${gamename} ServerAdmin password change" + read -rp "Enter new password: " newpassword + fn_print_info_nl "Changing password" + fn_script_log_info "Changing password" +} + +fn_serveradmin_password_set(){ + # Start server in "new password mode". + ts3serverpass="1" + exitbypass="1" + command_start.sh + fn_firstcommand_reset + fn_print_ok_nl "New password applied" + fn_script_log_pass "New ServerAdmin password applied" +} + +# Running functions. +check.sh +fn_serveradmin_password_prompt +if [ "${status}" != "0" ]; then + # Stop any running server. + exitbypass="1" + command_stop.sh + fn_firstcommand_reset + fn_serveradmin_password_set + parms="serveradmin_password=\"${newpassword}\" inifile=\"${servercfgfullpath}\" > /dev/null 2>&1" + ts3serverpass="0" + command_restart.sh + fn_firstcommand_reset +else + fn_serveradmin_password_set + command_stop.sh + fn_firstcommand_reset +fi + +core_exit.sh diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh new file mode 100755 index 000000000..fdaf9f5a0 --- /dev/null +++ b/lgsm/functions/command_update.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# LinuxGSM command_update.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of servers. + +commandname="UPDATE" +commandaction="Updating" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_dots "" +check.sh +core_logs.sh +check_last_update.sh + +if [ "${shortname}" == "ts3" ]; then + update_ts3.sh +elif [ "${shortname}" == "mc" ]; then + update_minecraft.sh +elif [ "${shortname}" == "mcb" ]; then + update_minecraft_bedrock.sh +elif [ "${shortname}" == "mumble" ]; then + update_mumble.sh +elif [ "${shortname}" == "fctr" ]; then + update_factorio.sh +elif [ "${shortname}" == "mta" ]; then + update_mta.sh +elif [ "${shortname}" == "jk2" ]; then + update_jediknight2.sh +elif [ "${shortname}" == "vints" ]; then + update_vintagestory.sh +else + update_steamcmd.sh +fi + +core_exit.sh diff --git a/lgsm/functions/command_update_linuxgsm.sh b/lgsm/functions/command_update_linuxgsm.sh new file mode 100755 index 000000000..341b46e0b --- /dev/null +++ b/lgsm/functions/command_update_linuxgsm.sh @@ -0,0 +1,201 @@ +#!/bin/bash +# LinuxGSM command_update_linuxgsm.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Deletes the functions dir to allow re-downloading of functions from GitHub. + +commandname="UPDATE-LGSM" +commandaction="Updating LinuxGSM" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh + +fn_print_dots "" +fn_script_log_info "Updating LinuxGSM" + +fn_print_dots "Selecting repo" +fn_script_log_info "Selecting repo" +# Select remotereponame +curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1>/dev/null +if [ $? != "0" ]; then + curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1>/dev/null + if [ $? != "0" ]; then + fn_print_fail_nl "Selecting repo: Unable to to access GitHub or Bitbucket repositories" + fn_script_log_fatal "Selecting repo: Unable to to access GitHub or Bitbucket repositories" + core_exit.sh + else + remotereponame="Bitbucket" + fn_print_ok_nl "Selecting repo: ${remotereponame}" + fi +else + remotereponame="GitHub" + fn_print_ok_nl "Selecting repo: ${remotereponame}" +fi + +# Check linuxsm.sh +echo -en "checking ${remotereponame} linuxgsm.sh...\c" +if [ "${remotereponame}" == "GitHub" ]; then + curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1>/dev/null +else + curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1>/dev/null +fi +if [ $? != "0" ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Checking ${remotereponame} linuxgsm.sh" + fn_script_log_fatal "Curl returned error: $?" + core_exit.sh +fi + +if [ "${remotereponame}" == "GitHub" ]; then + tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh")) +else + tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh")) +fi + +if [ "${tmp_script_diff}" != "" ]; then + fn_print_update_eol_nl + fn_script_log_update "Checking ${remotereponame} linuxgsm.sh" + rm -f "${tmpdir:?}/linuxgsm.sh" + fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "nochmodx" "norun" "noforcedl" "nomd5" +else + fn_print_ok_eol_nl + fn_script_log_pass "Checking ${remotereponame} linuxgsm.sh" +fi + +# Check gameserver.sh +# Compare gameserver.sh against linuxgsm.sh in the tmp dir. +# Ignoring server specific vars. +echo -en "checking ${selfname}...\c" +fn_script_log_info "Checking ${selfname}" +script_diff=$(diff <(sed '\/shortname/d;\/gameservername/d;\/gamename/d;\/githubuser/d;\/githubrepo/d;\/githubbranch/d' "${tmpdir}/linuxgsm.sh") <(sed '\/shortname/d;\/gameservername/d;\/gamename/d;\/githubuser/d;\/githubrepo/d;\/githubbranch/d' "${rootdir}/${selfname}")) +if [ "${script_diff}" != "" ]; then + fn_print_update_eol_nl + fn_script_log_update "Checking ${selfname}" + echo -en "backup ${selfname}...\c" + fn_script_log_info "Backup ${selfname}" + if [ ! -d "${backupdir}/script" ]; then + mkdir -p "${backupdir}/script" + fi + cp "${rootdir}/${selfname}" "${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak" + if [ $? != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Backup ${selfname}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Backup ${selfname}" + echo -e "backup location ${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak" + fn_script_log_pass "Backup location ${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak" + fi + + echo -en "copying ${selfname}...\c" + fn_script_log_info "copying ${selfname}" + cp "${tmpdir}/linuxgsm.sh" "${rootdir}/${selfname}" + sed -i "s+shortname=\"core\"+shortname=\"${shortname}\"+g" "${rootdir}/${selfname}" + sed -i "s+gameservername=\"core\"+gameservername=\"${gameservername}\"+g" "${rootdir}/${selfname}" + sed -i "s+gamename=\"core\"+gamename=\"${gamename}\"+g" "${rootdir}/${selfname}" + sed -i "s+githubuser=\"GameServerManagers\"+githubuser=\"${githubuser}\"+g" "${rootdir}/${selfname}" + sed -i "s+githubrepo=\"LinuxGSM\"+githubrepo=\"${githubrepo}\"+g" "${rootdir}/${selfname}" + sed -i "s+githubbranch=\"master\"+githubbranch=\"${githubbranch}\"+g" "${rootdir}/${selfname}" + + if [ $? != "0" ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "copying ${selfname}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "copying ${selfname}" + fi +else + fn_print_ok_eol_nl + fn_script_log_info "Checking ${selfname}" +fi + +# Check _default.cfg. +echo -en "checking ${remotereponame} config _default.cfg...\c" +fn_script_log_info "Checking ${remotereponame} config _default.cfg" +if [ "${remotereponame}" == "GitHub" ]; then + curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null +else + curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null +fi +if [ $? != "0" ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Checking ${remotereponame} config _default.cfg" + fn_script_log_fatal "Curl returned error: $?" + core_exit.sh +fi + +if [ "${remotereponame}" == "GitHub" ]; then + config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) +else + config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) +fi + +if [ "${config_file_diff}" != "" ]; then + fn_print_update_eol_nl + fn_script_log_update "Checking ${remotereponame} config _default.cfg" + rm -f "${configdirdefault:?}/config-lgsm/${gameservername:?}/_default.cfg" + fn_fetch_file_github "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "nochmodx" "norun" "noforce" "nomd5" + alert="config" + alert.sh +else + fn_print_ok_eol_nl + fn_script_log_pass "Checking ${remotereponame} config _default.cfg" +fi + +# Check and update modules. +if [ -n "${functionsdir}" ]; then + if [ -d "${functionsdir}" ]; then + cd "${functionsdir}" || exit + for functionfile in *; do + # check if module exists in the repo and remove if missing. + # commonly used if module names change. + echo -en "checking ${remotereponame} module ${functionfile}...\c" + github_file_url_dir="lgsm/functions" + if [ "${remotereponame}" == "GitHub" ]; then + curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null + else + curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null + fi + if [ $? != 0 ]; then + fn_print_error_eol_nl + fn_script_log_error "Checking ${remotereponame} module ${functionfile}" + echo -en "removing module ${functionfile}...\c" + if ! rm -f "${functionfile:?}"; then + fn_print_fail_eol_nl + fn_script_log_fatal "Removing module ${functionfile}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Removing module ${functionfile}" + fi + else + # compare file + if [ "${remotereponame}" == "GitHub" ]; then + function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}")) + else + function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}")) + fi + + # results + if [ "${function_file_diff}" != "" ]; then + fn_print_update_eol_nl + fn_script_log_update "Checking ${remotereponame} module ${functionfile}" + rm -rf "${functionsdir:?}/${functionfile}" + fn_update_function + else + fn_print_ok_eol_nl + fn_script_log_pass "Checking ${remotereponame} module ${functionfile}" + fi + fi + done + fi +fi + +fn_print_ok_nl "Updating functions" +fn_script_log_pass "Updating functions" + +core_exit.sh diff --git a/lgsm/functions/command_validate.sh b/lgsm/functions/command_validate.sh new file mode 100755 index 000000000..4c51bacb3 --- /dev/null +++ b/lgsm/functions/command_validate.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# LinuxGSM command_validate.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Runs a server validation. + +commandname="VALIDATE" +commandaction="Validating" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_validate(){ + fn_print_warn "Validate might overwrite some customised files" + fn_script_log_warn "${commandaction} server: Validate might overwrite some customised files" + totalseconds=3 + for seconds in {3..1}; do + fn_print_warn "Validate might overwrite some customised files: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + sleep 1 + if [ "${seconds}" == "0" ]; then + break + fi + done + fn_print_warn_nl "Validate might overwrite some customised files" + + fn_dl_steamcmd +} + +# The location where the builds are checked and downloaded. +remotelocation="SteamCMD" +check.sh + +fn_print_dots "${remotelocation}" + +if [ "${status}" != "0" ]; then + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fn_validate + exitbypass=1 + command_start.sh + fn_firstcommand_reset +else + fn_validate +fi + +core_exit.sh diff --git a/lgsm/functions/command_wipe.sh b/lgsm/functions/command_wipe.sh new file mode 100755 index 000000000..63cb830fb --- /dev/null +++ b/lgsm/functions/command_wipe.sh @@ -0,0 +1,232 @@ +#!/bin/bash +# LinuxGSM command_backup.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Wipes server data, useful after updates for some games like Rust. + +commandname="WIPE" +commandaction="Wiping" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +# Provides an exit code upon error. +fn_wipe_exit_code(){ + ((exitcode=$?)) + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "${currentaction}" + core_exit.sh + else + fn_print_ok_eol_nl + fi +} + +# Removes files to wipe server. +fn_wipe_server_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_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}" + fn_wipe_exit_code + fn_sleep_time + else + echo -e "no blueprint file 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. + 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" + totalseconds=3 + for seconds in {3..1}; do + fn_print_warn "this game server will be stopped during wipe: ${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_wipe_warning(){ + fn_print_warn "wipe is about to start" + fn_script_log_warn "wipe is about to start" + totalseconds=3 + for seconds in {3..1}; do + fn_print_warn "wipe is about to start: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + sleep 1 + if [ "${seconds}" == "0" ]; then + break + fi + done + fn_print_warn "wipe is about to start" +} + +# Will change the seed everytime the wipe command is run if the seed in config is not set. +fn_wipe_random_seed(){ + shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" +} + +fn_print_dots "" +check.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 + check_status.sh + if [ "${status}" != "0" ]; then + fn_stop_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fn_wipe_server_files + exitbypass=1 + command_start.sh + fn_firstcommand_reset + else + fn_wipe_server_files + 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" +fi +core_exit.sh diff --git a/lgsm/functions/compress_unreal2_maps.sh b/lgsm/functions/compress_unreal2_maps.sh new file mode 100755 index 000000000..0c32d3c77 --- /dev/null +++ b/lgsm/functions/compress_unreal2_maps.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# LinuxGSM compress_unreal2_maps.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Compresses unreal maps. + +commandname="MAP-COMPRESSOR" +commandaction="Compressing maps" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +fn_print_header +echo -e "Will compress all maps in:" +echo -e "" +pwd +echo -e "" +echo -e "Compressed maps saved to:" +echo -e "" +echo -e "${compressedmapsdir}" +echo -e "" +if ! fn_prompt_yn "Start compression?" Y; then + exitcode=0 + core_exit.sh +fi +mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 +rm -rfv "${serverfiles:?}/Maps/"*.ut2.uz2 +cd "${systemdir}" || exit +for map in "${serverfiles}/Maps/"*; do + ./ucc-bin compress "${map}" --nohomedir +done +mv -fv "${serverfiles}/Maps/"*.ut2.uz2 "${compressedmapsdir}" + +core_exit.sh diff --git a/lgsm/functions/compress_ut99_maps.sh b/lgsm/functions/compress_ut99_maps.sh new file mode 100755 index 000000000..9aa074ba9 --- /dev/null +++ b/lgsm/functions/compress_ut99_maps.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# LinuxGSM compress_ut99_maps.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Compresses unreal maps. + +commandname="MAP-COMPRESSOR" +commandaction="Compressing maps" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +fn_print_header +echo -e "Will compress all maps in:" +echo -e "" +pwd +echo -e "" +echo -e "Compressed maps saved to:" +echo -e "" +echo -e "${compressedmapsdir}" +echo -e "" +if ! fn_prompt_yn "Start compression?" Y; then + exitcode=0 + core_exit.sh +fi +mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 +rm -rfv "${serverfiles:?}/Maps/"*.unr.uz +cd "${systemdir}" || exit +for map in "${serverfiles}/Maps/"*; do + ./ucc-bin compress "${map}" --nohomedir +done +mv -fv "${serverfiles}/Maps/"*.unr.uz "${compressedmapsdir}" + +core_exit.sh diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh new file mode 100755 index 000000000..b947cbc6d --- /dev/null +++ b/lgsm/functions/core_dl.sh @@ -0,0 +1,494 @@ +#!/bin/bash +# LinuxGSM core_dl.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Deals with all downloads for LinuxGSM. + +# remote_fileurl: The URL of the file: http://example.com/dl/File.tar.bz2 +# local_filedir: location the file is to be saved: /home/server/lgsm/tmp +# local_filename: name of file (this can be different from the url name): file.tar.bz2 +# chmodx: Optional, set to "chmodx" to make file executable using chmod +x +# run: Optional, set run to execute the file after download +# forcedl: Optional, force re-download of file even if exists +# md5: Optional, set an md5 sum and will compare it against the file. +# +# Downloads can be defined in code like so: +# fn_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" +# fn_fetch_file "http://example.com/file.tar.bz2" "/some/dir" "file.tar.bz2" "chmodx" "run" "forcedl" "10cd7353aa9d758a075c600a6dd193fd" + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_dl_steamcmd(){ + fn_print_start_nl "${remotelocation}" + fn_script_log_info "${commandaction} ${selfname}: ${remotelocation}" + if [ -n "${branch}" ]; then + echo -e "Branch: ${branch}" + fn_script_log_info "Branch: ${branch}" + fi + if [ -n "${betapassword}" ]; then + echo -e "Branch password: ${betapassword}" + fn_script_log_info "Branch password: ${betapassword}" + fi + if [ -d "${steamcmddir}" ]; then + cd "${steamcmddir}" || exit + fi + + # Unbuffer will allow the output of steamcmd not buffer allowing a smooth output. + # unbuffer us part of the expect package. + if [ "$(command -v unbuffer)" ]; then + unbuffer="unbuffer" + fi + + # Validate will be added as a parameter if required. + if [ "${commandname}" == "VALIDATE" ]||[ "${commandname}" == "INSTALL" ]; then + validate="validate" + fi + + # To do error checking for SteamCMD the output of steamcmd will be saved to a log. + steamcmdlog="${lgsmlogdir}/${selfname}-steamcmd.log" + + # clear previous steamcmd log + if [ -f "${steamcmdlog}" ]; then + rm -f "${steamcmdlog:?}" + fi + counter=0 + while [ "${counter}" == "0" ]||[ "${exitcode}" != "0" ]; do + counter=$((counter+1)) + # Select SteamCMD parameters + # If GoldSrc (appid 90) servers. GoldSrc (appid 90) require extra commands. + if [ "${appid}" == "90" ]; then + # If using a specific branch. + if [ -n "${branch}" ]&&[ -n "${betapassword}" ]; then + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + elif [ -n "${branch}" ]; then + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + else + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + fi + # Force Windows Platform type. + elif [ "${steamcmdforcewindows}" == "yes" ]; then + if [ -n "${branch}" ]&&[ -n "${betapassword}" ]; then + ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + elif [ -n "${branch}" ]; then + ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + else + ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + fi + # All other servers. + else + if [ -n "${branch}" ]&&[ -n "${betapassword}" ]; then + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + elif [ -n "${branch}" ]; then + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + else + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + fi + fi + + # Error checking for SteamCMD. Some errors will loop to try again and some will just exit. + # Check also if we have more errors than retries to be sure that we do not loop to many times and error out. + exitcode=$? + if [ -n "$(grep -i "Error!" "${steamcmdlog}" | tail -1)" ]&&[ "$(grep -ic "Error!" "${steamcmdlog}")" -ge "${counter}" ] ; then + # Not enough space. + if [ -n "$(grep "0x202" "${steamcmdlog}" | tail -1)" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough space to download server files" + fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Not enough space to download server files" + core_exit.sh + # Need tp purchase game. + elif [ -n "$(grep "No subscription" "${steamcmdlog}" | tail -1)" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Steam account does not have a license for the required game" + fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Steam account does not have a license for the required game" + core_exit.sh + # Two-factor authentication failure + elif [ -n "$(grep "Two-factor code mismatch" "${steamcmdlog}" | tail -1)" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Two-factor authentication failure" + fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Two-factor authentication failure" + core_exit.sh + # Incorrect Branch password + elif [ -n "$(grep "Password check for AppId" "${steamcmdlog}" | tail -1)" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: betapassword is incorrect" + fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: betapassword is incorrect" + core_exit.sh + # Update did not finish. + elif [ -n "$(grep "0x402" "${steamcmdlog}" | tail -1)" ]||[ -n "$(grep "0x602" "${steamcmdlog}" | tail -1)" ]; then + fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Update required but not completed - check network" + fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Update required but not completed - check network" + else + fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured" + fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured" + fi + elif [ "${exitcode}" != "0" ]; then + fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Exit code: ${exitcode}" + fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Exit code: ${exitcode}" + else + fn_print_complete_nl "${commandaction} ${selfname}: ${remotelocation}" + fn_script_log_pass "${commandaction} ${selfname}: ${remotelocation}" + fi + + if [ "${counter}" -gt "10" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Did not complete the download, too many retrys" + fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Did not complete the download, too many retrys" + core_exit.sh + fi + done +} + +# Emptys contents of the LinuxGSM tmpdir. +fn_clear_tmp(){ + echo -en "clearing LinuxGSM tmp directory..." + if [ -d "${tmpdir}" ]; then + rm -rf "${tmpdir:?}/"* + local exitcode=$? + if [ "${exitcode}" == 0 ]; then + fn_print_ok_eol_nl + fn_script_log_pass "clearing LinuxGSM tmp directory" + else + fn_print_error_eol_nl + fn_script_log_error "clearing LinuxGSM tmp directory" + fi + fi +} + +fn_dl_md5(){ + # Runs MD5 Check if available. + if [ "${md5}" != "0" ]&&[ "${md5}" != "nomd5" ]; then + echo -en "verifying ${local_filename} with MD5..." + fn_sleep_time + md5sumcmd=$(md5sum "${local_filedir}/${local_filename}"|awk '{print $1;}') + if [ "${md5sumcmd}" != "${md5}" ]; then + fn_print_fail_eol_nl + echo -e "${local_filename} returned MD5 checksum: ${md5sumcmd}" + echo -e "expected MD5 checksum: ${md5}" + fn_script_log_fatal "Verifying ${local_filename} with MD5" + fn_script_log_info "${local_filename} returned MD5 checksum: ${md5sumcmd}" + fn_script_log_info "Expected MD5 checksum: ${md5}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Verifying ${local_filename} with MD5" + fn_script_log_info "${local_filename} returned MD5 checksum: ${md5sumcmd}" + fn_script_log_info "Expected MD5 checksum: ${md5}" + fi + fi +} + +# Extracts bzip2, gzip or zip files. +# Extracts can be defined in code like so: +# fn_dl_extract "${local_filedir}" "${local_filename}" "${extractdir}" +# fn_dl_extract "/home/gameserver/lgsm/tmp" "file.tar.bz2" "/home/gamserver/serverfiles" +fn_dl_extract(){ + local_filedir="${1}" + local_filename="${2}" + extractdir="${3}" + # Extracts archives. + echo -en "extracting ${local_filename}..." + mime=$(file -b --mime-type "${local_filedir}/${local_filename}") + if [ ! -d "${extractdir}" ]; then + mkdir "${extractdir}" + fi + if [ "${mime}" == "application/gzip" ]||[ "${mime}" == "application/x-gzip" ]; then + extractcmd=$(tar -zxf "${local_filedir}/${local_filename}" -C "${extractdir}") + elif [ "${mime}" == "application/x-bzip2" ]; then + extractcmd=$(tar -jxf "${local_filedir}/${local_filename}" -C "${extractdir}") + elif [ "${mime}" == "application/x-xz" ]; then + extractcmd=$(tar -xf "${local_filedir}/${local_filename}" -C "${extractdir}") + elif [ "${mime}" == "application/zip" ]; then + extractcmd=$(unzip -qo -d "${extractdir}" "${local_filedir}/${local_filename}") + fi + local exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Extracting download" + if [ -f "${lgsmlog}" ]; then + echo -e "${extractcmd}" >> "${lgsmlog}" + fi + echo -e "${extractcmd}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Extracting download" + fi +} + +# Trap to remove file download if canceled before completed. +fn_fetch_trap(){ + echo -e "" + echo -en "downloading ${local_filename}..." + fn_print_canceled_eol_nl + fn_script_log_info "Downloading ${local_filename}...CANCELED" + fn_sleep_time + rm -f "${local_filedir:?}/${local_filename}" + echo -en "downloading ${local_filename}..." + fn_print_removed_eol_nl + fn_script_log_info "Downloading ${local_filename}...REMOVED" + core_exit.sh +} + +fn_fetch_file(){ + remote_fileurl="${1}" + remote_fileurl_backup="${2}" + remote_fileurl_name="${3}" + remote_fileurl_backup_name="${4}" + local_filedir="${5}" + local_filename="${6}" + chmodx="${7:-0}" + run="${8:-0}" + forcedl="${9:-0}" + md5="${10:-0}" + + # Download file if missing or download forced. + if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then + # If backup fileurl exists include it. + if [ -n "${remote_fileurl_backup}" ]; then + # counter set to 0 to allow second try + counter=0 + remote_fileurls_array=( remote_fileurl remote_fileurl_backup ) + else + # counter set to 1 to not allow second try + counter=1 + remote_fileurls_array=( remote_fileurl ) + fi + for remote_fileurl_array in "${remote_fileurls_array[@]}"; do + if [ "${remote_fileurl_array}" == "remote_fileurl" ]; then + fileurl="${remote_fileurl}" + fileurl_name="${remote_fileurl_name}" + elif [ "${remote_fileurl_array}" == "remote_fileurl_backup" ]; then + fileurl="${remote_fileurl_backup}" + fileurl_name="${remote_fileurl_backup_name}" + fi + counter=$((counter+1)) + if [ ! -d "${local_filedir}" ]; then + mkdir -p "${local_filedir}" + fi + # Trap will remove part downloaded files if canceled. + trap fn_fetch_trap INT + # Larger files show a progress bar. + if [ "${local_filename##*.}" == "bz2" ]||[ "${local_filename##*.}" == "gz" ]||[ "${local_filename##*.}" == "zip" ]||[ "${local_filename##*.}" == "jar" ]||[ "${local_filename##*.}" == "xz" ]; then + echo -en "downloading ${local_filename}..." + fn_sleep_time + echo -en "\033[1K" + curlcmd=$(curl --connect-timeout 10 --progress-bar --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}") + echo -en "downloading ${local_filename}..." + else + echo -en "fetching ${fileurl_name} ${local_filename}...\c" + curlcmd=$(curl --connect-timeout 10 -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) + fi + local exitcode=$? + + # Download will fail if downloads a html file. + if [ -f "${local_filedir}/${local_filename}" ]; then + if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE" )" ]; then + rm "${local_filedir:?}/${local_filename:?}" + local exitcode=2 + fi + fi + + # On first try will error. On second try will fail. + if [ "${exitcode}" != 0 ]; then + if [ ${counter} -ge 2 ]; then + fn_print_fail_eol_nl + if [ -f "${lgsmlog}" ]; then + fn_script_log_fatal "Downloading ${local_filename}" + fn_script_log_fatal "${fileurl}" + fi + core_exit.sh + else + fn_print_error_eol_nl + if [ -f "${lgsmlog}" ]; then + fn_script_log_error "Downloading ${local_filename}" + fn_script_log_error "${fileurl}" + fi + fi + else + fn_print_ok_eol + sleep 0.3 + echo -en "\033[2K\\r" + if [ -f "${lgsmlog}" ]; then + fn_script_log_pass "Downloading ${local_filename}" + fi + + # Make file executable if chmodx is set. + if [ "${chmodx}" == "chmodx" ]; then + chmod +x "${local_filedir}/${local_filename}" + fi + + # Remove trap. + trap - INT + + break + fi + done + fi + + if [ -f "${local_filedir}/${local_filename}" ]; then + fn_dl_md5 + # Execute file if run is set. + if [ "${run}" == "run" ]; then + # shellcheck source=/dev/null + source "${local_filedir}/${local_filename}" + fi + fi +} + +# GitHub file download functions. +# Used to simplify downloading specific files from GitHub. + +# github_file_url_dir: the directory of the file in the GitHub: lgsm/functions +# github_file_url_name: the filename of the file to download from GitHub: core_messages.sh +# githuburl: the full GitHub url + +# remote_fileurl: The URL of the file: http://example.com/dl/File.tar.bz2 +# local_filedir: location the file is to be saved: /home/server/lgsm/tmp +# local_filename: name of file (this can be different from the url name): file.tar.bz2 +# chmodx: Optional, set to "chmodx" to make file executable using chmod +x +# run: Optional, set run to execute the file after download +# forcedl: Optional, force re-download of file even if exists +# md5: Optional, set an md5 sum and will compare it against the file. + +# Fetches files from the Git repo. +fn_fetch_file_github(){ + github_file_url_dir="${1}" + github_file_url_name="${2}" + # For legacy versions - code can be removed at a future date + if [ "${legacymode}" == "1" ]; then + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + elif [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" + else + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + fi + remote_fileurl_name="GitHub" + remote_fileurl_backup_name="Bitbucket" + local_filedir="${3}" + local_filename="${github_file_url_name}" + chmodx="${4:-0}" + run="${5:-0}" + forcedl="${6:-0}" + md5="${7:-0}" + # Passes vars to the file download function. + fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" +} + +# Fetches config files from the Git repo. +fn_fetch_config(){ + github_file_url_dir="${1}" + github_file_url_name="${2}" + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" + else + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + fi + remote_fileurl_name="GitHub" + remote_fileurl_backup_name="Bitbucket" + local_filedir="${3}" + local_filename="${4}" + chmodx="nochmodx" + run="norun" + forcedl="noforce" + md5="nomd5" + # Passes vars to the file download function. + fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" +} + +# Fetches modules from the Git repo during first download. +fn_fetch_function(){ + github_file_url_dir="lgsm/functions" + github_file_url_name="${functionfile}" + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" + else + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + fi + remote_fileurl_name="GitHub" + remote_fileurl_backup_name="Bitbucket" + local_filedir="${functionsdir}" + local_filename="${github_file_url_name}" + chmodx="chmodx" + run="run" + forcedl="noforce" + md5="nomd5" + # Passes vars to the file download function. + fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" +} + +# Fetches modules from the Git repo during update-lgsm. +fn_update_function(){ + github_file_url_dir="lgsm/functions" + github_file_url_name="${functionfile}" + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" + else + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + fi + remote_fileurl_name="GitHub" + remote_fileurl_backup_name="Bitbucket" + local_filedir="${functionsdir}" + local_filename="${github_file_url_name}" + chmodx="chmodx" + run="norun" + forcedl="noforce" + md5="nomd5" + # Passes vars to the file download function. + fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" + +} + +# Function to download latest github release. +# $1 GitHub user / organisation. +# $2 Repo name. +# $3 Destination for download. +# $4 Search string in releases (needed if there are more files that can be downloaded from the release pages). +fn_dl_latest_release_github(){ + local githubreleaseuser="${1}" + local githubreleaserepo="${2}" + local githubreleasedownloadpath="${3}" + local githubreleasesearch="${4}" + local githublatestreleaseurl="https://api.github.com/repos/${githubreleaseuser}/${githubreleaserepo}/releases/latest" + + # Get last github release. + # If no search for the release filename is set, just get the first file from the latest release. + if [ -z "${githubreleasesearch}" ]; then + githubreleaseassets=$(curl -s "${githublatestreleaseurl}" | jq '[ .assets[] ]') + else + githubreleaseassets=$(curl -s "${githublatestreleaseurl}" | jq "[ .assets[]|select(.browser_download_url | contains(\"${githubreleasesearch}\")) ]") + fi + + # Check how many releases we got from the api and exit if we have more then one. + if [ "$(echo -e "${githubreleaseassets}" | jq '. | length')" -gt 1 ]; then + fn_print_fatal_nl "Found more than one release to download - Please report this to the LinuxGSM issue tracker" + fn_script_log_fatal "Found more than one release to download - Please report this to the LinuxGSM issue tracker" + else + # Set variables for download via fn_fetch_file. + githubreleasefilename=$(echo -e "${githubreleaseassets}" | jq -r '.[]name') + githubreleasedownloadlink=$(echo -e "${githubreleaseassets}" | jq -r '.[]browser_download_url') + + # Error if no version is there. + if [ -z "${githubreleasefilename}" ]; then + fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fatal "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + else + # Fetch file from the remote location from the existing function to the ${tmpdir} for now. + fn_fetch_file "${githubreleasedownloadlink}" "" "${githubreleasefilename}" "" "${githubreleasedownloadpath}" "${githubreleasefilename}" + fi + fi +} + +# Check that curl is installed +if [ ! "$(command -v curl 2>/dev/null)" ]; then + echo -e "[ FAIL ] Curl is not installed" + exit 1 +fi diff --git a/lgsm/functions/core_exit.sh b/lgsm/functions/core_exit.sh new file mode 100755 index 000000000..34379a486 --- /dev/null +++ b/lgsm/functions/core_exit.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# LinuxGSM core_exit.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles exiting of LinuxGSM by running and reporting an exit code. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_exit_dev_debug(){ + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "" + echo -e "${functionselfname} exiting with code: ${exitcode}" + if [ -f "${rootdir}/dev-debug.log" ]; then + grep "functionfile=" "${rootdir}/dev-debug.log" | sed 's/functionfile=//g' > "${rootdir}/dev-debug-function-order.log" + fi + fi +} + +# If running dependency check as root will remove any files that belong to root user. +if [ "$(whoami)" == "root" ]; then + find "${lgsmdir}"/ -group root -prune -exec rm -rf {} + > /dev/null 2>&1 + find "${logdir}"/ -group root -prune -exec rm -rf {} + > /dev/null 2>&1 +fi + +if [ "${exitbypass}" ]; then + unset exitbypass +elif [ "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then + # List LinuxGSM version in logs + fn_script_log_info "LinuxGSM version: ${version}" + if [ "${exitcode}" == "1" ]; then + fn_script_log_fatal "${functionselfname} exiting with code: ${exitcode}" + elif [ "${exitcode}" == "2" ]; then + fn_script_log_error "${functionselfname} exiting with code: ${exitcode}" + elif [ "${exitcode}" == "3" ]; then + fn_script_log_warn "${functionselfname} exiting with code: ${exitcode}" + else + fn_script_log_warn "${functionselfname} exiting with code: ${exitcode}" + fi + fn_exit_dev_debug + # remove trap. + trap - INT + exit "${exitcode}" +elif [ "${exitcode}" ]&&[ "${exitcode}" == "0" ]; then + # List LinuxGSM version in logs + fn_script_log_info "LinuxGSM version: ${version}" + fn_script_log_pass "${functionselfname} exiting with code: ${exitcode}" + fn_exit_dev_debug + # remove trap. + trap - INT + exit "${exitcode}" +else + # List LinuxGSM version in logs + fn_script_log_info "LinuxGSM version: ${version}" + fn_print_error "No exit code set" + fn_script_log_pass "${functionselfname} exiting with code: NOT SET" + fn_exit_dev_debug + # remove trap. + trap - INT + exit "${exitcode}" +fi diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh new file mode 100755 index 000000000..0a0941377 --- /dev/null +++ b/lgsm/functions/core_functions.sh @@ -0,0 +1,800 @@ +#!/bin/bash +# LinuxGSM core_functions.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Defines all functions to allow download and execution of functions using fn_fetch_function. +# This function is called first before any other function. Without this file other functions will not load. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +modulesversion="v20.6.2" + +# Core + +core_dl.sh(){ +functionfile="${FUNCNAME[0]}" +if [ "$(type fn_fetch_core_dl 2>/dev/null)" ]; then + fn_fetch_core_dl "lgsm/functions" "core_dl.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" +else + fn_bootstrap_fetch_file_github "lgsm/functions" "core_dl.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" +fi +} + +core_messages.sh(){ +functionfile="${FUNCNAME[0]}" +if [ "$(type fn_fetch_core_dl 2>/dev/null)" ]; then + fn_fetch_core_dl "lgsm/functions" "core_messages.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" +else + fn_bootstrap_fetch_file_github "lgsm/functions" "core_messages.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" +fi +} + +core_legacy.sh(){ +functionfile="${FUNCNAME[0]}" +if [ "$(type fn_fetch_core_dl 2>/dev/null)" ]; then + fn_fetch_core_dl "lgsm/functions" "core_legacy.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" +else + fn_bootstrap_fetch_file_github "lgsm/functions" "core_legacy.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" +fi +} + +fn_parms(){ +parms="${startparameters}" +} + +core_exit.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +core_getopt.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +core_trap.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +core_steamcmd.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +core_github.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +# Commands + +command_backup.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_console.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_debug.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_details.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_donate.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_postdetails.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_test_alert.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_monitor.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_start.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_stop.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_validate.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_install.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_install_resources_mta.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +install_squad_license.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_mods_install.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_mods_update.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_mods_remove.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_fastdl.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_ts3_server_pass.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_restart.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_skeleton.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_wipe.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +# Checks + +check.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +check_config.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +check_deps.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +check_executable.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +check_glibc.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +check_ip.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +check_last_update.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +check_logs.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +check_permissions.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +check_root.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +check_status.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +check_steamcmd.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +check_system_dir.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +check_system_requirements.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +check_tmuxception.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +check_version.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +# Compress + +compress_unreal2_maps.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +compress_ut99_maps.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +# Mods + +mods_list.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +mods_core.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +# Dev + +command_dev_clear_functions.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_dev_debug.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_dev_detect_deps.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_dev_detect_glibc.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_dev_detect_ldd.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_dev_query_raw.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +# Fix + +fix.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_ark.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_av.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_arma3.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_bo.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_cmw.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_csgo.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_dst.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_hw.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_ins.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_kf.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_kf2.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_mcb.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_mta.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_nmrih.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_onset.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_ro.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_rust.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_rw.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_sfc.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_st.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_steamcmd.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_terraria.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_tf2.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_ut3.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_rust.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_samp.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_sdtd.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_sof2.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_squad.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_ts3.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_ut2k4.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_ut.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_unt.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_wurm.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fix_zmr.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +# Info + +info_stats.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +info_config.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +info_distro.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +info_gamedig.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +info_messages.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +info_parms.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +# Alert + +alert.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +alert_discord.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +alert_email.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +alert_ifttt.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +alert_mailgun.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +alert_pushbullet.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +alert_pushover.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +alert_telegram.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +alert_rocketchat.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +alert_sendgrid.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +alert_slack.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} +# Logs + +core_logs.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +# Query + +query_gamedig.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +# Update + +command_update_functions.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_update_linuxgsm.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_update.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +command_check_update.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +update_ts3.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +update_minecraft.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +update_minecraft_bedrock.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +update_mumble.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +update_mta.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +update_factorio.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +update_jediknight2.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +update_steamcmd.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +update_vintagestory.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +fn_update_functions.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +# +## Installer functions +# + +fn_autoinstall(){ +autoinstall=1 +command_install.sh +} + +install_complete.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +install_config.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +install_factorio_save.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +install_dst_token.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +install_eula.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +install_gsquery.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +install_gslt.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +install_header.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +install_logs.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +install_retry.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +install_server_dir.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} +install_server_files.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +install_stats.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +install_steamcmd.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +install_ts3.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +install_ts3db.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +install_ut2k4.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +install_dl_ut2k4.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +install_ut2k4_key.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + +# Calls code required for legacy servers +core_legacy.sh + +# Creates tmp dir if missing +if [ ! -d "${tmpdir}" ]; then + mkdir -p "${tmpdir}" +fi + +# Creates lock dir if missing +if [ ! -d "${lockdir}" ]; then + mkdir -p "${lockdir}" +fi + +# Calls on-screen messages (bootstrap) +core_messages.sh + +#Calls file downloader (bootstrap) +core_dl.sh + +# Calls the global Ctrl-C trap +core_trap.sh diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh new file mode 100755 index 000000000..b0986024a --- /dev/null +++ b/lgsm/functions/core_getopt.sh @@ -0,0 +1,208 @@ +#!/bin/bash +# LinuxGSM core_getopt.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: getopt arguments. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +### Define all commands here. +## User commands | Trigger commands | Description +# Standard commands. +cmd_install=( "i;install" "command_install.sh" "Install the server." ) +cmd_auto_install=( "ai;auto-install" "fn_autoinstall" "Install the server without prompts." ) +cmd_start=( "st;start" "command_start.sh" "Start the server." ) +cmd_stop=( "sp;stop" "command_stop.sh" "Stop the server." ) +cmd_restart=( "r;restart" "command_restart.sh" "Restart the server." ) +cmd_details=( "dt;details" "command_details.sh" "Display server information." ) +cmd_postdetails=( "pd;postdetails" "command_postdetails.sh" "Post details to termbin.com (removing passwords)." ) +cmd_backup=( "b;backup" "command_backup.sh" "Create backup archives of the server." ) +cmd_update_linuxgsm=( "ul;update-lgsm;uf;update-functions" "command_update_linuxgsm.sh" "Check and apply any LinuxGSM updates." ) +cmd_test_alert=( "ta;test-alert" "command_test_alert.sh" "Send a test alert." ) +cmd_monitor=( "m;monitor" "command_monitor.sh" "Check server status and restart if crashed." ) +cmd_skeleton=( "sk;skeleton" "command_skeleton.sh" "Create a skeleton directory." ) +cmd_donate=( "do;donate" "command_donate.sh" "Donation options." ) +# Console servers only. +cmd_console=( "c;console" "command_console.sh" "Access server console." ) +cmd_debug=( "d;debug" "command_debug.sh" "Start server directly in your terminal." ) +# Update servers only. +cmd_update=( "u;update" "command_update.sh" "Check and apply any server updates." ) +cmd_check_update=( "cu;check-update" "command_check_update.sh" "Check if a gameserver update is available" ) +cmd_force_update=( "fu;force-update;update-restart;ur" "forceupdate=1; command_update.sh" "Apply server updates bypassing check." ) +# SteamCMD servers only. +cmd_validate=( "v;validate" "command_validate.sh" "Validate server files with SteamCMD." ) +# Server with mods-install. +cmd_mods_install=( "mi;mods-install" "command_mods_install.sh" "View and install available mods/addons." ) +cmd_mods_remove=( "mr;mods-remove" "command_mods_remove.sh" "View and remove an installed mod/addon." ) +cmd_mods_update=( "mu;mods-update" "command_mods_update.sh" "Update installed mods/addons." ) +# Server specific. +cmd_change_password=( "pw;change-password" "command_ts3_server_pass.sh" "Change TS3 serveradmin password." ) +cmd_install_default_resources=( "ir;install-default-resources" "command_install_resources_mta.sh" "Install the MTA default resources." ) +cmd_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_map_compressor_u99=( "mc;map-compressor" "compress_ut99_maps.sh" "Compresses all ${gamename} server maps." ) +cmd_map_compressor_u2=( "mc;map-compressor" "compress_unreal2_maps.sh" "Compresses all ${gamename} server maps." ) +cmd_install_cdkey=( "cd;server-cd-key" "install_ut2k4_key.sh" "Add your server cd key." ) +cmd_install_dst_token=( "ct;cluster-token" "install_dst_token.sh" "Configure cluster token." ) +cmd_install_squad_license=( "li;license" "install_squad_license.sh" "Add your Squad server license." ) +cmd_fastdl=( "fd;fastdl" "command_fastdl.sh" "Build a FastDL directory." ) +# Dev commands. +cmd_dev_debug=( "dev;developer" "command_dev_debug.sh" "Enable developer Mode." ) +cmd_dev_detect_deps=( "dd;detect-deps" "command_dev_detect_deps.sh" "Detect required dependencies." ) +cmd_dev_detect_glibc=( "dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect required glibc." ) +cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect required dynamic dependencies." ) +cmd_dev_query_raw=( "qr;query-raw" "command_dev_query_raw.sh" "The raw output of gamedig and gsquery." ) +cmd_dev_clear_functions=( "cf;clear-functions" "command_dev_clear_functions.sh" "Delete the contents of the functions dir." ) + + +### Set specific opt here. + +currentopt=( "${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monitor[@]}" "${cmd_test_alert[@]}" "${cmd_details[@]}" "${cmd_postdetails[@]}" "${cmd_skeleton[@]}" ) + +# Update LinuxGSM. +currentopt+=( "${cmd_update_linuxgsm[@]}" ) + +# Exclude noupdate games here. +if [ "${shortname}" == "jk2" ]||[ "${engine}" != "idtech3" ];then + if [ "${shortname}" != "bf1942" ]&&[ "${shortname}" != "bfv" ]&&[ "${engine}" != "idtech2" ]&&[ "${engine}" != "iw2.0" ]&&[ "${engine}" != "iw3.0" ]&&[ "${engine}" != "quake" ]&&[ "${shortname}" != "samp" ]&&[ "${shortname}" != "ut2k4" ]&&[ "${shortname}" != "ut99" ]; then + currentopt+=( "${cmd_update[@]}" ) + # force update for SteamCMD or Multi Theft Auto only. + if [ "${appid}" ]||[ "${shortname}" == "mta" ]; then + currentopt+=( "${cmd_force_update[@]}" ) + fi + fi +fi + +# Validate and check-update command. +if [ "${appid}" ]; then + currentopt+=( "${cmd_validate[@]}" "${cmd_check_update[@]}" ) +fi + +# Backup. +currentopt+=( "${cmd_backup[@]}" ) + +# Console & Debug +currentopt+=( "${cmd_console[@]}" "${cmd_debug[@]}" ) + +## Game server exclusive commands. + +# FastDL command. +if [ "${engine}" == "source" ]; then + currentopt+=( "${cmd_fastdl[@]}" ) +fi + +# TeamSpeak exclusive. +if [ "${shortname}" == "ts3" ]; then + currentopt+=( "${cmd_change_password[@]}" ) +fi + +# Unreal exclusive. +if [ "${shortname}" == "rust" ]; then + currentopt+=( "${cmd_wipe[@]}" "${cmd_full_wipe[@]}" ) +fi +if [ "${engine}" == "unreal2" ]; then + if [ "${shortname}" == "ut2k4" ]; then + currentopt+=( "${cmd_install_cdkey[@]}" "${cmd_map_compressor_u2[@]}" ) + else + currentopt+=( "${cmd_map_compressor_u2[@]}" ) + fi +fi +if [ "${engine}" == "unreal" ]; then + currentopt+=( "${cmd_map_compressor_u99[@]}" ) +fi + +# DST exclusive. +if [ "${shortname}" == "dst" ]; then + currentopt+=( "${cmd_install_dst_token[@]}" ) +fi + +# MTA exclusive. +if [ "${shortname}" == "mta" ]; then + currentopt+=( "${cmd_install_default_resources[@]}" ) +fi + +# Squad license exclusive. +if [ "${shortname}" == "squad" ]; then + currentopt+=( "${cmd_install_squad_license[@]}" ) +fi + +## Mods commands. +if [ "${engine}" == "source" ]||[ "${shortname}" == "rust" ]||[ "${shortname}" == "hq" ]||[ "${shortname}" == "sdtd" ]||[ "${shortname}" == "cs" ]||[ "${shortname}" == "dod" ]||[ "${shortname}" == "tfc" ]||[ "${shortname}" == "ns" ]||[ "${shortname}" == "ts" ]||[ "${shortname}" == "hldm" ]; then + currentopt+=( "${cmd_mods_install[@]}" "${cmd_mods_remove[@]}" "${cmd_mods_update[@]}" ) +fi + +## Installer. +currentopt+=( "${cmd_install[@]}" "${cmd_auto_install[@]}" ) + +## Developer commands. +currentopt+=( "${cmd_dev_debug[@]}" ) +if [ -f ".dev-debug" ]; then + currentopt+=( "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_clear_functions[@]}" ) +fi + +## Donate. +currentopt+=( "${cmd_donate[@]}" ) + +### Build list of available commands. +optcommands=() +index="0" +for ((index="0"; index < ${#currentopt[@]}; index+=3)); do + cmdamount=$(echo -e "${currentopt[index]}" | awk -F ';' '{ print NF }') + for ((cmdindex=1; cmdindex <= cmdamount; cmdindex++)); do + optcommands+=( "$(echo -e "${currentopt[index]}" | awk -F ';' -v x=${cmdindex} '{ print $x }')" ) + done +done + +# Shows LinuxGSM usage. +fn_opt_usage(){ + echo -e "Usage: $0 [option]" + echo -e "" + echo -e "LinuxGSM - ${gamename} - Version ${version}" + echo -e "https://linuxgsm.com/${gameservername}" + echo -e "" + echo -e "${lightyellow}Commands${default}" + # Display available commands. + index="0" + { + for ((index="0"; index < ${#currentopt[@]}; index+=3)); do + # Hide developer commands. + if [ "${currentopt[index+2]}" != "DEVCOMMAND" ]; then + echo -e "${cyan}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t| ${currentopt[index+2]}" + fi + done + } | column -s $'\t' -t + fn_script_log_pass "Display commands" + core_exit.sh +} + +# Check if command existw and run corresponding scripts, or display script usage. +if [ -z "${getopt}" ]; then + fn_opt_usage +fi +# If command exists. +for i in "${optcommands[@]}"; do + if [ "${i}" == "${getopt}" ] ; then + # Seek and run command. + index="0" + for ((index="0"; index < ${#currentopt[@]}; index+=3)); do + currcmdamount=$(echo -e "${currentopt[index]}" | awk -F ';' '{ print NF }') + for ((currcmdindex=1; currcmdindex <= currcmdamount; currcmdindex++)); do + if [ "$(echo -e "${currentopt[index]}" | awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then + # Run command. + eval "${currentopt[index+1]}" + # Exit should occur in modules. Should this not happen print an error + fn_print_error2_nl "Command did not exit correctly: ${getopt}" + fn_script_log_error "Command did not exit correctly: ${getopt}" + core_exit.sh + fi + done + done + fi +done + +# If we're executing this, it means command was not found. +fn_print_error2_nl "Unknown command: $0 ${getopt}" +fn_script_log_error "Unknown command: $0 ${getopt}" +fn_opt_usage +core_exit.sh diff --git a/lgsm/functions/core_github.sh b/lgsm/functions/core_github.sh new file mode 100644 index 000000000..5bd4bd730 --- /dev/null +++ b/lgsm/functions/core_github.sh @@ -0,0 +1,114 @@ +#!/bin/bash +# LinuxGSM core_github.sh function +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: core function file for updates via github + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +github_api="https://api.github.com" + +fn_githublocalversionfile(){ + local githubreleaseuser="${1}" + local githubreleaserepo="${2}" + + githublocalversionfile="${datadir}/github-${githubreleaseuser}-${githubreleaserepo}-version" +} + +# $1 githubuser/group +# $2 github repo name +fn_github_get_latest_release_version(){ + local githubreleaseuser="${1}" + local githubreleaserepo="${2}" + local githublatestreleaseurl="${github_api}/repos/${githubreleaseuser}/${githubreleaserepo}/releases/latest" + + githubreleaseversion=$(curl -s --connect-timeout 10 "${githublatestreleaseurl}" | jq '.tag_name' ) + + # error if no version is there + if [ -z "${githubreleaseversion}" ]; then + fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fatal "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + fi +} + +# $1 githubuser/group +# $2 github repo name +fn_github_set_latest_release_version(){ + local githubreleaseuser="${1}" + local githubreleaserepo="${2}" + + fn_githublocalversionfile "${githubreleaseuser}" "${githubreleaserepo}" + + local githublatestreleaseurl="${github_api}/repos/${githubreleaseuser}/${githubreleaserepo}/releases/latest" + githubreleaseversion=$(curl -s "${githublatestreleaseurl}" | jq -r '.tag_name' ) + + # error if no version is there + if [ -z "${githubreleaseversion}" ]; then + fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fatal "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + else + echo "${githubreleaseversion}" > "${githublocalversionfile}" + fi +} + +# $1 githubuser/group +# $2 github repo name +fn_github_get_installed_version(){ + local githubreleaseuser="${1}" + local githubreleaserepo="${2}" + + fn_githublocalversionfile "${githubreleaseuser}" "${githubreleaserepo}" + + githublocalversion=$(cat "${githublocalversionfile}") +} + +# $1 githubuser/group +# $2 github repo name +# if a update needs to be downloaded - updateneeded is set to 1 +fn_github_compare_version(){ + local githubreleaseuser="${1}" + local githubreleaserepo="${2}" + exitcode=0 + updateneeded=0 + + fn_githublocalversionfile "${githubreleaseuser}" "${githubreleaserepo}" + local githublatestreleaseurl="${github_api}/repos/${githubreleaseuser}/${githubreleaserepo}/releases/latest" + + githublocalversion=$(cat "${githublocalversionfile}") + githubreleaseversion=$(curl -s "${githublatestreleaseurl}" | jq '.tag_name' ) + + # error if no version is there + if [ -z "${githubreleaseversion}" ]; then + fn_print_fail_nl "Can not get version from Github Api for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fatal "Can not get version from Github Api for ${githubreleaseuser}/${githubreleaserepo}" + else + if [ "${githublocalversion}" == "${githubreleaseversion}" ]; then + echo -en "\n" + echo -e "No update from github.com/${githubreleaseuser}/${githubreleaserepo}/ available:" + echo -e "* Local build: ${red}${githublocalversion}${default}" + echo -e "* Remote build: ${green}${githubreleaseversion}${default}" + echo -en "\n" + else + # check if version that is installed is higher than the remote version to not override it + last_version=$(echo -e "${githublocalversion}\n${githubreleaseversion}" | sort -V | head -n1 ) + if [ "${githubreleaseversion}" == "${last_version}" ]; then + echo -en "\n" + echo -e "Update from github.com/${githubreleaseuser}/${githubreleaserepo}/ available:" + echo -e "* Local build: ${red}${githublocalversion}${default}" + echo -e "* Remote build: ${green}${githubreleaseversion}${default}" + echo -en "\n" + updateneeded=1 + else + # local version is higher than the remote version output this to the user + # strange case but could be possible, as a release could be removed from github + echo -en "\n" + echo -e "Local version is newer than the remote version" + echo -e "* Local version: ${green}${githublocalversion}${default}" + echo -e "* Remote version: ${green}${githubreleaseversion}${default}" + echo -en "\n" + exitcode=1 + fi + fi + fi +} diff --git a/lgsm/functions/core_legacy.sh b/lgsm/functions/core_legacy.sh new file mode 100755 index 000000000..2ea30f5a6 --- /dev/null +++ b/lgsm/functions/core_legacy.sh @@ -0,0 +1,79 @@ +#!/bin/bash +# LinuxGSM core_legacy.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Code for backwards compatability with older versions of LinuxGSM. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# This is to help the transition to v20.3.0 and above +legacy_versions_array=( v20.2.1 v20.2.0 v20.1.5 v20.1.4 v20.1.3 v20.1.2 v20.1.1 v20.1.0 v19.12.5 v19.12.4 v19.12.3 v19.12.2 v19.12.1 v19.12.0 ) +for legacy_version in "${legacy_versions_array[@]}"; do + if [ "${version}" == "${legacy_version}" ]; then + legacymode=1 + fi +done + +if [ -z "${serverfiles}" ]; then + serverfiles="${filesdir}" +fi + +if [ -z "${logdir}" ]; then + logdir="${rootdir}/log" +fi + +if [ -z "${lgsmlogdir}" ]; then + lgsmlogdir="${scriptlogdir}" +fi + +if [ -z "${lgsmlog}" ]; then + lgsmlog="${scriptlog}" +fi + +if [ -z "${lgsmlogdate}" ]; then + lgsmlogdate="${scriptlogdate}" +fi + +if [ -z "${steamcmddir}" ]; then + steamcmddir="${HOME}/.steam/steamcmd" +fi + +if [ -z "${lgsmdir}" ]; then + lgsmdir="${rootdir}/lgsm" +fi + +if [ -z "${tmpdir}" ]; then + tmpdir="${lgsmdir}/tmp" +fi + +if [ -z "${alertlog}" ]; then + alertlog="${emaillog}" +fi + +if [ -z "${servicename}" ]; then + servicename="${selfname}" +fi + +# Alternations to workshop variables. +if [ -z "${wsapikey}" ]; then + if [ "${workshopauth}" ]; then + wsapikey="${workshopauth}" + elif [ "${authkey}" ]; then + wsapikey="${authkey}" + fi +fi + +if [ -z "${wscollectionid}" ]; then + if [ "${workshopauth}" ]; then + wscollectionid="${ws_collection_id}" + elif [ "${authkey}" ]; then + wscollectionid="${workshopcollectionid}" + fi +fi + +if [ -z "${wsstartmap}" ]; then + if [ "${ws_start_map}" ]; then + wscollectionid="${ws_start_map}" + fi +fi diff --git a/lgsm/functions/core_logs.sh b/lgsm/functions/core_logs.sh new file mode 100755 index 000000000..b999cb347 --- /dev/null +++ b/lgsm/functions/core_logs.sh @@ -0,0 +1,103 @@ +#!/bin/bash +# LinuxGSM core_logs.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Acts as a log rotator, removing old logs. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Check if logfile variable and file exist, create logfile if it doesn't exist. +if [ "${consolelog}" ]; then + if [ ! -f "${consolelog}" ]; then + touch "${consolelog}" + fi +fi + +# For games not displaying a console, and having logs into their game directory. +check_status.sh +if [ "${status}" != "0" ]&&[ "${commandname}" == "START" ]&&[ -n "${gamelogfile}" ]; then + if [ "$(find "${systemdir}" -name "gamelog*.log")" ]; then + fn_print_info "Moving game logs to ${gamelogdir}" + fn_script_log_info "Moving game logs to ${gamelogdir}" + echo -en "\n" + fn_sleep_time + mv "${systemdir}"/gamelog*.log "${gamelogdir}" + fi +fi + +# Log manager will start the cleanup if it finds logs older than "${logdays}". +if [ "$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l)" -ne "0" ]; then + fn_print_dots "Starting" + # Set common logs directories + commonlogs="${systemdir}/logs" + commonsourcelogs="${systemdir}/*/logs" + # Set addon logs directories + sourcemodlogdir="${systemdir}/addons/sourcemod/logs" + ulxlogdir="${systemdir}/data/ulx_logs" + darkrplogdir="${systemdir}/data/darkrp_logs" + legacyserverlogdir="${logdir}/server" + # Setting up counting variables + scriptcount="0" ; consolecount="0" ; gamecount="0" ; srcdscount="0" ; smcount="0" ; ulxcount="0" ; darkrpcount="0" ; legacycount="0" + fn_sleep_time + fn_print_info "Removing logs older than ${logdays} days" + fn_script_log_info "Removing logs older than ${logdays} days" + # Logging logfiles to be removed according to "${logdays}", counting and removing them. + # Script logfiles. + find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" + scriptcount=$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l) + find "${lgsmlogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; + # SRCDS and unreal logfiles. + if [ "${engine}" == "unreal2" ]||[ "${engine}" == "source" ]; then + find "${gamelogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" + gamecount=$(find "${gamelogdir}"/ -type f -mtime +"${logdays}" | wc -l) + find "${gamelogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; + fi + # Console logfiles. + if [ "${consolelog}" ]; then + find "${consolelogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" + consolecount=$(find "${consolelogdir}"/ -type f -mtime +"${logdays}" | wc -l) + find "${consolelogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; + fi + # Common logfiles. + if [ -d "${commonlogs}" ]; then + find "${commonlogs}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" + smcount=$(find "${commonlogs}"/ -type f -mtime +"${logdays}" | wc -l) + find "${commonlogs}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; + fi + if [ -d "${commonsourcelogs}" ]; then + find "${commonsourcelogs}"/* -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" + smcount=$(find "${commonsourcelogs}"/* -type f -mtime +"${logdays}" | wc -l) + find "${commonsourcelogs}"/* -mtime +"${logdays}" -type f -exec rm -f {} \; + fi + # Source addons logfiles. + if [ "${engine}" == "source" ]; then + # SourceMod logfiles. + if [ -d "${sourcemodlogdir}" ]; then + find "${sourcemodlogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" + smcount=$(find "${sourcemodlogdir}"/ -type f -mtime +"${logdays}" | wc -l) + find "${sourcemodlogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; + fi + # Garry's Mod logfiles. + if [ "${shortname}" == "gmod" ]; then + # ULX logfiles. + if [ -d "${ulxlogdir}" ]; then + find "${ulxlogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" + ulxcount=$(find "${ulxlogdir}"/ -type f -mtime +"${logdays}" | wc -l) + find "${ulxlogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; + fi + # DarkRP logfiles. + if [ -d "${darkrplogdir}" ]; then + find "${darkrplogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" + darkrpcount=$(find "${darkrplogdir}"/ -type f -mtime +"${logdays}" | wc -l) + find "${darkrplogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; + fi + fi + fi + + # Count total amount of files removed. + countlogs=$((scriptcount + consolecount + gamecount + srcdscount + smcount + ulxcount + darkrpcount)) + # Job done. + fn_print_ok "Removed ${countlogs} log files" + fn_script_log "Removed ${countlogs} log files" +fi diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh new file mode 100755 index 000000000..388a64a9d --- /dev/null +++ b/lgsm/functions/core_messages.sh @@ -0,0 +1,563 @@ +#!/bin/bash +# LinuxGSM core_messages.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Defines on-screen messages such as [ OK ] and how script logs look. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# nl: new line: message is following by a new line. +# eol: end of line: message is placed at the end of the current line. +fn_ansi_loader(){ + if [ "${ansi}" != "off" ]; then + # echo colors + default="\e[0m" + black="\e[30m" + red="\e[31m" + lightred="\e[91m" + green="\e[32m" + lightgreen="\e[92m" + yellow="\e[33m" + lightyellow="\e[93m" + blue="\e[34m" + lightblue="\e[94m" + magenta="\e[35m" + lightmagenta="\e[95m" + cyan="\e[36m" + lightcyan="\e[96m" + darkgrey="\e[90m" + lightgrey="\e[37m" + white="\e[97m" + fi + # carriage return & erase to end of line. + creeol="\r\033[K" +} + +fn_sleep_time(){ + if [ "${sleeptime}" != "0" ]||[ "${travistest}" != "1" ]; then + if [ -z "${sleeptime}" ]; then + sleeptime=0.5 + fi + sleep "${sleeptime}" + fi +} + +# Log display +######################## +## Feb 28 14:56:58 ut99-server: Monitor: +fn_script_log(){ + if [ -d "${lgsmlogdir}" ]; then + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: ${1}" >> "${lgsmlog}" + else + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${1}" >> "${lgsmlog}" + fi + fi +} + +## Feb 28 14:56:58 ut99-server: Monitor: PASS: +fn_script_log_pass(){ + if [ -d "${lgsmlogdir}" ]; then + + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: PASS: ${1}" >> "${lgsmlog}" + else + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: PASS: ${1}" >> "${lgsmlog}" + fi + fi + exitcode=0 +} + +## Feb 28 14:56:58 ut99-server: Monitor: FATAL: +fn_script_log_fatal(){ + if [ -d "${lgsmlogdir}" ]; then + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: FATAL: ${1}" >> "${lgsmlog}" + else + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: FATAL: ${1}" >> "${lgsmlog}" + fi + fi + exitcode=1 +} + +## Feb 28 14:56:58 ut99-server: Monitor: ERROR: +fn_script_log_error(){ + if [ -d "${lgsmlogdir}" ]; then + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: ERROR: ${1}" >> "${lgsmlog}" + else + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ERROR: ${1}" >> "${lgsmlog}" + fi + fi + exitcode=2 +} + +## Feb 28 14:56:58 ut99-server: Monitor: WARN: +fn_script_log_warn(){ + if [ -d "${lgsmlogdir}" ]; then + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: WARN: ${1}" >> "${lgsmlog}" + else + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: WARN: ${1}" >> "${lgsmlog}" + fi + fi + exitcode=3 +} + +## Feb 28 14:56:58 ut99-server: Monitor: INFO: +fn_script_log_info(){ + if [ -d "${lgsmlogdir}" ]; then + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: INFO: ${1}" >> "${lgsmlog}" + else + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: INFO: ${1}" >> "${lgsmlog}" + fi + fi +} + +## Feb 28 14:56:58 ut99-server: Monitor: INFO: +fn_script_log_update(){ + if [ -d "${lgsmlogdir}" ]; then + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: UPDATE: ${1}" >> "${lgsmlog}" + else + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: UPDATE: ${1}" >> "${lgsmlog}" + fi + fi +} + +# On-Screen - Automated functions +################################## + +# [ .... ] +fn_print_dots(){ + if [ "${commandaction}" ]; then + echo -en "${creeol}[ .... ] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[ .... ] $*" + fi + fn_sleep_time +} + +fn_print_dots_nl(){ + if [ "${commandaction}" ]; then + echo -e "${creeol}[ .... ] ${commandaction} ${selfname}: $*" + else + echo -e "${creeol}[ .... ] $*" + fi + fn_sleep_time + echo -en "\n" +} + +# [ OK ] +fn_print_ok(){ + if [ "${commandaction}" ]; then + echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${green} OK ${default}] $*" + fi + fn_sleep_time +} + +fn_print_ok_nl(){ + if [ "${commandaction}" ]; then + echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${green} OK ${default}] $*" + fi + fn_sleep_time + echo -en "\n" +} + +# [ FAIL ] +fn_print_fail(){ + if [ "${commandaction}" ]; then + echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${red} FAIL ${default}] $*" + fi + fn_sleep_time +} + +fn_print_fail_nl(){ + if [ "${commandaction}" ]; then + echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${red} FAIL ${default}] $*" + fi + fn_sleep_time + echo -en "\n" +} + +# [ ERROR ] +fn_print_error(){ + if [ "${commandaction}" ]; then + echo -en "${creeol}[${red} ERROR ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${red} ERROR ${default}] $*" + fi + fn_sleep_time +} + +fn_print_error_nl(){ + if [ "${commandaction}" ]; then + echo -en "${creeol}[${red} ERROR ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${red} ERROR ${default}] $*" + fi + fn_sleep_time + echo -en "\n" +} + +# [ WARN ] +fn_print_warn(){ + if [ "${commandaction}" ]; then + echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${lightyellow} WARN ${default}] $*" + fi + fn_sleep_time +} + +fn_print_warn_nl(){ + if [ "${commandaction}" ]; then + echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${lightyellow} WARN ${default}] $*" + fi + fn_sleep_time + echo -en "\n" +} + +# [ INFO ] +fn_print_info(){ + if [ "${commandaction}" ]; then + echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${cyan} INFO ${default}] $*" + fi + fn_sleep_time +} + +fn_print_info_nl(){ + if [ "${commandaction}" ]; then + echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${cyan} INFO ${default}] $*" + fi + fn_sleep_time + echo -en "\n" +} + +# [ START ] +fn_print_start(){ + if [ "${commandaction}" ]; then + echo -en "${creeol}[${lightgreen} START ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${lightgreen} START ${default}] $*" + fi + fn_sleep_time +} + +fn_print_start_nl(){ + if [ "${commandaction}" ]; then + echo -en "${creeol}[${lightgreen} START ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${lightgreen} START ${default}] $*" + fi + fn_sleep_time + echo -en "\n" +} + +# On-Screen - Interactive messages +################################## + +# No More Room in Hell Debug +# ================================= +fn_print_header(){ + echo -e "" + echo -e "${lightyellow}${gamename} ${commandaction}${default}" + echo -e "=================================${default}" +} + +# Complete! +fn_print_complete(){ + echo -en "${green}Complete!${default} $*" + fn_sleep_time +} + +fn_print_complete_nl(){ + echo -e "${green}Complete!${default} $*" + fn_sleep_time +} + +# Failure! +fn_print_failure(){ + echo -en "${red}Failure!${default} $*" + fn_sleep_time +} + +fn_print_failure_nl(){ + echo -e "${red}Failure!${default} $*" + fn_sleep_time +} + +# Error! +fn_print_error2(){ + echo -en "${red}Error!${default} $*" + fn_sleep_time +} + +fn_print_error2_nl(){ + echo -e "${red}Error!${default} $*" + fn_sleep_time +} + +# Warning! +fn_print_warning(){ + echo -en "${lightyellow}Warning!${default} $*" + fn_sleep_time +} + +fn_print_warning_nl(){ + echo -e "${lightyellow}Warning!${default} $*" + fn_sleep_time +} + +# Information! +fn_print_information(){ + echo -en "${cyan}Information!${default} $*" + fn_sleep_time +} + +fn_print_information_nl(){ + echo -e "${cyan}Information!${default} $*" + fn_sleep_time +} + +# Y/N Prompt +fn_prompt_yn(){ + local prompt="$1" + local initial="$2" + + if [ "${initial}" == "Y" ]; then + prompt+=" [Y/n] " + elif [ "${initial}" == "N" ]; then + prompt+=" [y/N] " + else + prompt+=" [y/n] " + fi + + while true; do + read -e -i "${initial}" -p "${prompt}" -r yn + case "${yn}" in + [Yy]|[Yy][Ee][Ss]) return 0 ;; + [Nn]|[Nn][Oo]) return 1 ;; + *) echo -e "Please answer yes or no." ;; + esac + done +} + +# On-Screen End of Line +################################## + +# OK +fn_print_ok_eol(){ + echo -en "${green}OK${default}" + fn_sleep_time +} + +fn_print_ok_eol_nl(){ + echo -e "${green}OK${default}" + fn_sleep_time +} + +# FAIL +fn_print_fail_eol(){ + echo -en "${red}FAIL${default}" + fn_sleep_time +} + +fn_print_fail_eol_nl(){ + echo -e "${red}FAIL${default}" + fn_sleep_time +} + +# ERROR +fn_print_error_eol(){ + echo -en "${red}ERROR${default}" + fn_sleep_time +} + +fn_print_error_eol_nl(){ + echo -e "${red}ERROR${default}" + fn_sleep_time +} + +# WAIT +fn_print_wait_eol(){ + echo -en "${cyan}WAIT${default}" + fn_sleep_time +} + +fn_print_wait_eol_nl(){ + echo -e "${cyan}WAIT${default}" + fn_sleep_time +} + +# WARN +fn_print_warn_eol(){ + echo -en "${lightyellow}WARN${default}" + fn_sleep_time +} + +fn_print_warn_eol_nl(){ + echo -e "${lightyellow}WARN${default}" + fn_sleep_time +} + +# INFO +fn_print_info_eol(){ + echo -en "${cyan}INFO${default}" + fn_sleep_time +} + +fn_print_info_eol_nl(){ + echo -e "${cyan}INFO${default}" + fn_sleep_time +} + +# QUERYING +fn_print_querying_eol(){ + echo -en "${cyan}QUERYING${default}" + fn_sleep_time +} + +fn_print_querying_eol_nl(){ + echo -e "${cyan}QUERYING${default}" + fn_sleep_time +} + +# CHECKING +fn_print_checking_eol(){ + echo -en "${cyan}CHECKING${default}" + fn_sleep_time +} + +fn_print_checking_eol_nl(){ + echo -e "${cyan}CHECKING${default}" + fn_sleep_time +} + +# DELAY +fn_print_delay_eol(){ + echo -en "${green}DELAY${default}" + fn_sleep_time +} + +fn_print_delay_eol_nl(){ + echo -e "${green}DELAY${default}" + fn_sleep_time +} + +# CANCELED +fn_print_canceled_eol(){ + echo -en "${lightyellow}CANCELED${default}" + fn_sleep_time +} + +fn_print_canceled_eol_nl(){ + echo -e "${lightyellow}CANCELED${default}" + fn_sleep_time +} + +# REMOVED +fn_print_removed_eol(){ + echo -en "${red}REMOVED${default}" + fn_sleep_time +} + +fn_print_removed_eol_nl(){ + echo -e "${red}REMOVED${default}" + fn_sleep_time +} + +# UPDATE +fn_print_update_eol(){ + echo -en "${cyan}UPDATE${default}" + fn_sleep_time +} + +fn_print_update_eol_nl(){ + echo -e "${cyan}UPDATE${default}" + fn_sleep_time +} + +fn_print_ascii_logo(){ + echo -e "" + echo -e " mdMMMMbm" + echo -e " mMMMMMMMMMMm" + echo -e " mMMMMMMMMMMMMm" + echo -e " mMMMMMMMMMMMMMMm" + echo -e " hMMMV^VMMV^VMMMh" + echo -e " MMMMM MM MMMMM" + echo -e " hMMs vv sMMh" + echo -e " hMMM: :MMMh" + echo -e " .hMMMh hMMMh." + echo -e " -dMMMh ${lightgrey}__${default} hMMMd-" + echo -e " :mMMMs ${lightgrey}||${default} sMMMm:" + echo -e " :MMMM+ ${lightgrey}||${default} ${red}_${default} +NMMN:" + echo -e " .mMMM+ ${lightgrey}========${default} +MMMm." + echo -e " yMMMy ${darkgrey}##############${default} yMMMy" + echo -e " mMMM: ${darkgrey}##############${default} :MMMm" + echo -e " mMM ${lightyellow}nn${default} ${lightyellow}nn${default} ${lightyellow}nn${default} ${lightyellow}nn${default} MMm" + echo -e " o ${lightyellow}nNNNNNNNn${default} ${lightyellow}nNNNNNNNn${default} o" + echo -e " ${lightyellow}nNNNNNNNNNn${default} ${lightyellow}nNNNNNNNNNn${default}" + echo -e " ${lightyellow}nNNNNNNNNNNN${default} ${lightyellow}NNNNNNNNNNNn${default}" + echo -e " ${lightyellow}+NNNNNNNNN:${default} ${lightyellow}:NNNNNNNNN+${default}" + echo -e " ${lightyellow}nNNNNNNN${default} /\ ${lightyellow}NNNNNNNn${default}" + echo -e " ${lightyellow}nnnnn${default} db ${lightyellow}nnnnn${default}" + echo -e "" + echo -e "${lightyellow}888${default} ${lightyellow}d8b${default} ${default}.d8888b. .d8888b. 888b d888" + echo -e "${lightyellow}888 Y8P ${default}d88P Y88b d88P Y88b 8888b d8888" + echo -e "${lightyellow}888${default} ${default}888${default} 888 Y88b. 88888b.d88888" + echo -e "${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}88888b.${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} 888 Y888b. 888Y88888P888" + echo -e "${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}88b${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}Y8bd8P${default} 888 88888 Y88b. 888 Y888P 888" + echo -e "${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}X88K${default} 888 888 888 888 Y8P 888" + echo -e "${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}Y88b${default} ${lightyellow}88Y${default} ${lightyellow}.d8pq8b.${default} Y88b d88P Y88b d88P 888 * 888" + echo -e "${lightyellow}LinuxGSM${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}Y8888Y${default} ${lightyellow}888${default} ${lightyellow}888${default} Y2012P88 Y8888P 888 888" + echo -e "" +} + +fn_print_restart_warning(){ + fn_print_warn "${selfname} will be restarted" + fn_script_log_warn "${selfname} will be restarted" + totalseconds=3 + for seconds in {3..1}; do + fn_print_warn "${selfname} will be restarted: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + sleep 1 + if [ "${seconds}" == "0" ]; then + break + fi + done + fn_print_warn_nl "${selfname} will be restarted" +} + +# Functions below are used to ensure that logs and UI correctly reflect the command it is actually running. +# Useful when a command has to call upon another command causing the other command to overrite commandname variables + +# Used to remember the command that ran first. +fn_firstcommand_set(){ + if [ -z "${firstcommandname}" ]; then + firstcommandname="${commandname}" + firstcommandaction="${commandaction}" + fi +} + +# Used to reset commandname variables to the command the script ran first. +fn_firstcommand_reset(){ + commandname="${firstcommandname}" + commandaction="${firstcommandaction}" +} diff --git a/lgsm/functions/core_steamcmd.sh b/lgsm/functions/core_steamcmd.sh new file mode 100644 index 000000000..86c71b708 --- /dev/null +++ b/lgsm/functions/core_steamcmd.sh @@ -0,0 +1,323 @@ +#!/bin/bash +# LinuxGSM core_steamcmd.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Core functions for SteamCMD + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_install_steamcmd(){ + if [ "${shortname}" == "ark" ]&&[ "${installsteamcmd}" == "1" ]; then + steamcmddir="${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" + fi + if [ ! -d "${steamcmddir}" ]; then + mkdir -p "${steamcmddir}" + fi + fn_fetch_file "http://media.steampowered.com/client/steamcmd_linux.tar.gz" "" "" "" "${tmpdir}" "steamcmd_linux.tar.gz" "" "norun" "noforce" "nomd5" + fn_dl_extract "${tmpdir}" "steamcmd_linux.tar.gz" "${steamcmddir}" + chmod +x "${steamcmddir}/steamcmd.sh" +} + +fn_check_steamcmd_user(){ + # Checks if steamuser is setup. + if [ "${steamuser}" == "username" ]; then + fn_print_fail_nl "Steam login not set. Update steamuser in ${configdirserver}" + echo -e " * Change steamuser=\"username\" to a valid steam login." + if [ -d "${lgsmlogdir}" ]; then + fn_script_log_fatal "Steam login not set. Update steamuser in ${configdirserver}" + fi + core_exit.sh + fi + # Anonymous user is set if steamuser is missing. + if [ -z "${steamuser}" ]; then + if [ -d "${lgsmlogdir}" ]; then + fn_script_log_info "Using anonymous Steam login" + fi + steamuser="anonymous" + steampass='' + fi +} + +fn_check_steamcmd(){ + # Checks if SteamCMD exists when starting or updating a server. + # Only install if steamcmd package is missing or steamcmd dir is missing. + if [ ! -f "${steamcmddir}/steamcmd.sh" ]&&[ -z "$(command -v steamcmd 2>/dev/null)" ]; then + if [ "${commandname}" == "INSTALL" ]; then + fn_install_steamcmd + else + fn_print_warn_nl "SteamCMD is missing" + fn_script_log_warn "SteamCMD is missing" + fn_install_steamcmd + fi + elif [ "${commandname}" == "INSTALL" ]; then + fn_print_information "SteamCMD is already installed..." + fn_print_ok_eol_nl + fi +} + +fn_check_steamcmd_dir(){ + # Worksround that pre-installs the correct steam directories to ensure all packages use the correct Standard. + # https://github.com/ValveSoftware/steam-for-linux/issues/6976#issuecomment-610446347 + + # Create Steam installation directory. + if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then + mkdir -p "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" + fi + + # Create common Steam directory. + if [ ! -d "${HOME}/.steam" ]; then + mkdir -p "${HOME}/.steam" + fi + + # Symbolic links to Steam installation directory. + if [ ! -L "${HOME}/.steam/root" ]; then + if [ -d "${HOME}/.steam/root" ]; then + rm "${HOME}/.steam/root" + fi + ln -s "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" "${HOME}/.steam/root" + fi + + if [ ! -L "${HOME}/.steam/steam" ]; then + if [ -d "${HOME}/.steam/steam" ]; then + rm -rf "${HOME}/.steam/steam" + fi + ln -s "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" "${HOME}/.steam/steam" + fi +} + +fn_check_steamcmd_dir_legacy(){ + # Remove old Steam installation directories ~/Steam and ${rootdir}/steamcmd + if [ -d "${rootdir}/steamcmd" ]&&[ "${steamcmddir}" == "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then + rm -rf "${rootdir:?}/steamcmd" + fi + + if [ -d "${HOME}/Steam" ]&&[ "${steamcmddir}" == "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then + rm -rf "${HOME}/Steam" + fi +} + +fn_check_steamcmd_ark(){ + # Checks if SteamCMD exists in + # Engine/Binaries/ThirdParty/SteamCMD/Linux + # to allow ark mods to work + if [ ! -f "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamcmd.sh" ]; then + installsteamcmd=1 + if [ "${commandname}" == "INSTALL" ]; then + fn_install_steamcmd + else + fn_print_warn_nl "ARK mods SteamCMD is missing" + fn_script_log_warn "ARK mods SteamCMD is missing" + fn_install_steamcmd + fi + elif [ "${commandname}" == "INSTALL" ]; then + fn_print_information "ARK mods SteamCMD is already installed..." + fn_print_ok_eol_nl + fi +} + +fn_check_steamcmd_clear(){ + # Will remove steamcmd dir if steamcmd package is installed. + if [ "$(command -v steamcmd 2>/dev/null)" ]&&[ -d "${rootdir}/steamcmd" ]; then + rm -rf "${steamcmddir:?}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "Removing ${rootdir}/steamcmd" + else + fn_script_log_pass "Removing ${rootdir}/steamcmd" + fi + fi +} + +fn_check_steamcmd_exec(){ + if [ "$(command -v steamcmd 2>/dev/null)" ]; then + steamcmdcommand="steamcmd" + else + steamcmdcommand="./steamcmd.sh" + fi +} + +fn_update_steamcmd_localbuild(){ + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + fn_appmanifest_check + # Uses appmanifest to find local build. + localbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) + + # Set branch to public if no custom branch. + if [ -z "${branch}" ]; then + branch="public" + fi + + # Checks if localbuild variable has been set. + if [ -z "${localbuild}" ]||[ "${localbuild}" == "null" ]; then + fn_print_fail "Checking local build: ${remotelocation}" + fn_script_log_fatal "Checking local build" + core_exit.sh + else + fn_print_ok "Checking local build: ${remotelocation}" + fn_script_log_pass "Checking local build" + fi +} + +fn_update_steamcmd_remotebuild(){ + # Gets remote build info. + if [ -d "${steamcmddir}" ]; then + cd "${steamcmddir}" || exit + fi + + # Removes appinfo.vdf as a fix for not always getting up to date version info from SteamCMD. + if [ "$(find "${HOME}" -type f -name "appinfo.vdf" | wc -l)" -ne "0" ]; then + find "${HOME}" -type f -name "appinfo.vdf" -exec rm -f {} \; + fi + + # password for branch not needed to check the buildid + remotebuild=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]') + + if [ "${firstcommandname}" != "INSTALL" ]; then + fn_print_dots "Checking remote build: ${remotelocation}" + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_fail "Checking remote build: ${remotelocation}" + fn_script_log_fatal "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking remote build: ${remotelocation}" + fn_script_log_pass "Checking remote build" + fi + else + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_failure "Unable to get remote build" + fn_script_log_fatal "Unable to get remote build" + core_exit.sh + fi + fi +} + +fn_update_steamcmd_compare(){ + fn_print_dots "Checking for update: ${remotelocation}" + if [ "${localbuild}" != "${remotebuild}" ]; then + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "Update available" + echo -e "* Local build: ${red}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuild}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + if [ -n "${betapassword}" ]; then + echo -e "* Branch password: ${betapassword}" + fi + echo -e "https://steamdb.info/app/${appid}/" + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + if [ -n "${betapassword}" ]; then + fn_script_log_info "Branch password: ${betapassword}" + fi + fn_script_log_info "${localbuild} > ${remotebuild}" + + if [ "${commandname}" == "UPDATE" ]; then + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + fn_dl_steamcmd + # If server started. + else + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + fn_dl_steamcmd + exitbypass=1 + command_start.sh + fn_firstcommand_reset + unset exitbypass + fi + date +%s > "${lockdir}/lastupdate.lock" + alert="update" + elif [ "${commandname}" == "CHECK-UPDATE" ]; then + alert="check-update" + fi + alert.sh + else + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "No update available" + echo -e "* Local build: ${green}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuild}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + if [ -n "${betapassword}" ]; then + echo -e "* Branch password: ${betapassword}" + fi + echo -e "https://steamdb.info/app/${appid}/" + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + if [ -n "${betapassword}" ]; then + fn_script_log_info "Branch password: ${betapassword}" + fi + fi +} + +fn_appmanifest_info(){ + appmanifestfile=$(find "${serverfiles}" -type f -name "appmanifest_${appid}.acf") + appmanifestfilewc=$(find "${serverfiles}" -type f -name "appmanifest_${appid}.acf" | wc -l) +} + +fn_appmanifest_check(){ + fn_appmanifest_info + # Multiple or no matching appmanifest files may sometimes be present. + # This error is corrected if required. + if [ "${appmanifestfilewc}" -ge "2" ]; then + fn_print_error "Multiple appmanifest_${appid}.acf files found" + fn_script_log_error "Multiple appmanifest_${appid}.acf files found" + fn_print_dots "Removing x${appmanifestfilewc} appmanifest_${appid}.acf files" + for appfile in ${appmanifestfile}; do + rm -f "${appfile:?}" + done + appmanifestfilewc1="${appmanifestfilewc}" + fn_appmanifest_info + # if error can not be resolved. + if [ "${appmanifestfilewc}" -ge "2" ]; then + fn_print_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" + fn_script_log_fatal "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" + echo -e "* Check user permissions" + for appfile in ${appmanifestfile}; do + echo -e " ${appfile}" + done + core_exit.sh + else + fn_print_ok "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files" + fn_script_log_pass "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files" + fn_print_info_nl "Forcing update to correct issue" + fn_script_log_info "Forcing update to correct issue" + fn_dl_steamcmd + fi + elif [ "${appmanifestfilewc}" -eq "0" ]; then + fn_print_error_nl "No appmanifest_${appid}.acf found" + fn_script_log_error "No appmanifest_${appid}.acf found" + fn_print_info_nl "Forcing update to correct issue" + fn_script_log_info "Forcing update to correct issue" + fn_dl_steamcmd + fn_appmanifest_info + if [ "${appmanifestfilewc}" -eq "0" ]; then + fn_print_fail_nl "Still no appmanifest_${appid}.acf found" + fn_script_log_fatal "Still no appmanifest_${appid}.acf found" + core_exit.sh + fi + fi +} diff --git a/lgsm/functions/core_trap.sh b/lgsm/functions/core_trap.sh new file mode 100755 index 000000000..a3eaf5675 --- /dev/null +++ b/lgsm/functions/core_trap.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# LinuxGSM core_trap.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles CTRL-C trap to give an exit code. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_exit_trap(){ + if [ -z "${exitcode}" ]; then + exitcode=$? + fi + echo -e "" + if [ -z "${exitcode}" ]; then + exitcode=0 + fi + core_exit.sh +} + +# trap to give an exit code. +trap fn_exit_trap INT diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh new file mode 100755 index 000000000..4418c184f --- /dev/null +++ b/lgsm/functions/fix.sh @@ -0,0 +1,121 @@ +#!/bin/bash +# LinuxGSM fix.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Overall function for managing fixes. +# Runs functions that will fix an issue. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Messages that are displayed for some fixes. +fn_fix_msg_start(){ + fn_print_dots "Applying ${fixname} fix: ${gamename}" + fn_print_info "Applying ${fixname} fix: ${gamename}" + fn_script_log_info "Applying ${fixname} fix: ${gamename}" +} + +fn_fix_msg_start_nl(){ + fn_print_dots "Applying ${fixname} fix: ${gamename}" + fn_print_info "Applying ${fixname} fix: ${gamename}" + fn_script_log_info "Applying ${fixname} fix: ${gamename}" +} + +fn_fix_msg_end(){ + if [ $? != 0 ]; then + fn_print_error_nl "Applying ${fixname} fix: ${gamename}" + fn_script_log_error "Applying ${fixname} fix: ${gamename}" + else + fn_print_ok_nl "Applying ${fixname} fix: ${gamename}" + fn_script_log_pass "Applying ${fixname} fix: ${gamename}" + fi +} + +# Fixes that are run on start. +if [ "${commandname}" != "INSTALL" ]&&[ -z "${fixbypass}" ]; then + if [ "${appid}" ]; then + fix_steamcmd.sh + fi + + if [ "${shortname}" == "arma3" ]; then + fix_arma3.sh + elif [ "${shortname}" == "ark" ]; then + fix_ark.sh + elif [ "${shortname}" == "bo" ]; then + fix_bo.sh + elif [ "${shortname}" == "csgo" ]; then + fix_csgo.sh + elif [ "${shortname}" == "cmw" ]; then + fix_cmw.sh + elif [ "${shortname}" == "dst" ]; then + fix_dst.sh + elif [ "${shortname}" == "hw" ]; then + fix_hw.sh + elif [ "${shortname}" == "ins" ]; then + fix_ins.sh + elif [ "${shortname}" == "nmrih" ]; then + fix_nmrih.sh + elif [ "${shortname}" == "onset" ]; then + fix_onset.sh + elif [ "${shortname}" == "rust" ]; then + fix_rust.sh + elif [ "${shortname}" == "rw" ]; then + fix_rw.sh + elif [ "${shortname}" == "sdtd" ]; then + fix_sdtd.sh + elif [ "${shortname}" == "sfc" ]; then + fix_sfc.sh + elif [ "${shortname}" == "sof2" ]; then + fix_sof2.sh + elif [ "${shortname}" == "squad" ]; then + fix_squad.sh + elif [ "${shortname}" == "st" ]; then + fix_st.sh + elif [ "${shortname}" == "tf2" ]; then + fix_tf2.sh + elif [ "${shortname}" == "terraria" ]; then + fix_terraria.sh + elif [ "${shortname}" == "ts3" ]; then + fix_ts3.sh + elif [ "${shortname}" == "mcb" ]; then + fix_mcb.sh + elif [ "${shortname}" == "mta" ]; then + fix_mta.sh + elif [ "${shortname}" == "unt" ]; then + fix_unt.sh + elif [ "${shortname}" == "wurm" ]; then + fix_wurm.sh + elif [ "${shortname}" == "zmr" ]; then + fix_zmr.sh + fi +fi + +# Fixes that are run on install only. +if [ "${commandname}" == "INSTALL" ]; then + if [ "${shortname}" == "av" ]||[ "${shortname}" == "cmw" ]||[ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "onset" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "samp" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then + echo -e "" + echo -e "Applying Post-Install Fixes" + echo -e "=================================" + fn_sleep_time + postinstall=1 + if [ "${shortname}" == "av" ]; then + fix_av.sh + elif [ "${shortname}" == "kf" ]; then + fix_kf.sh + elif [ "${shortname}" == "kf2" ]; then + fix_kf2.sh + elif [ "${shortname}" == "ro" ]; then + fix_ro.sh + elif [ "${shortname}" == "samp" ]; then + fix_samp.sh + elif [ "${shortname}" == "ut2k4" ]; then + fix_ut2k4.sh + elif [ "${shortname}" == "ut" ]; then + fix_ut.sh + elif [ "${shortname}" == "ut3" ]; then + fix_ut3.sh + else + fn_print_information_nl "No fixes required." + fi + fi +fi diff --git a/lgsm/functions/fix_ark.sh b/lgsm/functions/fix_ark.sh new file mode 100755 index 000000000..da0097cab --- /dev/null +++ b/lgsm/functions/fix_ark.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# LinuxGSM fix_ark.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with ARK: Survival Evolved. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# removes mulitple appworkshop_346110.acf if found. +steamappsfilewc="$(find "${HOME}" -name appworkshop_346110.acf | wc -l)" +if [ "${steamappsfilewc}" -gt "1" ]; then + fixname="multiple appworkshop acf files" + fn_fix_msg_start + find "${HOME}" -name appworkshop_346110.acf -exec rm -f {} \; + fn_fix_msg_end +elif [ "${steamappsfilewc}" -eq "1" ]; then + # Steam mods directory selecter + # This allows LinxuGSM to select either ~/.steam or ~/Steam. depending on what is being used + steamappsfile=$(find "${HOME}" -name appworkshop_346110.acf) + steamappsdir=$(dirname "${steamappsfile}") + steamappspath=$(cd "${steamappsdir}" || return; cd ../;pwd) + + # removes the symlink if exists. + # fixes issue with older versions of LinuxGSM linking to /home/arkserver/steamcmd + if [ -L "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" ]; then + fixname="broken SteamCMD symlink" + fn_fix_msg_start + unlink "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux" + fn_fix_msg_end + check_steamcmd.sh + fi + + # removed ARK steamcmd directory if steamcmd is missing. + if [ ! -f "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamcmd.sh" ]; then + fixname="remove invalid ARK SteamCMD directory" + fn_fix_msg_start + rm -rf "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux" + fn_fix_msg_end + check_steamcmd.sh + fi + + # if the steamapps symlink is incorrect unlink it. + if [ -d "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" ]&&[ -L "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ]&&[ "$(readlink "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps")" != "${steamappspath}" ]; then + fixname="incorrect steamapps symlink" + fn_fix_msg_start + unlink "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" + fn_fix_msg_end + fi + + # Put symlink to steamapps directory into the ARK SteamCMD directory to link the downloaded mods to the correct location. + if [ ! -L "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ]; then + fixname="steamapps symlink" + fn_fix_msg_start + ln -s "${steamappspath}" "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" + fn_fix_msg_end + fi +fi diff --git a/lgsm/functions/fix_arma3.sh b/lgsm/functions/fix_arma3.sh new file mode 100755 index 000000000..bdd85af71 --- /dev/null +++ b/lgsm/functions/fix_arma3.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# LinuxGSM fix_arma3.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves an issue with ARMA3. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: 20150 Segmentation fault (core dumped) error. +if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3" ]||[ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3 - Other Profiles" ]; then + fixname="20150 Segmentation fault (core dumped)" + fn_fix_msg_start + mkdir -p "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3 - Other Profiles" + fn_fix_msg_end +fi diff --git a/lgsm/functions/fix_av.sh b/lgsm/functions/fix_av.sh new file mode 100755 index 000000000..6aed64f5e --- /dev/null +++ b/lgsm/functions/fix_av.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LinuxGSM fix_av.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves startup issue with Avorion + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" + +if [ "${postinstall}" == "1" ]; then + fn_parms(){ + parms="--datapath ${avdatapath} --galaxy-name ${selfname} --init-folders-only" + } + + fn_print_information "starting ${gamename} server to generate configs." + fn_sleep_time + # go to the executeable dir and start the init of the server + cd "${systemdir}" || return 2 + fn_parms + "${executabledir}/${executable}" ${parms} +fi diff --git a/lgsm/functions/fix_bo.sh b/lgsm/functions/fix_bo.sh new file mode 100644 index 000000000..453691874 --- /dev/null +++ b/lgsm/functions/fix_bo.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_hw.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Ballistic Overkill. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/BODS_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_cmw.sh b/lgsm/functions/fix_cmw.sh new file mode 100755 index 000000000..192f483e8 --- /dev/null +++ b/lgsm/functions/fix_cmw.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LinuxGSM fix_cmw.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves the issue of the not starting server on linux + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ ! -f "${executabledir}/steam_appid.txt" ]; then + fixname="steam_appid.txt" + fn_fix_msg_start + echo 219640 > "${executabledir}/steam_appid.txt" + fn_fix_msg_end +fi + +if [ ! -f "${servercfgfullpath}" ]; then + fn_fix_msg_start + fixname="copy config" + mkdir "${servercfgdir}" + cp "${systemdir}/UDKGame/Config/"*.ini "${servercfgdir}" + fn_fix_msg_end +fi diff --git a/lgsm/functions/fix_csgo.sh b/lgsm/functions/fix_csgo.sh new file mode 100755 index 000000000..be59c42ec --- /dev/null +++ b/lgsm/functions/fix_csgo.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# LinuxGSM fix_csgo.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with CS:GO. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: server not always creating steam_appid.txt file. +if [ ! -f "${serverfiles}/steam_appid.txt" ]; then + fixname="730 steam_appid.txt" + fn_fix_msg_start + echo -n "730" >> "${serverfiles}/steam_appid.txt" + fn_fix_msg_end +fi + +# Fixes: Error parsing BotProfile.db - unknown attribute 'Rank'". +if [ -f "${systemdir}/botprofile.db" ] && grep "^\s*Rank" "${systemdir}/botprofile.db" > /dev/null 2>&1; then + fixname="botprofile.db" + fn_fix_msg_start + sed -i 's/^\s*Rank/\t\/\/Rank/g' "${systemdir}/botprofile.db" > /dev/null 2>&1 + fn_fix_msg_end +fi + +# Fixes: Unknown command "cl_bobamt_vert" and exec: couldn't exec joystick.cfg. +if [ -f "${servercfgdir}/valve.rc" ] && grep -E '^\s*exec\s*(default|joystick)\.cfg' "${servercfgdir}/valve.rc" > /dev/null 2>&1; then + fixname="valve.rc" + fn_fix_msg_start + sed -i 's/^\s*exec\s*default.cfg/\/\/exec default.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1 + sed -i 's/^\s*exec\s*joystick.cfg/\/\/exec joystick.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1 + fn_fix_msg_end +fi diff --git a/lgsm/functions/fix_dst.sh b/lgsm/functions/fix_dst.sh new file mode 100755 index 000000000..49fce22e3 --- /dev/null +++ b/lgsm/functions/fix_dst.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# LinuxGSM fix_dst.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Don't Starve Together. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: ./dontstarve_dedicated_server_nullrenderer: ./lib32/libcurl-gnutls.so.4: no version information available (required by ./dontstarve_dedicated_server_nullrenderer). +# Issue only occures on CentOS as libcurl-gnutls.so.4 is called libcurl.so.4 on CentOS. +if [ -f "/etc/redhat-release" ]&&[ ! -f "${serverfiles}/bin/lib32/libcurl-gnutls.so.4" ]; then + fixname="libcurl-gnutls.so.4" + fn_fix_msg_start + ln -s "/usr/lib/libcurl.so.4" "${serverfiles}/bin/lib32/libcurl-gnutls.so.4" + fn_fix_msg_end +fi diff --git a/lgsm/functions/fix_hw.sh b/lgsm/functions/fix_hw.sh new file mode 100755 index 000000000..af06924db --- /dev/null +++ b/lgsm/functions/fix_hw.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_hw.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Hurtworld. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/Hurtworld_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_ins.sh b/lgsm/functions/fix_ins.sh new file mode 100755 index 000000000..21a979c4c --- /dev/null +++ b/lgsm/functions/fix_ins.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# LinuxGSM fix_ins.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Insurgency. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: ./srcds_linux: error while loading shared libraries: libtier0.so: cannot open shared object file: No such file or directory. + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/bin" + +# Fixes: issue #529 - gamemode not passed to debug or start. + +if [ "${commandname}" == "DEBUG" ]; then + defaultmap="\"${defaultmap}\"" +else + defaultmap="\\\"${defaultmap}\\\"" +fi diff --git a/lgsm/functions/fix_kf.sh b/lgsm/functions/fix_kf.sh new file mode 100755 index 000000000..e749a2d27 --- /dev/null +++ b/lgsm/functions/fix_kf.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# LinuxGSM fix_kf.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Killing Floor. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "Applying WebAdmin ROOst.css fix." +echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" +sed -i 's/none}/none;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" +sed -i 's/underline}/underline;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" +fn_sleep_time +echo -e "Applying WebAdmin CharSet fix." +echo -e "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" +sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/UWeb.int" +fn_sleep_time +echo -e "applying server name fix." +fn_sleep_time +echo -e "forcing server restart..." +fn_sleep_time +exitbypass=1 +command_start.sh +fn_firstcommand_reset +sleep 5 +exitbypass=1 +command_stop.sh +fn_firstcommand_reset +exitbypass=1 +command_start.sh +fn_firstcommand_reset +sleep 5 +exitbypass=1 +command_stop.sh +fn_firstcommand_reset diff --git a/lgsm/functions/fix_kf2.sh b/lgsm/functions/fix_kf2.sh new file mode 100755 index 000000000..d9f8c82b4 --- /dev/null +++ b/lgsm/functions/fix_kf2.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# LinuxGSM fix_kf2.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Killing Floor 2. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_parms(){ +parms="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\"" +} + +fn_print_information "starting ${gamename} server to generate configs." +fn_sleep_time +exitbypass=1 +command_start.sh +fn_firstcommand_reset +sleep 10 +exitbypass=1 +command_stop.sh +fn_firstcommand_reset diff --git a/lgsm/functions/fix_mcb.sh b/lgsm/functions/fix_mcb.sh new file mode 100755 index 000000000..4768a40cf --- /dev/null +++ b/lgsm/functions/fix_mcb.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# LinuxGSM fix_mcb.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves possible startup issue with Minecraft Bedrock. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# official docs state that the server should be started with: LD_LIBRARY_PATH=. ./bedrock_server +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" diff --git a/lgsm/functions/fix_mta.sh b/lgsm/functions/fix_mta.sh new file mode 100755 index 000000000..2c92e8d12 --- /dev/null +++ b/lgsm/functions/fix_mta.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# LinuxGSM fix_mta.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Installs the libmysqlclient for database functions on the server. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ ! -f "${lgsmdir}/lib/libmysqlclient.so.16" ]; then + fixname="libmysqlclient16" + fn_fix_msg_start_nl + fn_sleep_time + fn_fetch_file "https://nightly.mtasa.com/files/modules/64/libmysqlclient.so.16" "" "" "" "${lgsmdir}/lib" "libmysqlclient.so.16" "chmodx" "norun" "noforce" "6c188e0f8fb5d7a29f4bc413b9fed6c2" + fn_fix_msg_end +fi diff --git a/lgsm/functions/fix_nmrih.sh b/lgsm/functions/fix_nmrih.sh new file mode 100755 index 000000000..4bb70c6f9 --- /dev/null +++ b/lgsm/functions/fix_nmrih.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# LinuxGSM fix_nmrih.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Create symlinks for renamed No More Room In Hell serverfiles. +# Solution from Steam Community post: https://steamcommunity.com/app/224260/discussions/2/1732089092441769414/ + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +ln -s "${serverfiles}/bin/vphysics_srv.so" "${serverfiles}/bin/vphysics.so" +ln -s "${serverfiles}/bin/studiorender_srv.so" "${serverfiles}/bin/studiorender.so" +ln -s "${serverfiles}/bin/soundemittersystem_srv.so" "${serverfiles}/bin/soundemittersystem.so" +ln -s "${serverfiles}/bin/shaderapiempty_srv.so" "${serverfiles}/bin/shaderapiempty.so" +ln -s "${serverfiles}/bin/scenefilecache_srv.so" "${serverfiles}/bin/scenefilecache.so" +ln -s "${serverfiles}/bin/replay_srv.so" "${serverfiles}/bin/replay.so" +ln -s "${serverfiles}/bin/materialsystem_srv.so" "${serverfiles}/bin/materialsystem.so" diff --git a/lgsm/functions/fix_onset.sh b/lgsm/functions/fix_onset.sh new file mode 100755 index 000000000..c444c1ae9 --- /dev/null +++ b/lgsm/functions/fix_onset.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LinuxGSM fix_onset.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Onset. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" + +# Fixes: Failed loading "mariadb": libmariadbclient.so.18: cannot open shared object file: No such file or directory +# Issue only occures on CentOS as libmariadbclient.so.18 is called libmariadb.so.3 on CentOS. +if [ -f "/etc/redhat-release" ]&&[ ! -f "${serverfiles}/libmariadbclient.so.18" ]&&[ -f "/usr/lib64/libmariadb.so.3" ]; then + fixname="libmariadbclient.so.18" + fn_fix_msg_start + ln -s "/usr/lib64/libmariadb.so.3" "${serverfiles}/libmariadbclient.so.18" + fn_fix_msg_end +fi diff --git a/lgsm/functions/fix_ro.sh b/lgsm/functions/fix_ro.sh new file mode 100755 index 000000000..895c7c2da --- /dev/null +++ b/lgsm/functions/fix_ro.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# LinuxGSM fix_ro.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Red Orchestra. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "Applying WebAdmin ROOst.css fix." +echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" +sed -i 's/none}/none;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" +sed -i 's/underline}/underline;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" +fn_sleep_time +echo -e "Applying WebAdmin CharSet fix." +echo -e "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" +sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/uweb.int" +fn_sleep_time +echo -e "Applying Steam AppID fix." +sed -i 's/1210/1200/g' "${systemdir}/steam_appid.txt" +fn_sleep_time +echo -e "applying server name fix." +fn_sleep_time +echo -e "forcing server restart..." +fn_sleep_time +exitbypass=1 +command_start.sh +fn_firstcommand_reset +sleep 5 +exitbypass=1 +command_stop.sh +fn_firstcommand_reset +exitbypass=1 +command_start.sh +fn_firstcommand_reset +sleep 5 +exitbypass=1 +command_stop.sh +fn_firstcommand_reset diff --git a/lgsm/functions/fix_rust.sh b/lgsm/functions/fix_rust.sh new file mode 100755 index 000000000..1e62898df --- /dev/null +++ b/lgsm/functions/fix_rust.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# LinuxGSM fix_rust.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves startup issue with Rust. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: [Raknet] Server Shutting Down (Shutting Down). +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/RustDedicated_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_rw.sh b/lgsm/functions/fix_rw.sh new file mode 100755 index 000000000..aef41a703 --- /dev/null +++ b/lgsm/functions/fix_rw.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_rw.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Rising World. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" diff --git a/lgsm/functions/fix_samp.sh b/lgsm/functions/fix_samp.sh new file mode 100644 index 000000000..7a62bd4d1 --- /dev/null +++ b/lgsm/functions/fix_samp.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# LinuxGSM fix_sfc.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issue that the default rcon password is not changed + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ -f "${servercfgfullpath}" ]; then + # check if default password is set "changeme" + currentpass=$(grep -E "^rcon_password" "${servercfgfullpath}" | sed 's/^rcon_password //' ) + defaultpass="changeme" + # check if default password is set + if [ "${currentpass}" == "${defaultpass}" ]; then + fixname="change default rcon password" + fn_fix_msg_start + fn_script_log_info "changing rcon/admin password." + random=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) + rconpass="admin${random}" + sed -i "s/rcon_password changeme/rcon_password ${rconpass}/g" "${servercfgfullpath}" + fn_fix_msg_end + fi + # check if the hostname is the default name + currenthostname=$(grep -E "^hostname" "${servercfgfullpath}" | sed 's/^hostname //') + defaulthostname="SA-MP 0.3 Server" + if [ "${currenthostname}" == "${defaulthostname}" ]; then + fixname="change default hostname" + fn_fix_msg_start + fn_script_log_info "changing default hostname to LinuxGSM" + sed -i "s/hostname ${defaulthostname}/hostname LinuxGSM/g" "${servercfgfullpath}" + fn_fix_msg_end + fi +fi diff --git a/lgsm/functions/fix_sdtd.sh b/lgsm/functions/fix_sdtd.sh new file mode 100755 index 000000000..e93db7970 --- /dev/null +++ b/lgsm/functions/fix_sdtd.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_sdtd.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with 7 Days to Die. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}/7DaysToDieServer_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_sfc.sh b/lgsm/functions/fix_sfc.sh new file mode 100755 index 000000000..51b95b9d5 --- /dev/null +++ b/lgsm/functions/fix_sfc.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# LinuxGSM fix_sfc.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Source Forts Classic. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ ! -f "${serverfiles}/bin/datacache.so" ]; then + ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so" +fi + +if [ ! -f "${serverfiles}/bin/dedicated.so" ]; then + ln -s "${serverfiles}/bin/dedicated_srv.so" "${serverfiles}/bin/dedicated.so" +fi + +if [ ! -f "${serverfiles}/bin/engine.so" ]; then + ln -s "${serverfiles}/bin/engine_srv.so" "${serverfiles}/bin/engine.so" +fi + +if [ ! -f "${serverfiles}/bin/materialsystem.so" ]; then + ln -s "${serverfiles}/bin/materialsystem_srv.so" "${serverfiles}/bin/materialsystem.so" +fi + +if [ ! -f "${serverfiles}/bin/replay.so" ]; then + ln -s "${serverfiles}/bin/replay_srv.so" "${serverfiles}/bin/replay.so" +fi + +if [ ! -f "${serverfiles}/bin/shaderapiempty.so" ]; then + ln -s "${serverfiles}/bin/shaderapiempty_srv.so" "${serverfiles}/bin/shaderapiempty.so" +fi + +if [ ! -f "${serverfiles}/bin/soundemittersystem.so" ]; then + ln -s "${serverfiles}/bin/soundemittersystem_srv.so" "${serverfiles}/bin/soundemittersystem.so" +fi + +if [ ! -f "${serverfiles}/bin/studiorender.so" ]; then + ln -s "${serverfiles}/bin/studiorender_srv.so" "${serverfiles}/bin/studiorender.so" +fi + +if [ ! -f "${serverfiles}/bin/vphysics.so" ]; then + ln -s "${serverfiles}/bin/vphysics_srv.so" "${serverfiles}/bin/vphysics.so" +fi + +if [ ! -f "${serverfiles}/bin/scenefilecache.so" ]; then + ln -s "${serverfiles}/bin/scenefilecache_srv.so" "${serverfiles}/bin/scenefilecache.so" +fi diff --git a/lgsm/functions/fix_sof2.sh b/lgsm/functions/fix_sof2.sh new file mode 100755 index 000000000..002f42952 --- /dev/null +++ b/lgsm/functions/fix_sof2.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# LinuxGSM fix_rust.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Soldier of Fortune 2. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: error while loading shared libraries: libcxa.so.1 +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" diff --git a/lgsm/functions/fix_squad.sh b/lgsm/functions/fix_squad.sh new file mode 100644 index 000000000..b1ba1fde2 --- /dev/null +++ b/lgsm/functions/fix_squad.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# LinuxGSM fix_squad.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Squad. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# As the server base dir changed for the game, we need to migrate the default config from the old to the new location +oldservercfg="${serverfiles}/Squad/ServerConfig/${servercfg}" +if [ -f "${oldservercfg}" ]&&[ -f "${servercfgfullpath}" ]; then + # diff old and new config - if it is different move the old config over the new one + if [ "$(diff -c "${oldservercfg}" "${servercfgfullpath}" | wc -l)" -gt 0 ]; then + fixname="Migrate server config to new Game folder" + fn_fix_msg_start + mv -v "${oldservercfg}" "${servercfgfullpath}" + fn_fix_msg_end + else + fixname="remove the same config from old configdir" + fn_fix_msg_start + rm -f "${oldservercfg}" + fn_fix_msg_end + + fi +fi diff --git a/lgsm/functions/fix_st.sh b/lgsm/functions/fix_st.sh new file mode 100644 index 000000000..b9fb5b084 --- /dev/null +++ b/lgsm/functions/fix_st.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# LinuxGSM fix_rust.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves startup issue with Stationeers. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: [Raknet] Server Shutting Down (Shutting Down). +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/rocketstation_DedicatedServer_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_steamcmd.sh b/lgsm/functions/fix_steamcmd.sh new file mode 100755 index 000000000..5fb151bad --- /dev/null +++ b/lgsm/functions/fix_steamcmd.sh @@ -0,0 +1,100 @@ +#!/bin/bash +# LinuxGSM fix_steamcmd.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues related to SteamCMD. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# function to simplify the steamclient.so fix +# example +# fn_fix_steamclient_so 32|64 (bit) "${serverfiles}/linux32/" +fn_fix_steamclient_so(){ + # $1 type of fix 32 or 64 as possible values + # $2 as destination where the lib will be copied to + if [ "$1" == "32" ]; then + # steamclient.so x86 fix. + if [ ! -f "${2}/steamclient.so" ]; then + fixname="steamclient.so x86" + fn_fix_msg_start + if [ ! -d "${2}" ]; then + mkdir -p "${2}" + fi + if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then + cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${2}/steamclient.so" + elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then + cp "${steamcmddir}/linux32/steamclient.so" "${2}/steamclient.so" + fi + fn_fix_msg_end + fi + elif [ "$1" == "64" ]; then + # steamclient.so x86_64 fix. + if [ ! -f "${2}/steamclient.so" ]; then + fixname="steamclient.so x86_64" + fn_fix_msg_start + if [ ! -d "${2}" ]; then + mkdir -p "${2}" + fi + if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then + cp "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${2}/steamclient.so" + elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then + cp "${steamcmddir}/linux64/steamclient.so" "${2}/steamclient.so" + fi + fn_fix_msg_end + fi + fi +} + +# Helps fix: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so. +if [ ! -f "${HOME}/.steam/sdk64/steamclient.so" ]; then + fixname="steamclient.so sdk64" + fn_fix_msg_start + mkdir -p "${HOME}/.steam/sdk64" + if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then + cp "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${HOME}/.steam/sdk64/steamclient.so" + elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then + cp "${steamcmddir}/linux64/steamclient.so" "${HOME}/.steam/sdk64/steamclient.so" + fi + fn_fix_msg_end +fi + +# Helps fix: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so. +if [ ! -f "${HOME}/.steam/sdk32/steamclient.so" ]; then + fixname="steamclient.so sdk32" + fn_fix_msg_start + mkdir -p "${HOME}/.steam/sdk32" + if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then + cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so" + elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then + cp "${steamcmddir}/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so" + fi + fn_fix_msg_end +fi + +# steamclient.so fixes +if [ "${shortname}" == "bo" ]; then + fn_fix_steamclient_so "32" "${serverfiles}/BODS_Data/Plugins/x86" + fn_fix_steamclient_so "64" "${serverfiles}/BODS_Data/Plugins/x86_64" +elif [ "${shortname}" == "cmw" ]; then + fn_fix_steamclient_so "32" "${executabledir}/lib" +elif [ "${shortname}" == "cs" ]; then + fn_fix_steamclient_so "32" "${serverfiles}" +elif [ "${shortname}" == "col" ]; then + fn_fix_steamclient_so "64" "${serverfiles}" +elif [ "${shortname}" == "ins" ]; then + fn_fix_steamclient_so "32" "${serverfiles}/bin" +elif [ "${shortname}" == "pz" ]; then + fn_fix_steamclient_so "32" "${serverfiles}/linux32" + fn_fix_steamclient_so "64" "${serverfiles}/linux64" +elif [ "${shortname}" == "pvr" ]; then + fn_fix_steamclient_so "64" "${executabledir}" +elif [ "${shortname}" == "ss3" ]; then + fn_fix_steamclient_so "32" "${serverfiles}/Bin" +elif [ "${shortname}" == "tu" ];then + fn_fix_steamclient_so "64" "${executabledir}" +elif [ "${shortname}" == "unt" ]; then + fn_fix_steamclient_so "64" "${serverfiles}" +elif [ "${shortname}" == "wurm" ]; then + fn_fix_steamclient_so "64" "${serverfiles}/nativelibs" +fi diff --git a/lgsm/functions/fix_terraria.sh b/lgsm/functions/fix_terraria.sh new file mode 100755 index 000000000..7758fdad9 --- /dev/null +++ b/lgsm/functions/fix_terraria.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_terraria.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves an issue with Terraria. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export TERM=xterm diff --git a/lgsm/functions/fix_tf2.sh b/lgsm/functions/fix_tf2.sh new file mode 100755 index 000000000..27b35a0d2 --- /dev/null +++ b/lgsm/functions/fix_tf2.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# LinuxGSM fix_tf2.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Team Fortress 2. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: Team Fortress 2 Segmentation fault for Red-Hat Distros #2062. +if [ -f "/etc/redhat-release" ]&&[ ! -f "${serverfiles}/bin/libcurl-gnutls.so.4" ]; then + fixname="libcurl-gnutls.so.4" + fn_fix_msg_start + ln -s "/usr/lib/libcurl.so.4" "${serverfiles}/bin/libcurl-gnutls.so.4" + fn_fix_msg_end +fi diff --git a/lgsm/functions/fix_ts3.sh b/lgsm/functions/fix_ts3.sh new file mode 100755 index 000000000..223c90aea --- /dev/null +++ b/lgsm/functions/fix_ts3.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# LinuxGSM fix_ts3.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Teamspeak 3. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: makes libmariadb2 available #1924. +if [ ! -f "${serverfiles}/libmariadb.so.2" ]; then + fixname="libmariadb.so.2" + fn_fix_msg_start + cp "${serverfiles}/redist/libmariadb.so.2" "${serverfiles}/libmariadb.so.2" + fn_fix_msg_end +fi diff --git a/lgsm/functions/fix_unt.sh b/lgsm/functions/fix_unt.sh new file mode 100755 index 000000000..eae2e6313 --- /dev/null +++ b/lgsm/functions/fix_unt.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_rust.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves startup issue with Unturned. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/Unturned_Headless_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_ut.sh b/lgsm/functions/fix_ut.sh new file mode 100755 index 000000000..2e6686a8d --- /dev/null +++ b/lgsm/functions/fix_ut.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# LinuxGSM fix_ut.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Unreal Tournament. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +#Set Binary Executable +echo -e "chmod +x ${executabledir}/${executable}" +chmod +x "${executabledir}/${executable}" +fn_sleep_time diff --git a/lgsm/functions/fix_ut2k4.sh b/lgsm/functions/fix_ut2k4.sh new file mode 100755 index 000000000..49610e4b6 --- /dev/null +++ b/lgsm/functions/fix_ut2k4.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# LinuxGSM fix_ut2k4.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Unreal Tournament 2004. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "applying WebAdmin ut2003.css fix." +echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" +sed -i 's/none}/none;/g' "${serverfiles}/Web/ServerAdmin/ut2003.css" +sed -i 's/underline}/underline;/g' "${serverfiles}/Web/ServerAdmin/ut2003.css" +fn_sleep_time +echo -e "applying WebAdmin CharSet fix." +echo -e "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" +sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/UWeb.int" +fn_sleep_time +echo -e "applying server name fix." +fn_sleep_time +echo -e "forcing server restart." +fn_sleep_time +exitbypass=1 +command_start.sh +fn_firstcommand_reset +sleep 5 +exitbypass=1 +command_stop.sh +fn_firstcommand_reset +exitbypass=1 +command_start.sh +fn_firstcommand_reset +sleep 5 +exitbypass=1 +command_stop.sh +fn_firstcommand_reset diff --git a/lgsm/functions/fix_ut3.sh b/lgsm/functions/fix_ut3.sh new file mode 100755 index 000000000..d3b6f824b --- /dev/null +++ b/lgsm/functions/fix_ut3.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# LinuxGSM fix_ut2.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Unreal Tournament 3. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_parms(){ +parms="server VCTF-Suspense?Game=UTGameContent.UTVehicleCTFGame_Content?bIsDedicated=true?bIsLanMatch=false?bUsesStats=false?bShouldAdvertise=false?PureServer=1?bAllowJoinInProgress=true?ConfigSubDir=${selfname} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}" +} + +fn_print_information "starting ${gamename} server to generate configs." +fn_sleep_time +exitbypass=1 +command_start.sh +fn_firstcommand_reset +sleep 10 +exitbypass=1 +command_stop.sh +fn_firstcommand_reset diff --git a/lgsm/functions/fix_wurm.sh b/lgsm/functions/fix_wurm.sh new file mode 100755 index 000000000..aba24d382 --- /dev/null +++ b/lgsm/functions/fix_wurm.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LinuxGSM fix_wurm.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Wurm Unlimited. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# First run requires start with no parms. +# After first run new dirs are created. +if [ ! -d "${serverfiles}/Creative" ]; then + parmsbypass=1 + fixbypass=1 + exitbypass=1 + command_start.sh + fn_firstcommand_reset + sleep 10 + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + unset parmsbypass +fi diff --git a/lgsm/functions/fix_zmr.sh b/lgsm/functions/fix_zmr.sh new file mode 100755 index 000000000..491c36638 --- /dev/null +++ b/lgsm/functions/fix_zmr.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# LinuxGSM fix_sfc.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Zombie Master: Reborn. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ ! -f "${serverfiles}/bin/datacache.so" ]; then + ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so" +fi + +if [ ! -f "${serverfiles}/bin/dedicated.so" ]; then + ln -s "${serverfiles}/bin/dedicated_srv.so" "${serverfiles}/bin/dedicated.so" +fi + +if [ ! -f "${serverfiles}/bin/engine.so" ]; then + ln -s "${serverfiles}/bin/engine_srv.so" "${serverfiles}/bin/engine.so" +fi + +if [ ! -f "${serverfiles}/bin/materialsystem.so" ]; then + ln -s "${serverfiles}/bin/materialsystem_srv.so" "${serverfiles}/bin/materialsystem.so" +fi + +if [ ! -f "${serverfiles}/bin/replay.so" ]; then + ln -s "${serverfiles}/bin/replay_srv.so" "${serverfiles}/bin/replay.so" +fi + +if [ ! -f "${serverfiles}/bin/shaderapiempty.so" ]; then + ln -s "${serverfiles}/bin/shaderapiempty_srv.so" "${serverfiles}/bin/shaderapiempty.so" +fi + +if [ ! -f "${serverfiles}/bin/soundemittersystem.so" ]; then + ln -s "${serverfiles}/bin/soundemittersystem_srv.so" "${serverfiles}/bin/soundemittersystem.so" +fi + +if [ ! -f "${serverfiles}/bin/studiorender.so" ]; then + ln -s "${serverfiles}/bin/studiorender_srv.so" "${serverfiles}/bin/studiorender.so" +fi + +if [ ! -f "${serverfiles}/bin/vphysics.so" ]; then + ln -s "${serverfiles}/bin/vphysics_srv.so" "${serverfiles}/bin/vphysics.so" +fi + +if [ ! -f "${serverfiles}/bin/scenefilecache.so" ]; then + ln -s "${serverfiles}/bin/scenefilecache_srv.so" "${serverfiles}/bin/scenefilecache.so" +fi diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh new file mode 100755 index 000000000..d411a1205 --- /dev/null +++ b/lgsm/functions/info_config.sh @@ -0,0 +1,1694 @@ +#!/bin/bash +# LinuxGSM info_config.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Gets specific details from config files. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +## Examples of filtering to get info from config files. +# sed 's/foo//g' - remove foo +# tr -cd '[:digit:]' leave only digits +# tr -d '=\"; ' remove selected characters =\"; +# grep -v "foo" filter out lines that contain foo +# cut -f1 -d "/" remove everything after / + + +fn_info_config_assettocorsa(){ + if [ ! -f "${servercfgfullpath}" ]; then + httpport="${zero}" + port="${zero}" + queryport="${zero}" + servername="${unavailable}" + adminpassword="${unavailable}" + else + httpport=$(grep "HTTP_PORT" "${servercfgfullpath}" | tr -cd '[:digit:]') + port=$(grep "TCP_PORT" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport="${port}" + servername=$(grep "NAME" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/NAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| head -n 1) + adminpassword=$(grep "ADMIN_PASSWORD" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMIN_PASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + httpport=${httpport:-"0"} + port=${port:-"0"} + queryport=${queryport:-"0"} + servername=${servername:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + + fi +} + +fn_info_config_justcause2(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + else + servername=$(grep "Name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverdescription=$(grep "Description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + port=$(grep "BindPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + queryport="${port}" + 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"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${queryport:-"0"} + fi +} + +fn_info_config_justcause3(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverdescription="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryPort="${zero}" + steamport="${zero}" + tickrate="${zero}" + else + servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverdescription=$(grep "description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "\"maxPlayers\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + port=$(grep "\"port\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$(grep "\"queryPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + steamport=$(grep "\"steamPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + tickrate=$(grep "\"maxTickRate\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + + 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"} + serverdescription=${serverdescription:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers=:-"0"} + port=${port=:-"0"} + queryport=${queryport=:-"0"} + steamport=${steamport=:-"0"} + tickrate=${tickrate=:-"0"} + fi +} + +fn_info_config_ark(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + 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 +} + +fn_info_config_ballistic_overkill(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + maxplayers="${unavailable}" + else + servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "Password=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "ServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$((port + 1)) + maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + maxplayers=${maxplayers:-"NOT SET"} + fi +} + +fn_info_config_barotrauma(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + maxplayers="${unavailable}" + else + servername=$(grep -Po 'name="\K.*(?=")' "${servercfgfullpath}") # Assuming GNU grep is used + serverpassword=$(grep -Po 'password="\K.*(?=")' "${servercfgfullpath}") # Assuming GNU grep is used + port=$(grep " port=" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$(grep "queryport=" "${servercfgfullpath}" | tr -cd '[:digit:]') + maxplayers=$(grep "maxplayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_config_battalion1944(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + fi +} + +fn_info_config_bf1942(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + else + + servername=$(grep -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" + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + 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 +} + +fn_info_config_chivalry(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + else + servername=$(grep -E "^ServerName" "${servercfgfullpath}" | sed 's/^ServerName=//') + adminpassword=$(grep -E "^AdminPassword" "${servercfgfullpath}" | sed 's/^AdminPassword=//') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + fi +} + +fn_info_config_cod(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + rconpassword="${unavailable}" + else + servername=$(grep "sv_hostname " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | xargs) + rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + servername=${servername:-"NOT SET"} + rconpassword=${rconpassword=:-"NOT SET"} + fi +} + +fn_info_config_cod2(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + rconpassword="${unavailable}" + else + servername=$(grep "sv_hostname " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | xargs) + rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + servername=${servername:-"NOT SET"} + rconpassword=${rconpassword=:-"NOT SET"} + fi +} + +fn_info_config_cod4(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + rconpassword="${unavailable}" + else + servername=$(grep "sv_hostname " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | xargs) + rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + servername=${servername:-"NOT SET"} + rconpassword=${rconpassword=:-"NOT SET"} + fi +} + +fn_info_config_codwaw(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + rconpassword="${unavailable}" + else + servername=$(grep "sv_hostname " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | xargs) + rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + servername=${servername:-"NOT SET"} + rconpassword=${rconpassword=:-"NOT SET"} + fi +} + +fn_info_config_dontstarve(){ + if [ ! -f "${clustercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + gamemode="${unavailable}" + tickrate="${zero}" + masterport="${zero}" + else + servername=$(grep "cluster_name" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/cluster_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "cluster_password" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/cluster_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "max_players" "${clustercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + gamemode=$(grep "game_mode" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/game_mode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + tickrate=$(grep "tick_rate" "${clustercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + masterport=$(grep "master_port" "${clustercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + configip=$(grep "bind_ip" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bind_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ipsetinconfig=1 + ipinconfigvar="bind_ip" + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + gamemode=${gamemode:-"NOT SET"} + tickrate=${tickrate:-"0"} + masterport=${masterport:-"0"} + fi + + if [ ! -f "${servercfgfullpath}" ]; then + port="${zero}" + steamauthenticationport="${zero}" + steammasterserverport="${zero}" + else + port=$(grep "server_port" "${servercfgfullpath}" | grep "^server_port" | grep -v "#" | tr -cd '[:digit:]') + steamauthenticationport=$(grep "authentication_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + steammasterserverport=$(grep "master_server_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not Set + port=${port:-"0"} + steamauthenticationport=${steamauthenticationport:-"0"} + steammasterserverport=${steammasterserverport:-"0"} + fi +} + +fn_info_config_eco(){ + if [ ! -f "${servercfgfullpath}" ]; then + configip="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + tickrate="${zero}" + port="${zero}" + webadminport="${zero}" + else + configip=$(jq -r '.IPAddress' "${servercfgfullpath}") + servername=$(jq -r '.Description' "${servercfgfullpath}") + serverpassword=$(jq -r '.Password' "${servercfgfullpath}") + maxplayers=$(jq -r '.MaxConnections' "${servercfgfullpath}") + tickrate=$(jq -r '.Rate' "${servercfgfullpath}") + port=$(jq -r '.GameServerPort' "${servercfgfullpath}") + webadminport=$(jq -r '.WebServerPort' "${servercfgfullpath}") + + # Not Set + configip=${configip:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers=:-"0"} + port=${port=:-"0"} + webadminport=${webadminport=:-"0"} + fi +} + +fn_info_config_factorio(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="Factorio Server" + serverpassword="${unavailable}" + maxplayers="${zero}" + authtoken=${authtoken:-"NOT SET"} + savegameinterval="${unavailable}" + versioncount="${unavailable}" + else + servername=$(jq -r '.name' "${servercfgfullpath}") + serverpassword=$(jq -r '.game_password' "${servercfgfullpath}") + maxplayers=$(jq -r '.max_players' "${servercfgfullpath}") + authtoken=$(jq -r '.token' "${servercfgfullpath}") + savegameinterval=$(jq -r '.autosave_interval' "${servercfgfullpath}") + versioncount=$(jq -r '.autosave_slots' "${servercfgfullpath}") + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + authtoken=${authtoken:-"NOT SET"} + savegameinterval=${savegameinterval:-"0"} + versioncount=${versioncount:-"0"} + fi +} + +fn_info_config_minecraft(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + rconpassword="${unavailable}" + rconport="${zero}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + queryenabled="${unavailable}" + gamemode="${unavailable}" + gameworld="${unavailable}" + else + servername=$(grep "motd" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/motd//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "rcon.password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon.password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconport=$(grep "rcon.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "server-port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryport=$(grep "query.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + if [ -z "${queryport}" ]; then + queryport=${port} + fi + queryenabled=$(grep "enable-query" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/enable-query//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + gamemode=$(grep "gamemode" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + 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"} + rconpassword=${rconpassword:-"NOT SET"} + rconport=${rconport:-"NOT SET"} + maxplayers=${maxplayers:-"NOT SET"} + port=${port:-"NOT SET"} + queryport=${queryport:-"NOT SET"} + queryenabled="${queryenabled:-"NOT SET"}" + gamemode=${gamemode:-"NOT SET"} + gameworld=${gameworld:-"NOT SET"} + fi +} + +fn_info_config_minecraft_bedrock(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${zero}" + port="${zero}" + port6="${zero}" + queryport="${zero}" + gamemode="${unavailable}" + gameworld="${unavailable}" + else + servername=$(grep "server-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "server-port\b" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port6=$(grep "server-portv6\b" "${servercfgfullpath}" | sed 's/v6//g' | grep -v "#" | tr -cd '[:digit:]') + queryport=${port} + gamemode=$(grep "gamemode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/gamemode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"NOT SET"} + port=${port:-"NOT SET"} + port6=${port6:-"NOT SET"} + queryport=${queryport:-"NOT SET"} + gamemode=${gamemode:-"NOT SET"} + gameworld=${gameworld:-"NOT SET"} + fi +} + +fn_info_config_mofm(){ + 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 "ServerPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/ServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + fi +} + +fn_info_config_onset(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${zero}" + port="${zero}" + httpport="${zero}" + queryport="${zero}" + else + servername=$(grep -v "servername_short" "${servercfgfullpath}" | grep "servername" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/servername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' ) + maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + httpport=$((port-2)) + queryport=$((port-1)) + + # Not Set + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"NOT SET"} + port=${port:-"NOT SET"} + httpport=${httpport:-"NOT SET"} + queryport=${queryport:-"NOT SET"} + fi +} + +fn_info_config_mohaa(){ + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + else + rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not Set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +#Post Scriptum: The bloody Seventh +fn_info_config_pstbs(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${unavailable}" + reservedslots="${unavailable}" + else + servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=";,:' | sed -e 's/^[ \t]//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') + reservedslots=$(grep "NumReservedSlots=" "${servercfgfullpath}" | tr -cd '[:digit:]') + fi + + if [ ! -f "${servercfgdir}/Rcon.cfg" ]; then + rconport=${unavailable} + rconpassword=${unavailable} + else + rconport=$(grep "Port=" "${servercfgdir}/Rcon.cfg" | tr -cd '[:digit:]') + rconpassword=$(grep "Password=" "${servercfgdir}/Rcon.cfg" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + fi + + rconport=${rconport:-"0"} + if [ -z "${rconpassword}" ]||[ ${#rconpassword} == 1 ]; then + rconpassword="NOT SET" + fi + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + numreservedslots=${numreservedslots:-"0"} +} + +fn_info_config_projectcars(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + steamport="${zero}" + else + servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "password " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + port=$(grep "hostPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport=$(grep "queryPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + steamport=$(grep "steamPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"NOT SET"} + port=${port:-"NOT SET"} + queryport=${queryport:-"NOT SET"} + steamport=${steamport:-"NOT SET"} + fi +} + +fn_info_config_projectzomboid(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + rconpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + gameworld="${unavailable}" + else + servername=$(grep "PublicName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/PublicName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Password" | sed -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "RCONPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/RCONPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "DefaultPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + gameworld=$(grep "Map" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Map" | sed -e '/^#/d' -e 's/Map//g' | tr -d '=\";' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + maxplayers=${maxplayers:-"NOT SET"} + port=${port:-"NOT SET"} + gameworld=${gameworld:-"NOT SET"} + fi +} + +fn_info_config_quakeworld(){ + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + else + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | 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 + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_config_quake2(){ + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + else + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not Set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_config_quake3(){ + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + else + rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not Set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_config_jk2(){ + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${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]*$//') + + # Not Set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_config_quakelive(){ + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + rconport="${zero}" + statsport="${zero}" + else + rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "sv_maxClients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + port=$(grep "net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport="${port}" + rconport=$(grep "zmq_rcon_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + statsport=$(grep "zmq_stats_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + 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_realvirtuality(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + adminpassword="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + else + servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + adminpassword=$(grep "passwordAdmin" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/passwordAdmin//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + # Not Set + servername=${servername:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_config_risingworld(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + rconpassword="${unavailable}" + rconport="${zero}" + maxplayers="${zero}" + port="${zero}" + gamemode="${unavailable}" + gameworld="${unavailable}" + else + servername=$(grep "server_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "server_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconport=$(grep "rcon_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + maxplayers=$(grep "settings_max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "server_port" "${servercfgfullpath}" | grep -v "database_mysql_server_port" | grep -v "#" | tr -cd '[:digit:]') + gamemode=$(grep "gamemode" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + gameworld=$(grep "server_world_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_world_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + javaram=$(grep "server_memory" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_memory//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + 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" + + # Not Set + servername=${servername:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + rconport=${rconport:-"NOT SET"} + maxplayers=${maxplayers:-"NOT SET"} + port=${port:-"NOT SET"} + gamemode=${gamemode:-"NOT SET"} + gameworld=${gameworld:-"NOT SET"} + fi +} + +fn_info_config_rtcw(){ + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + else + rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not Set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +#StickyBots +fn_info_config_sbots(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${unavailable}" + else + servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=";,:' | sed -e 's/^[ \t]//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') + fi + + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} +} + +fn_info_config_sof2(){ + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + else + rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not Set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_config_source(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + rconpassword="${unavailable}" + else + servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "sv_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/sv_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + fi +} + +fn_info_config_starbound(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + queryenabled="${unavailable}" + rconenabled="${unavailable}" + rconpassword="${unavailable}" + port="21025" + queryport="21025" + rconport="21026" + maxplayers="8" + else + servername=$(grep "serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/serverName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + queryenabled=$(grep "runQueryServer" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/runQueryServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconenabled=$(grep "runRconServer" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/runRconServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "rconServerPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/rconServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "gameServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$(grep "queryServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + rconport=$(grep "rconServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | tr -cd '[:digit:]') + + # Not Set + servername=${servername:-"NOT SET"} + queryenabled=${queryenabled:-"NOT SET"} + rconenabled=${rconenabled:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + port=${port:-"21025"} + queryport=${queryport:-"21025"} + rconport=${rconport:-"21026"} + maxplayers=${maxplayers:-"8"} + fi +} + +fn_info_config_teamspeak3(){ + if [ ! -f "${servercfgfullpath}" ]; then + dbplugin="${unavailable}" + port="9987" + queryport="10011" + fileport="30033" + else + dbplugin=$(grep "dbplugin=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/dbplugin=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "default_voice_port" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$(grep "query_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + fileport=$(grep "filetransfer_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + 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 + port=${port:-"9987"} + queryport=${queryport:-"10011"} + fileport=${fileport:-"30033"} + fi +} + +fn_info_config_mumble(){ + if [ ! -f "${servercfgfullpath}" ]; then + port="64738" + queryport="${port}" + servername="Mumble" + else + port=$(grep "port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^;/d' -e 's/port//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + queryport="${port}" + + 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_config_samp(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="unnamed server" + serverpassword="${unavailable}" + rconpassword="${unavailable}" + port="7777" + maxplayers="50" + else + servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not Set + servername=${servername:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + port=${port:-"8303"} + maxplayers=${maxplayers:-"12"} + fi +} + +fn_info_config_teeworlds(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="unnamed server" + serverpassword="${unavailable}" + rconpassword="${unavailable}" + port="8303" + queryport="8303" + maxplayers="12" + else + servername=$(grep "sv_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^password" | sed -e '/^#/d' -e 's/^password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "sv_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "sv_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryport="${port}" + maxplayers=$(grep "sv_max_clients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + port=${port:-"8303"} + queryport=${port:-"8303"} + maxplayers=${maxplayers:-"12"} + fi +} + +fn_info_config_terraria(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + port="${zero}" + gameworld="${unavailable}" + maxplayers="${zero}" + queryport="${zero}" + else + servername=$(grep "worldname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/worldname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "port" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=${port:-"0"} + gameworld=$(grep "world=" "${servercfgfullpath}" | grep -v "//" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/world=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + # Not Set + servername=${servername:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + gameworld=${gameworld:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_config_towerunite(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${zero}" + else + servername=$(grep "ServerTitle" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerTitle//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not Set + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_config_unreal(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + queryportgs="${zero}" + webadminenabled="${unavailable}" + webadminport="${zero}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + port=$(grep "Port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]') + queryport=$((port + 1)) + queryportgs=$(grep "OldQueryPortNumber" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + webadminenabled=$(grep "bEnabled" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + webadminport=$(grep "ListenPort" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + webadminuser=$(grep "AdminUsername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminUsername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + webadminpass=$(grep "UTServerAdmin.UTServerAdmin" "${servercfgfullpath}" -A 4 | grep "AdminPassword" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + queryportgs=${queryportgs:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminport=${webadminport:-"0"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} + fi +} + +fn_info_config_unreal2(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + queryportgs="${zero}" + webadminenabled="${unavailable}" + webadminport="${zero}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" + else + servername=$(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 +} + +fn_info_config_unreal3(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + maxplayers="${unavailable}" + webadminenabled="${unavailable}" + webadminport="${zero}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + webadminenabled=$(grep "bEnabled" "${servercfgdir}/UTWeb.ini" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + webadminport=$(grep "ListenPort" "${servercfgdir}/UTWeb.ini" | grep -v "#" | tr -cd '[:digit:]') + webadminuser="Admin" + webadminpass=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + maxplayers=${maxplayers:-"NOT SET"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminport=${webadminport:-"0"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} + fi +} + +fn_info_config_ut(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') + + # Not set + servername=${servername:-"NOT SET"} + fi +} + +fn_info_config_warfork(){ + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + maxplayers="${zero}" + else + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not Set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_config_kf2(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + port="${unavailable}" + queryport="${unavailable}" + webadminenabled="${unavailable}" + webadminport="${zero}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "Port" "${servercfgdir}/LinuxServer-KFEngine.ini" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]') + webadminenabled=$(grep "bEnabled" "${servercfgdir}/KFWeb.ini" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + webadminport=$(grep "ListenPort" "${servercfgdir}/KFWeb.ini" | grep -v "#" | tr -cd '[:digit:]') + webadminuser="Admin" + webadminpass=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminport=${webadminport:-"0"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} + fi +} + +fn_info_config_sdtd(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + webadminenabled="${unavailable}" + webadminport="${zero}" + webadminpass="${unavailable}" + telnetenabled="${unavailable}" + telnetport="${zero}" + telnetpass="${unavailable}" + telnetip="${unavailable}" + maxplayers="${unavailable}" + gamemode="${unavailable}" + gameworld="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + port=$(grep "ServerPort" "${servercfgfullpath}" | grep -Eo 'value="[0-9]+"' | tr -cd '[:digit:]') + queryport=${port:-"0"} + + webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminpass=$(grep "ControlPanelPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + telnetenabled=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + telnetpass=$(grep "TelnetPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + # 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" + 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 + port=${port:-"22003"} + httpport=${httpport:-"22005"} + ase=${ase:-"Disabled"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_config_wolfensteinenemyterritory(){ + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + else + port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport="${port}" + rconpassword=$(grep "set zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + 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_config_etlegacy(){ + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + else + port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport="${port}" + rconpassword=$(grep "set rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + 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_config_wurmunlimited(){ + if [ ! -f "${servercfgfullpath}" ]; then + port="${zero}" + queryport="${zero}" + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + maxplayers="${zero}" + else + + port=$(grep "EXTERNALPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryport=$(grep "QUERYPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + servername=$(grep "SERVERNAME=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERNAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "SERVERPASSWORD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERPASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + adminpassword=$(grep "ADMINPWD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMINPWD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MAXPLAYERS=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + 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 +} + +fn_info_config_squad(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${unavailable}" + else + servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') + fi + + if [ ! -f "${servercfgdir}/Rcon.cfg" ]; then + rconport=${unavailable} + rconpassword=${unavailable} + else + rconport=$(grep "Port=" "${servercfgdir}/Rcon.cfg" | tr -cd '[:digit:]') + rconpassword=$(grep "Password=" "${servercfgdir}/Rcon.cfg" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + fi + + rconport=${rconport:-"0"} + if [ -z "${rconpassword}" ]||[ ${#rconpassword} == 1 ]; then + rconpassword="NOT SET" + fi + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} +} + +fn_info_config_stationeers(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + rconpassword="${unavailable}" + maxplayers="${unavailable}" + else + servername=$(grep "SERVERNAME" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERNAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "PASSWORD" "${servercfgfullpath}" | grep "^PASSWORD" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/PASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "RCONPASSWORD" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/RCONPASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MAXPLAYER" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/MAXPLAYER//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_config_mordhau(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + rconpassword="${unavailable}" + maxplayers="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') + serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | awk -F '=' '{print $2}') + rconpassword=$(grep "AdminPassword" "${servercfgfullpath}" | awk -F '=' '{print $2}') + maxplayers=$(grep "MaxSlots" "${servercfgfullpath}" | awk -F '=' '{print $2}') + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + + +fn_info_config_avorion() { + if [ ! -f "${servercfgfullpath}" ]; then + maxplayers="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + rconpassword="${unavailable}" + rconport="${unavailable}" + rconenabled="${unavailable}" + queryport="${unavailable}" + else + maxplayers=$(grep "maxPlayers=" "${servercfgfullpath}" | sed 's/maxPlayers=//') + servername=$(grep "name=" "${servercfgfullpath}" | sed 's/name=//') + serverpassword=$(grep "password=" "${servercfgfullpath}" | sed 's/password=//') + rconpassword=$(grep "rconPassword=" "${servercfgfullpath}" | sed 's/rconPassword=//') + rconport=$(grep "rconPort=" "${servercfgfullpath}" | sed 's/rconPort=//') + if [ -n "${rconpassword}" ]; then + rconenabled="true" + queryport="${rconport}" + fi + + # Not set + maxplayers=${maxplayers:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + rconport=${rconport:-"0"} + rconenabled=${rconenabled:-"false"} + queryport=${queryport:-"0"} + fi +} + +fn_info_config_soldat(){ + if [ ! -f "${servercfgfullpath}" ]; then + adminpassword="${unavailable}" + maxplayers="${unavailable}" + port="${zero}" + queryport="${zero}" + servername="${unavailable}" + serverpassword="${unavailable}" + else + adminpassword=$(grep "Admin_Password=" "${servercfgfullpath}" | awk -F '=' '{print $2}') + maxplayers=$(grep "Max_Players=" "${servercfgfullpath}" | tr -cd '[:digit:]') + port=$(grep "Port=" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport="${port}" + servername=$(grep "Server_Name=" "${servercfgfullpath}" | awk -F '=' '{print $2}') + serverpassword=$(grep "Game_Password=" "${servercfgfullpath}" | awk -F '=' '{print $2}') + + # Not set + adminpassword=${adminpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"23073"} + queryport=${queryport:-"23083"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + fi +} + +fn_info_config_pavlovvr(){ + 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 +} + +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}") + + # 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_config_vintagestory(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${unavailable}" + serverpassword="${unavailable}" + port="${unavailable}" + queryport="${unavailable}" + configip="${unavailable}" + 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}") + + serverpassword=${serverpassword:-"NOT SET"} + configip=${configip:-"0.0.0.0"} + 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 + else + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + configip=${configip:-"0.0.0.0"} + tickrate=${tickrate:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + fi +} + +if [ "${shortname}" == "ac" ]; then + fn_info_config_assettocorsa +elif [ "${shortname}" == "ark" ]; then + fn_info_config_ark +elif [ "${shortname}" == "av" ]; then + fn_info_config_avorion +elif [ "${shortname}" == "bo" ]; then + fn_info_config_ballistic_overkill +elif [ "${shortname}" == "bt" ]; then + fn_info_config_barotrauma +elif [ "${shortname}" == "bt1944" ]; then + fn_info_config_battalion1944 +elif [ "${shortname}" == "bf1942" ]; then + fn_info_config_bf1942 +elif [ "${shortname}" == "bfv" ]; then + fn_info_config_bfv +elif [ "${shortname}" == "cmw" ]; then + fn_info_config_chivalry +elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]; then + fn_info_config_cod +elif [ "${shortname}" == "cod2" ]; then + fn_info_config_cod2 +elif [ "${shortname}" == "cod4" ]; then + fn_info_config_cod4 +elif [ "${shortname}" == "codwaw" ]; then + fn_info_config_codwaw +elif [ "${shortname}" == "col" ]; then + fn_info_config_col +elif [ "${shortname}" == "dst" ]; then + fn_info_config_dontstarve +elif [ "${shortname}" == "eco" ]; then + fn_info_config_eco +elif [ "${shortname}" == "fctr" ]; then + fn_info_config_factorio +elif [ "${shortname}" == "jc2" ]; then + fn_info_config_justcause2 +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 +elif [ "${shortname}" == "jk2" ]; then + fn_info_config_jk2 +elif [ "${shortname}" == "mc" ]; then + fn_info_config_minecraft +elif [ "${shortname}" == "mcb" ]; then + fn_info_config_minecraft_bedrock +elif [ "${shortname}" == "onset" ]; then + fn_info_config_onset +elif [ "${shortname}" == "pstbs" ]; then + fn_info_config_pstbs +elif [ "${shortname}" == "pc" ]; then + fn_info_config_projectcars +elif [ "${shortname}" == "pz" ]; then + fn_info_config_projectzomboid +elif [ "${shortname}" == "arma3" ]; then + fn_info_config_realvirtuality +elif [ "${shortname}" == "rtcw" ]; then + fn_info_config_rtcw +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 +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 +elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then + fn_info_config_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 +elif [ "${shortname}" == "squad" ]; then + fn_info_config_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 +elif [ "${shortname}" == "vints" ]; then + fn_info_config_vintagestory +fi diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh new file mode 100755 index 000000000..3b199b4f0 --- /dev/null +++ b/lgsm/functions/info_distro.sh @@ -0,0 +1,288 @@ +#!/bin/bash +# LinuxGSM info_distro.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Variables providing useful info on the Operating System such as disk and performace info. +# Used for command_details.sh, command_debug.sh and alert.sh. + +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}') +fi +### Distro information + +## Distro +# Returns architecture, kernel and distro/os. +arch=$(uname -m) +kernel=$(uname -r) + +# Distro Name - Ubuntu 16.04 LTS +# Distro Version - 16.04 +# Distro ID - ubuntu +# Distro Codename - xenial + +# Gathers distro info from various sources filling in missing gaps. +distro_info_array=( os-release lsb_release hostnamectl debian_version redhat-release ) +for distro_info in "${distro_info_array[@]}"; do + if [ -f "/etc/os-release" ]&&[ "${distro_info}" == "os-release" ]; then + distroname=$(grep PRETTY_NAME /etc/os-release | sed 's/PRETTY_NAME=//g' | tr -d '="' | sed 's/\"//g') + distroversion=$(grep VERSION_ID /etc/os-release | sed 's/VERSION_ID=//g' | sed 's/\"//g') + distroid=$(grep ID /etc/os-release | grep -v _ID | grep -v ID_ | sed 's/ID=//g' | sed 's/\"//g') + distrocodename=$(grep VERSION_CODENAME /etc/os-release | sed 's/VERSION_CODENAME=//g' | sed 's/\"//g') + elif [ "$(command -v lsb_release 2>/dev/null)" ]&&[ "${distro_info}" == "lsb_release" ]; then + if [ -z "${distroname}" ];then + distroname=$(lsb_release -sd) + elif [ -z "${distroversion}" ]; then + distroversion=$(lsb_release -sr) + elif [ -z "${distroid}" ]; then + distroid=$(lsb_release -si) + elif [ -z "${distrocodename}" ]; then + distrocodename=$(lsb_release -sc) + fi + elif [ "$(command -v hostnamectl 2>/dev/null)" ]&&[ "${distro_info}" == "hostnamectl" ]; then + if [ -z "${distroname}" ];then + distroname=$(hostnamectl | grep "Operating System" | sed 's/Operating System: //g') + fi + elif [ -f "/etc/debian_version" ]&&[ "${distro_info}" == "debian_version" ]; then + if [ -z "${distroname}" ]; then + distroname="Debian $(cat /etc/debian_version)" + elif [ -z "${distroversion}" ]; then + distroversion=$(cat /etc/debian_version) + elif [ -z "${distroid}" ]; then + distroid="debian" + fi + elif [ -f "/etc/redhat-release" ]&&[ "${distro_info}" == "redhat-release" ]; then + if [ -z "${distroname}" ]; then + distroname=$(cat /etc/redhat-release) + elif [ -z "${distroversion}" ]; then + distroversion=$(rpm -qa \*-release | grep -Ei "oracle|redhat|centos|fedora" | cut -d"-" -f3) + elif [ -z "${distroid}" ]; then + distroid=$(awk '{print $1}' /etc/redhat-release) + fi + fi +done + +## Glibc version +# e.g: 1.17 +glibcversion=$(ldd --version | sed -n '1s/.* //p') + +## tmux version +# e.g: tmux 1.6 +if [ ! "$(command -V tmux 2>/dev/null)" ]; then + tmuxv="${red}NOT INSTALLED!${default}" +else + if [ "$(tmux -V | sed "s/tmux //" | sed -n '1 p' | tr -cd '[:digit:]')" -lt "16" ]; then + tmuxv="$(tmux -V) (>= 1.6 required for console log)" + else + tmuxv=$(tmux -V) + fi +fi + +## Uptime +uptime=$(/dev/null)" ]; then + # Issue #2005 - Kernel 3.14+ contains MemAvailable which should be used. All others will be calculated. + + # get the raw KB values of these fields. + physmemtotalkb=$(grep MemTotal /proc/meminfo | awk '{print $2}') + physmemfreekb=$(grep ^MemFree /proc/meminfo | awk '{print $2}') + physmembufferskb=$(grep ^Buffers /proc/meminfo | awk '{print $2}') + physmemcachedkb=$(grep ^Cached /proc/meminfo | awk '{print $2}') + physmemreclaimablekb=$(grep ^SReclaimable /proc/meminfo | awk '{print $2}') + + # check if MemAvailable Exists. + if grep -q ^MemAvailable /proc/meminfo; then + physmemactualfreekb=$(grep ^MemAvailable /proc/meminfo | awk '{print $2}') + else + physmemactualfreekb=$((physmemfreekb+physmembufferskb+physmemcachedkb)) + fi + + # Available RAM and swap. + physmemtotalmb=$((physmemtotalkb/1024)) + physmemtotal=$(numfmt --to=iec --from=iec --suffix=B "${physmemtotalkb}K") + physmemfree=$(numfmt --to=iec --from=iec --suffix=B "${physmemactualfreekb}K") + physmemused=$(numfmt --to=iec --from=iec --suffix=B "$((physmemtotalkb-physmemfreekb-physmembufferskb-physmemcachedkb-physmemreclaimablekb))K") + physmemavailable=$(numfmt --to=iec --from=iec --suffix=B "${physmemactualfreekb}K") + physmemcached=$(numfmt --to=iec --from=iec --suffix=B "$((physmemcachedkb+physmemreclaimablekb))K") + + swaptotal=$(numfmt --to=iec --from=iec --suffix=B "$(grep ^SwapTotal /proc/meminfo | awk '{print $2}')K") + swapfree=$(numfmt --to=iec --from=iec --suffix=B "$(grep ^SwapFree /proc/meminfo | awk '{print $2}')K") + swapused=$(numfmt --to=iec --from=iec --suffix=B "$(($(grep ^SwapTotal /proc/meminfo | awk '{print $2}')-$(grep ^SwapFree /proc/meminfo | awk '{print $2}')))K") + # RAM usage of the game server pid + # MB + if [ "${gameserverpid}" ]; then + memused=$(ps --forest -o rss -g "${gameserverpid}" | awk '{s+=$1} END {print s}'| awk '{$1/=1024;printf "%.0f",$1}{print $2}') + # % + pmemused=$(ps --forest -o %mem -g "${gameserverpid}" | awk '{s+=$1} END {print s}') + fi +else +# Older distros will need to use free. + # Older versions of free do not support -h option. + if [ "$(free -h > /dev/null 2>&1; echo $?)" -ne "0" ]; then + humanreadable="-m" + else + humanreadable="-h" + fi + physmemtotalmb=$(free -m | awk '/Mem:/ {print $2}') + physmemtotal=$(free ${humanreadable} | awk '/Mem:/ {print $2}') + physmemfree=$(free ${humanreadable} | awk '/Mem:/ {print $4}') + physmemused=$(free ${humanreadable} | awk '/Mem:/ {print $3}') + + oldfree=$(free ${humanreadable} | awk '/cache:/') + if [ "${oldfree}" ]; then + physmemavailable="n/a" + physmemcached="n/a" + else + physmemavailable=$(free ${humanreadable} | awk '/Mem:/ {print $7}') + physmemcached=$(free ${humanreadable} | awk '/Mem:/ {print $6}') + fi + + swaptotal=$(free ${humanreadable} | awk '/Swap:/ {print $2}') + swapused=$(free ${humanreadable} | awk '/Swap:/ {print $3}') + swapfree=$(free ${humanreadable} | awk '/Swap:/ {print $4}') +fi + +### Disk information + +## Available disk space on the partition. +filesystem=$(LC_ALL=C df -hP "${rootdir}" | tail -n 1 | awk '{print $1}') +totalspace=$(LC_ALL=C df -hP "${rootdir}" | tail -n 1 | awk '{print $2}') +usedspace=$(LC_ALL=C df -hP "${rootdir}" | tail -n 1 | awk '{print $3}') +availspace=$(LC_ALL=C df -hP "${rootdir}" | tail -n 1 | awk '{print $4}') + +## LinuxGSM used space total. +rootdirdu=$(du -sh "${rootdir}" 2> /dev/null | awk '{print $1}') +if [ -z "${rootdirdu}" ]; then + rootdirdu="0M" +fi + +## LinuxGSM used space in serverfiles dir. +serverfilesdu=$(du -sh "${serverfiles}" 2> /dev/null | awk '{print $1}') +if [ -z "${serverfilesdu}" ]; then + serverfilesdu="0M" +fi + +## LinuxGSM used space total minus backup dir. +rootdirduexbackup=$(du -sh --exclude="${backupdir}" "${serverfiles}" 2> /dev/null | awk '{print $1}') +if [ -z "${rootdirduexbackup}" ]; then + rootdirduexbackup="0M" +fi + +## Backup info +if [ -d "${backupdir}" ]; then + # Used space in backups dir. + backupdirdu=$(du -sh "${backupdir}" | awk '{print $1}') + # If no backup dir, size is 0M. + if [ -z "${backupdirdu}" ]; then + backupdirdu="0M" + fi + + # number of backups set to 0 by default. + backupcount=0 + + # If there are backups in backup dir. + if [ "$(find "${backupdir}" -name "*.tar.gz" | wc -l)" -ne "0" ]; then + # number of backups. + backupcount=$(find "${backupdir}"/*.tar.gz | wc -l) + # most recent backup. + lastbackup=$(find "${backupdir}"/*.tar.gz | head -1) + # date of most recent backup. + lastbackupdate=$(date -r "${lastbackup}") + # no of days since last backup. + lastbackupdaysago=$(( ( $(date +'%s') - $(date -r "${lastbackup}" +'%s') )/60/60/24 )) + # size of most recent backup. + lastbackupsize=$(du -h "${lastbackup}" | awk '{print $1}') + fi +fi + +# Network Interface name +netint=$(ip -o addr | grep "${ip}" | awk '{print $2}') +netlink=$(ethtool "${netint}" 2>/dev/null| grep Speed | awk '{print $2}') + +# External IP address +if [ -z "${extip}" ]; then + extip=$(curl --connect-timeout 10 -s https://api.ipify.org 2>/dev/null) + exitcode=$? + # Should ifconfig.co return an error will use last known IP. + if [ ${exitcode} -eq 0 ]; then + if [[ "${extip}" != *"DOCTYPE"* ]]; then + echo -e "${extip}" > "${tmpdir}/extip.txt" + else + if [ -f "${tmpdir}/extip.txt" ]; then + extip=$(cat "${tmpdir}/extip.txt") + else + fn_print_error_nl "Unable to get external IP" + fi + fi + else + if [ -f "${tmpdir}/extip.txt" ]; then + extip=$(cat "${tmpdir}/extip.txt") + else + fn_print_error_nl "Unable to get external IP" + fi + fi +fi + +# Alert IP address +if [ "${displayip}" ]; then + alertip="${displayip}" +elif [ "${extip}" ]; then + alertip="${extip}" +else + alertip="${ip}" +fi + +# Steam Master Server - checks if detected by master server. +if [ "$(command -v jq 2>/dev/null)" ]; then + if [ "${ip}" ]&&[ "${port}" ]; then + if [ "${steammaster}" == "true" ]; then + # 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)" + done + # Should that not work it will try the external IP. + if [ "${masterserver}" == "0" ]; then + masterserver="$(curl --connect-timeout 10 -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${extip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null)" + fi + if [ "${masterserver}" == "0" ]; then + displaymasterserver="false" + else + displaymasterserver="true" + fi + fi + fi +fi + +# Sets the SteamCMD glibc requirement if the game server requirement is less or not required. +if [ "${appid}" ]; then + if [ "${glibc}" = "null" ]||[ -z "${glibc}" ]||[ "$(printf '%s\n'${glibc}'\n' "2.14" | sort -V | head -n 1)" != "2.14" ]; then + glibc="2.14" + fi +fi diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh new file mode 100755 index 000000000..ab8e77be4 --- /dev/null +++ b/lgsm/functions/info_messages.sh @@ -0,0 +1,1671 @@ +#!/bin/bash +# LinuxGSM info_messages.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Defines server info messages for details and alerts. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Standard Details +# This applies to all engines + +fn_info_message_head(){ + echo -e "" + echo -e "${lightyellow}Summary${default}" + fn_messages_separator + echo -e "Message" + echo -e "${alertbody}" + echo -e "" + echo -e "Game" + echo -e "${gamename}" + echo -e "" + echo -e "Server name" + echo -e "${servername}" + echo -e "" + echo -e "Hostname" + echo -e "${HOSTNAME}" + echo -e "" + echo -e "Server IP" + if [ "${multiple_ip}" == "1" ]; then + echo -e "NOT SET" + else + echo -e "${ip}:${port}" + fi +} + +fn_info_message_distro(){ + # + # Distro Details + # ===================================== + # Distro: Ubuntu 14.04.4 LTS + # Arch: x86_64 + # Kernel: 3.13.0-79-generic + # Hostname: hostname + # tmux: tmux 1.8 + # glibc: 2.19 + + echo -e "" + echo -e "${lightyellow}Distro Details${default}" + fn_messages_separator + { + echo -e "${lightblue}Distro:\t${default}${distroname}" + echo -e "${lightblue}Arch:\t${default}${arch}" + echo -e "${lightblue}Kernel:\t${default}${kernel}" + echo -e "${lightblue}Hostname:\t${default}${HOSTNAME}" + echo -e "${lightblue}Uptime:\t${default}${days}d, ${hours}h, ${minutes}m" + echo -e "${lightblue}tmux:\t${default}${tmuxv}" + echo -e "${lightblue}glibc:\t${default}${glibcversion}" + } | column -s $'\t' -t +} + +fn_info_message_server_resource(){ + # + # Server Resource + # ========================================================================================================================================================================================================================================== + # CPU + # Model: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz + # Cores: 4 + # Frequency: 2499.994 MHz + # Avg Load: 0.20, 0.08, 0.01 + # + # Memory + # Mem: total used free cached available + # Physical: 7.8GB 598MB 7.0GB 4.0GB 7.0GB + # Swap: 512MB 0B 512MB + # + # Storage + # Filesystem: /dev/sda + # Total: 157G + # Used: 138G + # Available: 12G + + echo -e "" + echo -e "${lightyellow}Server Resource${default}" + fn_messages_separator + { + echo -e "${lightyellow}CPU\t${default}" + echo -e "${lightblue}Model:\t${default}${cpumodel}" + echo -e "${lightblue}Cores:\t${default}${cpucores}" + echo -e "${lightblue}Frequency:\t${default}${cpufreqency}MHz" + echo -e "${lightblue}Avg Load:\t${default}${load}" + } | column -s $'\t' -t + echo -e "" + { + echo -e "${lightyellow}Memory\t${default}" + echo -e "${lightblue}Mem:\t${lightblue}total\tused\tfree\tcached\tavailable${default}" + echo -e "${lightblue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}\t${physmemavailable}${default}" + echo -e "${lightblue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}" + } | column -s $'\t' -t + echo -e "" + { + echo -e "${lightyellow}Storage${default}" + echo -e "${lightblue}Filesystem:\t${default}${filesystem}" + echo -e "${lightblue}Total:\t\t${default}${totalspace}" + echo -e "${lightblue}Used:\t\t${default}${usedspace}" + echo -e "${lightblue}Available:\t${default}${availspace}" + } | column -s $'\t' -t + echo -e "" + { + echo -e "${lightyellow}Network${default}" + if [ -n "${netint}" ]; then + echo -e "${lightblue}Interface:\t${default}${netint}" + fi + if [ -n "${netlink}" ]; then + echo -e "${lightblue}Link Speed:\t${default}${netlink}" + fi + echo -e "${lightblue}IP:\t${default}${ip}" + if [ "${ip}" != "${extip}" ]; then + echo -e "${lightblue}Internet IP:\t${default}${extip}" + fi + } | column -s $'\t' -t +} + +fn_info_message_gameserver_resource(){ + # Game Server Resource Usage + # ========================================================================================================================================================================================================================================== + # CPU Used: 2.5% + # Mem Used: 2.1% 171MB + # + # Storage + # Total: 21G + # Serverfiles: 20G + # Backups: 20K + + echo -e "" + echo -e "${lightyellow}Game Server Resource Usage${default}" + fn_messages_separator + { + if [ "${status}" != "0" ]; then + echo -e "${lightblue}CPU Used:\t${default}${cpuused}%${default}" + echo -e "${lightblue}Mem Used:\t${default}${pmemused}%\t${memused}MB${default}" + else + echo -e "${lightblue}CPU Used:\t${default}0%${default}" + echo -e "${lightblue}Mem Used:\t${default}0%\t0MB${default}" + fi + } | column -s $'\t' -t + echo -e "" + { + echo -e "${lightyellow}Storage${default}" + echo -e "${lightblue}Total:\t${default}${rootdirdu}" + echo -e "${lightblue}Serverfiles:\t${default}${serverfilesdu}" + if [ -d "${backupdir}" ]; then + echo -e "${lightblue}Backups:\t${default}${backupdirdu}" + fi + } | column -s $'\t' -t +} + +fn_info_message_gameserver(){ + # Counter-Strike: Global Offensive Server Details + # ========================================================================================================================================================================================================================================== + # Server name: LinuxGSM + # Server IP: 80.70.189.230:27015 + # Server password: NOT SET + # RCON password: adminF54CC0VR + # Players: 0/16 + # Current map: de_mirage + # Default map: de_mirage + # Game type: 0 + # Game mode: 0 + # Tick rate: 64 + # Master Server: listed + # Status: ONLINE + + echo -e "" + echo -e "${lightgreen}${gamename} Server Details${default}" + fn_info_message_password_strip + fn_messages_separator + { + # Server name + if [ -n "${gdname}" ]; then + echo -e "${lightblue}Server name:\t${default}${gdname}" + elif [ -n "${servername}" ]; then + echo -e "${lightblue}Server name:\t${default}${servername}" + fi + + # Server description + if [ -n "${serverdescription}" ]; then + echo -e "${lightblue}Server Description:\t${default}${serverdescription}" + fi + + # Appid + if [ -n "${appid}" ]; then + echo -e "${lightblue}App ID:\t${default}${appid}" + fi + + # Branch + if [ -n "${branch}" ]; then + echo -e "${lightblue}Branch:\t${default}${branch}" + fi + + # Beta Password + if [ -n "${betapassword}" ]; then + echo -e "${lightblue}Beta Password:\t${default}${betapassword}" + fi + + # Server ip + if [ "${multiple_ip}" == "1" ]; then + echo -e "${lightblue}Server IP:\t${default}NOT SET" + else + echo -e "${lightblue}Server IP:\t${default}${ip}:${port}" + fi + + # Internet ip + if [ -n "${extip}" ]; then + if [ "${ip}" != "${extip}" ]; then + echo -e "${lightblue}Internet IP:\t${default}${extip}:${port}" + fi + fi + + # Display ip + if [ -n "${displayip}" ]; then + echo -e "${lightblue}Display IP:\t${default}${displayip}:${port}" + fi + + # Server password + if [ -n "${serverpassword}" ]; then + echo -e "${lightblue}Server password:\t${default}${serverpassword}" + fi + + # Query enabled (Starbound) + if [ -n "${queryenabled}" ]; then + echo -e "${lightblue}Query enabled:\t${default}${queryenabled}" + fi + + # RCON enabled (Starbound) + if [ -n "${rconenabled}" ]; then + echo -e "${lightblue}RCON enabled:\t${default}${rconenabled}" + fi + + # RCON password + if [ -n "${rconpassword}" ]; then + echo -e "${lightblue}RCON password:\t${default}${rconpassword}" + fi + + # RCON web (Rust) + if [ -n "${rconweb}" ]; then + echo -e "${lightblue}RCON web:\t${default}${rconweb}" + fi + + # Admin password + if [ -n "${adminpassword}" ]; then + echo -e "${lightblue}Admin password:\t${default}${adminpassword}" + fi + + # Stats password (Quake Live) + if [ -n "${statspassword}" ]; then + echo -e "${lightblue}Stats password:\t${default}${statspassword}" + fi + + # Players + if [ "${querystatus}" != "0" ]; then + if [ -n "${maxplayers}" ]; then + echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}" + fi + else + if [ -n "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then + echo -e "${lightblue}Players:\t${default}${gdplayers}/${gdmaxplayers}" + elif [ -n "${gdplayers}" ]&&[ -n "${maxplayers}" ]; then + echo -e "${lightblue}Players:\t${default}${gdplayers}/${maxplayers}" + elif [ -z "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then + echo -e "${lightblue}Players:\t${default}0/${gdmaxplayers}" + elif [ -n "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]; then + echo -e "${lightblue}Players:\t${default}${gdplayers}/∞" + elif [ -z "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]&&[ -n "${maxplayers}" ]; then + echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}" + fi + fi + + # Bots + if [ -n "${gdbots}" ]; then + echo -e "${lightblue}Bots:\t${default}${gdbots}" + fi + + # Current map + if [ -n "${gdmap}" ]; then + echo -e "${lightblue}Current map:\t${default}${gdmap}" + fi + + # Default map + if [ -n "${defaultmap}" ]; then + echo -e "${lightblue}Default map:\t${default}${defaultmap}" + fi + + if [ -n "${defaultscenario}" ]; then + # Current scenario + if [ -n "${gdgamemode}" ]; then + echo -e "${lightblue}Current scenario:\t${default}${gdgamemode}" + fi + else + # Current game mode + if [ -n "${gdgamemode}" ]; then + echo -e "${lightblue}Current game mode:\t${default}${gdgamemode}" + fi + fi + + # Default scenario + if [ -n "${defaultscenario}" ]; then + echo -e "${lightblue}Default scenario:\t${default}${defaultscenario}" + fi + + # Game type + if [ -n "${gametype}" ]; then + echo -e "${lightblue}Game type:\t${default}${gametype}" + fi + + # Game mode + if [ -n "${gamemode}" ]; then + echo -e "${lightblue}Game mode:\t${default}${gamemode}" + fi + + # Game world + if [ -n "${gameworld}" ]; then + echo -e "${lightblue}Game world:\t${default}${gameworld}" + fi + + # Tick rate + if [ -n "${tickrate}" ]; then + echo -e "${lightblue}Tick rate:\t${default}${tickrate}" + fi + + # Sharding (Don't Starve Together) + if [ -n "${sharding}" ]; then + echo -e "${lightblue}Sharding:\t${default}${sharding}" + fi + + # Master (Don't Starve Together) + if [ -n "${master}" ]; then + echo -e "${lightblue}Master:\t${default}${master}" + fi + + # Shard (Don't Starve Together) + if [ -n "${shard}" ]; then + echo -e "${lightblue}Shard:\t${default}${shard}" + fi + + # Cluster (Don't Starve Together) + if [ -n "${cluster}" ]; then + echo -e "${lightblue}Cluster:\t${default}${cluster}" + fi + + # Cave (Don't Starve Together) + if [ -n "${cave}" ]; then + echo -e "${lightblue}Cave:\t${default}${cave}" + fi + + # Creativemode (Hurtworld) + if [ -n "${creativemode}" ]; then + echo -e "${lightblue}Creativemode:\t${default}${creativemode}" + fi + + # TeamSpeak dbplugin + if [ -n "${dbplugin}" ]; then + echo -e "${lightblue}dbplugin:\t${default}${dbplugin}" + fi + + # ASE (Multi Theft Auto) + if [ -n "${ase}" ]; then + echo -e "${lightblue}ASE:\t${default}${ase}" + fi + + # Save interval (Rust) + if [ -n "${saveinterval}" ]; then + echo -e "${lightblue}ASE:\t${default}${saveinterval} s" + fi + + # Random map rotation mode (Squad and Post Scriptum) + if [ -n "${randommap}" ]; then + echo -e "${lightblue}Map rotation:\t${default}${randommap}" + fi + + # Server Version (Jedi Knight II: Jedi Outcast) + if [ -n "${serverversion}" ]; then + echo -e "${lightblue}Server Version:\t${default}${serverversion}" + fi + + # authentication token (Factorio) + if [ -n "${authtoken}" ]; then + echo -e "${lightblue}Auth Token:\t${default}${authtoken}" + fi + + # savegameinterval (Factorio) + if [ -n "${savegameinterval}" ]; then + echo -e "${lightblue}Savegame Interval:\t${default}${savegameinterval}" + fi + + # versioncount (Factorio) + if [ -n "${versioncount}" ]; then + echo -e "${lightblue}Version Count:\t${default}${versioncount}" + fi + + # Listed on Master server + if [ -n "${displaymasterserver}" ]; then + if [ "${displaymasterserver}" == "true" ]; then + echo -e "${lightblue}Master server:\t${green}listed${default}" + else + echo -e "${lightblue}Master server:\t${red}not listed${default}" + fi + fi + + # Online status + if [ "${status}" == "0" ]; then + echo -e "${lightblue}Status:\t${red}OFFLINE${default}" + else + echo -e "${lightblue}Status:\t${green}ONLINE${default}" + fi + } | column -s $'\t' -t + echo -e "" +} + +fn_info_message_script(){ + # + # csgoserver Script Details + #========================================================================================================================================================================================================================================== + # Script name: csgoserver + # LinuxGSM version: v19.9.0 + # glibc required: 2.15 + # Discord alert: off + # Email alert: off + # IFTTT alert: off + # Mailgun (email) alert: off + # Pushbullet alert: off + # Pushover alert: off + # Rocketchat alert: off + # Slack alert: off + # Telegram alert: off + # Update on start: off + # User: lgsm + # Location: /home/lgsm/csgoserver + # Config file: /home/lgsm/csgoserver/serverfiles/csgo/cfg/csgoserver.cfg + + echo -e "${lightgreen}${selfname} Script Details${default}" + fn_messages_separator + { + # Script name + echo -e "${lightblue}Script name:\t${default}${selfname}" + + # LinuxGSM version + if [ -n "${version}" ]; then + echo -e "${lightblue}LinuxGSM version:\t${default}${version}" + fi + + # glibc required + if [ -n "${glibc}" ]; then + if [ "${glibc}" == "null" ]; then + # Glibc is not required. + : + elif [ -z "${glibc}" ]; then + echo -e "${lightblue}glibc required:\t${red}UNKNOWN${default}" + elif [ "$(printf '%s\n'${glibc}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibc}" ]; then + echo -e "${lightblue}glibc required:\t${red}${glibc} ${default}(${red}distro glibc ${glibcversion} too old${default})" + else + echo -e "${lightblue}glibc required:\t${green}${glibc}${default}" + fi + fi + + # Discord alert + echo -e "${lightblue}Discord alert:\t${default}${discordalert}" + # Email alert + echo -e "${lightblue}Email alert:\t${default}${emailalert}" + # IFTTT alert + echo -e "${lightblue}IFTTT alert:\t${default}${iftttalert}" + # Mailgun alert + echo -e "${lightblue}Mailgun (email) alert:\t${default}${mailgunalert}" + # Pushbullet alert + echo -e "${lightblue}Pushbullet alert:\t${default}${pushbulletalert}" + # Pushover alert + echo -e "${lightblue}Pushover alert:\t${default}${pushoveralert}" + # Rocketchat alert + echo -e "${lightblue}Rocketchat alert:\t${default}${rocketchatalert}" + # Slack alert + echo -e "${lightblue}Slack alert:\t${default}${slackalert}" + # Telegram alert + echo -e "${lightblue}Telegram alert:\t${default}${telegramalert}" + + # Update on start + if [ -n "${updateonstart}" ]; then + echo -e "${lightblue}Update on start:\t${default}${updateonstart}" + fi + + # User + echo -e "${lightblue}User:\t${default}$(whoami)" + + # Script location + echo -e "${lightblue}Location:\t${default}${rootdir}" + + # Config file location + if [ -n "${servercfgfullpath}" ]; then + if [ -f "${servercfgfullpath}" ]; then + echo -e "${lightblue}Config file:\t${default}${servercfgfullpath}" + elif [ -d "${servercfgfullpath}" ]; then + echo -e "${lightblue}Config dir:\t${default}${servercfgfullpath}" + else + echo -e "${lightblue}Config file:\t${default}${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})" + fi + fi + + # Network config file location (ARMA 3) + if [ -n "${networkcfgfullpath}" ]; then + echo -e "${lightblue}Network config file:\t${default}${networkcfgfullpath}" + fi + } | column -s $'\t' -t +} + +fn_info_message_backup(){ + # + # Backups + # ===================================== + # No. of backups: 1 + # Latest backup: + # date: Fri May 6 18:34:19 UTC 2016 + # file: /home/lgsm/qlserver/backups/ql-server-2016-05-06-183239.tar.gz + # size: 945M + + echo -e "" + echo -e "${lightgreen}Backups${default}" + fn_messages_separator + if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then + echo -e "No Backups created" + else + { + echo -e "${lightblue}No. of backups:\t${default}${backupcount}" + echo -e "${lightblue}Latest backup:${default}" + if [ "${lastbackupdaysago}" == "0" ]; then + echo -e "${lightblue} date:\t${default}${lastbackupdate} (less than 1 day ago)" + elif [ "${lastbackupdaysago}" == "1" ]; then + echo -e "${lightblue} date:\t${default}${lastbackupdate} (1 day ago)" + else + echo -e "${lightblue} date:\t${default}${lastbackupdate} (${lastbackupdaysago} days ago)" + fi + echo -e "${lightblue} file:\t${default}${lastbackup}" + echo -e "${lightblue} size:\t${default}${lastbackupsize}" + } | column -s $'\t' -t + fi +} + +fn_info_message_commandlineparms(){ + # + # Command-line Parameters + # ===================================== + # ./run_server_x86.sh +set net_strict 1 + + echo -e "" + echo -e "${lightgreen}Command-line Parameters${default}" + fn_info_message_password_strip + fn_messages_separator + if [ "${serverpassword}" == "NOT SET" ]; then + unset serverpassword + fi + fn_parms + echo -e "${preexecutable} ${executable} ${parms}" +} + +fn_info_message_ports(){ + # Ports + # ===================================== + # Change ports by editing the parameters in: + # /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg + + echo -e "" + echo -e "${lightgreen}Ports${default}" + fn_messages_separator + echo -e "${lightblue}Change ports by editing the parameters in:${default}" + + parmslocation="${red}UNKNOWN${default}" + # engines/games that require editing in the config file. + local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "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") + for port_edit in "${ports_edit_array[@]}"; do + if [ "${shortname}" == "ut3" ]; then + parmslocation="${servercfgdir}/UTWeb.ini" + elif [ "${shortname}" == "kf2" ]; then + parmslocation="${servercfgdir}/LinuxServer-KFEngine.ini\n${servercfgdir}/KFWeb.ini" + elif [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then + parmslocation="${servercfgfullpath}" + fi + done + # engines/games that require editing the parms. + local ports_edit_array=( "Avorion" "col" "goldsrc" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "qfusion" "Rust" "scpsl" "scpslsm" "Soldat" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned" ) + for port_edit in "${ports_edit_array[@]}"; do + if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then + parmslocation="${configdirserver}" + fi + done + echo -e "${parmslocation}" + echo -e "" + echo -e "${lightblue}Useful port diagnostic command:${default}" +} + +fn_info_message_statusbottom(){ + echo -e "" + if [ "${status}" == "0" ]; then + echo -e "${lightblue}Status:\t${red}OFFLINE${default}" + else + echo -e "${lightblue}Status:\t${green}ONLINE${default}" + fi + echo -e "" +} + +fn_info_logs(){ + echo -e "" + echo -e "${selfname} Logs" + echo -e "=================================" + + if [ -n "${lgsmlog}" ]; then + echo -e "\nScript log\n===================" + if [ ! "$(ls -A "${lgsmlogdir}")" ]; then + echo -e "${lgsmlogdir} (NO LOG FILES)" + elif [ ! -s "${lgsmlog}" ]; then + echo -e "${lgsmlog} (LOG FILE IS EMPTY)" + else + echo -e "${lgsmlog}" + tail -25 "${lgsmlog}" + fi + echo -e "" + fi + + if [ -n "${consolelog}" ]; then + echo -e "\nConsole log\n====================" + if [ ! "$(ls -A "${consolelogdir}")" ]; then + echo -e "${consolelogdir} (NO LOG FILES)" + elif [ ! -s "${consolelog}" ]; then + echo -e "${consolelog} (LOG FILE IS EMPTY)" + else + echo -e "${consolelog}" + tail -25 "${consolelog}" | awk '{ sub("\r$", ""); print }' + fi + echo -e "" + fi + + if [ -n "${gamelogdir}" ]; then + echo -e "\nServer log\n===================" + if [ ! "$(ls -A "${gamelogdir}")" ]; then + echo -e "${gamelogdir} (NO LOG FILES)" + else + echo -e "${gamelogdir}" + # dos2unix sed 's/\r//' + tail "${gamelogdir}"/* 2>/dev/null | grep -v "==>" | sed '/^$/d' | sed 's/\r//' | tail -25 + fi + echo -e "" + fi +} + +# Engine/Game Specific details + +fn_info_message_assettocorsa(){ + echo -e "netstat -atunp| grep acServer" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> HTTP\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_ark(){ + echo -e "netstat -atunp | grep ShooterGame" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + # Don't do arithmetics if ever the port wasn't a numeric value + if [ "${port}" -eq "${port}" ]; then + echo -e "> RAW\tINBOUND\t$((port+1))\tudp" + fi + echo -e "> Query\tINBOUND\t${queryport}\tudp" + echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_avorion() { + echo "netstat -atunp | grep Avorion" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_ballisticoverkill(){ + echo -e "netstat -atunp | grep BODS.x86" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game/RCON\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_battalion1944(){ + echo -e "netstat -atunp | grep BattalionServ" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + # Don't do arithmetics if ever the port wasn't a numeric value + # unconfirmed - http://wiki.battaliongame.com/Community_Servers#Firewalls_.2F_Port_Forwarding + if [ "${port}" -eq "${port}" ]; then + echo -e "> Steam\tINBOUND\t$((port+1))\tudp" + echo -e "> Unused\tINBOUND\t$((port+2))\ttcp" + fi + echo -e "> Query\tINBOUND\t${queryport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_cod(){ + echo -e "netstat -atunp | grep cod_lnxded" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_coduo(){ + echo -e "netstat -atunp | grep coduo_lnxded" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_chivalry(){ + fn_info_message_password_strip + echo -e "netstat -atunp | grep UDKGame" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + echo -e "> RCON\tINBOUND\t27960\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_cod2(){ + echo -e "netstat -atunp | grep cod2_lnxded" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_cod4(){ + echo -e "netstat -atunp" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_codwaw(){ + echo -e "netstat -atunp | grep codwaw_lnxded" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_dst(){ + echo -e "netstat -atunp | grep dontstarve" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game: Server\tINBOUND\t${port}\tudp" + echo -e "> Game: Master\tINBOUND\t${masterport}\tudp" + echo -e "> Steam: Auth\tINBOUND\t${steamauthenticationport}\tudp" + echo -e "> Steam: Master\tINBOUND\t${steammasterserverport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_eco(){ + echo -e "netstat -atunp | grep 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" + } | column -s $'\t' -t +} + + +fn_info_message_etlegacy(){ + echo -e "netstat -atunp | grep etlded" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game/Query\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_factorio(){ + echo -e "netstat -atunp | grep factorio" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_goldsrc(){ + echo -e "netstat -atunp | grep hlds_linux" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp" + echo -e "< Client\tOUTBOUND\t${clientport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_hurtworld(){ + echo -e "netstat -atunp | grep Hurtworld" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game/RCON\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_inss(){ + echo -e "netstat -atunp | grep Insurgency" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + if [ -n "${rconport}" ]; then + echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + fi + } | 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_justcause2(){ + echo -e "netstat -atunp | grep Jcmp-Server" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_justcause3(){ + echo -e "netstat -atunp | grep Server" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + echo -e "> Steam\tINBOUND\t${steamport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_minecraft(){ + echo -e "netstat -atunp | grep java" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\ttcp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + echo -e "> Rcon\tINBOUND\t${rconport}\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_minecraft_bedrock(){ + echo -e "netstat -atunp | grep bedrock_serv" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Game\tINBOUND\t${port6}\tudp6" + } | column -s $'\t' -t +} + +fn_info_message_onset(){ + echo -e "netstat -atunp | grep OnsetServer" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + echo -e "> HTTP\tINBOUND\t${httpport}\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_mohaa(){ + echo -e "netstat -atunp | grep mohaa_lnxded" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_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" + } | column -s $'\t' -t +} + +fn_info_message_mumble(){ + echo -e "netstat -atunp | grep murmur" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Voice\tINBOUND\t${port}\tudp" + echo -e "> ServerQuery\tINBOUND\t${port}\ttcp" + } | column -s $'\t' -t +} +fn_info_message_pstbs(){ + echo -e "netstat -atunp | grep PostScriptum" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_projectcars(){ + echo -e "netstat -atunp | grep DedicatedS" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + echo -e "> Steam\tINBOUND\t${steamport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_projectzomboid(){ + echo -e "netstat -atunp | grep ProjectZomb" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game/Query\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_quake(){ + echo -e "netstat -atunp | grep mvdsv" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_quake2(){ + echo -e "netstat -atunp | grep quake2" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_quake3(){ + echo -e "netstat -atunp | grep q3ded" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_quakelive(){ + echo -e "netstat -atunp | grep qzeroded" + echo -e "" + if [ -z "${port}" ]||[ -z "${rconport}" ]||[ -z "${statsport}" ]; then + echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}." + echo -e "" + fi + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game/Query\tINBOUND\t${port}\tudp" + echo -e "> Rcon\tINBOUND\t${rconport}\tudp" + echo -e "> Stats\tINBOUND\t${statsport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_arma3(){ + echo -e "netstat -atunp | grep arma3server" + echo -e "" + # Default port + if [ -z "${port}" ]; then + port="2302" + fi + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + # Don't do arithmetics if ever the port wasn't a numeric value + if [ "${port}" -eq "${port}" ]; then + echo -e "> Query Steam\tINBOUND\t$((port+1))\tudp" + echo -e "> Steam: Master traffic\tINBOUND\t$((port+2))\tudp" + echo -e "> Undocumented Port\tINBOUND\t$((port+3))\tudp" + fi + } | column -s $'\t' -t +} + +fn_info_message_bf1942(){ + echo -e "netstat -atunp | grep bf1942_lnxd" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game/Query\tINBOUND\t${port}\tudp" + echo -e "> Query Steam\tINBOUND\t${queryport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_bfv(){ + echo -e "netstat -atunp | grep bfv_linded" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_risingworld(){ + echo -e "netstat -atunp | grep java" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp" + echo -e "> Query HTTP\tINBOUND\t${httpqueryport}\ttcp" + echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_rtcw(){ + echo -e "netstat -atunp | grep iowolfded" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_rust(){ + echo -e "netstat -atunp | grep Rust" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game/Query\tINBOUND\t${port}\tudp" + echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_samp(){ + echo -e "netstat -atunp | grep samp03svr" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp" + } | column -s $'\t' -t +} + +fn_info_message_sbots(){ + echo -e "netstat -atunp | grep blank1" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_sdtd(){ + fn_info_message_password_strip + echo -e "netstat -atunp | grep 7DaysToDie" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game/RCON\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp" + echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp" + } | 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 password:\t${default}${webadminpass}" + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${gamename} Telnet${default}" + fn_messages_separator + { + echo -e "${lightblue}Telnet enabled:\t${default}${telnetenabled}" + echo -e "${lightblue}Telnet address:\t${default}${telnetip} ${telnetport}" + echo -e "${lightblue}Telnet password:\t${default}${telnetpass}" + } | column -s $'\t' -t +} + +fn_info_message_sof2(){ + echo -e "netstat -atunp | grep sof2ded" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game/Query\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_source(){ + echo -e "netstat -atunp | grep srcds_linux" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp" + echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp" + echo -e "< Client\tOUTBOUND\t${clientport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_spark(){ + fn_info_message_password_strip + echo -e "netstat -atunp | grep server_linux" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game/RCON\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp" + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${servername} Web Admin${default}" + fn_messages_separator + { + 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 +} + +fn_info_message_squad(){ + echo -e "netstat -atunp | grep SquadServer" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_starbound(){ + echo -e "netstat -atunp | grep starbound" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\ttcp" + echo -e "> Query\tINBOUND\t${queryport}\ttcp" + echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_stationeers(){ + echo -e "netstat -atunp | grep rocketstation" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\ttcp" + echo -e "> Query\tINBOUND\t${queryport}\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_teamspeak3(){ + echo -e "netstat -atunp | grep ts3server" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Voice\tINBOUND\t${port}\tudp" + echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp" + echo -e "> File transfer\tINBOUND\t${fileport}\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_teeworlds(){ + echo -e "netstat -atunp | grep teeworlds" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\Query\tINBOUND\t${port}\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_terraria(){ + echo -e "netstat -atunp | grep Terraria" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_towerunite(){ + echo -e "netstat -atunp | grep TowerServer" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\ttcp" + # Don't do arithmetics if ever the port wasn't a numeric value + if [ "${port}" -eq "${port}" ]; then + echo -e "> Steam\tINBOUND\t$((port+1))\tudp" + fi + echo -e "> Query\tINBOUND\t${queryport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_unreal(){ + fn_info_message_password_strip + echo -e "netstat -atunp | grep ucc-bin" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE" + echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + if [ "${engine}" == "unreal" ]; then + echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp" + fi + if [ "${engine}" != "unreal" ]&&[ "${appid}" != "223250" ]; then + echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}" + fi + if [ "${appid}" == "215360" ]; then + echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp" + else + echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp" + fi + if [ "${appid}" ]; then + if [ "${appid}" == "223250" ]; then + echo -e "< Steam\tINBOUND\t20610\tudp" + else + echo -e "< Steam\tINBOUND\t20660\tudp" + fi + fi + echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${servername} 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 username:\t${default}${webadminuser}" + echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + } | column -s $'\t' -t +} + +fn_info_message_unreal2(){ + fn_info_message_password_strip + echo -e "netstat -atunp | grep ucc-bin" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE" + echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + if [ "${appid}" != "223250" ]; then + echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}" + fi + echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${servername} 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 username:\t${default}${webadminuser}" + echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + } | column -s $'\t' -t +} + +fn_info_message_unreal3(){ + fn_info_message_password_strip + echo -e "netstat -atunp | grep ut3-bin" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${servername} 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 username:\t${default}${webadminuser}" + echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + } | column -s $'\t' -t +} + +fn_info_message_unturned(){ + echo -e "netstat -atunp | grep Unturned" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_ut(){ + echo -e "netstat -atunp | grep UE4Server" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_kf2(){ + fn_info_message_password_strip + echo -e "netstat -atunp | grep KFGame" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\ttcp\tPort=${port}" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + echo -e "> Steam\tINBOUND\t20560\tudp" + echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${servername} 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 username:\t${default}${webadminuser}" + echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + } | column -s $'\t' -t +} + +fn_info_message_wolfensteinenemyterritory(){ + echo -e "netstat -atunp | grep etded" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game/Query\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + + +fn_info_message_wurmunlimited(){ + echo -e "netstat -atunp | grep WurmServer" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\ttcp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_mta(){ + echo -e "netstat -atunp | grep mta-server" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game/Query\tOUTBOUND\t${port}\tudp" + echo -e "> HTTP Server\tINBOUND\t${httpport}\ttcp" + if [ "${ase}" == "Enabled" ]; then + echo -e "> Query Port\tOUTBOUND\t${queryport}\tudp" + fi + } | column -s $'\t' -t +} + +fn_info_message_mordhau(){ + echo -e "netstat -atunp | grep Mord" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> BeaconPort\tINBOUND\t${beaconport}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_barotrauma(){ + echo -e "netstat -atunp | grep /./Server.bin" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t$((port+1))\tudp" + } | column -s $'\t' -t +} + +fn_info_message_soldat() { + echo -e "netstat -atunp | grep soldat" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" + echo -e "> FILES\tINBOUND\t$((port+10))\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_warfork(){ + echo -e "netstat -atunp | grep wf_server" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> HTTP\tINBOUND\t${httpport}\ttcp" + } | column -s $'\t' -t +} + +fn_info_message_pavlovvr(){ + echo "netstat -atunp | grep Pavlov" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Game\tINBOUND\t$((port+400))\tudp" + } | column -s $'\t' -t +} + +fn_info_message_colony(){ + echo -e "netstat -atunp | grep colonyserv" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Steam\tINBOUND\t${steamport}\tudp" + } | column -s $'\t' -t +} + +fn_info_message_vintagestory(){ + echo "netstat -atunp | grep cli" + echo -e "" + { + 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" + } | column -s $'\t' -t +} + +fn_info_message_select_engine(){ + # Display details depending on game or engine. + if [ "${shortname}" == "ac" ]; then + fn_info_message_assettocorsa + elif [ "${shortname}" == "ark" ]; then + fn_info_message_ark + elif [ "${shortname}" == "av" ]; then + fn_info_message_avorion + elif [ "${shortname}" == "arma3" ]; then + fn_info_message_arma3 + elif [ "${shortname}" == "bo" ]; then + fn_info_message_ballisticoverkill + elif [ "${shortname}" == "bt" ]; then + fn_info_message_barotrauma + elif [ "${shortname}" == "bt1944" ]; then + fn_info_message_battalion1944 + elif [ "${shortname}" == "cmw" ]; then + fn_info_message_chivalry + elif [ "${shortname}" == "cod" ]; then + fn_info_message_cod + elif [ "${shortname}" == "coduo" ]; then + fn_info_message_coduo + elif [ "${shortname}" == "cod2" ]; then + fn_info_message_cod2 + elif [ "${shortname}" == "cod4" ]; then + fn_info_message_cod4 + elif [ "${shortname}" == "codwaw" ]; then + fn_info_message_codwaw + elif [ "${shortname}" == "col" ]; then + fn_info_message_colony + elif [ "${shortname}" == "dst" ]; then + fn_info_message_dst + elif [ "${shortname}" == "eco" ]; then + fn_info_message_eco + elif [ "${shortname}" == "etl" ]; then + fn_info_message_etlegacy + elif [ "${shortname}" == "fctr" ]; then + fn_info_message_factorio + elif [ "${shortname}" == "hw" ]; then + fn_info_message_hurtworld + elif [ "${shortname}" == "inss" ]; then + fn_info_message_inss + elif [ "${shortname}" == "jk2" ]; then + fn_info_message_jk2 + elif [ "${shortname}" == "jc2" ]; then + fn_info_message_justcause2 + elif [ "${shortname}" == "jc3" ]; then + fn_info_message_justcause3 + elif [ "${shortname}" == "kf2" ]; then + fn_info_message_kf2 + elif [ "${shortname}" == "mcb" ]; then + fn_info_message_minecraft_bedrock + elif [ "${shortname}" == "onset" ]; then + fn_info_message_onset + elif [ "${shortname}" == "mom" ]; then + fn_info_message_mom + elif [ "${shortname}" == "pz" ]; then + fn_info_message_projectzomboid + elif [ "${shortname}" == "pstbs" ]; then + fn_info_message_pstbs + elif [ "${shortname}" == "pc" ]; then + fn_info_message_projectcars + elif [ "${shortname}" == "qw" ]; then + fn_info_message_quake + elif [ "${shortname}" == "q2" ]; then + fn_info_message_quake2 + elif [ "${shortname}" == "q3" ]; then + fn_info_message_quake3 + elif [ "${shortname}" == "ql" ]; then + fn_info_message_quakelive + elif [ "${shortname}" == "samp" ]; then + fn_info_message_samp + elif [ "${shortname}" == "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 + elif [ "${shortname}" == "terraria" ]; then + fn_info_message_terraria + elif [ "${shortname}" == "ts3" ]; then + fn_info_message_teamspeak3 + elif [ "${shortname}" == "tu" ]; then + fn_info_message_towerunite + elif [ "${shortname}" == "tw" ]; then + fn_info_message_teeworlds + elif [ "${shortname}" == "unt" ]; then + fn_info_message_unturned + elif [ "${shortname}" == "ut" ]; then + fn_info_message_ut + elif [ "${shortname}" == "mc" ]; then + fn_info_message_minecraft + elif [ "${shortname}" == "mh" ]; then + fn_info_message_mordhau + elif [ "${shortname}" == "mohaa" ]; then + fn_info_message_mohaa + elif [ "${shortname}" == "mta" ]; then + fn_info_message_mta + elif [ "${shortname}" == "mumble" ]; then + fn_info_message_mumble + elif [ "${shortname}" == "bf1942" ]; then + fn_info_message_bf1942 + elif [ "${shortname}" == "bfv" ]; then + fn_info_message_bfv + elif [ "${shortname}" == "rtcw" ]; then + fn_info_message_rtcw + elif [ "${shortname}" == "pvr" ]; then + fn_info_message_pavlovvr + 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 + elif [ "${shortname}" == "wet" ]; then + fn_info_message_wolfensteinenemyterritory + elif [ "${engine}" == "goldsrc" ]; then + fn_info_message_goldsrc + elif [ "${engine}" == "source" ]; then + fn_info_message_source + elif [ "${engine}" == "spark" ]; then + fn_info_message_spark + elif [ "${engine}" == "unreal" ]; then + fn_info_message_unreal + elif [ "${engine}" == "unreal2" ]; then + fn_info_message_unreal2 + elif [ "${engine}" == "unreal3" ]; then + fn_info_message_unreal3 + else + fn_print_error_nl "Unable to detect server engine." + fi +} + +# Separator is different for details +fn_messages_separator(){ + if [ "${commandname}" == "details" ]; then + printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = + else + echo -e "=================================" + fi +} + +# Removes the passwords form all but details +fn_info_message_password_strip(){ + if [ "${commandname}" != "DETAILS" ]; then + if [ "${serverpassword}" ]; then + serverpassword="********" + fi + + if [ "${rconpassword}" ]; then + rconpassword="********" + fi + + if [ "${adminpassword}" ]; then + adminpassword="********" + fi + + if [ "${statspassword}" ]; then + statspassword="********" + fi + + if [ "${webadminpass}" ]; then + webadminpass="********" + fi + + if [ "${telnetpass}" ]; then + telnetpass="********" + fi + + if [ "${wsapikey}" ]; then + wsapikey="********" + fi + + if [ "${gslt}" ]; then + gslt="********" + fi + + fi +} diff --git a/lgsm/functions/info_parms.sh b/lgsm/functions/info_parms.sh new file mode 100755 index 000000000..7644b03a7 --- /dev/null +++ b/lgsm/functions/info_parms.sh @@ -0,0 +1,313 @@ +#!/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_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}" == "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 new file mode 100755 index 000000000..3332f2c5b --- /dev/null +++ b/lgsm/functions/info_stats.sh @@ -0,0 +1,155 @@ +#!/bin/bash +# LinuxGSM info_stats.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Collect optional Stats sent to LinuxGSM project. +# Uses Google analytics. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +info_distro.sh + +# remove uuid that was used in v20.2.0 and below +if [ -f "${datadir}/uuid.txt" ]; then + rm "${datadir:?}/uuid.txt" +fi + +# generate uuid's +# this consists of a standard uuid and a docker style name +# to allow human readable uuid's. +# e.g angry_proskuriakova_38a9ef76-4ae3-46a6-a895-7af474831eba + +if [ ! -f "${datadir}/uuid-${selfname}.txt" ]||[ ! -f "${datadir}/uuid-install.txt" ]; then + # download dictionary words + if [ ! -f "${datadir}/name-left.csv" ]; then + fn_fetch_file_github "lgsm/data" "name-left.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" + fi + if [ ! -f "${datadir}/name-right.csv" ]; then + fn_fetch_file_github "lgsm/data" "name-right.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" + fi + + # generate instance uuid + if [ -n "$(command -v uuidgen 2>/dev/null)" ]; then + uuid="$(uuidgen)" + else + uuid="$(cat /proc/sys/kernel/random/uuid)" + fi + + nameleft="$(shuf -n 1 "${datadir}/name-left.csv")" + nameright="$(shuf -n 1 "${datadir}/name-right.csv")" + echo "instance_${nameleft}_${nameright}_${uuid}" > "${datadir}/uuid-${selfname}.txt" + # generate install uuid if missing + if [ ! -f "${datadir}/uuid-install.txt" ];then + echo "${nameleft}_${nameright}_${uuid}" > "${datadir}/uuid-install.txt" + fi +fi + +uuidinstance=$(cat "${datadir}/uuid-${selfname}.txt") +uuidinstall=$(cat "${datadir}/uuid-install.txt") +# machine-id is a unique id set on OS install +uuidhardware=$(cat "/etc/machine-id") + +# results are rounded up to reduce number of different results in analytics. +# nearest 100Mhz. +cpuusedmhzroundup="$(((cpuusedmhz + 99) / 100 * 100))" +# nearest 100MB +memusedroundup="$(((memused + 99) / 100 * 100))" + +# Spliting the metrics in to 3 propertys allows more accurate metrics on numbers of invidual instances, installs and hardware. +# Instance Property - UA-165287622-1 +# Install Property - UA-165287622-2 +# Hardware Property - UA-165287622-3 + +## Distro. +curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + +## Game Server Name. +curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + +## LinuxGSM Version. +curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + +## CPU usage of a game server. +if [ -n "${cpuusedmhzroundup}" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +## Ram usage of a game server. +if [ -n "${memusedroundup}" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +## Disk usage of a game server. +if [ -n "${serverfilesdu}" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi + +## CPU Model. +if [ -n "${cpumodel}" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + +fi + +## CPU Frequency. +if [ -n "${cpufreqency}" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi + +## Server RAM. +if [ -n "${physmemtotal}" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi + +## Server Disk. +if [ -n "${totalspace}" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi + +## Summary Stats +curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "v=1" > /dev/null 2>&1 + +fn_script_log_info "Send LinuxGSM stats" +fn_script_log_info "* uuid-${selfname}: ${uuidinstance}" +fn_script_log_info "* uuid-install: ${uuidinstall}" +fn_script_log_info "* uuid-hardware: ${uuidhardware}" +fn_script_log_info "* Game Name: ${gamename}" +fn_script_log_info "* Distro Name: ${distroname}" +fn_script_log_info "* Game Server CPU Used: ${cpuusedmhzroundup}MHz" +fn_script_log_info "* Game Server RAM Used: ${memusedroundup}MB" +fn_script_log_info "* Game Server Disk Used: ${serverfilesdu}" +fn_script_log_info "* Server CPU Model: ${cpumodel}" +fn_script_log_info "* Server CPU Frequency: ${cpufreqency}" +fn_script_log_info "* Server RAM: ${physmemtotal}" +fn_script_log_info "* Server Disk: ${totalspace}" diff --git a/lgsm/functions/install_complete.sh b/lgsm/functions/install_complete.sh new file mode 100755 index 000000000..ad258b224 --- /dev/null +++ b/lgsm/functions/install_complete.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# LinuxGSM install_complete.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Prints installation completion message and hints. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "=================================" +echo -e "Install Complete!" +fn_script_log_info "Install Complete!" +echo -e "" +echo -e "To start server type:" +echo -e "./${selfname} start" +echo -e "" +core_exit.sh diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh new file mode 100755 index 000000000..e1f0ba245 --- /dev/null +++ b/lgsm/functions/install_config.sh @@ -0,0 +1,853 @@ +#!/bin/bash +# LinuxGSM install_config.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Creates default server configs. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Checks if server cfg dir exists, creates it if it doesn't. +fn_check_cfgdir(){ + if [ ! -d "${servercfgdir}" ]; then + echo -e "creating ${servercfgdir} config directory." + fn_script_log_info "creating ${servercfgdir} config directory." + mkdir -pv "${servercfgdir}" + fi +} + +# Downloads default configs from Game-Server-Configs repo to lgsm/config-default. +fn_fetch_default_config(){ + echo -e "" + echo -e "${lightyellow}Downloading ${gamename} Configs${default}" + echo -e "=================================" + echo -e "default configs from https://github.com/GameServerManagers/Game-Server-Configs" + fn_sleep_time + mkdir -p "${lgsmdir}/config-default/config-game" + githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/master" + for config in "${array_configs[@]}"; do + fn_fetch_file "${githuburl}/${gamedirname}/${config}" "${remote_fileurl_backup}" "GitHub" "Bitbucket" "${lgsmdir}/config-default/config-game" "${config}" "nochmodx" "norun" "forcedl" "nomd5" + done +} + +# Copys default configs from Game-Server-Configs repo to server config location. +fn_default_config_remote(){ + for config in "${array_configs[@]}"; do + # every config is copied + echo -e "copying ${config} config file." + fn_script_log_info "copying ${servercfg} config file." + if [ "${config}" == "${servercfgdefault}" ]; then + mkdir -p "${servercfgdir}" + cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}" + elif [ "${shortname}" == "arma3" ]&&[ "${config}" == "${networkcfgdefault}" ]; then + mkdir -p "${servercfgdir}" + cp -nv "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}" + elif [ "${shortname}" == "dst" ]&&[ "${config}" == "${clustercfgdefault}" ]; then + cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}" + else + mkdir -p "${servercfgdir}" + cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgdir}/${config}" + fi + done + fn_sleep_time +} + +# Copys local default config to server config location. +fn_default_config_local(){ + echo -e "copying ${servercfgdefault} config file." + cp -nv "${servercfgdir}/${servercfgdefault}" "${servercfgfullpath}" + fn_sleep_time +} + +# Changes some variables within the default configs. +# SERVERNAME to LinuxGSM +# PASSWORD to random password +fn_set_config_vars(){ + if [ -f "${servercfgfullpath}" ]; then + random=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) + servername="LinuxGSM" + rconpass="admin${random}" + echo -e "changing hostname." + fn_script_log_info "changing hostname." + fn_sleep_time + # prevents var from being overwritten with the servername. + if grep -q "SERVERNAME=SERVERNAME" "${lgsmdir}/config-default/config-game/${config}" 2>/dev/null; then + sed -i "s/SERVERNAME=SERVERNAME/SERVERNAME=${servername}/g" "${servercfgfullpath}" + elif grep -q "SERVERNAME=\"SERVERNAME\"" "${lgsmdir}/config-default/config-game/${config}" 2>/dev/null; then + sed -i "s/SERVERNAME=\"SERVERNAME\"/SERVERNAME=\"${servername}\"/g" "${servercfgfullpath}" + else + sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}" + fi + echo -e "changing rcon/admin password." + fn_script_log_info "changing rcon/admin password." + if [ "${shortname}" == "squad" ]; then + sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgdir}/Rcon.cfg" + else + sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgfullpath}" + fi + fn_sleep_time + else + fn_script_log_warn "Config file not found, cannot alter it." + echo -e "Config file not found, cannot alter it." + fn_sleep_time + fi +} + +# Changes some variables within the default Don't Starve Together configs. +fn_set_dst_config_vars(){ + ## cluster.ini + if grep -Fq "SERVERNAME" "${clustercfgfullpath}"; then + echo -e "changing server name." + fn_script_log_info "changing server name." + sed -i "s/SERVERNAME/LinuxGSM/g" "${clustercfgfullpath}" + fn_sleep_time + echo -e "changing shard mode." + fn_script_log_info "changing shard mode." + sed -i "s/USESHARDING/${sharding}/g" "${clustercfgfullpath}" + fn_sleep_time + echo -e "randomizing cluster key." + fn_script_log_info "randomizing cluster key." + randomkey=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) + sed -i "s/CLUSTERKEY/${randomkey}/g" "${clustercfgfullpath}" + fn_sleep_time + else + echo -e "${clustercfg} is already configured." + fn_script_log_info "${clustercfg} is already configured." + fi + + ## server.ini + # removing unnecessary options (dependent on sharding & shard type). + if [ "${sharding}" == "false" ]; then + sed -i "s/ISMASTER//g" "${servercfgfullpath}" + sed -i "/SHARDNAME/d" "${servercfgfullpath}" + elif [ "${master}" == "true" ]; then + sed -i "/SHARDNAME/d" "${servercfgfullpath}" + fi + + echo -e "changing shard name." + fn_script_log_info "changing shard name." + sed -i "s/SHARDNAME/${shard}/g" "${servercfgfullpath}" + fn_sleep_time + echo -e "changing master setting." + fn_script_log_info "changing master setting." + sed -i "s/ISMASTER/${master}/g" "${servercfgfullpath}" + fn_sleep_time + + ## worldgenoverride.lua + if [ "${cave}" == "true" ]; then + echo -e "defining ${shard} as cave in ${servercfgdir}/worldgenoverride.lua." + fn_script_log_info "defining ${shard} as cave in ${servercfgdir}/worldgenoverride.lua." + echo 'return { override_enabled = true, preset = "DST_CAVE", }' > "${servercfgdir}/worldgenoverride.lua" + fi + fn_sleep_time + echo -e "" +} + +# Lists local config file locations +fn_list_config_locations(){ + echo -e "" + echo -e "${lightyellow}Config File Locations${default}" + echo -e "=================================" + if [ -n "${servercfgfullpath}" ]; then + if [ -f "${servercfgfullpath}" ]; then + echo -e "Game Server Config File: ${servercfgfullpath}" + elif [ -d "${servercfgfullpath}" ]; then + echo -e "Game Server Config Dir: ${servercfgfullpath}" + else + echo -e "Config file: ${red}${servercfgfullpath} (${red}FILE MISSING${default})" + fi + fi + echo -e "LinuxGSM Config: ${lgsmdir}/config-lgsm/${gameservername}" + echo -e "Documentation: https://docs.linuxgsm.com/configuration/game-server-config" + echo -e "" +} + +if [ "${shortname}" == "sdtd" ]; then + gamedirname="7DaysToDie" + fn_default_config_local + fn_list_config_locations +elif [ "${shortname}" == "ac" ]; then + gamedirname="AssettoCorsa" + array_configs+=( server_cfg.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "ahl" ]; then + gamedirname="ActionHalfLife" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "ahl2" ]; then + gamedirname="ActionSource" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "ark" ]; then + gamedirname="ARKSurvivalEvolved" + fn_check_cfgdir + array_configs+=( GameUserSettings.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "arma3" ]; then + gamedirname="Arma3" + fn_check_cfgdir + array_configs+=( server.cfg network.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "bo" ]; then + gamedirname="BallisticOverkill" + array_configs+=( config.txt ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "bo" ]; then + gamedirname="BaseDefense" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "bt" ]; then + gamedirname="Barotrauma" + fn_check_cfgdir + array_configs+=( serversettings.xml ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "bt1944" ]; then + gamedirname="Battalion1944" + fn_check_cfgdir + array_configs+=( DefaultGame.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "bf1942" ]; then + gamedirname="Battlefield1942" + array_configs+=( serversettings.con ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "bfv" ]; then + gamedirname="BattlefieldVietnam" + array_configs+=( serversettings.con ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "bs" ]; then + gamedirname="BladeSymphony" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "bb" ]; then + gamedirname="BrainBread" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "bb2" ]; then + gamedirname="BrainBread2" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "bmdm" ]; then + gamedirname="BlackMesa" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "cod" ]; then + gamedirname="CallOfDuty" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "coduo" ]; then + gamedirname="CallOfDutyUnitedOffensive" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "cod2" ]; then + gamedirname="CallOfDuty2" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "cod4" ]; then + gamedirname="CallOfDuty4" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "codwaw" ]; then + gamedirname="CallOfDutyWorldAtWar" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "cc" ]; then + gamedirname="CodenameCURE" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "col" ]; then + gamedirname="ColonySurvival" + array_configs+=( colserver.json ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "cs" ]; then + gamedirname="CounterStrike" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "cscz" ]; then + gamedirname="CounterStrikeConditionZero" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "csgo" ]; then + gamedirname="CounterStrikeGlobalOffensive" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "css" ]; then + gamedirname="CounterStrikeSource" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "dod" ]; then + gamedirname="DayOfDefeat" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "dods" ]; then + gamedirname="DayOfDefeatSource" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "doi" ]; then + gamedirname="DayOfInfamy" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "dmc" ]; then + gamedirname="DeathmatchClassic" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "dst" ]; then + gamedirname="DontStarveTogether" + fn_check_cfgdir + array_configs+=( cluster.ini server.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_dst_config_vars + fn_list_config_locations +elif [ "${shortname}" == "dab" ]; then + gamedirname="DoubleActionBoogaloo" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "dys" ]; then + gamedirname="Dystopia" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "eco" ]; then + gamedirname="Eco" + array_configs+=( Network.eco ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "etl" ]; then + gamedirname="ETLegacy" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "fctr" ]; then + gamedirname="Factorio" + array_configs+=( server-settings.json ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "fof" ]; then + gamedirname="FistfulofFrags" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "gmod" ]; then + gamedirname="GarrysMod" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "hldm" ]; then + gamedirname="HalfLifeDeathmatch" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "hldms" ]; then + gamedirname="HalfLifeDeathmatchSource" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "opfor" ]; then + gamedirname="OpposingForce" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "hl2dm" ]; then + gamedirname="HalfLife2Deathmatch" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "ins" ]; then + gamedirname="Insurgency" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "ios" ]; then + gamedirname="IOSoccer" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "jc2" ]; then + gamedirname="JustCause2" + array_configs+=( config.lua ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "jc3" ]; then + gamedirname="JustCause3" + array_configs+=( config.json ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "kf" ]; then + gamedirname="KillingFloor" + array_configs+=( Default.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "l4d" ]; then + gamedirname="Left4Dead" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "l4d2" ]; then + gamedirname="Left4Dead2" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "mc" ]; then + gamedirname="Minecraft" + array_configs+=( server.properties ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "mcb" ]; then + gamedirname="MinecraftBedrock" + array_configs+=( server.properties ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "mohaa" ]; then + gamedirname="MedalOfHonorAlliedAssault" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "mh" ]; then + gamedirname="Mordhau" + fn_check_cfgdir + array_configs+=( Game.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "ns" ]; then + gamedirname="NaturalSelection" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "nmrih" ]; then + gamedirname="NoMoreRoominHell" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "nd" ]; then + gamedirname="NuclearDawn" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "mta" ]; then + gamedirname="MultiTheftAuto" + fn_check_cfgdir + array_configs+=( acl.xml mtaserver.conf vehiclecolors.conf ) + fn_fetch_default_config + fn_default_config_remote + fn_list_config_locations +elif [ "${shotname}" == "mom" ];then + gamedirname="MemoriesofMars" + array_configs+=( DedicatedServerConfig.cfg) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "mumble" ]; then + gamedirname="Mumble" + array_configs+=( murmur.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_list_config_locations +elif [ "${shortname}" == "pvr" ]; then + gamedirname="PavlovVR" + fn_check_cfgdir + array_configs+=( Game.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${shortname}" == "pvkii" ]; then + gamedirname="PiratesVikingandKnightsII" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "pz" ]; then + gamedirname="ProjectZomboid" + fn_check_cfgdir + array_configs+=( server.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "pc" ]; then + gamedirname="ProjectCars" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "q2" ]; then + gamedirname="Quake2" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "q3" ]; then + gamedirname="Quake3Arena" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "ql" ]; then + gamedirname="QuakeLive" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "jk2" ]; then + gamedirname="JediKnightIIJediOutcast" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${shortname}" == "qw" ]; then + gamedirname="QuakeWorld" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "ricochet" ]; then + gamedirname="Ricochet" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "rtcw" ]; then + gamedirname="ReturnToCastleWolfenstein" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "rust" ]; then + gamedirname="Rust" + fn_check_cfgdir + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_list_config_locations +elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then + gamedirname="SCPSecretLaboratory" + array_configs+=( config_gameplay.txt config_localadmin.txt ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "sol" ]; then + gamedirname="Soldat" + array_configs+=( soldat.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "sof2" ]; then + gamedirname="SoldierOfFortune2Gold" + array_configs+=( server.cfg mapcycle.txt) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "sfc" ]; then + gamedirname="SourceFortsClassic" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "squad" ]; then + gamedirname="Squad" + array_configs+=( Admins.cfg Bans.cfg License.cfg Server.cfg Rcon.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "sb" ]; then + gamedirname="Starbound" + array_configs+=( starbound_server.config ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "st" ]; then + gamedirname="Stationeers" + array_configs+=( default.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "sven" ]; then + gamedirname="SvenCoop" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "tf2" ]; then + gamedirname="TeamFortress2" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "tfc" ]; then + gamedirname="TeamFortressClassic" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "ts" ]; then + gamedirname="TheSpecialists" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "ts3" ]; then + gamedirname="TeamSpeak3" + array_configs+=( ts3server.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_list_config_locations +elif [ "${shortname}" == "tw" ]; then + gamedirname="Teeworlds" + array_configs+=( server.cfg ctf.cfg dm.cfg duel.cfg tdm.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "terraria" ]; then + gamedirname="Terraria" + array_configs+=( serverconfig.txt ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "tu" ]; then + gamedirname="TowerUnite" + fn_check_cfgdir + array_configs+=( TowerServer.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "ut" ]; then + gamedirname="UnrealTournament" + array_configs+=( Game.ini Engine.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "ut2k4" ]; then + gamedirname="UnrealTournament2004" + array_configs+=( UT2004.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "ut99" ]; then + gamedirname="UnrealTournament99" + array_configs+=( Default.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "unt" ]; then + gamedirname="Unturned" + array_configs+=( Config.json ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "vints" ]; then + gamedirname="VintageStory" + array_configs+=( serverconfig.json ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "vs" ]; then + gamedirname="VampireSlayer" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "wet" ]; then + gamedirname="WolfensteinEnemyTerritory" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "wf" ]; then + gamedirname="Warfork" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "wurm" ]; then + gamedirname="WurmUnlimited" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "zmr" ]; then + gamedirname="ZombieMasterReborn" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "zps" ]; then + gamedirname="ZombiePanicSource" + array_configs+=( server.cfg ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +fi diff --git a/lgsm/functions/install_dst_token.sh b/lgsm/functions/install_dst_token.sh new file mode 100755 index 000000000..50bc7ed97 --- /dev/null +++ b/lgsm/functions/install_dst_token.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# LinuxGSM install_dst_token.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Configures Don't Starve Together cluster with given token. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "${lightyellow}Enter ${gamename} Cluster Token${default}" +echo -e "=================================" +fn_sleep_time +echo -e "A cluster token is required to run this server!" +echo -e "Follow the instructions in this link to obtain this key:" +echo -e "https://linuxgsm.com/dst-auth-token" +echo -e "" +if [ -z "${autoinstall}" ]; then + overwritetoken="true" + if [ -s "${clustercfgdir}/cluster_token.txt" ]; then + echo -e "The cluster token is already set. Do you want to overwrite it?" + fn_script_log_info "Don't Starve Together cluster token is already set" + if fn_prompt_yn "Continue?" N; then + overwritetoken="true" + else + overwritetoken="false" + fi + fi + if [ "${overwritetoken}" == "true" ]; then + echo -e "Once you have the cluster token, enter it below" + echo -n "Cluster Token: " + read -r token + mkdir -pv "${clustercfgdir}" + echo -e "${token}" > "${clustercfgdir}/cluster_token.txt" + if [ -f "${clustercfgdir}/cluster_token.txt" ]; then + echo -e "Don't Starve Together cluster token created" + fn_script_log_info "Don't Starve Together cluster token created" + fi + unset overwritetoken + fi +else + echo -e "You can add your cluster token using the following command" + echo -e "./${selfname} cluster-token" +fi +echo -e "" diff --git a/lgsm/functions/install_eula.sh b/lgsm/functions/install_eula.sh new file mode 100755 index 000000000..0e6b8bd9b --- /dev/null +++ b/lgsm/functions/install_eula.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# LinuxGSM install_eula.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Gets user to accept the EULA. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ "${shortname}" == "ts3" ]; then + eulaurl="https://www.teamspeak.com/en/privacy-and-terms" +elif [ "${shortname}" == "mc" ]; then + eulaurl="https://account.mojang.com/documents/minecraft_eula" +elif [ "${shortname}" == "ut" ]; then + eulaurl="https://www.epicgames.com/unrealtournament/unreal-tournament-pre-alpha-test-development-build-eula" +fi + +echo -e "" +echo -e "${lightyellow}Accept ${gamename} EULA${default}" +echo -e "=================================" +fn_sleep_time +echo -e "You are required to accept the EULA:" +echo -e "${eulaurl}" +echo -e "" +if [ -z "${autoinstall}" ]; then + echo -e "By continuing you are indicating your agreement to the EULA." + echo -e "" + if ! fn_prompt_yn "Continue?" Y; then + exitcode=0 + core_exit.sh + fi +elif [ "${commandname}" == "START" ]; then + fn_print_info "By continuing you are indicating your agreement to the EULA." + echo -e "" + sleep 5 +else + echo -e "By using auto-install you are indicating your agreement to the EULA." + echo -e "" + sleep 5 +fi + +if [ "${shortname}" == "ts3" ]; then + touch "${executabledir}/.ts3server_license_accepted" +elif [ "${shortname}" == "mc" ]; then + touch "${serverfiles}/eula.txt" + echo -e "eula=true" > "${serverfiles}/eula.txt" +elif [ "${shortname}" == "ut" ]; then + : +fi diff --git a/lgsm/functions/install_factorio_save.sh b/lgsm/functions/install_factorio_save.sh new file mode 100755 index 000000000..f5fdb8a04 --- /dev/null +++ b/lgsm/functions/install_factorio_save.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# LinuxGSM install_factorio_save.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Creates the initial save file for Factorio. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "${lightyellow}Creating initial Factorio savefile${default}" +echo -e "=================================" +fn_sleep_time +check_glibc.sh +"${executabledir}"/factorio --create "${serverfiles}/save1" diff --git a/lgsm/functions/install_gslt.sh b/lgsm/functions/install_gslt.sh new file mode 100755 index 000000000..a8f8065c2 --- /dev/null +++ b/lgsm/functions/install_gslt.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# LinuxGSM install_gslt.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Configures GSLT. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "${lightyellow}Game Server Login Token${default}" +echo -e "=================================" +fn_sleep_time +if [ "${shortname}" == "csgo" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "nmrih" ]||[ "${shortname}" == "bs" ]; then + echo -e "GSLT is required to run a public ${gamename} server" + fn_script_log_info "GSLT is required to run a public ${gamename} server" +else + echo -e "GSLT is an optional feature for ${gamename} server" + fn_script_log_info "GSLT is an optional feature for ${gamename} server" +fi + +echo -e "Get more info and a token here:" +echo -e "https://docs.linuxgsm.com/steamcmd/gslt" +fn_script_log_info "Get more info and a token here:" +fn_script_log_info "https://docs.linuxgsm.com/steamcmd/gslt" +echo -e "" +if [ -z "${autoinstall}" ]; then + if [ "${shortname}" != "tu" ]; then + echo -e "Enter token below (Can be blank)." + echo -n "GSLT TOKEN: " + read -r token + if ! grep -q "^gslt=" "${configdirserver}/${selfname}.cfg" > /dev/null 2>&1; then + echo -e "\ngslt=\"${token}\"" >> "${configdirserver}/${selfname}.cfg" + else + sed -i -e "s/gslt=\"[^\"]*\"/gslt=\"${token}\"/g" "${configdirserver}/${selfname}.cfg" + fi + fi +fi +fn_sleep_time +if [ "${shortname}" == "tu" ]; then + echo -e "The GSLT can be changed by editing ${servercfgdir}/${servercfg}." + fn_script_log_info "The GSLT can be changed by editing ${servercfgdir}/${servercfg}." +else + echo -e "The GSLT can be changed by editing ${configdirserver}/${selfname}.cfg." + fn_script_log_info "The GSLT can be changed by editing ${configdirserver}/${selfname}.cfg." +fi +echo -e "" diff --git a/lgsm/functions/install_header.sh b/lgsm/functions/install_header.sh new file mode 100755 index 000000000..4cf067f8f --- /dev/null +++ b/lgsm/functions/install_header.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# LinuxGSM install_header.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Prints installation header. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +clear +fn_print_ascii_logo +fn_sleep_time +echo -e "=================================" +echo -e "${lightyellow}Linux${default}GSM_" +echo -e "by Daniel Gibbs" +echo -e "${lightblue}Version:${default} ${version}" +echo -e "${lightblue}Game:${default} ${gamename}" +echo -e "${lightblue}Website:${default} https://linuxgsm.com" +echo -e "${lightblue}Contributors:${default} https://linuxgsm.com/contrib" +echo -e "${lightblue}Sponsor:${default} https://linuxgsm.com/sponsor" +echo -e "=================================" +fn_sleep_time diff --git a/lgsm/functions/install_logs.sh b/lgsm/functions/install_logs.sh new file mode 100755 index 000000000..57a41500c --- /dev/null +++ b/lgsm/functions/install_logs.sh @@ -0,0 +1,100 @@ +#!/bin/bash +# LinuxGSM install_logs.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Creates log directories. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ "${checklogs}" != "1" ]; then + echo -e "" + echo -e "${lightyellow}Creating log directories${default}" + echo -e "=================================" +fi +fn_sleep_time +# Create LinuxGSM logs. +echo -en "installing log dir: ${logdir}..." +mkdir -p "${logdir}" +if [ $? != 0 ]; then + fn_print_fail_eol_nl + core_exit.sh +else + fn_print_ok_eol_nl +fi + +echo -en "installing LinuxGSM log dir: ${lgsmlogdir}..." +mkdir -p "${lgsmlogdir}" +if [ $? != 0 ]; then + fn_print_fail_eol_nl + core_exit.sh +else + fn_print_ok_eol_nl +fi +echo -en "creating LinuxGSM log: ${lgsmlog}..." +touch "${lgsmlog}" +if [ $? != 0 ]; then + fn_print_fail_eol_nl + core_exit.sh +else + fn_print_ok_eol_nl +fi +# Create Console logs. +if [ "${consolelogdir}" ]; then + echo -en "installing console log dir: ${consolelogdir}..." + mkdir -p "${consolelogdir}" + if [ $? != 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi + echo -en "creating console log: ${consolelog}..." + if ! touch "${consolelog}"; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi +fi + +# Create Game logs. +if [ "${gamelogdir}" ]&&[ ! -d "${gamelogdir}" ]; then + echo -en "installing game log dir: ${gamelogdir}..." + if ! mkdir -p "${gamelogdir}"; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi +fi + +# Symlink to gamelogdir +# unless gamelogdir is within logdir. +# e.g serverfiles/log is not within log/: symlink created +# log/server is in log/: symlink not created +if [ "${gamelogdir}" ]; then + if [ "${gamelogdir:0:${#logdir}}" != "${logdir}" ]; then + echo -en "creating symlink to game log dir: ${logdir}/server -> ${gamelogdir}..." + if ! ln -nfs "${gamelogdir}" "${logdir}/server"; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi + fi +fi + +# If server uses SteamCMD create a symbolic link to the Steam logs. +if [ -d "${rootdir}/Steam/logs" ]; then + if [ ! -L "${logdir}/steamcmd" ]; then + echo -en "creating symlink to steam log dir: ${logdir}/steamcmd -> ${rootdir}/Steam/logs..." + if ! ln -nfs "${rootdir}/Steam/logs" "${logdir}/steamcmd"; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi + fi +fi +fn_script_log_info "Logs installed" diff --git a/lgsm/functions/install_modules.sh b/lgsm/functions/install_modules.sh new file mode 100755 index 000000000..2ee8e4fc4 --- /dev/null +++ b/lgsm/functions/install_modules.sh @@ -0,0 +1,20 @@ +#!/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" "nomd5" +fn_dl_extract "${tmpdir}" "master.tar.gz" "${tmpdir}" +cp "${tmpdir}/LinuxGSM-master/lgsm/functions"/*.sh "${functionsdir}" +cp "${tmpdir}/LinuxGSM-master/lgsm/functions"/*.py "${functionsdir}" +chmod +x "${functionsdir}"/* +command_update_linuxgsm.sh +fn_firstcommand_reset diff --git a/lgsm/functions/install_mta_resources.sh b/lgsm/functions/install_mta_resources.sh new file mode 100755 index 000000000..011ad9b71 --- /dev/null +++ b/lgsm/functions/install_mta_resources.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# LinuxGSM install_mta_resources.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Installs the libmysqlclient for database functions on the server and optionally installs default resources required to run the server. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_print_information_nl "${gamename} will not function without resources!" +echo -e " * install default resources using ./${selfname} install-default-resources" +echo -e " * download resources from https://community.multitheftauto.com" diff --git a/lgsm/functions/install_retry.sh b/lgsm/functions/install_retry.sh new file mode 100755 index 000000000..080f864a2 --- /dev/null +++ b/lgsm/functions/install_retry.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# LinuxGSM install_retry.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Asks for installation retry after failure. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if fn_prompt_yn "Retry install?" Y; then + command_install.sh; core_exit.sh +else + exitcode=0 + core_exit.sh +fi diff --git a/lgsm/functions/install_server_dir.sh b/lgsm/functions/install_server_dir.sh new file mode 100755 index 000000000..9e75fb488 --- /dev/null +++ b/lgsm/functions/install_server_dir.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# LinuxGSM install_server_dir.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Creates the server directory. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "${lightyellow}Server Directory${default}" +echo -e "=================================" +fn_sleep_time +if [ -d "${serverfiles}" ]; then + fn_print_warning_nl "A server is already installed here." +fi +pwd +echo -e "" +if [ -z "${autoinstall}" ]; then + if ! fn_prompt_yn "Continue?" Y; then + exitcode=0 + core_exit.sh + fi +fi +if [ ! -d "${serverfiles}" ]; then + mkdir -v "${serverfiles}" +fi diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh new file mode 100755 index 000000000..c7a6a3097 --- /dev/null +++ b/lgsm/functions/install_server_files.sh @@ -0,0 +1,110 @@ +#!/bin/bash +# LinuxGSM install_server_files.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Installs server files. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_install_server_files(){ + if [ "${shortname}" == "ahl" ]; then + remote_fileurl="http://linuxgsm.download/ActionHalfLife/action_halflife-1.0.tar.xz"; local_filedir="${tmpdir}"; local_filename="action_halflife-1.0.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="61d7b79fd714888b6d65944fdaafa94a" + elif [ "${shortname}" == "bf1942" ]; then + remote_fileurl="http://linuxgsm.download/BattleField1942/bf1942_lnxded-1.61-hacked-to-1.612.full.tar.xz"; local_filedir="${tmpdir}"; local_filename="bf1942_lnxded-1.61-hacked-to-1.612.full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="4223bf4ed85f5162c24b2cba51249b9e" + elif [ "${shortname}" == "bfv" ];then + remote_fileurl="http://linuxgsm.download/BattlefieldVietnam/bfv_linded-v1.21-20041207_patch.tar.xz"; local_filedir="${tmpdir}"; local_filename="bfv_linded-v1.21-20041207_patch.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="e3b4962cdd9d41e23c6fed65101bccde" + elif [ "${shortname}" == "bb" ]; then + remote_fileurl="http://linuxgsm.download/BrainBread/brainbread-v1.2-linuxserver.tar.xz"; local_filedir="${tmpdir}"; local_filename="brainbread-v1.2-linuxserver.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="55f227183b736397806d5b6db6143f15" + elif [ "${shortname}" == "cod" ]; then + remote_fileurl="http://linuxgsm.download/CallOfDuty/cod-lnxded-1.5b-full.tar.xz"; local_filedir="${tmpdir}"; local_filename="cod-lnxded-1.5-large.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="ee0ad1ccbfa1fd27fde01a4a431a5c2f" + elif [ "${shortname}" == "coduo" ]; then + remote_fileurl="http://linuxgsm.download/CallOfDutyUnitedOffensive/coduo-lnxded-1.51b-full.tar.xz"; local_filedir="${tmpdir}"; local_filename="coduo-lnxded-1.51b-full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="35cabccd67adcda44aaebc59405915b9" + elif [ "${shortname}" == "cod2" ]; then + remote_fileurl="http://linuxgsm.download/CallOfDuty2/cod2-lnxded-1.3-full.tar.xz"; local_filedir="${tmpdir}"; local_filename="cod2-lnxded-1.3-full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="b8c4c611f01627dd43348e78478a3d41" + elif [ "${shortname}" == "cod4" ]; then + remote_fileurl="http://linuxgsm.download/CallOfDuty4/cod4x18_1790_lnxded.tar.xz"; local_filedir="${tmpdir}"; local_filename="cod4x18_1790_lnxded.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="30609db2afde09d22498fbab3a427d11" + elif [ "${shortname}" == "codwaw" ]; then + remote_fileurl="http://linuxgsm.download/CallOfDutyWorldAtWar/codwaw-lnxded-1.7-full.tar.xz"; local_filedir="${tmpdir}"; local_filename="codwaw-lnxded-1.7-full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="2c6be1bb66ea631b9b2e7ae6216c6680" + elif [ "${shortname}" == "etl" ]; then + remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/etlegacy-v2.76-i386-et-260b.tar.xz"; local_filedir="${tmpdir}"; local_filename="etlegacy-v2.75-i386-et-260b.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="178a00233cec1e25b69d130107ce1a79" + elif [ "${shortname}" == "mohaa" ]; then + remote_fileurl="http://linuxgsm.download/MedalofHonorAlliedAssault/moh_revival_v1.12_RC3.5.1.tar.xz"; local_filedir="${tmpdir}"; local_filename="moh_revival_v1.12_RC3.5.1.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="7c664538999252eeaf2b6d9949416480" + elif [ "${shortname}" == "ns" ]; then + remote_fileurl="http://linuxgsm.download/NaturalSelection/ns_dedicated_server_v32.tar.xz"; local_filedir="${tmpdir}"; local_filename="ns_dedicated_server_v32.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="23ec3cadd93d8bb1c475bad5b9cce370" + elif [ "${shortname}" == "q2" ]; then + remote_fileurl="http://linuxgsm.download/Quake2/quake2-3.20-glibc-i386-full-linux2.0.tar.xz"; local_filedir="${tmpdir}"; local_filename="quake2-3.20-glibc-i386-full-linux2.0.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="2908164a32d4808bb720f2161f6b0c82" + elif [ "${shortname}" == "q3" ]; then + remote_fileurl="http://linuxgsm.download/Quake3/quake3-1.32c-x86-full-linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="quake3-1.32c-x86-full-linux.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="b0e26d8919fe9313fb9d8ded2360f3db" + elif [ "${shortname}" == "qw" ]; then + remote_fileurl="http://linuxgsm.download/QuakeWorld/nquake.server.linux.190506.full.tar.xz"; local_filedir="${tmpdir}"; local_filename="nquake.server.linux.190506.full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="82055b7d973206c13a606db8ba288d03" + elif [ "${shortname}" == "rtcw" ]; then + remote_fileurl="http://linuxgsm.download/ReturnToCastleWolfenstein/iortcw-1.51c-x86_64-server-linux-20190507.tar.xz"; local_filedir="${tmpdir}"; local_filename="iortcw-1.51c-x86_64-server-linux-20190507.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="df6ff664d37dd0d22787848bdb3cac5f" + elif [ "${shortname}" == "sfc" ]; then + remote_fileurl="http://linuxgsm.download/SourceFortsClassic/SFClassic-1.0-RC7-fix.tar.xz"; local_filedir="${tmpdir}"; local_filename="SFClassic-1.0-RC7-fix.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="70077137185700e28fe6bbb6021d12bc" + elif [ "${shortname}" == "sof2" ]; then + remote_fileurl="http://linuxgsm.download/SoldierOfFortune2/sof2gold-1.03.tar.xz"; local_filedir="${tmpdir}"; local_filename="sof2gold-1.03.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="201e23bab04207d00ce813d001c483d9" + elif [ "${shortname}" == "ts" ]; then + remote_fileurl="http://linuxgsm.download/TheSpecialists/ts-3-linux-final.tar.xz"; local_filedir="${tmpdir}"; local_filename="ts-3-linux-final.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="3c66ecff6e3644f7ac88015732a0fb93" + elif [ "${shortname}" == "ut2k4" ]; then + remote_fileurl="http://linuxgsm.download/UnrealTournament2004/ut2004-server-3369-3-ultimate-linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="ut2004-server-3369-3-ultimate-linux.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="9fceaab68554749f4b45be66613b9a15" + elif [ "${shortname}" == "ut99" ]; then + remote_fileurl="http://linuxgsm.download/UnrealTournament99/ut99-server-469a-ultimate-linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="ut99-server-469a-ultimate-linux.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="e3f2ffaab8e23b98d9e825d0244e8b9d" + elif [ "${shortname}" == "ut" ]; then + remote_fileurl="http://linuxgsm.download/UnrealTournament/UnrealTournament-Server-XAN-3525360-Linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="UnrealTournament-Server-XAN-3525360-Linux.tar.xz"; chmodx="noexecute" run="norun"; force="noforce"; md5="41dd92015713a78211eaccf503b72393" + elif [ "${shortname}" == "ut3" ]; then + remote_fileurl="http://linuxgsm.download/UnrealTournament3/UT3-linux-server-2.1.tar.xz"; local_filedir="${tmpdir}"; local_filename="UT3-linux-server-2.1.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="8876cca61e3f83ea08db25208bde6ac6" + elif [ "${shortname}" == "vs" ]; then + remote_fileurl="http://linuxgsm.download/VampireSlayer/vs_l-6.0_full.tar.xz"; local_filedir="${tmpdir}"; local_filename="vs_l-6.0_full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="b322f79e0abd31847493c52acf802667" + elif [ "${shortname}" == "wet" ]; then + remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/enemy-territory.260b.tar.xz"; local_filedir="${tmpdir}"; local_filename="enemy-territory.260b.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="581a333cc7eacda2f56d5a00fe11eafa" + elif [ "${shortname}" == "samp" ]; then + remote_fileurl="https://files.sa-mp.com/samp037svr_R2-1.tar.gz"; local_filedir="${tmpdir}"; local_filename="samp037svr_R2-1.tar.gz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="93705e165550c97484678236749198a4" + elif [ "${shortname}" == "zmr" ]; then + remote_fileurl="http://linuxgsm.download/ZombieMasterReborn/zombie_master_reborn_b5_2.tar.xz"; local_filedir="${tmpdir}"; local_filename="zombie_master_reborn_b5_2.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="4b9b9832e863d03981a40c26065792a6" + fi + fn_fetch_file "${remote_fileurl}" "" "" "" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" + fn_dl_extract "${local_filedir}" "${local_filename}" "${serverfiles}" +} + +echo -e "" +echo -e "${lightyellow}Installing ${gamename} Server${default}" +echo -e "=================================" +fn_sleep_time + +if [ "${appid}" ]; then + fn_dl_steamcmd +fi + +if [ "${shortname}" == "ts3" ]; then + update_ts3.sh +elif [ "${shortname}" == "mc" ]; then + install_eula.sh + update_minecraft.sh +elif [ "${shortname}" == "mcb" ]; then + update_minecraft_bedrock.sh +elif [ "${shortname}" == "mumble" ]; then + update_mumble.sh +elif [ "${shortname}" == "mta" ]; then + update_mta.sh +elif [ "${shortname}" == "fctr" ]; then + update_factorio.sh + install_factorio_save.sh +elif [ "${shortname}" == "jk2" ]; then + update_jediknight2.sh +elif [ "${shortname}" == "vints" ]; then + update_vintagestory.sh +elif [ -z "${appid}" ]||[ "${shortname}" == "ahl" ]||[ "${shortname}" == "bd" ]||[ "${shortname}" == "bb" ]||[ "${shortname}" == "ns" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "ts" ]||[ "${shortname}" == "vs" ]||[ "${shortname}" == "zmr" ]; then + if [ "${shortname}" == "ut" ]; then + install_eula.sh + fi + fn_install_server_files +fi + +if [ -z "${autoinstall}" ]; then + echo -e "" + echo -e "=================================" + if ! fn_prompt_yn "Was the install successful?" Y; then + install_retry.sh + fi +fi diff --git a/lgsm/functions/install_squad_license.sh b/lgsm/functions/install_squad_license.sh new file mode 100755 index 000000000..181646e85 --- /dev/null +++ b/lgsm/functions/install_squad_license.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# LinuxGSM install_squad_license.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Configures the Squad server's license. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "${lightyellow}Squad Server License${default}" +echo -e "=================================" +fn_sleep_time +echo -e "Server license is an optional feature for ${gamename} server" +fn_script_log_info "Server license is an optional feature for ${gamename} server" + +echo -e "Get more info and a server license here:" +echo -e "http://forums.joinsquad.com/topic/16519-server-licensing-general-info/" +fn_script_log_info "Get more info and a server license here:" +fn_script_log_info "http://forums.joinsquad.com/topic/16519-server-licensing-general-info/" +echo -e "" +fn_sleep_time +echo -e "The Squad server license can be changed by editing ${servercfgdir}/License.cfg." +fn_script_log_info "The Squad server license can be changed by editing ${selfname}." +echo -e "" diff --git a/lgsm/functions/install_stats.sh b/lgsm/functions/install_stats.sh new file mode 100755 index 000000000..d3b45b40b --- /dev/null +++ b/lgsm/functions/install_stats.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# LinuxGSM install_stats.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Enabled LinuxGSM Stats. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "${lightyellow}LinuxGSM Stats${default}" +echo -e "=================================" +fn_sleep_time +echo -e "Assist LinuxGSM development by sending anonymous stats to developers." +echo -e "More info: https://docs.linuxgsm.com/configuration/linuxgsm-stats" +echo -e "The following info will be sent:" +echo -e "* game server" +echo -e "* distro" +echo -e "* game server resource usage" +echo -e "* server hardware info" +if [ -z "${autoinstall}" ]; then + if fn_prompt_yn "Allow anonymous usage statistics?" Y; then + echo "stats=\"on\"" >> "${configdirserver}/common.cfg" + fn_print_information_nl "Stats setting is now enabled in common.cfg." + fi +else + fn_print_information_nl "auto-install leaves stats off by default. Stats can be enabled in common.cfg" +fi diff --git a/lgsm/functions/install_steamcmd.sh b/lgsm/functions/install_steamcmd.sh new file mode 100755 index 000000000..b1e64a42c --- /dev/null +++ b/lgsm/functions/install_steamcmd.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# LinuxGSM install_steamcmd.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Downloads SteamCMD on install. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "${lightyellow}Installing SteamCMD${default}" +echo -e "=================================" +fn_sleep_time +check_steamcmd.sh diff --git a/lgsm/functions/install_ts3db.sh b/lgsm/functions/install_ts3db.sh new file mode 100755 index 000000000..07ab7a111 --- /dev/null +++ b/lgsm/functions/install_ts3db.sh @@ -0,0 +1,76 @@ +#!/bin/bash +# LinuxGSM install_ts3db.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Installs the database server MariaDB for TeamSpeak 3. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_install_ts3db_mariadb(){ + if [ ! -f "${serverfiles}/libts3db_mariadb.so" ]; then + echo -e "copying libmariadb.so.2...\c" + cp "${serverfiles}/redist/libmariadb.so.2" "${serverfiles}" + local exitcode=$? + if [ "${exitcode}" == "0" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "copying libmariadb.so.2" + else + fn_print_fail_eol_nl + fn_script_log_fatal "copying libmariadb.so.2" + core_exit.sh + fi + fi + + echo -e "" + echo -e "${lightyellow}Configure ${gamename} Server for MariaDB${default}" + echo -e "=================================" + fn_sleep_time + read -rp "Enter MariaDB hostname: " mariahostname + read -rp "Enter MariaDB port: " mariaport + read -rp "Enter MariaDB username: " mariausername + read -rp "Enter MariaDB password: " mariapassword + read -rp "Enter MariaDB database name: " mariadbname + read -rp "Enter MariaDB socket path: " mariadbsocket + + { + echo -e "[config]" + echo -e "host='${mariahostname}'" + echo -e "port='${mariaport}'" + echo -e "username='${mariausername}'" + echo -e "password='${mariapassword}'" + echo -e "database='${mariadbname}'" + echo -e "socket='${mariadbsocket}'" + } >> "${servercfgdir}/ts3db_mariadb.ini" + sed -i "s/dbplugin=ts3db_sqlite3/dbplugin=ts3db_mariadb/g" "${servercfgfullpath}" + sed -i "s/dbpluginparameter=/dbpluginparameter=ts3db_mariadb.ini/g" "${servercfgfullpath}" + sed -i "s/dbsqlcreatepath=create_sqlite\//dbsqlcreatepath=create_mariadb\//g" "${servercfgfullpath}" + echo -e "updating ts3db_mariadb.ini." + fn_sleep_time +} + +echo -e "" +echo -e "${lightyellow}Select Database${default}" +echo -e "=================================" +fn_sleep_time +if [ -z "${autoinstall}" ]; then + if fn_prompt_yn "Do you want to use MariaDB instead of sqlite? (MariaDB must be pre-configured)" N; then + fn_install_ts3db_mariadb + fi +else +fn_print_information_nl "./${selfname} auto-install is uses sqlite. For MariaDB use ./${selfname} install" +fi + +install_eula.sh + +echo -e "" +echo -e "${lightyellow}Getting privilege key${default}" +echo -e "=================================" +fn_sleep_time +fn_print_information_nl "Save these details for later." +fn_print_information_nl "Key also saved in:" +echo -e "${serverfiles}/privilege_key.txt" +cd "${executabledir}" || exit +./ts3server_startscript.sh start inifile=ts3-server.ini 2>&1 | tee "${serverfiles}/privilege_key.txt" +sleep 5 +./ts3server_startscript.sh stop diff --git a/lgsm/functions/install_ut2k4_key.sh b/lgsm/functions/install_ut2k4_key.sh new file mode 100755 index 000000000..124052d05 --- /dev/null +++ b/lgsm/functions/install_ut2k4_key.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# LinuxGSM install_ut2k4_key.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Activates ut2k4 server with given key. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "${lightyellow}Enter ${gamename} CD Key${default}" +echo -e "=================================" +fn_sleep_time +echo -e "To get your server listed on the Master Server list" +echo -e "you must get a free CD key. Get a key here:" +echo -e "https://www.epicgames.com/unrealtournament/forums/cdkey.php?2004" +echo -e "" +if [ -z "${autoinstall}" ]; then + echo -e "Once you have the key enter it below" + echo -n "KEY: " + read -r CODE + echo -e ""\""CDKey"\""="\""${CODE}"\""" > "${systemdir}/cdkey" + if [ -f "${systemdir}/cdkey" ]; then + fn_script_log_info "UT2K4 Server CD Key created" + fi +else + echo -e "You can add your key using the following command" + echo -e "./${selfname} server-cd-key" +fi +echo -e "" diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh new file mode 100755 index 000000000..7e46f7977 --- /dev/null +++ b/lgsm/functions/mods_core.sh @@ -0,0 +1,749 @@ +#!/bin/bash +# LinuxGSM command_mods_install.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Core functions for mods list/install/update/remove + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Files and Directories. +modsdir="${lgsmdir}/mods" +modstmpdir="${modsdir}/tmp" +extractdir="${modstmpdir}/extract" +modsinstalledlist="installed-mods.txt" +modsinstalledlistfullpath="${modsdir}/${modsinstalledlist}" + +## Installation. + +# Download management. +fn_mod_install_files(){ + fn_fetch_file "${modurl}" "" "" "" "${modstmpdir}" "${modfilename}" + # Check if variable is valid checking if file has been downloaded and exists. + if [ ! -f "${modstmpdir}/${modfilename}" ]; then + fn_print_failure "An issue occurred downloading ${modprettyname}" + fn_script_log_fatal "An issue occurred downloading ${modprettyname}" + core_exit.sh + fi + if [ ! -d "${extractdir}" ]; then + mkdir -p "${extractdir}" + fi + fn_dl_extract "${modstmpdir}" "${modfilename}" "${extractdir}" +} + +# Convert mod files to lowercase if needed. +fn_mod_lowercase(){ + if [ "${modlowercase}" == "LowercaseOn" ]; then + + echo -en "converting ${modprettyname} files to lowercase..." + fn_sleep_time + fn_script_log_info "Converting ${modprettyname} files to lowercase" + fileswc=$(find "${extractdir}" -depth | wc -l) + echo -en "\r" + while read -r src; do + dst=$(dirname "${src}$(/)basename" "${src}" | tr '[:upper:]' '[:lower:]') + if [ "${src}" != "${dst}" ] + then + [ ! -e "${dst}" ] && mv -T "${src}" "${dst}" || echo -e "${src} was not renamed" + local exitcode=$? + ((renamedwc++)) + fi + echo -en "${renamedwc} / ${totalfileswc} / ${fileswc} converting ${modprettyname} files to lowercase..." $'\r' + ((totalfileswc++)) + done < <(find "${extractdir}" -depth) + echo -en "${renamedwc} / ${totalfileswc} / ${fileswc} converting ${modprettyname} files to lowercase..." + + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi + fi +} + +# Create ${modcommand}-files.txt containing the full extracted file/directory list. +fn_mod_create_filelist(){ + echo -en "building ${modcommand}-files.txt..." + fn_sleep_time + # ${modsdir}/${modcommand}-files.txt. + find "${extractdir}" -mindepth 1 -printf '%P\n' > "${modsdir}/${modcommand}-files.txt" + local exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Building ${modsdir}/${modcommand}-files.txt" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Building ${modsdir}/${modcommand}-files.txt" + fi + # Adding removed files if needed. + if [ -f "${modsdir}/.removedfiles.tmp" ]; then + cat "${modsdir}/.removedfiles.tmp" >> "${modsdir}/${modcommand}-files.txt" + fi +} + +# Copy the mod into serverfiles. +fn_mod_copy_destination(){ + echo -en "copying ${modprettyname} to ${modinstalldir}..." + fn_sleep_time + cp -Rf "${extractdir}/." "${modinstalldir}/" + local exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Copying ${modprettyname} to ${modinstalldir}" + else + fn_print_ok_eol_nl + fn_script_log_pass "Copying ${modprettyname} to ${modinstalldir}" + fi +} + +# Add the mod to the installed-mods.txt. +fn_mod_add_list(){ + if [ -z "$(sed -n "/^${modcommand}$/p" "${modsinstalledlistfullpath}")" ]; then + echo -e "${modcommand}" >> "${modsinstalledlistfullpath}" + fn_script_log_info "${modcommand} added to ${modsinstalledlist}" + fi +} + +# Prevent sensitive directories from being erased upon uninstall by removing them from: ${modcommand}-files.txt. +fn_mod_tidy_files_list(){ + # Check file list validity. + fn_check_mod_files_list + # Output to the user + echo -en "tidy up ${modcommand}-files.txt..." + fn_sleep_time + fn_script_log_info "Tidy up ${modcommand}-files.txt" + # Lines/files to remove from file list (end with ";" separator). + removefromlist="cfg;addons;RustDedicated_Data;RustDedicated_Data\/Managed;RustDedicated_Data\/Managed\/x86;RustDedicated_Data\/Managed\/x64;" + # Loop through files to remove from file list, + # generate elements to remove from list. + removefromlistamount=$(echo -e "${removefromlist}" | awk -F ';' '{ print NF }') + # Test all subvalue of "removefromlist" using the ";" separator. + for ((filesindex=1; filesindex < removefromlistamount; filesindex++)); do + # Put current file into test variable. + removefilevar=$(echo -e "${removefromlist}" | awk -F ';' -v x=${filesindex} '{ print $x }') + # Delete line(s) matching exactly. + sed -i "/^${removefilevar}$/d" "${modsdir}/${modcommand}-files.txt" + # Exit on error. + local exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Error while tidying line: ${removefilevar} from: ${modsdir}/${modcommand}-files.txt" + core_exit.sh + break + fi + done + fn_print_ok_eol_nl + # Sourcemod fix + # Remove metamod from sourcemod fileslist. + if [ "${modcommand}" == "sourcemod" ]; then + # Remove addons/metamod & addons/metamod/sourcemod.vdf from ${modcommand}-files.txt. + sed -i "/^addons\/metamod$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/metamod\/sourcemod.vdf$/d" "${modsdir}/${modcommand}-files.txt" + fi + + # Remove common paths from deletion list (Add your sourcemod mod here) + if [ "${modcommand}" == "gokz" ] || [ "${modcommand}" == "ttt" ] || [ "${modcommand}" == "steamworks" ] || [ "${modcommand}" == "get5" ]; then + sed -i "/^addons\/sourcemod$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/configs$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/extensions$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/logs$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/plugins$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/plugins\/disabled$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/translations$/d" "${modsdir}/${modcommand}-files.txt" + # Don't delete directories of translations like 'fr', 'sv', 'de', etc + sed -i "/^addons\/sourcemod\/translations\/[A-Za-z0-9_]*$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^cfg\/sourcemod$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^maps$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^materialss$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^materials\/models$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^materials\/models\/weapons$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^materials\/darkness$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^materials\/decals$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^materials\/overlays$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^models$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^models\/weapons$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^sound$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^sound\/weapons$/d" "${modsdir}/${modcommand}-files.txt" + fi + + # Remove paths of specific mods from deletion list + if [ "${modcommand}" == "gokz" ]; then + sed -i "/^addons\/sourcemod\/scripting\/include\/smjansson.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/GlobalAPI-Core.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/sourcebanspp.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/autoexecconfig.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/colorvariables.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/movementapi.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/movement.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/dhooks.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/updater.inc$/d" "${modsdir}/${modcommand}-files.txt" + fi +} + +## Information Gathering. + +# Get details of a mod any (relevant and unique, such as full mod name or install command) value. +fn_mod_get_info(){ + # Variable to know when job is done. + modinfocommand="0" + # Find entry in global array. + for ((index=0; index <= ${#mods_global_array[@]}; index++)); do + # When entry is found. + if [ "${mods_global_array[index]}" == "${currentmod}" ]; then + # Go back to the previous "MOD" separator. + for ((index=index; index <= ${#mods_global_array[@]}; index--)); do + # When "MOD" is found. + if [ "${mods_global_array[index]}" == "MOD" ]; then + # Get info. + fn_mods_define + modinfocommand="1" + break + fi + done + fi + # Exit the loop if job is done. + if [ "${modinfocommand}" == "1" ]; then + break + fi + done + + # What happens if mod is not found. + if [ "${modinfocommand}" == "0" ]; then + fn_script_log_error "Could not find information for ${currentmod}" + fn_print_error_nl "Could not find information for ${currentmod}" + core_exit.sh + fi +} + +# Define all variables for a mod at once when index is set to a separator. +fn_mods_define(){ +if [ -z "$index" ]; then + fn_script_log_fatal "index variable not set. Please report an issue." + fn_print_error "index variable not set. Please report an issue." + echo -e "* https://github.com/GameServerManagers/LinuxGSM/issues" + core_exit.sh +fi + modcommand="${mods_global_array[index+1]}" + modprettyname="${mods_global_array[index+2]}" + modurl="${mods_global_array[index+3]}" + modfilename="${mods_global_array[index+4]}" + modsubdirs="${mods_global_array[index+5]}" + modlowercase="${mods_global_array[index+6]}" + modinstalldir="${mods_global_array[index+7]}" + modkeepfiles="${mods_global_array[index+8]}" + modengines="${mods_global_array[index+9]}" + modgames="${mods_global_array[index+10]}" + modexcludegames="${mods_global_array[index+11]}" + modsite="${mods_global_array[index+12]}" + moddescription="${mods_global_array[index+13]}" +} + +# Builds list of installed mods. +# using installed-mods.txt grabing mod info from mods_list.sh. +fn_mods_installed_list(){ + fn_mods_count_installed + # Set/reset variables. + installedmodsline="1" + installedmodslist=() + modprettynamemaxlength="0" + modsitemaxlength="0" + moddescriptionmaxlength="0" + modcommandmaxlength="0" + # Loop through every line of the installed mods list ${modsinstalledlistfullpath}. + while [ "${installedmodsline}" -le "${installedmodscount}" ]; do + currentmod=$(sed "${installedmodsline}q;d" "${modsinstalledlistfullpath}") + # Get mod info to make sure mod exists. + fn_mod_get_info + # Add the mod to available commands. + installedmodslist+=( "${modcommand}" ) + # Increment line check. + ((installedmodsline++)) + done + if [ "${installedmodscount}" ]; then + fn_script_log_info "${installedmodscount} addons/mods are currently installed" + fi +} + +# Loops through mods_global_array to define available mods & provide available commands for mods installation. +fn_mods_available(){ + # First, reset variables. + compatiblemodslist=() + availablemodscommands=() + # Find compatible games. + # Find separators through the global array. + for ((index="0"; index <= ${#mods_global_array[@]}; index++)); do + # If current value is a separator; then. + if [ "${mods_global_array[index]}" == "${modseparator}" ]; then + # Set mod variables. + fn_mods_define + # Test if game is compatible. + fn_mod_compatible_test + # If game is compatible. + if [ "${modcompatibility}" == "1" ]; then + # Put it into an array to prepare user output. + compatiblemodslist+=( "${modprettyname}" "${modcommand}" "${modsite}" "${moddescription}" ) + # Keep available commands in an array to make life easier. + availablemodscommands+=( "${modcommand}" ) + fi + fi + done +} + +## Mod compatibility check. + +# Find out if a game is compatible with a mod from a modgames (list of games supported by a mod) variable. +fn_compatible_mod_games(){ + # Reset test value. + modcompatiblegame="0" + # If value is set to GAMES (ignore). + if [ "${modgames}" != "GAMES" ]; then + # How many games we need to test. + gamesamount=$(echo -e "${modgames}" | awk -F ';' '{ print NF }') + # Test all subvalue of "modgames" using the ";" separator. + for ((gamevarindex=1; gamevarindex < gamesamount; gamevarindex++)); do + # Put current game name into modtest variable. + gamemodtest=$( echo -e "${modgames}" | awk -F ';' -v x=${gamevarindex} '{ print $x }' ) + # If game name matches. + if [ "${gamemodtest}" == "${gamename}" ]; then + # Mod is compatible. + modcompatiblegame="1" + fi + done + fi +} + +# Find out if an engine is compatible with a mod from a modengines (list of engines supported by a mod) variable. +fn_compatible_mod_engines(){ + # Reset test value. + modcompatibleengine="0" + # If value is set to ENGINES (ignore). + if [ "${modengines}" != "ENGINES" ]; then + # How many engines we need to test. + enginesamount=$(echo -e "${modengines}" | awk -F ';' '{ print NF }') + # Test all subvalue of "modengines" using the ";" separator. + for ((gamevarindex=1; gamevarindex < ${enginesamount}; gamevarindex++)); do + # Put current engine name into modtest variable. + enginemodtest=$( echo -e "${modengines}" | awk -F ';' -v x=${gamevarindex} '{ print $x }' ) + # If engine name matches. + if [ "${enginemodtest}" == "${engine}" ]; then + # Mod is compatible. + modcompatibleengine="1" + fi + done + fi +} + +# Find out if a game is not compatible with a mod from a modnotgames (list of games not supported by a mod) variable. +fn_not_compatible_mod_games(){ + # Reset test value. + modeincompatiblegame="0" + # If value is set to NOTGAMES (ignore). + if [ "${modexcludegames}" != "NOTGAMES" ]; then + # How many engines we need to test. + excludegamesamount=$(echo -e "${modexcludegames}" | awk -F ';' '{ print NF }') + # Test all subvalue of "modexcludegames" using the ";" separator. + for ((gamevarindex=1; gamevarindex < excludegamesamount; gamevarindex++)); do + # Put current engine name into modtest variable. + excludegamemodtest=$( echo -e "${modexcludegames}" | awk -F ';' -v x=${gamevarindex} '{ print $x }' ) + # If engine name matches. + if [ "${excludegamemodtest}" == "${gamename}" ]; then + # Mod is compatible. + modeincompatiblegame="1" + fi + done + fi +} + +# Sums up if a mod is compatible or not with modcompatibility=0/1. +fn_mod_compatible_test(){ + # Test game and engine compatibility. + fn_compatible_mod_games + fn_compatible_mod_engines + fn_not_compatible_mod_games + if [ "${modeincompatiblegame}" == "1" ]; then + modcompatibility="0" + elif [ "${modcompatibleengine}" == "1" ]||[ "${modcompatiblegame}" == "1" ]; then + modcompatibility="1" + else + modcompatibility="0" + fi +} + +## Directory management. + +# Create mods files and directories if it doesn't exist. +fn_create_mods_dir(){ + # Create lgsm data modsdir. + if [ ! -d "${modsdir}" ]; then + echo -en "creating LinuxGSM mods data directory ${modsdir}..." + mkdir -p "${modsdir}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Creating mod download dir ${modsdir}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Creating mod download dir ${modsdir}" + fi + fi + # Create mod install directory. + if [ ! -d "${modinstalldir}" ]; then + echo -en "creating mods install directory ${modinstalldir}..." + mkdir -p "${modinstalldir}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Creating mod install directory ${modinstalldir}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Creating mod install directory ${modinstalldir}" + fi + fi + + # Create lgsm/data/${modsinstalledlist}. + if [ ! -f "${modsinstalledlistfullpath}" ]; then + touch "${modsinstalledlistfullpath}" + fn_script_log_info "Created ${modsinstalledlistfullpath}" + fi +} + +# Create tmp download mod directory. +fn_mods_create_tmp_dir(){ + if [ ! -d "${modstmpdir}" ]; then + mkdir -p "${modstmpdir}" + exitcode=$? + echo -en "creating mod download directory ${modstmpdir}..." + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Creating mod download directory ${modstmpdir}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Creating mod download directory ${modstmpdir}" + fi + fi +} + +# Remove the tmp mod download directory when finished. +fn_mods_clear_tmp_dir(){ + if [ -d "${modstmpdir}" ]; then + echo -en "clearing mod download directory ${modstmpdir}..." + rm -fr "${modstmpdir:?}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Clearing mod download directory ${modstmpdir}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Clearing mod download directory ${modstmpdir}" + fi + + fi + # Clear temp file list as well. + if [ -f "${modsdir}/.removedfiles.tmp" ]; then + rm -f "${modsdir:?}/.removedfiles.tmp" + fi +} + +# Counts how many mods were installed. +fn_mods_count_installed(){ + if [ -f "${modsinstalledlistfullpath}" ]; then + installedmodscount=$(wc -l < "${modsinstalledlistfullpath}") + else + installedmodscount=0 + fi +} + +# Exits if no mods were installed. +fn_mods_check_installed(){ + # Count installed mods. + fn_mods_count_installed + # If no mods are found. + if [ ${installedmodscount} -eq 0 ]; then + echo -e "" + fn_print_failure_nl "No installed mods or addons were found" + echo -e " * Install mods using LinuxGSM first with: ./${selfname} mods-install" + fn_script_log_error "No installed mods or addons were found." + core_exit.sh + fi +} + +# Checks that mod files list exists and isn't empty. +fn_check_mod_files_list(){ + # File list must exist and be valid before any operation on it. + if [ -f "${modsdir}/${modcommand}-files.txt" ]; then + # How many lines is the file list. + modsfilelistsize=$(wc -l < "${modsdir}/${modcommand}-files.txt") + # If file list is empty. + if [ "${modsfilelistsize}" -eq 0 ]; then + fn_print_failure "${modcommand}-files.txt is empty" + echo -e "* Unable to remove ${modprettyname}" + fn_script_log_fatal "${modcommand}-files.txt is empty: Unable to remove ${modprettyname}." + core_exit.sh + fi + else + fn_print_failure "${modsdir}/${modcommand}-files.txt does not exist" + fn_script_log_fatal "${modsdir}/${modcommand}-files.txt does not exist: Unable to remove ${modprettyname}." + core_exit.sh + fi +} + +fn_mod_exist(){ + modreq=$1 + # requires one parameter, the mod + if [ -f "${modsdir}/${modreq}-files.txt" ]; then + # how many lines is the file list + modsfilelistsize=$(wc -l < "${modsdir}/${modreq}-files.txt") + # if file list is empty + if [ "${modsfilelistsize}" -eq 0 ]; then + fn_mod_required_fail_exist "${modreq}" + fi + else + fn_mod_required_fail_exist "${modreq}" + fi +} + +fn_mod_required_fail_exist(){ + modreq=$1 + # requires one parameter, the mod + fn_script_log_fatal "${modreq}-files.txt is empty: unable to find ${modreq} installed" + echo -en "* Unable to find '${modreq}' which is required prior to installing this mod..." + fn_print_fail_eol_nl + core_exit.sh +} + +fn_mod_liblist_gam_filenames(){ + # clear variables just in case + moddll="" + modso="" + moddylib="" + + # default libraries + case ${gamename} in + "Counter-Strike 1.6") + moddll="mp.dll" + modso="cs.so" + moddylib="cs.dylib" + ;; + "Day of Defeat") + moddll="dod.dll" + modso="dod.so" + moddylib="dod.dylib" + ;; + "Team Fortress Classic") + moddll="tfc.dll" + modso="tfc.so" + moddylib="tfc.dylib" + ;; + "Natural Selection") + moddll="ns.dll" + modso="ns_i386.so" + moddylib="" + ;; + "The Specialists") + moddll="mp.dll" + modso="ts_i386.so" + moddylib="" + ;; + "Half-Life: Deathmatch") + moddll="hl.dll" + modso="hl.so" + moddylib="hl.dylib" + ;; + esac +} + +# modifers for liblist.gam to add/remote metamod binaries +fn_mod_install_liblist_gam_file(){ + + fn_mod_liblist_gam_filenames + + if [ -f "${modinstalldir}/liblist.gam" ]; then + # modify the liblist.gam file to initialize Metamod + logentry="sed replace (dlls\\${moddll}) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll in liblist.gam..." + rpldll="s/dlls\\\\${moddll}/addons\/metamod\/dlls\/metamod.dll/g" + sed -i $rpldll "${modinstalldir}/liblist.gam" + grep -q "addons/metamod/dlls/metamod.dll" "${modinstalldir}/liblist.gam" + exitcode=$? + # if replacement back didn't happen, error out. + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass "${logentry}" + fn_print_ok_eol_nl + fi + + # modify the liblist.gam file to initialize metamod + logentry="sed replace (dlls\\${modso}) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll_linux in liblist.gam..." + rplso="s/dlls\/${modso}/addons\/metamod\/dlls\/metamod.so/g" + sed -i $rplso "${modinstalldir}/liblist.gam" + grep -q "addons/metamod/dlls/metamod.so" "${modinstalldir}/liblist.gam" + exitcode=$? + # if replacement back didn't happen, error out + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass "${logentry}" + fn_print_ok_eol_nl + fi + + # mac os needs to be checked not all mods support mac os + if [ -n "${moddylib}" ]; then + # modify the liblist.gam file to initialize metamod + logentry="sed replace (dlls\\${moddylib}) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll_osx in liblist.gam..." + rpldylib="s/dlls\/${moddylib}/addons\/metamod\/dlls\/metamod.dylib/g" + sed -i $rpldylib "${modinstalldir}/liblist.gam" + grep -q "addons/metamod/dlls/metamod.dylib" "${modinstalldir}/liblist.gam" + exitcode=$? + # if replacement back didn't happen, error out. + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass ${logentry} + fn_print_ok_eol_nl + fi + fi + fi +} + +fn_mod_remove_liblist_gam_file(){ + + fn_mod_liblist_gam_filenames + + if [ -f "${modinstalldir}/liblist.gam" ]; then + # modify the liblist.gam file back to defaults + logentry="sed replace (addons/metamod/dlls/metamod.dll) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll in liblist.gam..." + rpldll="s/addons\/metamod\/dlls\/metamod.dll/dlls\\\\${moddll}/g" + sed -i $rpldll "${modinstalldir}/liblist.gam" + grep -q "${moddll}" "${modinstalldir}/liblist.gam" + exitcode=$? + # if replacement back didn't happen, error out. + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass ${logentry} + fn_print_ok_eol_nl + fi + + # modify the liblist.gam file back to defaults + logentry="sed replace (addons/metamod/dlls/metamod.so) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll_linux in liblist.gam..." + rplso="s/addons\/metamod\/dlls\/metamod.so/dlls\/${modso}/g" + sed -i $rplso "${modinstalldir}/liblist.gam" + grep -q "${modso}" "${modinstalldir}/liblist.gam" + exitcode=$? + # if replacement back didn't happen, error out + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass ${logentry} + fn_print_ok_eol_nl + fi + + # mac os needs to be checked not all mods support mac os + if [ -n "${moddylib}" ]; then + # modify the liblist.gam file back to defaults + logentry="sed replace (addons/metamod/dlls/metamod.dylib) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll_osx in liblist.gam..." + rpldylib="s/addons\/metamod\/dlls\/metamod.dylib/dlls\/${moddylib}/g" + sed -i $rpldylib "${modinstalldir}/liblist.gam" + grep -q "${moddylib}" "${modinstalldir}/liblist.gam" + # if replacement back didn't happen, error out. + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass ${logentry} + fn_print_ok_eol_nl + fi + fi + fi +} + +fn_mod_install_amxmodx_file(){ + # does plugins.ini exist? + if [ -f "${modinstalldir}/addons/metamod/plugins.ini" ]; then + # since it does exist, is the entry already in plugins.ini + logentry="line (linux addons/amxmodx/dlls/amxmodx_mm_i386.so) inserted into ${modinstalldir}/addons/metamod/plugins.ini" + echo -en "adding amxmodx_mm_i386.so in plugins.ini..." + grep -q "amxmodx_mm_i386.so" "${modinstalldir}/addons/metamod/plugins.ini" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + # file exists but the entry does not, let's add it + echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" >> "${modinstalldir}/addons/metamod/plugins.ini" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass ${logentry} + fn_print_ok_eol_nl + fi + fi + else + # create new file and add the mod to it + echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" > "${modinstalldir}/addons/metamod/plugins.ini" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "${logentry}" + fn_print_fail_eol_nl + core_exit.sh + else + fn_script_log_pass ${logentry} + fn_print_ok_eol_nl + fi + fi +} + +fn_mod_remove_amxmodx_file(){ + if [ -f "${modinstalldir}/addons/metamod/plugins.ini" ]; then + # since it does exist, is the entry already in plugins.ini + logentry="line (linux addons/amxmodx/dlls/amxmodx_mm_i386.so) removed from ${modinstalldir}/addons/metamod/plugins.ini" + echo -en "removing amxmodx_mm_i386.so in plugins.ini..." + grep -q "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" "${modinstalldir}/addons/metamod/plugins.ini" + # iIs it found? If so remove it and clean up + exitcode=$? + if [ "${exitcode}" == 0 ]; then + # delete the line we inserted + sed -i '/linux addons\/amxmodx\/dlls\/amxmodx_mm_i386.so/d' "${modinstalldir}/addons/metamod/plugins.ini" + # remove empty lines + sed -i '/^$/d' "${modinstalldir}/addons/metamod/plugins.ini" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass ${logentry} + fn_print_ok_eol_nl + fi + + # if file is empty, remove it. + if [ -f "${modinstalldir}/addons/metamod/plugins.ini" ]; then + rm "${modinstalldir}/addons/metamod/plugins.ini" + fn_script_log_pass "file removed ${modinstalldir}/addons/metamod/plugins.ini because it was empty" + fi + fi + fi +} + +## Database initialisation. + +mods_list.sh +fn_mods_available diff --git a/lgsm/functions/mods_list.sh b/lgsm/functions/mods_list.sh new file mode 100755 index 000000000..8272d8c16 --- /dev/null +++ b/lgsm/functions/mods_list.sh @@ -0,0 +1,163 @@ +#!/bin/bash +# LinuxGSM mods_list.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Lists and defines available mods for LinuxGSM supported servers; works along with mods_core.sh. +# Usage: To add a mod, you need to add an array variable following the guide to set proper values; +# Usage: Then add this array to the mods_global_array. +# Usage: If needed, you can scrape the download URL first. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Get a proper URL for mods that don't provide a good one (optional) +fn_script_log_info "Retrieving latest mods URLs" + +# Metamod (Half-life 1 Classic Engine) +metamodversion="1.21.1-am" +metamodlatestfile="metamod-${metamodversion}.zip" +metamoddownloadurl="https://www.amxmodx.org/release/${metamodlatestfile}" +metamodurl="${metamoddownloadurl}" +# AMX Mod X: Base +amxxbaseversion="1.8.2" +amxxbasemod="base" +amxxbaselatestfile="amxmodx-${amxxbaseversion}-${amxxbasemod}-linux.tar.gz" +amxxbasedownloadurl="https://www.amxmodx.org/release/${amxxbaselatestfile}" +amxxbaseurl="${amxxbasedownloadurl}" +# AMX Mod X: Counter-Strike +amxxcsversion="1.8.2" +amxxcsmod="cstrike" +amxxcslatestfile="amxmodx-${amxxbaseversion}-${amxxcsmod}-linux.tar.gz" +amxxcsdownloadurl="https://www.amxmodx.org/release/${amxxcslatestfile}" +amxxcsurl="${amxxcsdownloadurl}" +# AMX Mod X: Day of Defeat +amxxdodversion="1.8.2" +amxxdodmod="dod" +amxxdodlatestfile="amxmodx-${amxxdodversion}-${amxxdodmod}-linux.tar.gz" +amxxdoddownloadurl="https://www.amxmodx.org/release/${amxxdodlatestfile}" +amxxdodurl="${amxxdoddownloadurl}" +# AMX Mod X: Team Fortress Classic +amxxtfcversion="1.8.2" +amxxtfcmod="tfc" +amxxtfclatestfile="amxmodx-${amxxtfcversion}-${amxxtfcmod}-linux.tar.gz" +amxxtfcdownloadurl="https://www.amxmodx.org/release/${amxxtfclatestfile}" +amxxtfcurl="${amxxtfcdownloadurl}" +# AMX Mod X: Natural Selection +amxxnsversion="1.8.2" +amxxnsmod="ns" +amxxnslatestfile="amxmodx-${amxxnsversion}-${amxxnsmod}-linux.tar.gz" +amxxnsdownloadurl="https://www.amxmodx.org/release/${amxxnslatestfile}" +amxxnsurl="${amxxnsdownloadurl}" +# AMX Mod X: The Specialists +amxxtsversion="1.8.2" +amxxtsmod="ts" +amxxtslatestfile="amxmodx-${amxxtsversion}-${amxxtsmod}-linux.tar.gz" +amxxtsdownloadurl="https://www.amxmodx.org/release/${amxxtslatestfile}" +amxxtsurl="${amxxtsdownloadurl}" +# Metamod:Source +metamodsourceversion="1.10" +metamodsourcescrapeurl="https://mms.alliedmods.net/mmsdrop/${metamodsourceversion}/mmsource-latest-linux" +metamodsourcelatestfile=$(wget "${metamodsourcescrapeurl}" -q -O -) +metamodsourcedownloadurl="https://www.metamodsource.net/latest.php?os=linux&version=${metamodsourceversion}" +metamodsourceurl="${metamodsourcedownloadurl}" +# Sourcemod +sourcemodversion="1.10" +sourcemodscrapeurl="https://sm.alliedmods.net/smdrop/${sourcemodversion}/sourcemod-latest-linux" +sourcemodlatestfile=$(wget "${sourcemodscrapeurl}" -q -O -) +sourcemoddownloadurl="https://www.sourcemod.net/latest.php?os=linux&version=${sourcemodversion}" +sourcemodurl="${sourcemoddownloadurl}" +# Steamworks +steamworksscrapeurl="https://users.alliedmods.net/~kyles/builds/SteamWorks" +steamworkslatestfile=$(curl --connect-timeout 10 -sL ${steamworksscrapeurl} | grep -m 1 linux | cut -d '"' -f 4) +steamworksdownloadurl="${steamworksscrapeurl}/${steamworkslatestfile}" +steamworksurl="${steamworksdownloadurl}" +# CS:GO Mods +get5lastbuild=$(curl --connect-timeout 10 -sL https://ci.splewis.net/job/get5/lastSuccessfulBuild/api/json | jq -r '.artifacts[]') +get5latestfile=$(echo -e "${get5lastbuild}" | jq -r '.fileName') +get5latestfilepath=$(echo -e "${get5lastbuild}" | jq -r '.relativePath') +get5url="https://ci.splewis.net/job/get5/lastSuccessfulBuild/artifact/${get5latestfilepath}" +csgopuglatest=$(curl --connect-timeout 10 -sL https://api.github.com/repos/splewis/csgo-pug-setup/releases/latest | jq '.assets[]') +csgopuglatestfile=$(echo -e "${csgopuglatest}" | jq -r '.name') +csgopuglatestlink=$(echo -e "${csgopuglatest}" | jq -r '.browser_download_url') +# Oxide +oxiderustlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.Rust/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url') +oxidehurtworldlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.Hurtworld/releases/latest | jq -r '.assets[].browser_download_url') +oxidesdtdlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.SevenDaysToDie/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url' ) + +# Define mods information (required) + +# Separator name +modseparator="MOD" + +# REQUIRED: mod_info_name=( MOD "modcommand" "Pretty Name" "URL" "filename" "modsubdirs" "LowercaseOn/Off" "/files/to/keep;" "/install/path" "ENGINES" "GAMES" "NOTGAMES" "AUTHOR_URL" "Short Description" ) +# Example 1) Well made mod: mod_info_name=( MOD "awesomemod" "This is an Awesome Mod" "https://awesomemod.com/latest.zip" "awesomemod.zip" "0" "LowercaseOff" "OVERWRITE" "${systemdir}/addons" "source;unity3d;" "GAMES" "NOTGAMES" "https://awesomemod.com/" "This mod knows that 42 is the answer" ) +# Example 2) Poorly made mod: mod_info_name=( MOD "stupidmod" "This is a stupid mod" "${crappymodurl}" "StupidMod.zip" "2" "LowercaseOn" "cfg;data/crappymod;" "${systemdir}" "source;" "GAMES" "Garry's mod;Counter-Strike: Source;" "This mod is dumber than dumb" ) +# None of those values can be empty +# index | Usage +# [0] | MOD: separator, all mods must begin with it +# [1] | "modcommand": the LGSM name and command to install the mod (must be unique and lowercase) +# [2] | "Pretty Name": the common name people use to call the mod that will be displayed to the user +# [3] | "URL": link to the mod archive file; can be a variable previously defined while scraping a URL +# [4] | "filename": the output filename +# [5] | "modsubdirs": in how many subdirectories is the mod (none is 0) (not used at release, but could be in the future) +# [6] | "LowercaseOn/Off": LowercaseOff or LowercaseOn: enable/disable converting extracted files and directories to lowercase (some games require it) +# [7] | "modinstalldir": the directory in which to install the mode (use LGSM dir variables such as ${systemdir}) +# [8] | "/files/to/keep;", files & directories that should not be overwritten upon update, separated and ended with a semicolon; you can also use "OVERWRITE" value to ignore the value or "NOUPDATE" to disallow updating; for files to keep upon uninstall, see fn_mod_tidy_files_list from mods_core.sh +# [9] | "Supported Engines;": list them according to LGSM ${engine} variables, separated and ended with a semicolon, or use ENGINES to ignore the value +# [10] | "Supported Games;": list them according to LGSM ${gamename} variables, separated and ended with a semicolon, or use GAMES to ignore the value +# [11] | "Unsupported Games;": list them according to LGSM ${gamename} variables, separated and ended with a semicolon, or use NOTGAMES to ignore the value (useful to exclude a game when using Supported Engines) +# [12] | "AUTHOR_URL" is the author's website, displayed to the user when chosing mods to install +# [13] | "Short Description" a description showed to the user upon installation/removal + +# Half-life 1 Engine Mods +mod_info_metamod=( MOD "metamod" "Metamod" "${metamodurl}" "${metamodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/plugins.ini;" "ENGINES" "Counter-Strike 1.6;Day of Defeat;Team Fortress Classic;Natural Selection;The Specialists;Half-Life: Deathmatch;" "NOTGAMES" "https://github.com/alliedmodders/metamod-hl1" "Plugins Framework" ) +mod_info_base_amxx=( MOD "amxmodx" "AMX Mod X: Base" "${amxxbaseurl}" "${amxxbaselatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Counter-Strike 1.6;Day of Defeat;Team Fortress Classic;Natural Selection;The Specialists;Half-Life: Deathmatch;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod)" ) + +# CS 1.6 (HL1) Engine Mods +mod_info_cs_amxx=( MOD "amxmodxcs" "AMX Mod X: Counter-Strike" "${amxxcsurl}" "${amxxcslatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Counter-Strike 1.6;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" ) + +# DOD (HL1) Engine Mods +mod_info_dod_amxx=( MOD "amxmodxdod" "AMX Mod X: Day of Defeat" "${amxxdodurl}" "${amxxdodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Day of Defeat;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" ) + +# TFC (HL1) Engine Mods +mod_info_tfc_amxx=( MOD "amxmodxtfc" "AMX Mod X: Team Fortress Classic" "${amxxtfcurl}" "${amxxtfclatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Team Fortress Classic;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" ) + +# NS (Natural Selection) (HL1) Engine Mods +mod_info_ns_amxx=( MOD "amxmodxns" "AMX Mod X: Natural Selection" "${amxxnsurl}" "${amxxnslatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Natural Selection;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" ) + +# TS (The Specialists) (HL1) Engine Mods +mod_info_ts_amxx=( MOD "amxmodxts" "AMX Mod X: The Specialists" "${amxxtsurl}" "${amxxtslatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "The Specialists;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" ) + +# Source mods +mod_info_metamodsource=( MOD "metamodsource" "Metamod: Source" "${metamodsourceurl}" "${metamodsourcelatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/metaplugins.ini;" "source;" "GAMES" "NOTGAMES" "https://www.sourcemm.net" "Plugins Framework" ) +mod_info_sourcemod=( MOD "sourcemod" "SourceMod" "${sourcemodurl}" "${sourcemodlatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "GAMES" "NOTGAMES" "http://www.sourcemod.net" "Admin Features (requires Metamod: Source)" ) +mod_info_steamworks=( MOD "steamworks" "SteamWorks" "${steamworksurl}" "${steamworkslatestfile}" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/KyleSanderson/SteamWorks" "Exposing SteamWorks functions to SourcePawn" ) +mod_info_stripper=( MOD "stripper" "Stripper Source" "http://www.bailopan.net/stripper/snapshots/1.2/stripper-1.2.2-git129-linux.tar.gz" "stripper-1.2.2-git129-linux.tar.gz" "0" "LowercaseOff" "${systemdir}" "addons/stripper/maps;" "ENGINES" "Counter-Strike: Global Offensive;Counter-Strike: Source;Day of Defeat: Source;Half Life: Deathmatch;Half Life 2: Deathmatch;Insurgency;Left 4 Dead;Left 4 Dead 2;Nuclear Dawn;Team Fortress 2;" "NOTGAMES" "http://www.bailopan.net/stripper/" "Add or remove objects from map (requires MetaMod)") + +# CS:GO Mods +mod_info_gokz=( MOD "gokz" "GOKZ" "https://bitbucket.org/kztimerglobalteam/gokz/downloads/GOKZ-latest.zip" "gokz-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://bitbucket.org/kztimerglobalteam/gokz/src/master/" "Implements the KZ game mode (requires SourceMod and MetaMod)" ) +mod_info_ttt=( MOD "ttt" "Trouble in Terrorist Town" "https://csgottt.com/downloads/ttt-latest-dev-${sourcemodversion}.zip" "ttt-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/Bara/TroubleinTerroristTown" "Implements the TTT game mode (requires SourceMod and MetaMod)" ) +mod_info_get5=( MOD "get5" "Get 5" "${get5url}" "${get5latestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/get5" "Plugin for competitive matches/scrims (requires SourceMod and MetaMod)" ) +mod_info_pug=( MOD "pug" "PUG" "${csgopuglatestlink}" "${csgopuglatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/csgo-pug-setup" "plugin for setting up private pug/10man games" ) + +# Garry's Mod Addons +mod_info_ulib=( MOD "ulib" "ULib" "https://codeload.github.com/TeamUlysses/ulib/zip/master" "ulib-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "Complete Framework" ) +mod_info_ulx=( MOD "ulx" "ULX" "https://codeload.github.com/TeamUlysses/ulx/zip/master" "ulx-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "Admin Panel (requires ULib)" ) +mod_info_utime=( MOD "utime" "UTime" "https://github.com/TeamUlysses/utime/archive/master.zip" "utime-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "Keep track of players play time" ) +mod_info_uclip=( MOD "uclip" "UClip" "https://github.com/TeamUlysses/uclip/archive/master.zip" "uclip-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "An alternative to noclip" ) +mod_info_acf=( MOD "acf" "Armoured Combat Framework" "https://github.com/nrlulz/ACF/archive/master.zip" "acf-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "acf-master/lua/acf/shared/guns;" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/nrlulz/ACF" "Realistic Wepons & Engines" ) +mod_info_acf_missiles=( MOD "acfmissiles" "ACF Missiles" "https://github.com/Bubbus/ACF-Missiles/archive/master.zip" "acf-missiles-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Bubbus/ACF-Missiles" "More missiles for ACF" ) +mod_info_advdupe2=( MOD "advdupe2" "Advanced Duplicator 2" "https://github.com/wiremod/advdupe2/archive/master.zip" "advdupe2-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://www.wiremod.com" "Save your constructions" ) +mod_info_pac3=( MOD "pac3" "PAC3" "https://github.com/CapsAdmin/pac3/archive/master.zip" "pac3-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/CapsAdmin/pac3" "Advanced player model customization" ) +mod_info_wiremod=( MOD "wiremod" "Wiremod" "https://github.com/wiremod/wire/archive/master.zip" "wire-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/wiremod/wire" "Base Wiremod Addon") +mod_info_wiremodextras=( MOD "wiremod-extras" "Wiremod Extras" "https://github.com/wiremod/wire-extras/archive/master.zip" "wire-extras-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/wiremod/wire-extras/" "Addition to Wiremod, Extra Content") +mod_info_darkrp=( MOD "darkrp" "DarkRP" "https://github.com/FPtje/DarkRP/archive/master.zip" "darkrp-master.zip" "0" "LowercaseOn" "${systemdir}/gamemodes" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://darkrp.com" "Most popular gamemode" ) +mod_info_darkrpmodification=( MOD "darkrpmodification" "DarkRP Modification" "https://github.com/FPtje/darkrpmodification/archive/master.zip" "darkrpmodification-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "NOUPDATE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://darkrp.com" "Customize DarkRP settings" ) + +# Oxidemod +mod_info_rustoxide=( MOD "rustoxide" "Oxide for Rust" "${oxiderustlatestlink}" "Oxide.Rust-linux.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Rust;" "NOTGAMES" "https://umod.org/games/rust" "Allows for the use of plugins" ) +mod_info_hwoxide=( MOD "hwoxide" "Oxide for Hurtworld" "${oxidehurtworldlatestlink}" "Oxide.Hurtworld.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Hurtworld;" "NOTGAMES" "https://umod.org/games/hurtworld" "Allows for the use of plugins" ) +mod_info_sdtdoxide=( MOD "sdtdoxide" "Oxide for 7 Days To Die" "${oxidesdtdlatestlink}" "Oxide.SevenDaysToDie.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "7 Days To Die;" "NOTGAMES" "https://umod.org/games/7-days-to-die" "Allows for the use of plugins" ) + +# REQUIRED: Set all mods info into the global array +mods_global_array=( "${mod_info_metamod[@]}" "${mod_info_base_amxx[@]}" "${mod_info_cs_amxx[@]}" "${mod_info_dod_amxx[@]}" "${mod_info_tfc_amxx[@]}" "${mod_info_ns_amxx[@]}" "${mod_info_ts_amxx[@]}" "${mod_info_metamodsource[@]}" "${mod_info_sourcemod[@]}" "${mod_info_steamworks[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_get5[@]}" "${mod_info_pug[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" ) diff --git a/lgsm/functions/query_gamedig.sh b/lgsm/functions/query_gamedig.sh new file mode 100755 index 000000000..4d479a4c0 --- /dev/null +++ b/lgsm/functions/query_gamedig.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# LinuxGSM query_gamedig.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Querys a gameserver using node-gamedig. +# https://github.com/sonicsnes/node-gamedig + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Check if gamedig and jq are installed. +if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; then + + # will bypass query if server offline. + check_status.sh + if [ "${status}" != "0" ]; then + # 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}") + querystatus=$(echo "${gamedigraw}" | jq '.error|length') + + if [ "${querystatus}" != "null" ]; then + gamedigcmd=$(echo -e "gamedig --type \"${querytype}\" --host \"${queryip}\" --port \"${queryport}\"|jq") + gamedigraw=$(gamedig --type "${querytype}" --host "${queryip}" --port "${queryport}") + querystatus=$(echo "${gamedigraw}" | jq '.error|length') + fi + + # server name. + gdname=$(echo "${gamedigraw}" | jq -re '.name') + if [ "${gdname}" == "null" ]; then + unset gdname + fi + + # numplayers. + if [ "${querytype}" == "minecraft" ]; then + gdplayers=$(echo "${gamedigraw}" | jq -re '.players | length-1') + else + gdplayers=$(echo "${gamedigraw}" | jq -re '.players | length') + fi + if [ "${gdplayers}" == "null" ]; then + unset gdplayers + elif [ "${gdplayers}" == "[]" ]||[ "${gdplayers}" == "-1" ]; then + gdplayers=0 + fi + + # maxplayers. + gdmaxplayers=$(echo "${gamedigraw}" | jq -re '.maxplayers') + if [ "${gdmaxplayers}" == "null" ]; then + unset maxplayers + elif [ "${gdmaxplayers}" == "[]" ]; then + gdmaxplayers=0 + fi + + # current map. + gdmap=$(echo "${gamedigraw}" | jq -re '.map') + if [ "${gdmap}" == "null" ]; then + unset gdmap + fi + + # current gamemode. + gdgamemode=$(echo "${gamedigraw}" | jq -re '.raw.rules.GameMode_s') + if [ "${gdgamemode}" == "null" ]; then + unset gdgamemode + fi + + # numbots. + gdbots=$(echo "${gamedigraw}" | jq -re '.bots | length') + if [ "${gdbots}" == "null" ]||[ "${gdbots}" == "0" ]; then + unset gdbots + fi + fi +fi diff --git a/lgsm/functions/query_gsquery.py b/lgsm/functions/query_gsquery.py new file mode 100755 index 000000000..6c21b1a89 --- /dev/null +++ b/lgsm/functions/query_gsquery.py @@ -0,0 +1,145 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# LinuxGSM query_gsquery.py function +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Allows querying of various game servers. + +import optparse +import socket +import sys + +class gsquery: + def __init__(self, options, arguments): + self.option = options + self.argument = arguments + # + self.server_response_timeout = 5 + self.default_buffer_length = 1024 + # + sourcequery=['protocol-valve','avalanche3.0','barotrauma','madness','quakelive','realvirtuality','refractor','source','goldsrc','spark','starbound','unity3d','unreal4','wurm'] + idtech2query=['protocol-quake3','idtech2','quake','iw2.0'] + idtech3query=['protocol-quake3','iw3.0','ioquake3','qfusion'] + minecraftquery=['minecraft','lwjgl2'] + minecraftbequery=['minecraftbe'] + jc2mpquery=['jc2mp'] + mumblequery=['mumbleping'] + soldatquery=['soldat'] + twquery=['teeworlds'] + unrealquery=['protocol-gamespy1','unreal'] + unreal2query=['protocol-unreal2','unreal2'] + unreal3query=['ut3','unreal3'] + if self.option.engine in sourcequery: + self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0' + elif self.option.engine in idtech2query: + self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00' + elif self.option.engine in idtech3query: + self.query_prompt_string = b'\xff\xff\xff\xffgetstatus' + elif self.option.engine in jc2mpquery: + self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40' + elif self.option.engine in minecraftquery: + self.query_prompt_string = b'\xFE\xFD\x09\x3d\x54\x1f\x93' + elif self.option.engine in minecraftbequery: + self.query_prompt_string = b'\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x12\x34\x56\x78\x00\x00\x00\x00\x00\x00\x00\x00' + elif self.option.engine in mumblequery: + self.query_prompt_string = b'\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08' + elif self.option.engine in soldatquery: + self.query_prompt_string = b'\x69\x00' + elif self.option.engine in twquery: + self.query_prompt_string = b"\x04\x00\x00\xff\xff\xff\xff\x05" + bytearray(511) + elif self.option.engine in unrealquery: + self.query_prompt_string = b'\x5C\x69\x6E\x66\x6F\x5C' + elif self.option.engine in unreal2query: + self.query_prompt_string = b'\x79\x00\x00\x00\x00' + elif self.option.engine in unreal3query: + self.query_prompt_string = b'\xFE\xFD\x09\x00\x00\x00\x00' + + self.connected = False + self.response = None + self.sanity_checks() + + def fatal_error(self, error_message, error_code=1): + sys.stderr.write('ERROR: ' + str(error_message) + '\n') + sys.exit(error_code) + + def exit_success(self, success_message=''): + sys.stdout.write('OK: ' + str(success_message) + '\n') + sys.exit(0) + + def responding(self): + # Connect. + connection = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + connection.settimeout(self.server_response_timeout) + try: + self.connected = connection.connect((self.option.address, int(self.option.port))) + except socket.timeout: + self.fatal_error('Request timed out', 1) + except: + self.fatal_error('Unable to connect', 1) + # Send. + connection.send(self.query_prompt_string) + # Receive. + try: + self.response = connection.recv(self.default_buffer_length) + except socket.error: + self.fatal_error('Unable to receive', 2) + connection.close() + # Response. + if self.response is None: + self.fatal_error('No response', 3) + if len(self.response) < 5: + sys.exit('Short response.', 3) + else: + self.exit_success(str(self.response)) + + def sanity_checks(self): + if not self.option.address: + self.fatal_error('No IPv4 address supplied.', 4) + if not self.option.port: + self.fatal_error('No port supplied.', 4) + +if __name__ == '__main__': + parser = optparse.OptionParser( + usage='usage: python3 %prog [options]', + version='%prog 0.0.1' + ) + parser.add_option( + '-a', '--address', + action='store', + dest='address', + default=False, + help='The IPv4 address of the server.' + ) + parser.add_option( + '-p', '--port', + action='store', + dest='port', + default=False, + help='The IPv4 port of the server.' + ) + parser.add_option( + '-e', '--engine', + action='store', + dest='engine', + default=False, + help='Engine type: protocol-valve protocol-quake3 protocol-quake3 protocol-gamespy1 protocol-unreal2 ut3 minecraft minecraftbe jc2mp mumbleping soldat teeworlds' + ) + parser.add_option( + '-v', '--verbose', + action='store_true', + dest='verbose', + default=False, + help='Display verbose output.' + ) + parser.add_option( + '-d', '--debug', + action='store_true', + dest='debug', + default=False, + help='Display debugging output.' + ) + options, arguments = parser.parse_args() + # + server = gsquery(options, arguments) + server.responding() diff --git a/lgsm/functions/update_factorio.sh b/lgsm/functions/update_factorio.sh new file mode 100755 index 000000000..0886a0a0e --- /dev/null +++ b/lgsm/functions/update_factorio.sh @@ -0,0 +1,165 @@ +#!/bin/bash +# LinuxGSM update_factorio.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Factorio servers. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_factorio_dl(){ + fn_fetch_file "https://factorio.com/get-download/${downloadbranch}/headless/${factorioarch}" "" "" "" "${tmpdir}" "factorio_headless_${factorioarch}-${remotebuild}.tar.xz" "" "norun" "noforce" "nomd5" + fn_dl_extract "${tmpdir}" "factorio_headless_${factorioarch}-${remotebuild}.tar.xz" "${tmpdir}" + echo -e "copying to ${serverfiles}...\c" + cp -R "${tmpdir}/factorio/"* "${serverfiles}" + local exitcode=$? + if [ "${exitcode}" == "0" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "Copying to ${serverfiles}" + fn_clear_tmp + else + fn_print_fail_eol_nl + fn_script_log_fatal "Copying to ${serverfiles}" + core_exit.sh + fn_clear_tmp + fi +} + +fn_update_factorio_localbuild(){ + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Uses executable to find local build. + cd "${executabledir}" || exit + if [ -f "${executable}" ]; then + localbuild=$(${executable} --version | grep "Version:" | awk '{print $2}') + fn_print_ok "Checking for update: ${remotelocation}: checking local build" + fn_script_log_pass "Checking local build" + else + localbuild="0" + fn_print_error "Checking for update: ${remotelocation}: checking local build" + fn_script_log_error "Checking local build" + fi +} + +fn_update_factorio_remotebuild(){ + # Gets remote build info. + remotebuild=$(curl -s "https://factorio.com/get-download/${downloadbranch}/headless/${factorioarch}" | grep -o '[0-9]\.[0-9]\{1,\}\.[0-9]\{1,\}' | head -1) + if [ "${firstcommandname}" != "INSTALL" ]; then + fn_print_dots "Checking remote build: ${remotelocation}" + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_fail "Checking remote build: ${remotelocation}" + fn_script_log_fatal "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking remote build: ${remotelocation}" + fn_script_log_pass "Checking remote build" + fi + else + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_failure "Unable to get remote build" + fn_script_log_fatal "Unable to get remote build" + core_exit.sh + fi + fi +} + +fn_update_factorio_compare(){ + fn_print_dots "Checking for update: ${remotelocation}" + # Removes dots so if statement can compare version numbers. + fn_print_dots "Checking for update: ${remotelocation}" + localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') + remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') + if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "Update available" + echo -e "* Local build: ${red}${localbuild} ${factorioarch}${default}" + echo -e "* Remote build: ${green}${remotebuild} ${factorioarch}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild} ${factorioarch}" + fn_script_log_info "Remote build: ${remotebuild} ${factorioarch}" + if [ -v "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuild}" + + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + exitbypass=1 + fn_update_factorio_dl + if [ "${requirerestart}" == "1" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + fn_update_factorio_dl + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi + unset exitbypass + date +%s > "${lockdir}/lastupdate.lock" + alert="update" + alert.sh + else + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "No update available" + echo -e "* Local build: ${green}${localbuild} ${factorioarch}${default}" + echo -e "* Remote build: ${green}${remotebuild} ${factorioarch}${default}" + if [ -v "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild} ${factorioarch}" + fn_script_log_info "Remote build: ${remotebuild} ${factorioarch}" + if [ -v "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fi +} + +# The location where the builds are checked and downloaded. +remotelocation="factorio.com" + +# Game server architecture. +factorioarch="linux64" + +if [ "${branch}" == "stable" ]; then + downloadbranch="stable" +elif [ "${branch}" == "experimental" ]; then + downloadbranch="latest" +else + downloadbranch="${branch}" +fi + +if [ "${firstcommandname}" == "INSTALL" ]; then + fn_update_factorio_remotebuild + fn_update_factorio_dl +else + fn_print_dots "Checking for update" + fn_print_dots "Checking for update: ${remotelocation}" + fn_script_log_info "Checking for update: ${remotelocation}" + fn_update_factorio_localbuild + fn_update_factorio_remotebuild + fn_update_factorio_compare +fi diff --git a/lgsm/functions/update_jediknight2.sh b/lgsm/functions/update_jediknight2.sh new file mode 100644 index 000000000..770002254 --- /dev/null +++ b/lgsm/functions/update_jediknight2.sh @@ -0,0 +1,174 @@ +#!/bin/bash +# LinuxGSM update_jk2.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of jk2 servers. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_jk2_dl(){ + fn_fetch_file "https://github.com/mvdevs/jk2mv/releases/download/${remotebuild}/jk2mv-v${remotebuild}-dedicated.zip" "" "" "" "${tmpdir}" "jk2mv-${remotebuild}-dedicated.zip" "" "norun" "noforce" "nomd5" + fn_dl_extract "${tmpdir}" "jk2mv-${remotebuild}-dedicated.zip" "${tmpdir}/jk2mv-v${remotebuild}-dedicated" + echo -e "copying to ${serverfiles}...\c" + cp -R "${tmpdir}/jk2mv-v${remotebuild}-dedicated/linux-amd64/jk2mvded"* "${serverfiles}/GameData" + local exitcode=$? + if [ "${exitcode}" == "0" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "Copying to ${serverfiles}" + fn_clear_tmp + else + fn_print_fail_eol_nl + fn_script_log_fatal "Copying to ${serverfiles}" + core_exit.sh + fi +} + +fn_update_jk2_localbuild(){ + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Uses log file to gather info. + # Log is generated and cleared on startup but filled on shutdown. + requirerestart=1 + localbuild=$(grep "\"version\"" "${consolelogdir}"/* 2>/dev/null | sed 's/.*://' | awk '{print $1}' | head -n 1) + if [ -z "${localbuild}" ]; then + fn_print_error "Checking local build: ${remotelocation}" + fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" + fn_print_info_nl "Checking local build: ${remotelocation}: forcing server restart" + fn_script_log_error "No log files containing version info" + fn_script_log_info "Forcing server restart" + + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + sleep 3 + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + # If server started. + else + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fi + fi + + if [ -z "${localbuild}" ]; then + localbuild=$(grep Version "$(ls -tr "${consolelogdir}"/* 2>/dev/null)" | tail -1 | sed 's/.*Version //') + fi + + if [ -z "${localbuild}" ]; then + localbuild="0" + fn_print_error "Checking local build: ${remotelocation}: waiting for local build: missing local build info" + fn_script_log_error "Missing local build info" + fn_script_log_error "Set localbuild to 0" + else + fn_print_ok "Checking local build: ${remotelocation}" + fn_script_log_pass "Checking local build" + fi +} + +fn_update_jk2_remotebuild(){ + # Gets remote build info. + remotebuild=$(curl -s "https://api.github.com/repos/mvdevs/jk2mv/releases/latest" | grep dedicated.zip | tail -1 | awk -F"/" '{ print $8 }') + if [ "${firstcommandname}" != "INSTALL" ]; then + fn_print_dots "Checking remote build: ${remotelocation}" + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_fail "Checking remote build: ${remotelocation}" + fn_script_log_fatal "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking remote build: ${remotelocation}" + fn_script_log_pass "Checking remote build" + fi + else + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_failure "Unable to get remote build" + fn_script_log_fatal "Unable to get remote build" + core_exit.sh + fi + fi +} + +fn_update_jk2_compare(){ + # Removes dots so if statement can compare version numbers. + fn_print_dots "Checking for update: ${remotelocation}" + localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') + remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') + if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "Update available" + echo -e "* Local build: ${red}${localbuild} ${jk2arch}${default}" + echo -e "* Remote build: ${green}${remotebuild} ${jk2arch}${default}" + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild} ${jk2arch}" + fn_script_log_info "Remote build: ${remotebuild} ${jk2arch}" + fn_script_log_info "${localbuild} > ${remotebuild}" + + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + exitbypass=1 + fn_update_jk2_dl + if [ "${requirerestart}" == "1" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + fn_update_jk2_dl + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi + date +%s > "${lockdir}/lastupdate.lock" + alert="update" + alert.sh + else + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "No update available" + echo -e "* Local build: ${green}${localbuild} ${jk2arch}${default}" + echo -e "* Remote build: ${green}${remotebuild} ${jk2arch}${default}" + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild} ${jk2arch}" + fn_script_log_info "Remote build: ${remotebuild} ${jk2arch}" + fi +} + +# The location where the builds are checked and downloaded. +remotelocation="jk2mv.org" + +# Game server architecture. +jk2arch="x64" + +if [ "${firstcommandname}" == "INSTALL" ]; then + fn_update_jk2_remotebuild + fn_update_jk2_dl +else + update_steamcmd.sh + fn_print_dots "Checking for update" + fn_print_dots "Checking for update: ${remotelocation}" + fn_script_log_info "Checking for update: ${remotelocation}" + fn_update_jk2_localbuild + fn_update_jk2_remotebuild + fn_update_jk2_compare +fi diff --git a/lgsm/functions/update_minecraft.sh b/lgsm/functions/update_minecraft.sh new file mode 100644 index 000000000..ef4a29a97 --- /dev/null +++ b/lgsm/functions/update_minecraft.sh @@ -0,0 +1,163 @@ +#!/bin/bash +# LinuxGSM update_minecraft.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Minecraft servers. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_minecraft_dl(){ + # Generate link to version manifest json. + remotebuildlink=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r --arg branch ${branch} --arg mcversion ${remotebuild} '.versions | .[] | select(.type==$branch and .id==$mcversion) | .url') + # Generate link to server.jar + remotebuildurl=$(curl -s "${remotebuildlink}" | jq -r '.downloads.server.url') + + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "minecraft_server.${remotebuild}.jar" "" "norun" "noforce" "nomd5" + echo -e "copying to ${serverfiles}...\c" + cp "${tmpdir}/minecraft_server.${remotebuild}.jar" "${serverfiles}/minecraft_server.jar" + local exitcode=$? + if [ "${exitcode}" == "0" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "Copying to ${serverfiles}" + chmod u+x "${serverfiles}/minecraft_server.jar" + fn_clear_tmp + else + fn_print_fail_eol_nl + fn_script_log_fatal "Copying to ${serverfiles}" + fn_clear_tmp + core_exit.sh + fi +} + +fn_update_minecraft_localbuild(){ + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Uses executable to find local build. + cd "${executabledir}" || exit + if [ -f "minecraft_server.jar" ]; then + localbuild=$(unzip -p "minecraft_server.jar" version.json | jq -r '.id') + fn_print_ok "Checking local build: ${remotelocation}" + fn_script_log_pass "Checking local build" + else + localbuild="0" + fn_print_error "Checking local build: ${remotelocation}" + fn_script_log_error "Checking local build" + fi +} + +fn_update_minecraft_remotebuild(){ + # Gets remote build info. + # Latest release. + if [ "${branch}" == "release" ] && [ "${mcversion}" == "latest" ]; then + remotebuild=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.latest.release') + # Latest snapshot. + elif [ "${branch}" == "snapshot" ] && [ "${mcversion}" == "latest" ]; then + remotebuild=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.latest.snapshot') + # Specific release/snapshot. + else + remotebuild=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r --arg branch ${branch} --arg mcversion ${mcversion} '.versions | .[] | select(.type==$branch and .id==$mcversion) | .id') + fi + + if [ "${firstcommandname}" != "INSTALL" ]; then + fn_print_dots "Checking remote build: ${remotelocation}" + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_fail "Checking remote build: ${remotelocation}" + fn_script_log_fatal "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking remote build: ${remotelocation}" + fn_script_log_pass "Checking remote build" + fi + else + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_failure "Unable to get remote build" + fn_script_log_fatal "Unable to get remote build" + core_exit.sh + fi + fi +} + +fn_update_minecraft_compare(){ + # Removes dots so if statement can compare version numbers. + fn_print_dots "Checking for update: ${remotelocation}" + if [ "${localbuild}" != "${remotebuild}" ]||[ "${forceupdate}" == "1" ]; then + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "Update available" + echo -e "* Local build: ${red}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuild}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + fn_script_log_info "${localbuild} > ${remotebuild}" + + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + exitbypass=1 + fn_update_minecraft_dl + if [ "${requirerestart}" == "1" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + fn_update_minecraft_dl + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi + unset exitbypass + date +%s > "${lockdir}/lastupdate.lock" + alert="update" + alert.sh + else + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "No update available" + echo -e "* Local build: ${green}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuild}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fi +} + +# The location where the builds are checked and downloaded. +remotelocation="mojang.com" + +if [ "${firstcommandname}" == "INSTALL" ]; then + fn_update_minecraft_remotebuild + fn_update_minecraft_dl +else + fn_print_dots "Checking for update" + fn_print_dots "Checking for update: ${remotelocation}" + fn_script_log_info "Checking for update: ${remotelocation}" + fn_update_minecraft_localbuild + fn_update_minecraft_remotebuild + fn_update_minecraft_compare +fi diff --git a/lgsm/functions/update_minecraft_bedrock.sh b/lgsm/functions/update_minecraft_bedrock.sh new file mode 100755 index 000000000..f109a52e3 --- /dev/null +++ b/lgsm/functions/update_minecraft_bedrock.sh @@ -0,0 +1,177 @@ +#!/bin/bash +# LinuxGSM update_minecraft_bedrock.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Minecraft Bedrock servers. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +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') + fn_fetch_file "${latestmcbuildurl}" "" "" "" "${tmpdir}" "bedrock_server.${remotebuild}.zip" + echo -e "Extracting to ${serverfiles}...\c" + if [ "${firstcommandname}" == "INSTALL" ]; then + unzip -oq "${tmpdir}/bedrock_server.${remotebuild}.zip" -x "server.properties" -d "${serverfiles}" + else + unzip -oq "${tmpdir}/bedrock_server.${remotebuild}.zip" -x "permissions.json" "server.properties" "whitelist.json" -d "${serverfiles}" + fi + local exitcode=$? + if [ "${exitcode}" == "0" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "Extracting to ${serverfiles}" + chmod u+x "${serverfiles}/bedrock_server" + fn_clear_tmp + else + fn_print_fail_eol_nl + fn_script_log_fatal "Extracting to ${serverfiles}" + fn_clear_tmp + core_exit.sh + fi +} + +fn_update_minecraft_localbuild(){ + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Uses log file to gather info. + # Log is generated and cleared on startup but filled on shutdown. + requirerestart=1 + localbuild=$(grep Version "${consolelogdir}"/* 2>/dev/null | tail -1 | sed 's/.*Version //') + if [ -z "${localbuild}" ]; then + fn_print_error "Checking local build: ${remotelocation}" + fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" + fn_print_info_nl "Checking local build: ${remotelocation}: forcing server restart" + fn_script_log_error "No log files containing version info" + fn_script_log_info "Forcing server restart" + + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + sleep 3 + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + # If server started. + else + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fi + fi + + if [ -z "${localbuild}" ]; then + localbuild=$(grep Version "$(ls -tr "${consolelogdir}"/* 2>/dev/null)" | tail -1 | sed 's/.*Version //') + fi + + if [ -z "${localbuild}" ]; then + localbuild="0" + fn_print_error "Checking local build: ${remotelocation}: waiting for local build: missing local build info" + fn_script_log_error "Missing local build info" + fn_script_log_error "Set localbuild to 0" + else + fn_print_ok "Checking local build: ${remotelocation}" + fn_script_log_pass "Checking local build" + fi +} + +fn_update_minecraft_remotebuild(){ + # Gets remote build info. + remotebuild=$(curl -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]") + if [ "${firstcommandname}" != "INSTALL" ]; then + fn_print_dots "Checking remote build: ${remotelocation}" + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_fail "Checking remote build: ${remotelocation}" + fn_script_log_fatal "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking remote build: ${remotelocation}" + fn_script_log_pass "Checking remote build" + fi + else + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_failure "Unable to get remote build" + fn_script_log_fatal "Unable to get remote build" + core_exit.sh + fi + fi +} + +fn_update_minecraft_compare(){ + # Removes dots so if statement can compare version numbers. + fn_print_dots "Checking for update: ${remotelocation}" + localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') + remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') + if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "Update available" + echo -e "* Local build: ${red}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuild}${default}" + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + fn_script_log_info "${localbuild} > ${remotebuild}" + + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + exitbypass=1 + fn_update_minecraft_dl + if [ "${requirerestart}" == "1" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + fn_update_minecraft_dl + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi + unset exitbypass + date +%s > "${lockdir}/lastupdate.lock" + alert="update" + alert.sh + else + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "No update available" + echo -e "* Local build: ${green}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuild}${default}" + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + fi +} + +# The location where the builds are checked and downloaded. +remotelocation="minecraft.net" + +if [ "${firstcommandname}" == "INSTALL" ]; then + fn_update_minecraft_remotebuild + fn_update_minecraft_dl +else + fn_print_dots "Checking for update" + fn_print_dots "Checking for update: ${remotelocation}" + fn_script_log_info "Checking for update: ${remotelocation}" + fn_update_minecraft_localbuild + fn_update_minecraft_remotebuild + fn_update_minecraft_compare +fi diff --git a/lgsm/functions/update_mta.sh b/lgsm/functions/update_mta.sh new file mode 100755 index 000000000..96afd298f --- /dev/null +++ b/lgsm/functions/update_mta.sh @@ -0,0 +1,206 @@ +#!/bin/bash +# LinuxGSM update_mta.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Multi Theft Auto servers. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_mta_dl(){ + fn_fetch_file "http://linux.mtasa.com/dl/multitheftauto_linux_x64.tar.gz" "" "" "" "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "" "norun" "noforce" "nomd5" + mkdir "${tmpdir}/multitheftauto_linux_x64" + fn_dl_extract "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "${tmpdir}/multitheftauto_linux_x64" + echo -e "copying to ${serverfiles}...\c" + cp -R "${tmpdir}/multitheftauto_linux_x64/multitheftauto_linux_x64/"* "${serverfiles}" + local exitcode=$? + fn_clear_tmp + if [ "${exitcode}" == "0" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "Copying to ${serverfiles}" + chmod u+x "${serverfiles}/mta-server64" + else + fn_print_fail_eol_nl + fn_script_log_fatal "Copying to ${serverfiles}" + core_exit.sh + fi +} + +fn_update_mta_localbuild(){ + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Uses log file to gather info. + # Gives time for log file to generate. + requirerestart=1 + if [ ! -f "${serverfiles}/mods/deathmatch/logs/server.log" ]; then + fn_print_error "Checking local build: ${remotelocation}" + fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" + fn_print_info_nl "Checking local build: ${remotelocation}: forcing server restart" + fn_script_log_error "No log files containing version info" + fn_script_log_info "Forcing server restart" + exitbypass=1 + command_stop.sh + exitbypass=1 + command_start.sh + fn_firstcommand_reset + totalseconds=0 + # Check again, allow time to generate logs. + while [ ! -f "${serverfiles}/mods/deathmatch/logs/server.log" ]; do + sleep 1 + fn_print_info "Checking local build: ${remotelocation}: waiting for log file: ${totalseconds}" + if [ -v "${loopignore}" ]; then + loopignore=1 + fn_script_log_info "Waiting for log file to generate" + fi + + if [ "${totalseconds}" -gt "120" ]; then + localbuild="0" + fn_print_error "Checking local build: ${remotelocation}: waiting for log file: missing log file" + fn_script_log_error "Missing log file" + fn_script_log_error "Set localbuild to 0" + fi + + totalseconds=$((totalseconds + 1)) + done + fi + + if [ -z "${localbuild}" ]; then + localbuild=$(grep "= Multi Theft Auto: San Andreas v" "${serverfiles}/mods/deathmatch/logs/server.log" | awk '{ print $7 }' | sed -r 's/^.{1}//' | tail -1) + fi + + if [ -z "${localbuild}" ]; then + # Gives time for var to generate. + totalseconds=0 + for seconds in {1..120}; do + fn_print_info "Checking local build: ${remotelocation}: waiting for local build: ${totalseconds}" + if [ -z "${loopignore}" ]; then + loopignore=1 + fn_script_log_info "Waiting for local build to generate" + fi + localbuild=$(grep "= Multi Theft Auto: San Andreas v" "${serverfiles}/mods/deathmatch/logs/server.log" | awk '{ print $7 }' | sed -r 's/^.{1}//' | tail -1) + if [ "${localbuild}" ]; then + break + fi + sleep 1 + totalseconds=$((totalseconds + 1)) + done + fi + + if [ -z "${localbuild}" ]; then + localbuild="0" + fn_print_error "Checking local build: ${remotelocation}: waiting for local build: missing local build info" + fn_script_log_error "Missing local build info" + fn_script_log_error "Set localbuild to 0" + else + fn_print_ok "Checking local build: ${remotelocation}" + fn_script_log_pass "Checking local build" + fi +} + +fn_update_mta_remotebuild(){ + # Gets remote build info. + majorversion=$(curl -s https://raw.githubusercontent.com/multitheftauto/mtasa-blue/master/Server/version.h | grep "#define MTASA_VERSION_MAJOR" | awk '{ print $3 }' | sed 's/\r//g') + minorversion=$(curl -s https://raw.githubusercontent.com/multitheftauto/mtasa-blue/master/Server/version.h | grep "#define MTASA_VERSION_MINOR" | awk '{ print $3 }' | sed 's/\r//g') + maintenanceversion=$(curl -s https://raw.githubusercontent.com/multitheftauto/mtasa-blue/master/Server/version.h | grep "#define MTASA_VERSION_MAINTENANCE" | awk '{ print $3 }' | sed 's/\r//g') + remotebuild="${majorversion}.${minorversion}.${maintenanceversion}" + if [ "${firstcommandname}" != "INSTALL" ]; then + fn_print_dots "Checking remote build: ${remotelocation}" + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_fail "Checking remote build: ${remotelocation}" + fn_script_log_fatal "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking remote build: ${remotelocation}" + fn_script_log_pass "Checking remote build" + fi + else + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_failure "Unable to get remote build" + fn_script_log_fatal "Unable to get remote build" + core_exit.sh + fi + fi +} + +fn_update_mta_compare(){ + # Removes dots so if statement can compare version numbers. + fn_print_dots "Checking for update: ${remotelocation}" + localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') + remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') + if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then + fn_print_ok_nl "Checking for update: ${remotelocation}" + if [ "${forceupdate}" == "1" ]; then + # forceupdate bypasses checks, useful for small build changes + mtaupdatestatus="forced" + else + mtaupdatestatus="available" + fi + echo -en "\n" + echo -e "Update ${mtaupdatestatus}:" + echo -e "* Local build: ${red}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuild}${default}" + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + fn_script_log_info "${localbuild} > ${remotebuild}" + + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + exitbypass=1 + fn_update_mta_dl + if [ "${requirerestart}" == "1" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + fn_update_mta_dl + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi + unset exitbypass + date +%s > "${lockdir}/lastupdate.lock" + alert="update" + alert.sh + else + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "No update available" + echo -e "* Local build: ${green}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuild}${default}" + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + fi +} + +# The location where the builds are checked and downloaded. +remotelocation="linux.mtasa.com" + +if [ "${firstcommandname}" == "INSTALL" ]; then + fn_update_mta_remotebuild + fn_update_mta_dl +else + fn_print_dots "Checking for update" + fn_print_dots "Checking for update: ${remotelocation}" + fn_script_log_info "Checking for update: ${remotelocation}" + fn_update_mta_localbuild + fn_update_mta_remotebuild + fn_update_mta_compare +fi diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh new file mode 100755 index 000000000..d23f8ed36 --- /dev/null +++ b/lgsm/functions/update_mumble.sh @@ -0,0 +1,143 @@ +#!/bin/bash +# LinuxGSM update_mumble.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Mumble servers. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_mumble_dl(){ + fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${remotebuild}/murmur-static_${mumblearch}-${remotebuild}.tar.bz2" "" "" "" "${tmpdir}" "murmur-static_${mumblearch}-${remotebuild}.tar.bz2" "" "norun" "noforce" "nomd5" + fn_dl_extract "${tmpdir}" "murmur-static_${mumblearch}-${remotebuild}.tar.bz2" "${tmpdir}" + echo -e "copying to ${serverfiles}...\c" + cp -R "${tmpdir}/murmur-static_${mumblearch}-${remotebuild}/"* "${serverfiles}" + local exitcode=$? + if [ "${exitcode}" == "0" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "Copying to ${serverfiles}" + fn_clear_tmp + else + fn_print_fail_eol_nl + fn_script_log_fatal "Copying to ${serverfiles}" + fn_clear_tmp + core_exit.sh + fi +} + +fn_update_mumble_localbuild(){ + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Uses executable to find local build. + cd "${executabledir}" || exit + if [ -f "${executable}" ]; then + localbuild=$(${executable} -version 2>&1 >/dev/null | awk '{print $5}') + fn_print_ok "Checking local build: ${remotelocation}" + fn_script_log_pass "Checking local build" + else + localbuild="0" + fn_print_error "Checking local build: ${remotelocation}" + fn_script_log_error "Checking local build" + fi +} + +fn_update_mumble_remotebuild(){ + # Gets remote build info. + remotebuild=$(curl -s "https://api.github.com/repos/mumble-voip/mumble/releases/latest" | grep 'murmur-static_x86.*\.bz2"' | tail -1 | awk -F"/" '{ print $8 }') + if [ "${firstcommandname}" != "INSTALL" ]; then + fn_print_dots "Checking remote build: ${remotelocation}" + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_fail "Checking remote build: ${remotelocation}" + fn_script_log_fatal "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking remote build: ${remotelocation}" + fn_script_log_pass "Checking remote build" + fi + else + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_failure "Unable to get remote build" + fn_script_log_fatal "Unable to get remote build" + core_exit.sh + fi + fi +} + +fn_update_mumble_compare(){ + # Removes dots so if statement can compare version numbers. + fn_print_dots "Checking for update: ${remotelocation}" + localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') + remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') + if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "Update available" + echo -e "* Local build: ${red}${localbuild} ${mumblearch}${default}" + echo -e "* Remote build: ${green}${remotebuild} ${mumblearch}${default}" + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild} ${mumblearch}" + fn_script_log_info "Remote build: ${remotebuild} ${mumblearch}" + fn_script_log_info "${localbuild} > ${remotebuild}" + + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + exitbypass=1 + fn_update_mumble_dl + if [ "${requirerestart}" == "1" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + fn_update_mumble_dl + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi + unset exitbypass + date +%s > "${lockdir}/lastupdate.lock" + alert="update" + alert.sh + else + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "No update available" + echo -e "* Local build: ${green}${localbuild} ${mumblearch}${default}" + echo -e "* Remote build: ${green}${remotebuild} ${mumblearch}${default}" + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild} ${mumblearch}" + fn_script_log_info "Remote build: ${remotebuild} ${mumblearch}" + fi +} + +# The location where the builds are checked and downloaded. +remotelocation="mumble.info" + +# Game server architecture. +mumblearch="x86" + +if [ "${firstcommandname}" == "INSTALL" ]; then + fn_update_mumble_remotebuild + fn_update_mumble_dl +else + fn_print_dots "Checking for update: ${remotelocation}" + fn_script_log_info "Checking for update: ${remotelocation}" + fn_update_mumble_localbuild + fn_update_mumble_remotebuild + fn_update_mumble_compare +fi diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh new file mode 100644 index 000000000..85bacb899 --- /dev/null +++ b/lgsm/functions/update_steamcmd.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# LinuxGSM update_steamcmd.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating using SteamCMD. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# init steamcmd functions +core_steamcmd.sh + +# The location where the builds are checked and downloaded. +remotelocation="SteamCMD" +check.sh + +fn_print_dots "${remotelocation}" + +if [ "${forceupdate}" == "1" ]; then + # forceupdate bypasses update checks. + if [ "${status}" != "0" ]; then + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fn_dl_steamcmd + date +%s > "${lockdir}/lastupdate.lock" + exitbypass=1 + command_start.sh + fn_firstcommand_reset + else + fn_dl_steamcmd + date +%s > "${lockdir}/lastupdate.lock" + fi +else + fn_update_steamcmd_localbuild + fn_update_steamcmd_remotebuild + fn_update_steamcmd_compare +fi diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh new file mode 100755 index 000000000..94a56a707 --- /dev/null +++ b/lgsm/functions/update_ts3.sh @@ -0,0 +1,216 @@ +#!/bin/bash +# LinuxGSM command_ts3.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Teamspeak 3 servers. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_ts3_dl(){ + if [ "${ts3arch}" == "amd64" ]; then + remotebuildurl=$(curl -s 'https://www.teamspeak.com/versions/server.json' | jq -r '.linux.x86_64.mirrors."teamspeak.com"') + elif [ "${ts3arch}" == "x86" ]; then + remotebuildurl=$(curl -s 'https://www.teamspeak.com/versions/server.json' | jq -r '.linux.x86.mirrors."teamspeak.com"') + fi + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${remotebuild}.tar.bz2" "" "norun" "noforce" "nomd5" + fn_dl_extract "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${remotebuild}.tar.bz2" "${tmpdir}" + echo -e "copying to ${serverfiles}...\c" + cp -R "${tmpdir}/teamspeak3-server_linux_${ts3arch}/"* "${serverfiles}" + local exitcode=$? + if [ "${exitcode}" == "0" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "Copying to ${serverfiles}" + fn_clear_tmp + else + fn_print_fail_eol_nl + fn_script_log_fatal "Copying to ${serverfiles}" + fn_clear_tmp + core_exit.sh + fi +} + +fn_update_ts3_localbuild(){ + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Uses log file to gather info. + # Gives time for log file to generate. + requirerestart=1 + if [ ! -d "${serverfiles}/logs" ]||[ -z "$(find "${serverfiles}/logs/"* -name 'ts3server*_0.log' 2> /dev/null)" ]; then + fn_print_error "Checking local build: ${remotelocation}" + fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" + fn_print_info_nl "Checking local build: ${remotelocation}: forcing server restart" + fn_script_log_error "No log files containing version info" + fn_script_log_info "Forcing server restart" + exitbypass=1 + command_stop.sh + exitbypass=1 + command_start.sh + fn_firstcommand_reset + totalseconds=0 + # Check again, allow time to generate logs. + while [ ! -d "${serverfiles}/logs" ]||[ -z "$(find "${serverfiles}/logs/"* -name 'ts3server*_0.log' 2> /dev/null)" ]; do + sleep 1 + fn_print_info "Checking local build: ${remotelocation}: waiting for log file: ${totalseconds}" + if [ -v "${loopignore}" ]; then + loopignore=1 + fn_script_log_info "Waiting for log file to generate" + fi + + if [ "${totalseconds}" -gt "120" ]; then + localbuild="0" + fn_print_error "Checking local build: ${remotelocation}: waiting for log file: missing log file" + fn_script_log_error "Missing log file" + fn_script_log_error "Set localbuild to 0" + fi + + totalseconds=$((totalseconds + 1)) + done + fi + + if [ -z "${localbuild}" ]; then + localbuild=$(cat "$(find ./* -name "ts3server*_0.log" 2> /dev/null | sort | tail -1)" | grep -Eo "TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | grep -Eo "((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | tail -1) + fi + + if [ -z "${localbuild}" ]; then + # Gives time for var to generate. + totalseconds=0 + for seconds in {1..120}; do + fn_print_info "Checking local build: ${remotelocation}: waiting for local build: ${totalseconds}" + if [ -z "${loopignore}" ]; then + loopignore=1 + fn_script_log_info "Waiting for local build to generate" + fi + localbuild=$(cat "$(find ./* -name "ts3server*_0.log" 2> /dev/null | sort | tail -1)" | grep -Eo "TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | grep -Eo "((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | tail -1) + if [ "${localbuild}" ]||[ "${seconds}" == "120" ]; then + break + fi + sleep 1 + totalseconds=$((totalseconds + 1)) + done + fi + + if [ -z "${localbuild}" ]; then + localbuild="0" + fn_print_error "Checking local build: ${remotelocation}: waiting for local build: missing local build info" + fn_script_log_error "Missing local build info" + fn_script_log_error "Set localbuild to 0" + else + fn_print_ok "Checking local build: ${remotelocation}" + fn_script_log_pass "Checking local build" + fi +} + +fn_update_ts3_remotebuild(){ + # Gets remote build info. + if [ "${arch}" == "x86_64" ]; then + remotebuild=$(curl -s "https://www.teamspeak.com/versions/server.json" | jq -r '.linux.x86_64.version') + elif [ "${arch}" == "x86" ]; then + remotebuild=$(curl -s "https://www.teamspeak.com/versions/server.json" | jq -r '.linux.x86.version') + fi + if [ "${firstcommandname}" != "INSTALL" ]; then + fn_print_dots "Checking remote build: ${remotelocation}" + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_fail "Checking remote build: ${remotelocation}" + fn_script_log_fatal "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking remote build: ${remotelocation}" + fn_script_log_pass "Checking remote build" + fi + else + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_failure "Unable to get remote build" + fn_script_log_fatal "Unable to get remote build" + core_exit.sh + fi + fi +} + +fn_update_ts3_compare(){ + # Removes dots so if statement can compare version numbers. + fn_print_dots "Checking for update: ${remotelocation}" + localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') + remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') + if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "Update available" + echo -e "* Local build: ${red}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuild}${default}" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + fn_script_log_info "${localbuild} > ${remotebuild}" + + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + exitbypass=1 + fn_update_ts3_dl + if [ "${requirerestart}" == "1" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + fn_update_ts3_dl + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi + unset exitbypass + date +%s > "${lockdir}/lastupdate.lock" + alert="update" + alert.sh + else + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "No update available" + echo -e "* Local build: ${green}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuild}${default}" + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + fi +} + +# Game server architecture. +info_distro.sh +if [ "${arch}" == "x86_64" ]; then + ts3arch="amd64" +elif [ "${arch}" == "i386" ]||[ "${arch}" == "i686" ]; then + ts3arch="x86" +else + fn_print_failure "Unknown or unsupported architecture: ${arch}" + fn_script_log_fatal "Unknown or unsupported architecture: ${arch}" + core_exit.sh +fi + +# The location where the builds are checked and downloaded. +remotelocation="teamspeak.com" + +if [ "${firstcommandname}" == "INSTALL" ]; then + fn_update_ts3_remotebuild + fn_update_ts3_dl +else + fn_print_dots "Checking for update" + fn_print_dots "Checking for update: ${remotelocation}" + fn_script_log_info "Checking for update: ${remotelocation}" + fn_update_ts3_localbuild + fn_update_ts3_remotebuild + fn_update_ts3_compare +fi diff --git a/lgsm/functions/update_vintagestory.sh b/lgsm/functions/update_vintagestory.sh new file mode 100755 index 000000000..b2231c66e --- /dev/null +++ b/lgsm/functions/update_vintagestory.sh @@ -0,0 +1,148 @@ +#!/bin/bash +# LinuxGSM update_vintagestory.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Vintage Story servers. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_vs_dl(){ + # get version info for download + remotebuildresponse=$(curl -s "${apiurl}" | jq --arg version "${remotebuild}" '.[$version].server') + remotebuildfile=$(echo -e "${remotebuildresponse}" | jq -r '.filename') + remotebuildlink=$(echo -e "${remotebuildresponse}" | jq -r '.urls.cdn') + remotebuildmd5=$(echo -e "${remotebuildresponse}" | jq -r '.md5') + + # Download and extract files to serverfiles + fn_fetch_file "${remotebuildlink}" "" "" "" "${tmpdir}" "${remotebuildfile}" "nochmodx" "norun" "force" "${remotebuildmd5}" + fn_dl_extract "${tmpdir}" "${remotebuildfile}" "${serverfiles}" + fn_clear_tmp +} + +fn_update_vs_localbuild(){ + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Uses executable to find local build. + cd "${executabledir}" || exit + if [ -f "${executable}" ]; then + localbuild="$(${preexecutable} ${executable} --version | sed '/^[[:space:]]*$/d')" + fn_print_ok "Checking local build: ${remotelocation}" + fn_script_log_pass "Checking local build" + else + localbuild="0" + fn_print_error "Checking local build: ${remotelocation}" + fn_script_log_error "Checking local build" + fi +} + +fn_update_vs_remotebuild(){ + if [ "${branch}" == "stable" ]; then + remotebuild=$(curl -s "${apiurl}" | jq -r '[ to_entries[] ] | .[].key' | grep -Ev "\-rc|\-pre" | sort -r -V | head -1) + else + remotebuild=$(curl -s "${apiurl}" | jq -r '[ to_entries[] ] | .[].key' | grep -E "\-rc|\-pre" | sort -r -V | head -1) + fi + + if [ "${firstcommandname}" != "INSTALL" ]; then + fn_print_dots "Checking remote build: ${remotelocation}" + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_fail "Checking remote build: ${remotelocation}" + fn_script_log_fatal "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking remote build: ${remotelocation}" + fn_script_log_pass "Checking remote build" + fi + else + # Checks if remotebuild variable has been set. + if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + fn_print_failure "Unable to get remote build" + fn_script_log_fatal "Unable to get remote build" + core_exit.sh + fi + fi +} + +fn_update_vs_compare(){ + # Removes dots so if statement can compare version numbers. + fn_print_dots "Checking for update: ${remotelocation}" + if [ "${localbuild}" != "${remotebuild}" ]||[ "${forceupdate}" == "1" ]; then + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "Update available" + echo -e "* Local build: ${red}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuild}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + fn_script_log_info "${localbuild} > ${remotebuild}" + + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + exitbypass=1 + fn_update_vs_dl + if [ "${requirerestart}" == "1" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + fn_update_vs_dl + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi + unset exitbypass + date +%s > "${lockdir}/lastupdate.lock" + alert="update" + alert.sh + else + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "No update available" + echo -e "* Local build: ${green}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuild}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fi +} + +# The location where the builds are checked and downloaded. +remotelocation="vintagestory.at" +apiurl="http://api.${remotelocation}/stable-unstable.json" + +if [ "${firstcommandname}" == "INSTALL" ]; then + fn_update_vs_remotebuild + fn_update_vs_dl +else + fn_print_dots "Checking for update" + fn_print_dots "Checking for update: ${remotelocation}" + fn_script_log_info "Checking for update: ${remotelocation}" + fn_update_vs_localbuild + fn_update_vs_remotebuild + fn_update_vs_compare +fi diff --git a/linuxgsm.sh b/linuxgsm.sh new file mode 100644 index 000000000..f8d1449a0 --- /dev/null +++ b/linuxgsm.sh @@ -0,0 +1,470 @@ +#!/bin/bash +# Project: Linux Game Server Managers - LinuxGSM +# Author: Daniel Gibbs +# License: MIT License, Copyright (c) 2020 Daniel Gibbs +# Purpose: Linux Game Server Management Script +# Contributors: https://linuxgsm.com/contrib +# Documentation: https://docs.linuxgsm.com +# Website: https://linuxgsm.com + +# DO NOT EDIT THIS FILE +# LinuxGSM configuration is no longer edited here +# To update your LinuxGSM config go to: +# lgsm/config-lgsm +# https://docs.linuxgsm.com/configuration/linuxgsm-config + +# Debugging +if [ -f ".dev-debug" ]; then + exec 5>dev-debug.log + BASH_XTRACEFD="5" + set -x +fi + +version="v20.6.2" +shortname="core" +gameservername="core" +commandname="CORE" +rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") +selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +sessionname=$(echo "${selfname}" | cut -f1 -d".") +lgsmdir="${rootdir}/lgsm" +logdir="${rootdir}/log" +lgsmlogdir="${logdir}/lgsm" +steamcmddir="${HOME}/.steam/steamcmd" +serverfiles="${rootdir}/serverfiles" +functionsdir="${lgsmdir}/functions" +tmpdir="${lgsmdir}/tmp" +datadir="${lgsmdir}/data" +lockdir="${lgsmdir}/lock" +serverlist="${datadir}/serverlist.csv" +serverlistmenu="${datadir}/serverlistmenu.csv" +configdir="${lgsmdir}/config-lgsm" +configdirserver="${configdir}/${gameservername}" +configdirdefault="${lgsmdir}/config-default" +userinput="${1}" + +## GitHub Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="GameServerManagers" +githubrepo="LinuxGSM" +githubbranch="master" + +# Core function that is required first. +core_functions.sh(){ + functionfile="${FUNCNAME[0]}" + fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" +} + +# Bootstrap +# Fetches the core functions required before passed off to core_dl.sh. +fn_bootstrap_fetch_file(){ + remote_fileurl="${1}" + remote_fileurl_backup="${2}" + remote_fileurl_name="${3}" + remote_fileurl_backup_name="${4}" + local_filedir="${5}" + local_filename="${6}" + chmodx="${7:-0}" + run="${8:-0}" + forcedl="${9:-0}" + md5="${10:-0}" + # Download file if missing or download forced. + if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then + # If backup fileurl exists include it. + if [ -n "${remote_fileurl_backup}" ]; then + # counter set to 0 to allow second try + counter=0 + remote_fileurls_array=( remote_fileurl remote_fileurl_backup ) + else + # counter set to 1 to not allow second try + counter=1 + remote_fileurls_array=( remote_fileurl ) + fi + + for remote_fileurl_array in "${remote_fileurls_array[@]}"; do + if [ "${remote_fileurl_array}" == "remote_fileurl" ]; then + fileurl="${remote_fileurl}" + fileurl_name="${remote_fileurl_name}" + elif [ "${remote_fileurl_array}" == "remote_fileurl_backup" ]; then + fileurl="${remote_fileurl_backup}" + fileurl_name="${remote_fileurl_backup_name}" + fi + counter=$((counter+1)) + if [ ! -d "${local_filedir}" ]; then + mkdir -p "${local_filedir}" + fi + # Trap will remove part downloaded files if canceled. + trap fn_fetch_trap INT + # Larger files show a progress bar. + + echo -en "fetching ${fileurl_name} ${local_filename}...\c" + curlcmd=$(curl --connect-timeout 10 -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) + + local exitcode=$? + + # Download will fail if downloads a html file. + if [ -f "${local_filedir}/${local_filename}" ]; then + if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE" )" ]; then + rm "${local_filedir:?}/${local_filename:?}" + local exitcode=2 + fi + fi + + # On first try will error. On second try will fail. + if [ "${exitcode}" != 0 ]; then + if [ ${counter} -ge 2 ]; then + echo -e "FAIL" + if [ -f "${lgsmlog}" ]; then + fn_script_log_fatal "Downloading ${local_filename}" + fn_script_log_fatal "${fileurl}" + fi + core_exit.sh + else + echo -e "ERROR" + if [ -f "${lgsmlog}" ]; then + fn_script_log_error "Downloading ${local_filename}" + fn_script_log_error "${fileurl}" + fi + fi + else + echo -en "OK" + sleep 0.3 + echo -en "\033[2K\\r" + if [ -f "${lgsmlog}" ]; then + fn_script_log_pass "Downloading ${local_filename}" + fi + + # Make file executable if chmodx is set. + if [ "${chmodx}" == "chmodx" ]; then + chmod +x "${local_filedir}/${local_filename}" + fi + + # Remove trap. + trap - INT + + break + fi + done + fi + + if [ -f "${local_filedir}/${local_filename}" ]; then + # Execute file if run is set. + if [ "${run}" == "run" ]; then + # shellcheck source=/dev/null + source "${local_filedir}/${local_filename}" + fi + fi +} + +fn_bootstrap_fetch_file_github(){ + github_file_url_dir="${1}" + github_file_url_name="${2}" + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" + else + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + fi + remote_fileurl_name="GitHub" + remote_fileurl_backup_name="Bitbucket" + local_filedir="${3}" + local_filename="${github_file_url_name}" + chmodx="${4:-0}" + run="${5:-0}" + forcedl="${6:-0}" + md5="${7:-0}" + # Passes vars to the file download function. + fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" +} + +# Installer menu. + +fn_print_center() { + columns=$(tput cols) + line="$*" + printf "%*s\n" $(( (${#line} + columns) / 2)) "${line}" +} + +fn_print_horizontal(){ + printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "=" +} + +# Bash menu. +fn_install_menu_bash() { + local resultvar=$1 + title=$2 + caption=$3 + options=$4 + fn_print_horizontal + fn_print_center "${title}" + fn_print_center "${caption}" + fn_print_horizontal + menu_options=() + while read -r line || [[ -n "${line}" ]]; do + var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') + menu_options+=( "${var}" ) + done < "${options}" + menu_options+=( "Cancel" ) + select option in "${menu_options[@]}"; do + if [ "${option}" ]&&[ "${option}" != "Cancel" ]; then + eval "$resultvar=\"${option/%\ */}\"" + fi + break + done +} + +# Whiptail/Dialog menu. +fn_install_menu_whiptail() { + local menucmd=$1 + local resultvar=$2 + title=$3 + caption=$4 + options=$5 + height=${6:-40} + width=${7:-80} + menuheight=${8:-30} + IFS="," + menu_options=() + while read -r line; do + key=$(echo -e "${line}" | awk -F "," '{print $3}') + val=$(echo -e "${line}" | awk -F "," '{print $2}') + menu_options+=( "${val//\"}" "${key//\"}" ) + done < "${options}" + OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3) + if [ $? == 0 ]; then + eval "$resultvar=\"${OPTION}\"" + else + eval "$resultvar=" + fi +} + +# Menu selector. +fn_install_menu() { + local resultvar=$1 + local selection="" + title=$2 + caption=$3 + options=$4 + # Get menu command. + for menucmd in whiptail dialog bash; do + if [ "$(command -v "${menucmd}")" ]; then + menucmd=$(command -v "${menucmd}") + break + fi + done + case "$(basename "${menucmd}")" in + whiptail|dialog) + fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; + *) + fn_install_menu_bash selection "${title}" "${caption}" "${options}";; + esac + eval "$resultvar=\"${selection}\"" +} + +# Gets server info from serverlist.csv and puts in to array. +fn_server_info(){ + IFS="," + server_info_array=($(grep -aw "${userinput}" "${serverlist}")) + shortname="${server_info_array[0]}" # csgo + gameservername="${server_info_array[1]}" # csgoserver + gamename="${server_info_array[2]}" # Counter Strike: Global Offensive +} + +fn_install_getopt(){ + userinput="empty" + echo -e "Usage: $0 [option]" + echo -e "" + echo -e "Installer - Linux Game Server Managers - Version ${version}" + echo -e "https://linuxgsm.com" + echo -e "" + echo -e "Commands" + echo -e "install\t\t| Select server to install." + echo -e "servername\t| Enter name of game server to install. e.g $0 csgoserver." + echo -e "list\t\t| List all servers available for install." + exit +} + +fn_install_file(){ + local_filename="${gameservername}" + if [ -e "${local_filename}" ]; then + i=2 + while [ -e "${local_filename}-${i}" ] ; do + (( i++ )) + done + local_filename="${local_filename}-${i}" + fi + cp -R "${selfname}" "${local_filename}" + sed -i -e "s/shortname=\"core\"/shortname=\"${shortname}\"/g" "${local_filename}" + sed -i -e "s/gameservername=\"core\"/gameservername=\"${gameservername}\"/g" "${local_filename}" + echo -e "Installed ${gamename} server as ${local_filename}" + echo -e "" + if [ ! -d "${serverfiles}" ]; then + echo -e "./${local_filename} install" + else + echo -e "Remember to check server ports" + echo -e "./${local_filename} details" + fi + echo -e "" + exit +} + +# Prevent LinuxGSM from running as root. Except if doing a dependency install. +if [ "$(whoami)" == "root" ]; then + if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then + if [ "${shortname}" == "core" ]; then + echo -e "[ FAIL ] Do NOT run this script as root!" + exit 1 + fi + elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then + echo -e "[ FAIL ] Do NOT run this script as root!" + exit 1 + else + core_functions.sh + check_root.sh + fi +fi + +# LinuxGSM installer mode. +if [ "${shortname}" == "core" ]; then + # Download the latest serverlist. This is the complete list of all supported servers. + fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" + if [ ! -f "${serverlist}" ]; then + echo -e "[ FAIL ] serverlist.csv could not be loaded." + exit 1 + fi + + if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then + { + tail -n +1 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' + } | column -s $'\t' -t | more + exit + elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then + tail -n +1 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" + fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" + userinput="${result}" + fn_server_info + if [ "${result}" == "${gameservername}" ]; then + fn_install_file + elif [ "${result}" == "" ]; then + echo -e "Install canceled" + else + echo -e "[ FAIL ] menu result does not match gameservername" + echo -e "result: ${result}" + echo -e "gameservername: ${gameservername}" + fi + elif [ "${userinput}" ]; then + fn_server_info + if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then + fn_install_file + else + echo -e "[ FAIL ] unknown game server" + fi + else + fn_install_getopt + fi + +# LinuxGSM server mode. +else + core_functions.sh + if [ "${shortname}" != "core-dep" ]; then + # Load LinuxGSM configs. + # These are required to get all the default variables for the specific server. + # Load the default config. If missing download it. If changed reload it. + if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then + mkdir -p "${configdirdefault}/config-lgsm/${gameservername}" + fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + fi + if [ ! -f "${configdirserver}/_default.cfg" ]; then + mkdir -p "${configdirserver}" + echo -en "copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + if [ $? != 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + else + function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${function_file_diff}" != "" ]; then + fn_print_warn_nl "_default.cfg has altered. reloading config." + echo -en "copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + if [ $? != 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + fi + fi + fi + # Configs have to be loaded twice to allow start startparameters to pick up all vars + # shellcheck source=/dev/null + source "${configdirserver}/_default.cfg" + # Load the common.cfg config. If missing download it. + if [ ! -f "${configdirserver}/common.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/common.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/common.cfg" + fi + # Load the secrets-common.cfg config. If missing download it. + if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/secrets-common.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/secrets-common.cfg" + fi + # Load the instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/${selfname}.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/${selfname}.cfg" + fi + # Load the secrets-instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/secrets-${selfname}.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/secrets-${selfname}.cfg" + fi + # Use eval if startparameters are only in _default.cfg to ensure all vars in startparameters are set. + if ! grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/common.cfg" "${configdirserver}/${selfname}.cfg" "${configdirserver}/secrets-common.cfg" "${configdirserver}/secrets-${selfname}.cfg"; then + if [ "${shortname}" == "wurm" ]; then + # shellcheck source=/dev/null + source "${servercfgfullpath}" + fi + + if [ -n "${preexecutable}" ]; then + eval preexecutable="$(sed -nr 's/^ *preexecutable=(.*)$/\1/p' "${configdirserver}/_default.cfg")" + fi + eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/_default.cfg")" + eval executable="$(sed -nr 's/^ *executable=(.*)$/\1/p' "${configdirserver}/_default.cfg")" + fi + + # Load the linuxgsm.sh in to tmpdir. If missing download it. + if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then + fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5" + fi + + # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. + fn_ansi_loader + # Prevents running of core_exit.sh for Travis-CI. + if [ "${travistest}" != "1" ]; then + getopt=$1 + core_getopt.sh + fi +fi diff --git a/tests/tests_defaultcfg/defaultcfg_0.txt b/tests/tests_defaultcfg/defaultcfg_0.txt new file mode 100644 index 000000000..bcaa9f1dd --- /dev/null +++ b/tests/tests_defaultcfg/defaultcfg_0.txt @@ -0,0 +1,63 @@ +stats +displayip +postalert +discordalert +discordwebhook +emailalert +email +emailfrom +iftttalert +ifttttoken +iftttevent +mailgunalert +mailguntoken +mailgundomain +mailgunemailfrom +mailgunemail +pushbulletalert +pushbullettoken +channeltag +rocketchatalert +rocketchatwebhook +rocketchattoken +slackalert +slackwebhook +pushoveralert +pushovertoken +telegramalert +telegramtoken +telegramchatid +curlcustomstring +maxbackups +maxbackupdays +stoponbackup +consolelogging +logdays +querydelay +ansi +sleeptime +stopmode +querymode +querytype +consoleverbose +consoleinteract +gamename +engine +glibc +systemdir +executabledir +executable +servercfgdir +servercfg +servercfgdefault +servercfgfullpath +backupdir +logdir +lgsmlogdir +consolelogdir +lgsmlog +consolelog +alertlog +postdetailslog +lgsmlogdate +consolelogdate diff --git a/tests/tests_defaultcfg/defaultcfg_1.txt b/tests/tests_defaultcfg/defaultcfg_1.txt new file mode 100644 index 000000000..aa5b8a207 --- /dev/null +++ b/tests/tests_defaultcfg/defaultcfg_1.txt @@ -0,0 +1,54 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. +#### Game Server Settings #### +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +#### LinuxGSM Settings #### +## Notification Alerts +# (on|off) +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +# More info | https://docs.linuxgsm.com/alerts#more-info +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +# Email Alerts | https://docs.linuxgsm.com/alerts/email +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help". +## Backup | https://docs.linuxgsm.com/commands/backup +## Logging | https://docs.linuxgsm.com/features/logging +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +#### Advanced Settings #### +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +## Console type +consoleverbose="" +consoleinteract="" +## Game Server Details +# Do not edit +#### Directories #### +# Edit with care +## Game Server Directories +## Backup Directory +## Logging Directories +## Logs Naming diff --git a/tests/tests_defaultcfg/tests_defaultcfg.sh b/tests/tests_defaultcfg/tests_defaultcfg.sh new file mode 100644 index 000000000..4039d90e7 --- /dev/null +++ b/tests/tests_defaultcfg/tests_defaultcfg.sh @@ -0,0 +1,65 @@ +#!/bin/bash +echo -e "" +echo -e "0.1 - Full comparison Output" +echo -e "==================================================================" +echo -e "Description:" +echo -e "test checks that vars present in ALL _default.cfg files are correct." +echo -e "" +echo -e "In master config < | > In game config" +find "lgsm/config-default/config-lgsm/" ! -name '*template.cfg' -name "*.cfg" -type f -print0 | +while IFS= read -r -d $'\0' line; do + grep "=" "${line}" | cut -f1 -d"=" > defaultcfgtemp.txt + diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_0.txt defaultcfgtemp.txt) + if [ "${diffoutput}" ]; then + echo "File with errors:" + echo "${line}" + echo -e "=================================" + echo -e "In master config < | > In game config" + echo "${diffoutput}" + echo "" + fi + rm -f defaultcfgtemp.txt +done + +echo -e "" +echo -e "1.0 - Master Comparison" +echo -e "==================================================================" +echo -e "Description:" +echo -e "test checks that vars present in ALL _default.cfg files are correct." +echo -e "" +echo -e "In master config < | > In game config" +find lgsm/config-default/config-lgsm/ ! -name '*template.cfg' -name "*.cfg" -type f -print0 | +while IFS= read -r -d $'\0' line; do + grep "=" "${line}" | cut -f1 -d"=" > defaultcfgtemp.txt + diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_0.txt defaultcfgtemp.txt | grep '^<') + if [ "${diffoutput}" ]; then + echo "File with errors:" + echo "${line}" + echo -e "=================================" + echo -e "In master config < | > In game config" + echo "${diffoutput}" + echo "" + fi + rm -f defaultcfgtemp.txt +done + +echo -e "" +echo -e "2.0 - Check Comment" +echo -e "==================================================================" +echo -e "Description:" +echo -e "test checks that comments in ALL _default.cfg files are correct." +echo -e "" +echo -e "In master config < | > In game config" +find lgsm/config-default/config-lgsm/ ! -name '*template.cfg' -name "*.cfg" -type f -print0 | +while IFS= read -r -d $'\0' line; do + grep "#" "${line}" > defaultcfgtemp.txt + diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_1.txt defaultcfgtemp.txt | grep '^<') + if [ "${diffoutput}" ]; then + echo "File with errors:" + echo "${line}" + echo -e "=================================" + echo "${diffoutput}" + echo "" + fi + rm -f defaultcfgtemp.txt +done diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh new file mode 100644 index 000000000..55a05f99f --- /dev/null +++ b/tests/tests_fctrserver.sh @@ -0,0 +1,1183 @@ +#!/bin/bash +# Project: Game Server Managers - LinuxGSM +# Author: Daniel Gibbs +# License: MIT License, Copyright (c) 2020 Daniel Gibbs +# Purpose: Travis CI Tests: Factorio | Linux Game Server Management Script +# Contributors: https://linuxgsm.com/contrib +# Documentation: https://docs.linuxgsm.com +# Website: https://linuxgsm.com + +# DO NOT EDIT THIS FILE +# LinuxGSM configuration is no longer edited here +# To update your LinuxGSM config go to: +# lgsm/config-lgsm +# https://docs.linuxgsm.com/configuration/linuxgsm-config + +# Debugging +if [ -f ".dev-debug" ]; then + exec 5>dev-debug.log + BASH_XTRACEFD="5" + set -x +fi + +version="v20.6.2" +shortname="fctr" +gameservername="fctrserver" +commandname="CORE" +rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") +selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +sessionname=$(echo "${selfname}" | cut -f1 -d".") +lgsmdir="${rootdir}/lgsm" +logdir="${rootdir}/log" +lgsmlogdir="${logdir}/lgsm" +steamcmddir="${HOME}/.steam/steamcmd" +serverfiles="${rootdir}/serverfiles" +functionsdir="${lgsmdir}/functions" +tmpdir="${lgsmdir}/tmp" +datadir="${lgsmdir}/data" +lockdir="${lgsmdir}/lock" +serverlist="${datadir}/serverlist.csv" +serverlistmenu="${datadir}/serverlistmenu.csv" +configdir="${lgsmdir}/config-lgsm" +configdirserver="${configdir}/${gameservername}" +configdirdefault="${lgsmdir}/config-default" +userinput="${1}" + +# Allows for testing not on Travis CI. +# if using travis for tests +if [ -z "${TRAVIS}" ]; then + TRAVIS_BRANCH="develop" + TRAVIS_BUILD_DIR="${rootdir}" +fi +travistest="1" +## GitHub Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="GameServerManagers" +githubrepo="LinuxGSM" +githubbranch="${TRAVIS_BRANCH}" + +# Core function that is required first. +core_functions.sh(){ + functionfile="${FUNCNAME[0]}" + fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" +} + +# Bootstrap +# Fetches the core functions required before passed off to core_dl.sh. +fn_bootstrap_fetch_file(){ + remote_fileurl="${1}" + remote_fileurl_backup="${2}" + remote_fileurl_name="${3}" + remote_fileurl_backup_name="${4}" + local_filedir="${5}" + local_filename="${6}" + chmodx="${7:-0}" + run="${8:-0}" + forcedl="${9:-0}" + md5="${10:-0}" + # Download file if missing or download forced. + if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then + # If backup fileurl exists include it. + if [ -n "${remote_fileurl_backup}" ]; then + # counter set to 0 to allow second try + counter=0 + remote_fileurls_array=( remote_fileurl remote_fileurl_backup ) + else + # counter set to 1 to not allow second try + counter=1 + remote_fileurls_array=( remote_fileurl ) + fi + + for remote_fileurl_array in "${remote_fileurls_array[@]}"; do + if [ "${remote_fileurl_array}" == "remote_fileurl" ]; then + fileurl="${remote_fileurl}" + fileurl_name="${remote_fileurl_name}" + elif [ "${remote_fileurl_array}" == "remote_fileurl_backup" ]; then + fileurl="${remote_fileurl_backup}" + fileurl_name="${remote_fileurl_backup_name}" + fi + counter=$((counter+1)) + if [ ! -d "${local_filedir}" ]; then + mkdir -p "${local_filedir}" + fi + # Trap will remove part downloaded files if canceled. + trap fn_fetch_trap INT + # Larger files show a progress bar. + + echo -en "fetching ${fileurl_name} ${local_filename}...\c" + curlcmd=$(curl -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) + + local exitcode=$? + # Download will fail if downloads a html file. + if [ -f "${local_filedir}/${local_filename}" ]; then + if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE" )" ]; then + rm "${local_filedir:?}/${local_filename:?}" + local exitcode=2 + fi + fi + + # On first try will error. On second try will fail. + if [ "${exitcode}" != 0 ]; then + if [ ${counter} -ge 2 ]; then + echo -e "FAIL" + if [ -f "${lgsmlog}" ]; then + fn_script_log_fatal "Downloading ${local_filename}" + fn_script_log_fatal "${fileurl}" + fi + core_exit.sh + else + echo -e "ERROR" + if [ -f "${lgsmlog}" ]; then + fn_script_log_error "Downloading ${local_filename}" + fn_script_log_error "${fileurl}" + fi + fi + + else + echo -en "OK" + sleep 0.3 + echo -en "\033[2K\\r" + if [ -f "${lgsmlog}" ]; then + fn_script_log_pass "Downloading ${local_filename}" + fi + + # Make file executable if chmodx is set. + if [ "${chmodx}" == "chmodx" ]; then + chmod +x "${local_filedir}/${local_filename}" + fi + + # Remove trap. + trap - INT + + break + fi + done + fi + + if [ -f "${local_filedir}/${local_filename}" ]; then + # Execute file if run is set. + if [ "${run}" == "run" ]; then + # shellcheck source=/dev/null + source "${local_filedir}/${local_filename}" + fi + fi +} + +fn_bootstrap_fetch_file_github(){ + github_file_url_dir="${1}" + github_file_url_name="${2}" + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" + else + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + fi + remote_fileurl_name="GitHub" + remote_fileurl_backup_name="Bitbucket" + local_filedir="${3}" + local_filename="${github_file_url_name}" + chmodx="${4:-0}" + run="${5:-0}" + forcedl="${6:-0}" + md5="${7:-0}" + # Passes vars to the file download function. + fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" +} + +# Installer menu. + +fn_print_center() { + columns=$(tput cols) + line="$*" + printf "%*s\n" $(( (${#line} + columns) / 2)) "${line}" +} + +fn_print_horizontal(){ + printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "=" +} + +# Bash menu. +fn_install_menu_bash() { + local resultvar=$1 + title=$2 + caption=$3 + options=$4 + fn_print_horizontal + fn_print_center "${title}" + fn_print_center "${caption}" + fn_print_horizontal + menu_options=() + while read -r line || [[ -n "${line}" ]]; do + var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') + menu_options+=( "${var}" ) + done < "${options}" + menu_options+=( "Cancel" ) + select option in "${menu_options[@]}"; do + if [ "${option}" ]&&[ "${option}" != "Cancel" ]; then + eval "$resultvar=\"${option/%\ */}\"" + fi + break + done +} + +# Whiptail/Dialog menu. +fn_install_menu_whiptail() { + local menucmd=$1 + local resultvar=$2 + title=$3 + caption=$4 + options=$5 + height=${6:-40} + width=${7:-80} + menuheight=${8:-30} + IFS="," + menu_options=() + while read -r line; do + key=$(echo -e "${line}" | awk -F "," '{print $3}') + val=$(echo -e "${line}" | awk -F "," '{print $2}') + menu_options+=( "${val//\"}" "${key//\"}" ) + done < "${options}" + OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3) + if [ $? == 0 ]; then + eval "$resultvar=\"${OPTION}\"" + else + eval "$resultvar=" + fi +} + +# Menu selector. +fn_install_menu() { + local resultvar=$1 + local selection="" + title=$2 + caption=$3 + options=$4 + # Get menu command. + for menucmd in whiptail dialog bash; do + if [ "$(command -v "${menucmd}")" ]; then + menucmd=$(command -v "${menucmd}") + break + fi + done + case "$(basename "${menucmd}")" in + whiptail|dialog) + fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; + *) + fn_install_menu_bash selection "${title}" "${caption}" "${options}";; + esac + eval "$resultvar=\"${selection}\"" +} + +# Gets server info from serverlist.csv and puts in to array. +fn_server_info(){ + IFS="," + server_info_array=($(grep -aw "${userinput}" "${serverlist}")) + shortname="${server_info_array[0]}" # csgo + gameservername="${server_info_array[1]}" # csgoserver + gamename="${server_info_array[2]}" # Counter Strike: Global Offensive +} + +fn_install_getopt(){ + userinput="empty" + echo -e "Usage: $0 [option]" + echo -e "" + echo -e "Installer - Linux Game Server Managers - Version ${version}" + echo -e "https://linuxgsm.com" + echo -e "" + echo -e "Commands" + echo -e "install\t\t| Select server to install." + echo -e "servername\t| Enter name of game server to install. e.g $0 csgoserver." + echo -e "list\t\t| List all servers available for install." + exit +} + +fn_install_file(){ + local_filename="${gameservername}" + if [ -e "${local_filename}" ]; then + i=2 + while [ -e "${local_filename}-${i}" ] ; do + (( i++ )) + done + local_filename="${local_filename}-${i}" + fi + cp -R "${selfname}" "${local_filename}" + sed -i -e "s/shortname=\"core\"/shortname=\"${shortname}\"/g" "${local_filename}" + sed -i -e "s/gameservername=\"core\"/gameservername=\"${gameservername}\"/g" "${local_filename}" + echo -e "Installed ${gamename} server as ${local_filename}" + echo -e "" + if [ ! -d "${serverfiles}" ]; then + echo -e "./${local_filename} install" + else + echo -e "Remember to check server ports" + echo -e "./${local_filename} details" + fi + echo -e "" + exit +} + +# Prevent LinuxGSM from running as root. Except if doing a dependency install. +if [ "$(whoami)" == "root" ]; then + if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then + if [ "${shortname}" == "core" ]; then + echo -e "[ FAIL ] Do NOT run this script as root!" + exit 1 + fi + elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then + echo -e "[ FAIL ] Do NOT run this script as root!" + exit 1 + else + core_functions.sh + check_root.sh + fi +fi + +# LinuxGSM installer mode. +if [ "${shortname}" == "core" ]; then + # Download the latest serverlist. This is the complete list of all supported servers. + fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" + if [ ! -f "${serverlist}" ]; then + echo -e "[ FAIL ] serverlist.csv could not be loaded." + exit 1 + fi + + if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then + { + tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' + } | column -s $'\t' -t | more + exit + elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then + tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" + fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" + userinput="${result}" + fn_server_info + if [ "${result}" == "${gameservername}" ]; then + fn_install_file + elif [ "${result}" == "" ]; then + echo -e "Install canceled" + else + echo -e "[ FAIL ] menu result does not match gameservername" + echo -e "result: ${result}" + echo -e "gameservername: ${gameservername}" + fi + elif [ "${userinput}" ]; then + fn_server_info + if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then + fn_install_file + else + echo -e "[ FAIL ] unknown game server" + fi + else + fn_install_getopt + fi + +# LinuxGSM server mode. +else + core_functions.sh + if [ "${shortname}" != "core-dep" ]; then + # Load LinuxGSM configs. + # These are required to get all the default variables for the specific server. + # Load the default config. If missing download it. If changed reload it. + if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then + mkdir -p "${configdirdefault}/config-lgsm/${gameservername}" + fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + fi + if [ ! -f "${configdirserver}/_default.cfg" ]; then + mkdir -p "${configdirserver}" + echo -en "copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + else + function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${function_file_diff}" != "" ]; then + fn_print_warn_nl "_default.cfg has been altered. reloading config." + echo -en "copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + fi + fi + # shellcheck source=/dev/null + source "${configdirserver}/_default.cfg" + # Load the common.cfg config. If missing download it. + if [ ! -f "${configdirserver}/common.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/common.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/common.cfg" + fi + # Load the secrets-common.cfg config. If missing download it. + if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/secrets-common.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/secrets-common.cfg" + fi + # Load the instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/${selfname}.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/${selfname}.cfg" + fi + # Load the secrets-instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/secrets-${selfname}.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/secrets-${selfname}.cfg" + fi + + # Load the linuxgsm.sh in to tmpdir. If missing download it. + if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then + fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5" + fi + fi + # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. + fn_ansi_loader + # Prevents running of core_exit.sh for Travis-CI. + if [ "${travistest}" != "1" ]; then + getopt=$1 + core_getopt.sh + fi +fi + +fn_currentstatus_tmux(){ + check_status.sh + if [ "${status}" != "0" ]; then + currentstatus="ONLINE" + else + currentstatus="OFFLINE" + fi +} + +fn_setstatus(){ + fn_currentstatus_tmux + echo"" + echo -e "Required status: ${requiredstatus}" + counter=0 + echo -e "Current status: ${currentstatus}" + while [ "${requiredstatus}" != "${currentstatus}" ]; do + counter=$((counter+1)) + fn_currentstatus_tmux + echo -en "New status: ${currentstatus}\\r" + + if [ "${requiredstatus}" == "ONLINE" ]; then + (command_start.sh > /dev/null 2>&1) + else + (command_stop.sh > /dev/null 2>&1) + fi + if [ "${counter}" -gt "5" ]; then + currentstatus="FAIL" + echo -e "Current status: ${currentstatus}" + echo -e "" + echo -e "Unable to start or stop server." + exit 1 + fi + done + echo -en "New status: ${currentstatus}\\r" + echo -e "\n" + echo -e "Test starting:" + echo -e "" +} + +# End of every test will expect the result to either pass or fail +# If the script does not do as intended the whole test will fail +# if expecting a pass +fn_test_result_pass(){ + if [ $? != 0 ]; then + echo -e "=================================" + echo -e "Expected result: PASS" + echo -e "Actual result: FAIL" + fn_print_fail_nl "TEST FAILED" + exitcode=1 + core_exit.sh + else + echo -e "=================================" + echo -e "Expected result: PASS" + echo -e "Actual result: PASS" + fn_print_ok_nl "TEST PASSED" + echo -e "" + fi +} + +# if expecting a fail +fn_test_result_fail(){ + if [ $? == 0 ]; then + echo -e "=================================" + echo -e "Expected result: FAIL" + echo -e "Actual result: PASS" + fn_print_fail_nl "TEST FAILED" + exitcode=1 + core_exit.sh + else + echo -e "=================================" + echo -e "Expected result: FAIL" + echo -e "Actual result: FAIL" + fn_print_ok_nl "TEST PASSED" + echo -e "" + fi +} + +# test result n/a +fn_test_result_na(){ + echo -e "=================================" + echo -e "Expected result: N/A" + echo -e "Actual result: N/A" + fn_print_fail_nl "TEST N/A" +} + +sleeptime="0" + +echo -e "=================================" +echo -e "Travis CI Tests" +echo -e "Linux Game Server Manager" +echo -e "by Daniel Gibbs" +echo -e "Contributors: http://goo.gl/qLmitD" +echo -e "https://linuxgsm.com" +echo -e "=================================" +echo -e "" +echo -e "=================================" +echo -e "Server Tests" +echo -e "Using: ${gamename}" +echo -e "Testing Branch: ${TRAVIS_BRANCH}" +echo -e "=================================" + +echo -e "" +echo -e "Tests Summary" +echo -e "=================================" +echo -e "0.0 - Pre-test Tasks" +echo -e "0.1 - Create log dir's" +echo -e "0.2 - Enable dev-debug" +echo -e "" +echo -e "1.0 - Pre-install tests" +echo -e "1.1 - start - no files" +echo -e "1.2 - getopt" +echo -e "1.3 - getopt with incorrect args" +echo -e "" +echo -e "2.0 - Installation" +echo -e "2.1 - install" +echo -e "" +echo -e "3.0 - Start/Stop/Restart Tests" +echo -e "3.1 - start" +echo -e "3.2 - start - online" +echo -e "3.3 - start - updateonstart" +echo -e "3.4 - stop" +echo -e "3.5 - stop - offline" +echo -e "3.6 - restart" +echo -e "3.7 - restart - offline" +echo -e "" +echo -e "4.0 - Update Tests" +echo -e "4.1 - update" +echo -e "4.2 - update-lgsm" +echo -e "" +echo -e "5.0 - Monitor Tests" +echo -e "5.1 - monitor - online" +echo -e "5.2 - monitor - offline - with lockfile" +echo -e "5.3 - monitor - offline - no lockfile" +echo -e "5.4 - test-alert" +echo -e "" +echo -e "6.0 - Details Tests" +echo -e "6.1 - details" +echo -e "6.2 - postdetails" +echo -e "" +echo -e "7.0 - Backup Tests" +echo -e "7.1 - backup" +echo -e "" +echo -e "8.0 - Development Tools Tests" +echo -e "8.1 - dev - detect glibc" +echo -e "8.2 - dev - detect ldd" +echo -e "8.3 - dev - detect deps" +echo -e "8.4 - dev - query-raw" + +echo -e "" +echo -e "9.0 - Donate" +echo -e "9.1 - donate" +echo -e "" + +echo -e "0.0 - Pre-test Tasks" +echo -e "==================================================================" +echo -e "Description:" +echo -e "Create log dir's" +echo -e "" + +echo -e "" +echo -e "0.1 - Create log dir's" +echo -e "=================================" +echo -e "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + install_logs.sh +) +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "0.2 - Enable dev-debug" +echo -e "=================================" +echo -e "Description:" +echo -e "Enable dev-debug" +echo -e "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_debug.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "1.0 - Pre-install tests" +echo -e "==================================================================" +echo -e "" + +echo -e "1.1 - start - no files" +echo -e "=================================" +echo -e "Description:" +echo -e "test script reaction to missing server files." +echo -e "Command: ./${gameservername} start" +echo -e "" +# Allows for testing not on Travis CI +if [ -z "${TRAVIS}" ]; then +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) +fn_test_result_fail +else + echo -e "Test bypassed" +fi + +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "1.2 - getopt" +echo -e "=================================" +echo -e "Description:" +echo -e "displaying options messages." +echo -e "Command: ./${gameservername}" +echo -e "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + core_getopt.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "1.3 - getopt with incorrect args" +echo -e "=================================" +echo -e "Description:" +echo -e "displaying options messages." +echo -e "Command: ./${gameservername} abc123" +echo -e "" +getopt="abc123" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + core_getopt.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "2.0 - Installation" +echo -e "==================================================================" + +echo -e "" +echo -e "2.1 - install" +echo -e "=================================" +echo -e "Description:" +echo -e "install ${gamename} server." +echo -e "Command: ./${gameservername} auto-install" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + fn_autoinstall +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.0 - Start/Stop/Restart Tests" +echo -e "==================================================================" + +echo -e "" +echo -e "3.1 - start" +echo -e "=================================" +echo -e "Description:" +echo -e "start ${gamename} server." +echo -e "Command: ./${gameservername} start" +requiredstatus="OFFLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.2 - start - online" +echo -e "=================================" +echo -e "Description:" +echo -e "start ${gamename} server while already running." +echo -e "Command: ./${gameservername} start" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) +fn_test_result_fail +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.3 - start - updateonstart" +echo -e "=================================" +echo -e "Description:" +echo -e "will update server on start." +echo -e "Command: ./${gameservername} start" +requiredstatus="OFFLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + updateonstart="on";command_start.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.4 - stop" +echo -e "=================================" +echo -e "Description:" +echo -e "stop ${gamename} server." +echo -e "Command: ./${gameservername} stop" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_stop.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.5 - stop - offline" +echo -e "=================================" +echo -e "Description:" +echo -e "stop ${gamename} server while already stopped." +echo -e "Command: ./${gameservername} stop" +requiredstatus="OFFLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_stop.sh +) +fn_test_result_fail +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.6 - restart" +echo -e "=================================" +echo -e "Description:" +echo -e "restart ${gamename}." +echo -e "Command: ./${gameservername} restart" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_restart.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.7 - restart - offline" +echo -e "=================================" +echo -e "Description:" +echo -e "restart ${gamename} while already stopped." +echo -e "Command: ./${gameservername} restart" +requiredstatus="OFFLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_restart.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "4.0 - Update Tests" +echo -e "==================================================================" + +echo -e "" +echo -e "4.1 - update" +echo -e "=================================" +echo -e "Description:" +echo -e "check for updates." +echo -e "Command: ./${gameservername} update" +requiredstatus="OFFLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_update.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "4.2 - update-lgsm" +echo -e "=================================" +echo -e "Description:" +echo -e "update LinuxGSM." +echo -e "" +echo -e "Command: ./jc2server update-lgam" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_update_linuxgsm.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "5.0 - Monitor Tests" +echo -e "==================================================================" +echo -e "" +info_config.sh +echo -e "Server IP - Port: ${ip}:${port}" +echo -e "Server IP - Query Port: ${ip}:${queryport}" + +echo -e "" +echo -e "5.1 - monitor - online" +echo -e "=================================" +echo -e "Description:" +echo -e "run monitor server while already running." +echo -e "Command: ./${gameservername} monitor" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_monitor.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "5.2 - monitor - offline - with lockfile" +echo -e "=================================" +echo -e "Description:" +echo -e "run monitor while server is offline with lockfile." +echo -e "Command: ./${gameservername} monitor" +requiredstatus="OFFLINE" +fn_setstatus +fn_print_info_nl "creating lockfile." +date '+%s' > "${lockdir}/${selfname}.lock" +echo "${version}" >> "${lockdir}/${selfname}.lock" +echo "${port}" >> "${lockdir}/${selfname}.lock" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_monitor.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "5.3 - monitor - offline - no lockfile" +echo -e "=================================" +echo -e "Description:" +echo -e "run monitor while server is offline with no lockfile." +echo -e "Command: ./${gameservername} monitor" +requiredstatus="OFFLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_monitor.sh +) +fn_test_result_fail +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "5.4 - test-alert" +echo -e "=================================" +echo -e "Description:" +echo -e "run monitor while server is offline with no lockfile." +echo -e "Command: ./${gameservername} test-alert" +requiredstatus="OFFLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_test_alert.sh +) +fn_test_result_fail +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "6.0 - Details Tests" +echo -e "==================================================================" + +echo -e "" +echo -e "6.1 - details" +echo -e "=================================" +echo -e "Description:" +echo -e "display details." +echo -e "Command: ./${gameservername} details" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_details.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "6.2 - postdetails" +echo -e "=================================" +echo -e "Description:" +echo -e "post details." +echo -e "Command: ./${gameservername} postdetails" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_postdetails.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "7.0 - Backup Tests" +echo -e "==================================================================" + +echo -e "" +echo -e "7.1 - backup" +echo -e "=================================" +echo -e "Description:" +echo -e "run a backup." +echo -e "Command: ./${gameservername} backup" +requiredstatus="ONLINE" +fn_setstatus +echo -e "test de-activated until issue #1839 fixed" +#(command_backup.sh) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "8.0 - Development Tools Tests" +echo -e "==================================================================" + +echo -e "" +echo -e "8.1 - dev - detect glibc" +echo -e "=================================" +echo -e "Description:" +echo -e "detect glibc." +echo -e "Command: ./${gameservername} detect-glibc" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_detect_glibc.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "8.2 - dev - detect ldd" +echo -e "=================================" +echo -e "Description:" +echo -e "detect ldd." +echo -e "Command: ./${gameservername} detect-ldd" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_detect_ldd.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "8.3 - dev - detect deps" +echo -e "=================================" +echo -e "Description:" +echo -e "detect dependencies." +echo -e "Command: ./${gameservername} detect-deps" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_detect_deps.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "8.4 - dev - query-raw" +echo -e "=================================" +echo -e "Description:" +echo -e "raw query output." +echo -e "Command: ./${gameservername} query-raw" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_query_raw.sh +) +fn_test_result_na +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" + +echo -e "9.0 - Donate" +echo -e "==================================================================" + +echo -e "" +echo -e "9.1 - donate" +echo -e "=================================" +echo -e "Description:" +echo -e "donate." +echo -e "Command: ./${gameservername} donate" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_donate.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "=================================" +echo -e "Server Tests - Complete!" +echo -e "Using: ${gamename}" +echo -e "=================================" +requiredstatus="OFFLINE" +fn_setstatus + +core_exit.sh diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index c9926eb06..2eb1815f3 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -1,449 +1,1347 @@ #!/bin/bash -# TravisCI Tests -# Server Management Script +# Project: Game Server Managers - LinuxGSM # Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="071115" +# License: MIT License, Copyright (c) 2020 Daniel Gibbs +# Purpose: Travis CI Tests: Just Cause 2 | Linux Game Server Management Script +# Contributors: https://linuxgsm.com/contrib +# Documentation: https://docs.linuxgsm.com +# Website: https://linuxgsm.com -#### Variables #### +# DO NOT EDIT THIS FILE +# LinuxGSM configuration is no longer edited here +# To update your LinuxGSM config go to: +# lgsm/config-lgsm +# https://docs.linuxgsm.com/configuration/linuxgsm-config -# Notification Email -# (on|off) -emailnotification="on" -email="me@danielgibbs.co.uk" +# Debugging +if [ -f ".dev-debug" ]; then + exec 5>dev-debug.log + BASH_XTRACEFD="5" + set -x +fi + +version="v20.6.2" +shortname="jc2" +gameservername="jc2server" +commandname="CORE" +rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") +selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +sessionname=$(echo "${selfname}" | cut -f1 -d".") +lgsmdir="${rootdir}/lgsm" +logdir="${rootdir}/log" +lgsmlogdir="${logdir}/lgsm" +steamcmddir="${HOME}/.steam/steamcmd" +serverfiles="${rootdir}/serverfiles" +functionsdir="${lgsmdir}/functions" +tmpdir="${lgsmdir}/tmp" +datadir="${lgsmdir}/data" +lockdir="${lgsmdir}/lock" +serverlist="${datadir}/serverlist.csv" +serverlistmenu="${datadir}/serverlistmenu.csv" +configdir="${lgsmdir}/config-lgsm" +configdirserver="${configdir}/${gameservername}" +configdirdefault="${lgsmdir}/config-default" +userinput="${1}" + +# Allows for testing not on Travis CI. +# if using travis for tests +if [ -z "${TRAVIS}" ]; then + TRAVIS_BRANCH="develop" + TRAVIS_BUILD_DIR="${rootdir}" +fi +travistest="1" + +## GitHub Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="GameServerManagers" +githubrepo="LinuxGSM" +githubbranch="${TRAVIS_BRANCH}" + +# Core function that is required first. +core_functions.sh(){ + functionfile="${FUNCNAME[0]}" + fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" +} + +# Bootstrap +# Fetches the core functions required before passed off to core_dl.sh. +fn_bootstrap_fetch_file(){ + remote_fileurl="${1}" + remote_fileurl_backup="${2}" + remote_fileurl_name="${3}" + remote_fileurl_backup_name="${4}" + local_filedir="${5}" + local_filename="${6}" + chmodx="${7:-0}" + run="${8:-0}" + forcedl="${9:-0}" + md5="${10:-0}" + # Download file if missing or download forced. + if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then + # If backup fileurl exists include it. + if [ -n "${remote_fileurl_backup}" ]; then + # counter set to 0 to allow second try + counter=0 + remote_fileurls_array=( remote_fileurl remote_fileurl_backup ) + else + # counter set to 1 to not allow second try + counter=1 + remote_fileurls_array=( remote_fileurl ) + fi + + for remote_fileurl_array in "${remote_fileurls_array[@]}"; do + if [ "${remote_fileurl_array}" == "remote_fileurl" ]; then + fileurl="${remote_fileurl}" + fileurl_name="${remote_fileurl_name}" + elif [ "${remote_fileurl_array}" == "remote_fileurl_backup" ]; then + fileurl="${remote_fileurl_backup}" + fileurl_name="${remote_fileurl_backup_name}" + fi + counter=$((counter+1)) + if [ ! -d "${local_filedir}" ]; then + mkdir -p "${local_filedir}" + fi + # Trap will remove part downloaded files if canceled. + trap fn_fetch_trap INT + # Larger files show a progress bar. + + echo -en "fetching ${fileurl_name} ${local_filename}...\c" + curlcmd=$(curl -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) + + local exitcode=$? + # Download will fail if downloads a html file. + if [ -f "${local_filedir}/${local_filename}" ]; then + if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE" )" ]; then + rm "${local_filedir:?}/${local_filename:?}" + local exitcode=2 + fi + fi -# Steam login -steamuser="anonymous" -steampass="" + # On first try will error. On second try will fail. + if [ "${exitcode}" != 0 ]; then + if [ ${counter} -ge 2 ]; then + echo -e "FAIL" + if [ -f "${lgsmlog}" ]; then + fn_script_log_fatal "Downloading ${local_filename}" + fn_script_log_fatal "${fileurl}" + fi + core_exit.sh + else + echo -e "ERROR" + if [ -f "${lgsmlog}" ]; then + fn_script_log_error "Downloading ${local_filename}" + fn_script_log_error "${fileurl}" + fi + fi -# Start Variables -updateonstart="off" + else + echo -en "OK" + sleep 0.3 + echo -en "\033[2K\\r" + if [ -f "${lgsmlog}" ]; then + fn_script_log_pass "Downloading ${local_filename}" + fi -fn_parms(){ -parms="" + # Make file executable if chmodx is set. + if [ "${chmodx}" == "chmodx" ]; then + chmod +x "${local_filedir}/${local_filename}" + fi + + # Remove trap. + trap - INT + + break + fi + done + fi + + if [ -f "${local_filedir}/${local_filename}" ]; then + # Execute file if run is set. + if [ "${run}" == "run" ]; then + # shellcheck source=/dev/null + source "${local_filedir}/${local_filename}" + fi + fi } -#### Advanced Variables #### - -# Steam -appid="261140" - -# Server Details -servicename="jc2-server" -gamename="Just Cause 2" -engine="avalanche" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./Jcmp-Server" -servercfg="config.lua" -servercfgdir="${filesdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/default_config.lua" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -#gamelogdir="" # No server logs available -scriptlogdir="${rootdir}/log/script" -consolelogdir="${rootdir}/log/console" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -consolelog="${consolelogdir}/${servicename}-console.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" -consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_bootstrap_fetch_file_github(){ + github_file_url_dir="${1}" + github_file_url_name="${2}" + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" + else + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" -fi -source "${rootdir}/functions/${functionfile}" + remote_fileurl_name="GitHub" + remote_fileurl_backup_name="Bitbucket" + local_filedir="${3}" + local_filename="${github_file_url_name}" + chmodx="${4:-0}" + run="${5:-0}" + forcedl="${6:-0}" + md5="${7:-0}" + # Passes vars to the file download function. + fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction +# Installer menu. + +fn_print_center() { + columns=$(tput cols) + line="$*" + printf "%*s\n" $(( (${#line} + columns) / 2)) "${line}" } -fn_functions +fn_print_horizontal(){ + printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "=" +} -fn_currentstatus_tmux(){ -pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:") -if [ "${pid}" != "0" ]; then - currentstatus="ONLINE" -else - currentstatus="OFFLINE" -fi +# Bash menu. +fn_install_menu_bash() { + local resultvar=$1 + title=$2 + caption=$3 + options=$4 + fn_print_horizontal + fn_print_center "${title}" + fn_print_center "${caption}" + fn_print_horizontal + menu_options=() + while read -r line || [[ -n "${line}" ]]; do + var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') + menu_options+=( "${var}" ) + done < "${options}" + menu_options+=( "Cancel" ) + select option in "${menu_options[@]}"; do + if [ "${option}" ]&&[ "${option}" != "Cancel" ]; then + eval "$resultvar=\"${option/%\ */}\"" + fi + break + done } -fn_currentstatus_ts3(){ -ts3status=$(${executable} status servercfgfullpathfile=${servercfgfullpath}) +# Whiptail/Dialog menu. +fn_install_menu_whiptail() { + local menucmd=$1 + local resultvar=$2 + title=$3 + caption=$4 + options=$5 + height=${6:-40} + width=${7:-80} + menuheight=${8:-30} + IFS="," + menu_options=() + while read -r line; do + key=$(echo -e "${line}" | awk -F "," '{print $3}') + val=$(echo -e "${line}" | awk -F "," '{print $2}') + menu_options+=( "${val//\"}" "${key//\"}" ) + done < "${options}" + OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3) + if [ $? == 0 ]; then + eval "$resultvar=\"${OPTION}\"" + else + eval "$resultvar=" + fi +} + +# Menu selector. +fn_install_menu() { + local resultvar=$1 + local selection="" + title=$2 + caption=$3 + options=$4 + # Get menu command. + for menucmd in whiptail dialog bash; do + if [ "$(command -v "${menucmd}")" ]; then + menucmd=$(command -v "${menucmd}") + break + fi + done + case "$(basename "${menucmd}")" in + whiptail|dialog) + fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; + *) + fn_install_menu_bash selection "${title}" "${caption}" "${options}";; + esac + eval "$resultvar=\"${selection}\"" +} + +# Gets server info from serverlist.csv and puts in to array. +fn_server_info(){ + IFS="," + server_info_array=($(grep -aw "${userinput}" "${serverlist}")) + shortname="${server_info_array[0]}" # csgo + gameservername="${server_info_array[1]}" # csgoserver + gamename="${server_info_array[2]}" # Counter Strike: Global Offensive +} + +fn_install_getopt(){ + userinput="empty" + echo -e "Usage: $0 [option]" + echo -e "" + echo -e "Installer - Linux Game Server Managers - Version ${version}" + echo -e "https://linuxgsm.com" + echo -e "" + echo -e "Commands" + echo -e "install\t\t| Select server to install." + echo -e "servername\t| Enter name of game server to install. e.g $0 csgoserver." + echo -e "list\t\t| List all servers available for install." + exit +} + +fn_install_file(){ + local_filename="${gameservername}" + if [ -e "${local_filename}" ]; then + i=2 + while [ -e "${local_filename}-${i}" ] ; do + (( i++ )) + done + local_filename="${local_filename}-${i}" + fi + cp -R "${selfname}" "${local_filename}" + sed -i -e "s/shortname=\"core\"/shortname=\"${shortname}\"/g" "${local_filename}" + sed -i -e "s/gameservername=\"core\"/gameservername=\"${gameservername}\"/g" "${local_filename}" + echo -e "Installed ${gamename} server as ${local_filename}" + echo -e "" + if [ ! -d "${serverfiles}" ]; then + echo -e "./${local_filename} install" + else + echo -e "Remember to check server ports" + echo -e "./${local_filename} details" + fi + echo -e "" + exit +} -if [ "${ts3status}" == "Server is running" ]; then - currentstatus="ONLINE" +# Prevent LinuxGSM from running as root. Except if doing a dependency install. +if [ "$(whoami)" == "root" ]; then + if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then + if [ "${shortname}" == "core" ]; then + echo -e "[ FAIL ] Do NOT run this script as root!" + exit 1 + fi + elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then + echo -e "[ FAIL ] Do NOT run this script as root!" + exit 1 + else + core_functions.sh + check_root.sh + fi +fi + +# LinuxGSM installer mode. +if [ "${shortname}" == "core" ]; then + # Download the latest serverlist. This is the complete list of all supported servers. + fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" + if [ ! -f "${serverlist}" ]; then + echo -e "[ FAIL ] serverlist.csv could not be loaded." + exit 1 + fi + + if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then + { + tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' + } | column -s $'\t' -t | more + exit + elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then + tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" + fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" + userinput="${result}" + fn_server_info + if [ "${result}" == "${gameservername}" ]; then + fn_install_file + elif [ "${result}" == "" ]; then + echo -e "Install canceled" + else + echo -e "[ FAIL ] menu result does not match gameservername" + echo -e "result: ${result}" + echo -e "gameservername: ${gameservername}" + fi + elif [ "${userinput}" ]; then + fn_server_info + if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then + fn_install_file + else + echo -e "[ FAIL ] unknown game server" + fi + else + fn_install_getopt + fi + +# LinuxGSM server mode. else - currentstatus="OFFLINE" + core_functions.sh + if [ "${shortname}" != "core-dep" ]; then + # Load LinuxGSM configs. + # These are required to get all the default variables for the specific server. + # Load the default config. If missing download it. If changed reload it. + if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then + mkdir -p "${configdirdefault}/config-lgsm/${gameservername}" + fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + fi + if [ ! -f "${configdirserver}/_default.cfg" ]; then + mkdir -p "${configdirserver}" + echo -en "copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + else + function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${function_file_diff}" != "" ]; then + fn_print_warn_nl "_default.cfg has been altered. reloading config." + echo -en "copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + fi + fi + # shellcheck source=/dev/null + source "${configdirserver}/_default.cfg" + # Load the common.cfg config. If missing download it. + if [ ! -f "${configdirserver}/common.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/common.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/common.cfg" + fi + # Load the secrets-common.cfg config. If missing download it. + if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/secrets-common.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/secrets-common.cfg" + fi + # Load the instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/${selfname}.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/${selfname}.cfg" + fi + # Load the secrets-instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/secrets-${selfname}.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/secrets-${selfname}.cfg" + fi + + # Load the linuxgsm.sh in to tmpdir. If missing download it. + if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then + fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5" + fi + fi + # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. + fn_ansi_loader + # Prevents running of core_exit.sh for Travis-CI. + if [ "${travistest}" != "1" ]; then + getopt=$1 + core_getopt.sh + fi fi + +fn_currentstatus_tmux(){ + check_status.sh + if [ "${status}" != "0" ]; then + currentstatus="ONLINE" + else + currentstatus="OFFLINE" + fi } - + fn_setstatus(){ fn_currentstatus_tmux echo"" - echo "Required status: ${requiredstatus}" + echo -e "Required status: ${requiredstatus}" counter=0 - echo "Current status: ${currentstatus}" - while [ "${requiredstatus}" != "${currentstatus}" ]; do - counter=$((counter+1)) - fn_currentstatus_tmux - echo -ne "New status: ${currentstatus}\\r" - + echo -e "Current status: ${currentstatus}" + while [ "${requiredstatus}" != "${currentstatus}" ]; do + counter=$((counter+1)) + fn_currentstatus_tmux + echo -en "New status: ${currentstatus}\\r" + if [ "${requiredstatus}" == "ONLINE" ]; then - (fn_start > /dev/null 2>&1) + (command_start.sh > /dev/null 2>&1) else - (fn_stop > /dev/null 2>&1) + (command_stop.sh > /dev/null 2>&1) + fi + if [ "${counter}" -gt "5" ]; then + currentstatus="FAIL" + echo -e "Current status: ${currentstatus}" + echo -e "" + echo -e "Unable to start or stop server." + exit 1 fi - if [ "${counter}" -gt "5" ]; then - currentstatus="FAIL" - echo "Current status: ${currentstatus}" - echo "" - echo "Unable to start or stop server." - exit 1 - fi - done - echo -ne "New status: ${currentstatus}\\r" - echo -e "\n" - echo "Test starting:" - echo "" - sleep 0.5 + done + echo -en "New status: ${currentstatus}\\r" + echo -e "\n" + echo -e "Test starting:" + echo -e "" +} + +# End of every test will expect the result to either pass or fail +# If the script does not do as intended the whole test will fail +# if expecting a pass +fn_test_result_pass(){ + if [ $? != 0 ]; then + echo -e "=================================" + echo -e "Expected result: PASS" + echo -e "Actual result: FAIL" + fn_print_fail_nl "TEST FAILED" + exitcode=1 + core_exit.sh + else + echo -e "=================================" + echo -e "Expected result: PASS" + echo -e "Actual result: PASS" + fn_print_ok_nl "TEST PASSED" + echo -e "" + fi +} + +# if expecting a fail +fn_test_result_fail(){ + if [ $? == 0 ]; then + echo -e "=================================" + echo -e "Expected result: FAIL" + echo -e "Actual result: PASS" + fn_print_fail_nl "TEST FAILED" + exitcode=1 + core_exit.sh + else + echo -e "=================================" + echo -e "Expected result: FAIL" + echo -e "Actual result: FAIL" + fn_print_ok_nl "TEST PASSED" + echo -e "" + fi } -echo "=================================" -echo "TravisCI Tests" -echo "Linux Game Server Manager" -echo "by Daniel Gibbs" -echo "http://gameservermanagers.com" -echo "=================================" -echo "" -sleep 1 -echo "=================================" -echo "Server Tests" -echo "Using: ${gamename}" -echo "=================================" -echo "" -sleep 1 -mkdir ${rootdir} - - - -echo "1.0 - start - no files" -echo "=================================" -echo "Description:" -echo "test script reaction to missing server files." -echo "" -(fn_start) -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "1.1 - getopt" -echo "=================================" -echo "Description:" -echo "displaying options messages." -echo "" -(fn_getopt) -echo "" -echo "Test complete!" -sleep 1 -echo "" - - - -echo "2.0 - install" -echo "=================================" -echo "Description:" -echo "install ${gamename} server." -fn_autoinstall -echo "" -echo "Test complete!" -sleep 1 -echo "" - - - -echo "3.1 - start" -echo "=================================" -echo "Description:" -echo "start ${gamename} server." +# test result n/a +fn_test_result_na(){ + echo -e "=================================" + echo -e "Expected result: N/A" + echo -e "Actual result: N/A" + fn_print_fail_nl "TEST N/A" +} + +sleeptime="0" + +echo -e "=================================" +echo -e "Travis CI Tests" +echo -e "Linux Game Server Manager" +echo -e "by Daniel Gibbs" +echo -e "Contributors: http://goo.gl/qLmitD" +echo -e "https://linuxgsm.com" +echo -e "=================================" +echo -e "" +echo -e "=================================" +echo -e "Server Tests" +echo -e "Using: ${gamename}" +echo -e "Testing Branch: ${TRAVIS_BRANCH}" +echo -e "=================================" +echo -e "" +echo -e "Tests Summary" +echo -e "=================================" +echo -e "0.0 - Pre-test Tasks" +echo -e "0.1 - Create log dir's" +echo -e "0.2 - Enable dev-debug" +echo -e "" +echo -e "1.0 - Pre-install tests" +echo -e "1.1 - start - no files" +echo -e "1.2 - getopt" +echo -e "1.3 - getopt with incorrect args" +echo -e "" +echo -e "2.0 - Installation" +echo -e "2.1 - install" +echo -e "" +echo -e "3.0 - Start/Stop/Restart Tests" +echo -e "3.1 - start" +echo -e "3.2 - start - online" +echo -e "3.3 - start - updateonstart" +echo -e "3.4 - stop" +echo -e "3.5 - stop - offline" +echo -e "3.6 - restart" +echo -e "3.7 - restart - offline" +echo -e "" +echo -e "4.0 - Update Tests" +echo -e "4.1 - update" +echo -e "4.2 - update - change buildid" +echo -e "4.3 - update - change buildid - online" +echo -e "4.4 - update - remove appmanifest file" +echo -e "4.5 - force-update" +echo -e "4.6 - force-update - online" +echo -e "4.7 - validate" +echo -e "4.8 - validate - online" +echo -e "4.9 - update-lgsm" +echo -e "" +echo -e "5.0 - Monitor Tests" +echo -e "5.1 - monitor - online" +echo -e "5.2 - monitor - offline - with lockfile" +echo -e "5.3 - monitor - offline - no lockfile" +echo -e "5.4 - test-alert" +echo -e "" +echo -e "6.0 - Details Tests" +echo -e "6.1 - details" +echo -e "6.2 - postdetails" +echo -e "" +echo -e "7.0 - Backup Tests" +echo -e "7.1 - backup" +echo -e "" +echo -e "8.0 - Development Tools Tests" +echo -e "8.1 - dev - detect glibc" +echo -e "8.2 - dev - detect ldd" +echo -e "8.3 - dev - detect deps" +echo -e "8.4 - dev - query-raw" +echo -e "" +echo -e "9.0 - Donate" +echo -e "9.1 - donate" +echo -e "" +echo -e "0.0 - Pre-test Tasks" +echo -e "==================================================================" +echo -e "Description:" +echo -e "Create log dir's" +echo -e "" + +echo -e "" +echo -e "0.1 - Create log dir's" +echo -e "=================================" +echo -e "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + install_logs.sh +) +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "0.2 - Enable dev-debug" +echo -e "=================================" +echo -e "Description:" +echo -e "Enable dev-debug" +echo -e "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_debug.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "1.0 - Pre-install tests" +echo -e "==================================================================" +echo -e "" + +echo -e "1.1 - start - no files" +echo -e "=================================" +echo -e "Description:" +echo -e "test script reaction to missing server files." +echo -e "Command: ./${gameservername} start" +echo -e "" +# Allows for testing not on Travis CI +if [ -z "${TRAVIS}" ]; then +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) +fn_test_result_fail +else + echo -e "Test bypassed" +fi + +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "1.2 - getopt" +echo -e "=================================" +echo -e "Description:" +echo -e "displaying options messages." +echo -e "Command: ./${gameservername}" +echo -e "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + core_getopt.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "1.3 - getopt with incorrect args" +echo -e "=================================" +echo -e "Description:" +echo -e "displaying options messages." +echo -e "Command: ./${gameservername} abc123" +echo -e "" +getopt="abc123" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + core_getopt.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "2.0 - Installation" +echo -e "==================================================================" + +echo -e "" +echo -e "2.1 - install" +echo -e "=================================" +echo -e "Description:" +echo -e "install ${gamename} server." +echo -e "Command: ./${gameservername} auto-install" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + fn_autoinstall +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.0 - Start/Stop/Restart Tests" +echo -e "==================================================================" + +echo -e "" +echo -e "3.1 - start" +echo -e "=================================" +echo -e "Description:" +echo -e "start ${gamename} server." +echo -e "Command: ./${gameservername} start" requiredstatus="OFFLINE" fn_setstatus -fn_start -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "3.2 - start - online" -echo "=================================" -echo "Description:" -echo "start ${gamename} server while already running." +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.2 - start - online" +echo -e "=================================" +echo -e "Description:" +echo -e "start ${gamename} server while already running." +echo -e "Command: ./${gameservername} start" requiredstatus="ONLINE" fn_setstatus -(fn_start) -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "3.3 - start - updateonstart" -echo "=================================" -echo "Description:" -echo "will update server on start." +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) +fn_test_result_fail +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.3 - start - updateonstart" +echo -e "=================================" +echo -e "Description:" +echo -e "will update server on start." +echo -e "Command: ./${gameservername} start" requiredstatus="OFFLINE" fn_setstatus ( - updateonstart="on" - fn_start -) -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "3.4 - stop" -echo "=================================" -echo "Description:" -echo "stop ${gamename} server." + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + updateonstart="on";command_start.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.4 - stop" +echo -e "=================================" +echo -e "Description:" +echo -e "stop ${gamename} server." +echo -e "Command: ./${gameservername} stop" requiredstatus="ONLINE" fn_setstatus -fn_stop -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "3.5 - stop - offline" -echo "=================================" -echo "Description:" -echo "stop ${gamename} server while already stopped." +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_stop.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.5 - stop - offline" +echo -e "=================================" +echo -e "Description:" +echo -e "stop ${gamename} server while already stopped." +echo -e "Command: ./${gameservername} stop" requiredstatus="OFFLINE" fn_setstatus -(fn_stop) -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "3.6 - restart" -echo "=================================" -echo "Description:" -echo "restart ${gamename}." +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_stop.sh +) +fn_test_result_fail +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.6 - restart" +echo -e "=================================" +echo -e "Description:" +echo -e "restart ${gamename}." +echo -e "Command: ./${gameservername} restart" requiredstatus="ONLINE" fn_setstatus -fn_restart -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "3.7 - restart - offline" -echo "=================================" -echo "Description:" -echo "restart ${gamename} while already stopped." +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_restart.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.7 - restart - offline" +echo -e "=================================" +echo -e "Description:" +echo -e "restart ${gamename} while already stopped." +echo -e "Command: ./${gameservername} restart" requiredstatus="OFFLINE" fn_setstatus -fn_restart -echo "" -echo "Test complete!" -sleep 1 -echo "" - +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_restart.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +echo -e "" +echo -e "4.0 - Update Tests" +echo -e "==================================================================" -echo "4.1 - update" -echo "=================================" -echo "Description:" -echo "check for updates." +echo -e "" +echo -e "4.1 - update" +echo -e "=================================" +echo -e "Description:" +echo -e "check for updates." +echo -e "Command: ./${gameservername} update" requiredstatus="OFFLINE" fn_setstatus -fn_update_check -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "4.2 - update - change buildid" -echo "=================================" -echo "Description:" -echo "change the buildid tricking SteamCMD to update." +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_update.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "4.2 - update - change buildid" +echo -e "=================================" +echo -e "Description:" +echo -e "change the buildid tricking SteamCMD to update." +echo -e "Command: ./jc2server update" requiredstatus="OFFLINE" fn_setstatus -fn_printinfonl "changed buildid to 0." -sed -i 's/[0-9]\+/0/' ${filesdir}/steamapps/appmanifest_${appid}.acf -fn_update_check -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "4.3 - update - change buildid - online" -echo "=================================" -echo "Description:" -echo "change the buildid tricking SteamCMD to update server while already running." +fn_print_info_nl "changed buildid to 0." +sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_update.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "4.3 - update - change buildid - online" +echo -e "=================================" +echo -e "Description:" +echo -e "change the buildid tricking SteamCMD to update server while already running." +echo -e "Command: ./jc2server update" requiredstatus="ONLINE" fn_setstatus -fn_printinfonl "changed buildid to 0." -sed -i 's/[0-9]\+/0/' ${filesdir}/steamapps/appmanifest_${appid}.acf -fn_update_check -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "4.4 - update - remove appmanifest file" -echo "=================================" -echo "Description:" -echo "removing appmanifest file will cause script to repair." +fn_print_info_nl "changed buildid to 0." +sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_update.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "4.4 - update - remove appmanifest file" +echo -e "=================================" +echo -e "Description:" +echo -e "removing appmanifest file will cause script to repair." +echo -e "Command: ./jc2server update" requiredstatus="OFFLINE" fn_setstatus -fn_printinfonl "removed appmanifest_${appid}.acf." -rm --verbose "${filesdir}/steamapps/appmanifest_${appid}.acf" -fn_update_check -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "4.5 - force-update" -echo "=================================" -echo "Description:" -echo "force-update bypassing update check." +fn_print_info_nl "removed appmanifest_${appid}.acf." +rm --verbose "${serverfiles:?}/steamapps/appmanifest_${appid}.acf" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_update.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "4.5 - force-update" +echo -e "=================================" +echo -e "Description:" +echo -e "force-update bypassing update check." +echo -e "Command: ./jc2server force-update" requiredstatus="OFFLINE" fn_setstatus -fn_update_check -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "4.6 - force-update - online" -echo "=================================" -echo "Description:" -echo "force-update bypassing update check server while already running." +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + forceupdate=1;command_update.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "4.6 - force-update - online" +echo -e "=================================" +echo -e "Description:" +echo -e "force-update bypassing update check server while already running." +echo -e "Command: ./jc2server force-update" requiredstatus="ONLINE" fn_setstatus -fn_update_check -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "4.7 - validate" -echo "=================================" -echo "Description:" -echo "validate server files." +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + forceupdate=1;command_update.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "4.7 - validate" +echo -e "=================================" +echo -e "Description:" +echo -e "validate server files." +echo -e "Command: ./jc2server validate" requiredstatus="OFFLINE" fn_setstatus -fn_validate -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "4.8 - validate - online" -echo "=================================" -echo "Description:" -echo "validate server files while server while already running." +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_validate.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "4.8 - validate - online" +echo -e "=================================" +echo -e "Description:" +echo -e "validate server files while server already running." +echo -e "" +echo -e "Command: ./jc2server validate" requiredstatus="ONLINE" fn_setstatus -fn_validate -echo "" -echo "Test complete!" -sleep 1 -echo "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_validate.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +echo -e "" +echo -e "4.9 - update-lgsm" +echo -e "=================================" +echo -e "Description:" +echo -e "update LinuxGSM." +echo -e "" +echo -e "Command: ./jc2server update-lgam" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_update_linuxgsm.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "Inserting IP address" +echo -e "=================================" +echo -e "Description:" +echo -e "Inserting Travis IP in to config." +echo -e "Allows monitor to work" +if [ "$(ip -o -4 addr|grep eth0)" ]; then + travisip=$(ip -o -4 addr | grep eth0 | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | grep -v 127.0.0) +else + travisip=$(ip -o -4 addr | grep ens | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -v 127.0.0) +fi +sed -i "/BindIP/c\BindIP = \"${travisip}\"," "${serverfiles}/config.lua" +echo -e "IP: ${travisip}" +echo -e "" +echo -e "5.0 - Monitor Tests" +echo -e "==================================================================" +echo -e "" +info_config.sh +echo -e "Server IP - Port: ${ip}:${port}" +echo -e "Server IP - Query Port: ${ip}:${queryport}" -echo "5.1 - monitor - online" -echo "=================================" -echo "Description:" -echo "run monitor server while already running." +echo -e "" +echo -e "5.1 - monitor - online" +echo -e "=================================" +echo -e "Description:" +echo -e "run monitor server while already running." +echo -e "Command: ./${gameservername} monitor" requiredstatus="ONLINE" fn_setstatus -(fn_monitor) -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "5.2 - monitor - offline - no lockfile" -echo "=================================" -echo "Description:" -echo "run monitor while server is offline with no lockfile." +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_monitor.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "5.2 - monitor - offline - with lockfile" +echo -e "=================================" +echo -e "Description:" +echo -e "run monitor while server is offline with lockfile." +echo -e "Command: ./${gameservername} monitor" requiredstatus="OFFLINE" fn_setstatus -(fn_monitor) -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "5.3 - monitor - offline - with lockfile" -echo "=================================" -echo "Description:" -echo "run monitor while server is offline with no lockfile." +fn_print_info_nl "creating lockfile." +date '+%s' > "${lockdir}/${selfname}.lock" +echo "${version}" >> "${lockdir}/${selfname}.lock" +echo "${port}" >> "${lockdir}/${selfname}.lock" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_monitor.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "5.3 - monitor - offline - no lockfile" +echo -e "=================================" +echo -e "Description:" +echo -e "run monitor while server is offline with no lockfile." +echo -e "Command: ./${gameservername} monitor" requiredstatus="OFFLINE" fn_setstatus -fn_printinfonl "creating lockfile." -date > "${rootdir}/${lockselfname}" -(fn_monitor) -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "5.4 - monitor - gsquery.py failure" -echo "=================================" -echo "Description:" -echo "gsquery.py will fail to query port." -requiredstatus="ONLINE" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_monitor.sh +) +fn_test_result_fail +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "5.4 - test-alert" +echo -e "=================================" +echo -e "Description:" +echo -e "run monitor while server is offline with no lockfile." +echo -e "Command: ./${gameservername} test-alert" +requiredstatus="OFFLINE" fn_setstatus +cp "${servercfgfullpath}" "config.lua" sed -i 's/[0-9]\+/0/' "${servercfgfullpath}" -(fn_monitor) -echo "" -fn_printinfonl "Reseting ${servercfg}." -fn_install_config -echo "" -echo "Test complete!" -sleep 1 -echo "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_test_alert.sh +) +fn_test_result_fail +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +fn_print_info_nl "Re-generating ${servercfg}." +cp -v "config.lua" "${servercfgfullpath}" +echo -e "=================================" + +echo -e "" +echo -e "6.0 - Details Tests" +echo -e "==================================================================" + +echo -e "" +echo -e "6.1 - details" +echo -e "=================================" +echo -e "Description:" +echo -e "display details." +echo -e "Command: ./${gameservername} details" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_details.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "6.2 - postdetails" +echo -e "=================================" +echo -e "Description:" +echo -e "post details." +echo -e "Command: ./${gameservername} postdetails" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_postdetails.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "7.0 - Backup Tests" +echo -e "==================================================================" +echo -e "" +echo -e "7.1 - backup" +echo -e "=================================" +echo -e "Description:" +echo -e "run a backup." +echo -e "Command: ./${gameservername} backup" +requiredstatus="ONLINE" +fn_setstatus +echo -e "test de-activated until issue #1839 fixed" +#(command_backup.sh) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "8.0 - Development Tools Tests" +echo -e "==================================================================" + +echo -e "" +echo -e "8.1 - dev - detect glibc" +echo -e "=================================" +echo -e "Description:" +echo -e "detect glibc." +echo -e "Command: ./${gameservername} detect-glibc" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_detect_glibc.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "8.2 - dev - detect ldd" +echo -e "=================================" +echo -e "Description:" +echo -e "detect ldd." +echo -e "Command: ./${gameservername} detect-ldd" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_detect_ldd.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +echo -e "" +echo -e "8.3 - dev - detect deps" +echo -e "=================================" +echo -e "Description:" +echo -e "detect dependencies." +echo -e "Command: ./${gameservername} detect-deps" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_detect_deps.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' -echo "6.0 - details" -echo "=================================" -echo "Description:" -echo "display details." +echo -e "" +echo -e "8.4 - dev - query-raw" +echo -e "=================================" +echo -e "Description:" +echo -e "raw query output." +echo -e "Command: ./${gameservername} query-raw" requiredstatus="ONLINE" fn_setstatus -fn_details -echo "" -echo "Test complete!" -sleep 1 -echo "" - -echo "=================================" -echo "Server Tests - Complete!" -echo "Using: ${gamename}" -echo "=================================" -echo "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_query_raw.sh +) +fn_test_result_na +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "9.0 - Donate" +echo -e "==================================================================" + +echo -e "" +echo -e "9.1 - donate" +echo -e "=================================" +echo -e "Description:" +echo -e "donate." +echo -e "Command: ./${gameservername} donate" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_donate.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "=================================" +echo -e "Server Tests - Complete!" +echo -e "Using: ${gamename}" +echo -e "=================================" requiredstatus="OFFLINE" fn_setstatus -sleep 1 -fn_printinfo "Tidying up directories." -sleep 1 -rm -rfv ${serverfiles} -echo "END" +core_exit.sh diff --git a/tests/tests_kcov.sh b/tests/tests_kcov.sh new file mode 100644 index 000000000..743e2fda2 --- /dev/null +++ b/tests/tests_kcov.sh @@ -0,0 +1,14 @@ +#!/bin/bash +echo -e "Installing kcov" +curl -L "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/shunit2/shunit2-2.1.6.tgz" | tar zx +wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz +tar xzf master.tar.gz +cd kcov-master || exit +mkdir build +cd build || exit +cmake .. +make +sudo make install +cd ../.. +rm -rf kcov-master +mkdir -p coverage diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh new file mode 100644 index 000000000..8797e78e8 --- /dev/null +++ b/tests/tests_mcserver.sh @@ -0,0 +1,1228 @@ +#!/bin/bash +# Project: Game Server Managers - LinuxGSM +# Author: Daniel Gibbs +# License: MIT License, Copyright (c) 2020 Daniel Gibbs +# Purpose: Travis CI Tests: Minecraft | Linux Game Server Management Script +# Contributors: https://linuxgsm.com/contrib +# Documentation: https://docs.linuxgsm.com +# Website: https://linuxgsm.com + +# DO NOT EDIT THIS FILE +# LinuxGSM configuration is no longer edited here +# To update your LinuxGSM config go to: +# lgsm/config-lgsm +# https://docs.linuxgsm.com/configuration/linuxgsm-config + +# Debugging +if [ -f ".dev-debug" ]; then + exec 5>dev-debug.log + BASH_XTRACEFD="5" + set -x +fi + +version="v20.6.2" +shortname="mc" +gameservername="mcserver" +commandname="CORE" +rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") +selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +sessionname=$(echo "${selfname}" | cut -f1 -d".") +lgsmdir="${rootdir}/lgsm" +logdir="${rootdir}/log" +lgsmlogdir="${logdir}/lgsm" +steamcmddir="${HOME}/.steam/steamcmd" +serverfiles="${rootdir}/serverfiles" +functionsdir="${lgsmdir}/functions" +tmpdir="${lgsmdir}/tmp" +datadir="${lgsmdir}/data" +lockdir="${lgsmdir}/lock" +serverlist="${datadir}/serverlist.csv" +serverlistmenu="${datadir}/serverlistmenu.csv" +configdir="${lgsmdir}/config-lgsm" +configdirserver="${configdir}/${gameservername}" +configdirdefault="${lgsmdir}/config-default" +userinput="${1}" + +# Allows for testing not on Travis CI. +# if using travis for tests +if [ -z "${TRAVIS}" ]; then + TRAVIS_BRANCH="develop" + TRAVIS_BUILD_DIR="${rootdir}" +fi +travistest="1" + +## GitHub Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="GameServerManagers" +githubrepo="LinuxGSM" +githubbranch="${TRAVIS_BRANCH}" + +# Core function that is required first. +core_functions.sh(){ + functionfile="${FUNCNAME[0]}" + fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" +} + +# Bootstrap +# Fetches the core functions required before passed off to core_dl.sh. +fn_bootstrap_fetch_file(){ + remote_fileurl="${1}" + remote_fileurl_backup="${2}" + remote_fileurl_name="${3}" + remote_fileurl_backup_name="${4}" + local_filedir="${5}" + local_filename="${6}" + chmodx="${7:-0}" + run="${8:-0}" + forcedl="${9:-0}" + md5="${10:-0}" + # Download file if missing or download forced. + if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then + # If backup fileurl exists include it. + if [ -n "${remote_fileurl_backup}" ]; then + # counter set to 0 to allow second try + counter=0 + remote_fileurls_array=( remote_fileurl remote_fileurl_backup ) + else + # counter set to 1 to not allow second try + counter=1 + remote_fileurls_array=( remote_fileurl ) + fi + + for remote_fileurl_array in "${remote_fileurls_array[@]}"; do + if [ "${remote_fileurl_array}" == "remote_fileurl" ]; then + fileurl="${remote_fileurl}" + fileurl_name="${remote_fileurl_name}" + elif [ "${remote_fileurl_array}" == "remote_fileurl_backup" ]; then + fileurl="${remote_fileurl_backup}" + fileurl_name="${remote_fileurl_backup_name}" + fi + counter=$((counter+1)) + if [ ! -d "${local_filedir}" ]; then + mkdir -p "${local_filedir}" + fi + # Trap will remove part downloaded files if canceled. + trap fn_fetch_trap INT + # Larger files show a progress bar. + + echo -en "fetching ${fileurl_name} ${local_filename}...\c" + curlcmd=$(curl -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) + + local exitcode=$? + # Download will fail if downloads a html file. + if [ -f "${local_filedir}/${local_filename}" ]; then + if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE" )" ]; then + rm "${local_filedir:?}/${local_filename:?}" + local exitcode=2 + fi + fi + + # On first try will error. On second try will fail. + if [ "${exitcode}" != 0 ]; then + if [ ${counter} -ge 2 ]; then + echo -e "FAIL" + if [ -f "${lgsmlog}" ]; then + fn_script_log_fatal "Downloading ${local_filename}" + fn_script_log_fatal "${fileurl}" + fi + core_exit.sh + else + echo -e "ERROR" + if [ -f "${lgsmlog}" ]; then + fn_script_log_error "Downloading ${local_filename}" + fn_script_log_error "${fileurl}" + fi + fi + + else + echo -en "OK" + sleep 0.3 + echo -en "\033[2K\\r" + if [ -f "${lgsmlog}" ]; then + fn_script_log_pass "Downloading ${local_filename}" + fi + + # Make file executable if chmodx is set. + if [ "${chmodx}" == "chmodx" ]; then + chmod +x "${local_filedir}/${local_filename}" + fi + + # Remove trap. + trap - INT + + break + fi + done + fi + + if [ -f "${local_filedir}/${local_filename}" ]; then + # Execute file if run is set. + if [ "${run}" == "run" ]; then + # shellcheck source=/dev/null + source "${local_filedir}/${local_filename}" + fi + fi +} + +fn_bootstrap_fetch_file_github(){ + github_file_url_dir="${1}" + github_file_url_name="${2}" + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" + else + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + fi + remote_fileurl_name="GitHub" + remote_fileurl_backup_name="Bitbucket" + local_filedir="${3}" + local_filename="${github_file_url_name}" + chmodx="${4:-0}" + run="${5:-0}" + forcedl="${6:-0}" + md5="${7:-0}" + # Passes vars to the file download function. + fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" +} + +# Installer menu. + +fn_print_center() { + columns=$(tput cols) + line="$*" + printf "%*s\n" $(( (${#line} + columns) / 2)) "${line}" +} + +fn_print_horizontal(){ + printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "=" +} + +# Bash menu. +fn_install_menu_bash() { + local resultvar=$1 + title=$2 + caption=$3 + options=$4 + fn_print_horizontal + fn_print_center "${title}" + fn_print_center "${caption}" + fn_print_horizontal + menu_options=() + while read -r line || [[ -n "${line}" ]]; do + var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') + menu_options+=( "${var}" ) + done < "${options}" + menu_options+=( "Cancel" ) + select option in "${menu_options[@]}"; do + if [ "${option}" ]&&[ "${option}" != "Cancel" ]; then + eval "$resultvar=\"${option/%\ */}\"" + fi + break + done +} + +# Whiptail/Dialog menu. +fn_install_menu_whiptail() { + local menucmd=$1 + local resultvar=$2 + title=$3 + caption=$4 + options=$5 + height=${6:-40} + width=${7:-80} + menuheight=${8:-30} + IFS="," + menu_options=() + while read -r line; do + key=$(echo -e "${line}" | awk -F "," '{print $3}') + val=$(echo -e "${line}" | awk -F "," '{print $2}') + menu_options+=( "${val//\"}" "${key//\"}" ) + done < "${options}" + OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3) + if [ $? == 0 ]; then + eval "$resultvar=\"${OPTION}\"" + else + eval "$resultvar=" + fi +} + +# Menu selector. +fn_install_menu() { + local resultvar=$1 + local selection="" + title=$2 + caption=$3 + options=$4 + # Get menu command. + for menucmd in whiptail dialog bash; do + if [ "$(command -v "${menucmd}")" ]; then + menucmd=$(command -v "${menucmd}") + break + fi + done + case "$(basename "${menucmd}")" in + whiptail|dialog) + fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; + *) + fn_install_menu_bash selection "${title}" "${caption}" "${options}";; + esac + eval "$resultvar=\"${selection}\"" +} + +# Gets server info from serverlist.csv and puts in to array. +fn_server_info(){ + IFS="," + server_info_array=($(grep -aw "${userinput}" "${serverlist}")) + shortname="${server_info_array[0]}" # csgo + gameservername="${server_info_array[1]}" # csgoserver + gamename="${server_info_array[2]}" # Counter Strike: Global Offensive +} + +fn_install_getopt(){ + userinput="empty" + echo -e "Usage: $0 [option]" + echo -e "" + echo -e "Installer - Linux Game Server Managers - Version ${version}" + echo -e "https://linuxgsm.com" + echo -e "" + echo -e "Commands" + echo -e "install\t\t| Select server to install." + echo -e "servername\t| Enter name of game server to install. e.g $0 csgoserver." + echo -e "list\t\t| List all servers available for install." + exit +} + +fn_install_file(){ + local_filename="${gameservername}" + if [ -e "${local_filename}" ]; then + i=2 + while [ -e "${local_filename}-${i}" ] ; do + (( i++ )) + done + local_filename="${local_filename}-${i}" + fi + cp -R "${selfname}" "${local_filename}" + sed -i -e "s/shortname=\"core\"/shortname=\"${shortname}\"/g" "${local_filename}" + sed -i -e "s/gameservername=\"core\"/gameservername=\"${gameservername}\"/g" "${local_filename}" + echo -e "Installed ${gamename} server as ${local_filename}" + echo -e "" + if [ ! -d "${serverfiles}" ]; then + echo -e "./${local_filename} install" + else + echo -e "Remember to check server ports" + echo -e "./${local_filename} details" + fi + echo -e "" + exit +} + +# Prevent LinuxGSM from running as root. Except if doing a dependency install. +if [ "$(whoami)" == "root" ]; then + if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then + if [ "${shortname}" == "core" ]; then + echo -e "[ FAIL ] Do NOT run this script as root!" + exit 1 + fi + elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then + echo -e "[ FAIL ] Do NOT run this script as root!" + exit 1 + else + core_functions.sh + check_root.sh + fi +fi + +# LinuxGSM installer mode. +if [ "${shortname}" == "core" ]; then + # Download the latest serverlist. This is the complete list of all supported servers. + fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" + if [ ! -f "${serverlist}" ]; then + echo -e "[ FAIL ] serverlist.csv could not be loaded." + exit 1 + fi + + if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then + { + tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' + } | column -s $'\t' -t | more + exit + elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then + tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" + fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" + userinput="${result}" + fn_server_info + if [ "${result}" == "${gameservername}" ]; then + fn_install_file + elif [ "${result}" == "" ]; then + echo -e "Install canceled" + else + echo -e "[ FAIL ] menu result does not match gameservername" + echo -e "result: ${result}" + echo -e "gameservername: ${gameservername}" + fi + elif [ "${userinput}" ]; then + fn_server_info + if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then + fn_install_file + else + echo -e "[ FAIL ] unknown game server" + fi + else + fn_install_getopt + fi + +# LinuxGSM server mode. +else + core_functions.sh + if [ "${shortname}" != "core-dep" ]; then + # Load LinuxGSM configs. + # These are required to get all the default variables for the specific server. + # Load the default config. If missing download it. If changed reload it. + if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then + mkdir -p "${configdirdefault}/config-lgsm/${gameservername}" + fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + fi + if [ ! -f "${configdirserver}/_default.cfg" ]; then + mkdir -p "${configdirserver}" + echo -en "copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + else + function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${function_file_diff}" != "" ]; then + fn_print_warn_nl "_default.cfg has been altered. reloading config." + echo -en "copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + fi + fi + # shellcheck source=/dev/null + source "${configdirserver}/_default.cfg" + # Load the common.cfg config. If missing download it. + if [ ! -f "${configdirserver}/common.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/common.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/common.cfg" + fi + # Load the secrets-common.cfg config. If missing download it. + if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/secrets-common.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/secrets-common.cfg" + fi + # Load the instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/${selfname}.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/${selfname}.cfg" + fi + # Load the secrets-instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/secrets-${selfname}.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/secrets-${selfname}.cfg" + fi + + # Load the linuxgsm.sh in to tmpdir. If missing download it. + if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then + fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5" + fi + fi + # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. + fn_ansi_loader + # Prevents running of core_exit.sh for Travis-CI. + if [ "${travistest}" != "1" ]; then + getopt=$1 + core_getopt.sh + fi +fi + +fn_currentstatus_tmux(){ + check_status.sh + if [ "${status}" != "0" ]; then + currentstatus="ONLINE" + else + currentstatus="OFFLINE" + fi +} + +fn_setstatus(){ + fn_currentstatus_tmux + echo"" + echo -e "Required status: ${requiredstatus}" + counter=0 + echo -e "Current status: ${currentstatus}" + while [ "${requiredstatus}" != "${currentstatus}" ]; do + counter=$((counter+1)) + fn_currentstatus_tmux + echo -en "New status: ${currentstatus}\\r" + + if [ "${requiredstatus}" == "ONLINE" ]; then + (command_start.sh > /dev/null 2>&1) + else + (command_stop.sh > /dev/null 2>&1) + fi + if [ "${counter}" -gt "5" ]; then + currentstatus="FAIL" + echo -e "Current status: ${currentstatus}" + echo -e "" + echo -e "Unable to start or stop server." + exit 1 + fi + done + echo -en "New status: ${currentstatus}\\r" + echo -e "\n" + echo -e "Test starting:" + echo -e "" +} + +# End of every test will expect the result to either pass or fail +# If the script does not do as intended the whole test will fail +# if expecting a pass +fn_test_result_pass(){ + if [ $? != 0 ]; then + echo -e "=================================" + echo -e "Expected result: PASS" + echo -e "Actual result: FAIL" + fn_print_fail_nl "TEST FAILED" + exitcode=1 + core_exit.sh + else + echo -e "=================================" + echo -e "Expected result: PASS" + echo -e "Actual result: PASS" + fn_print_ok_nl "TEST PASSED" + echo -e "" + fi +} + +# if expecting a fail +fn_test_result_fail(){ + if [ $? == 0 ]; then + echo -e "=================================" + echo -e "Expected result: FAIL" + echo -e "Actual result: PASS" + fn_print_fail_nl "TEST FAILED" + exitcode=1 + core_exit.sh + else + echo -e "=================================" + echo -e "Expected result: FAIL" + echo -e "Actual result: FAIL" + fn_print_ok_nl "TEST PASSED" + echo -e "" + fi +} + +# test result n/a +fn_test_result_na(){ + echo -e "=================================" + echo -e "Expected result: N/A" + echo -e "Actual result: N/A" + fn_print_fail_nl "TEST N/A" +} + +sleeptime="0" + +echo -e "=================================" +echo -e "Travis CI Tests" +echo -e "Linux Game Server Manager" +echo -e "by Daniel Gibbs" +echo -e "Contributors: http://goo.gl/qLmitD" +echo -e "https://linuxgsm.com" +echo -e "=================================" +echo -e "" +echo -e "=================================" +echo -e "Server Tests" +echo -e "Using: ${gamename}" +echo -e "Testing Branch: ${TRAVIS_BRANCH}" +echo -e "=================================" +echo -e "" +echo -e "Tests Summary" +echo -e "=================================" +echo -e "0.0 - Pre-test Tasks" +echo -e "0.1 - Create log dir's" +echo -e "0.2 - Enable dev-debug" +echo -e "" +echo -e "1.0 - Pre-install tests" +echo -e "1.1 - start - no files" +echo -e "1.2 - getopt" +echo -e "1.3 - getopt with incorrect args" +echo -e "" +echo -e "2.0 - Installation" +echo -e "2.1 - install" +echo -e "" +echo -e "3.0 - Start/Stop/Restart Tests" +echo -e "3.1 - start" +echo -e "3.2 - start - online" +echo -e "3.3 - start - updateonstart" +echo -e "3.4 - stop" +echo -e "3.5 - stop - offline" +echo -e "3.6 - restart" +echo -e "3.7 - restart - offline" +echo -e "" +echo -e "4.0 - Update Tests" +echo -e "4.1 - update" +echo -e "4.2 - update-lgsm" +echo -e "" +echo -e "5.0 - Monitor Tests" +echo -e "5.1 - monitor - online" +echo -e "5.2 - monitor - offline - with lockfile" +echo -e "5.3 - monitor - offline - no lockfile" +echo -e "5.4 - test-alert" +echo -e "" +echo -e "6.0 - Details Tests" +echo -e "6.1 - details" +echo -e "6.2 - postdetails" +echo -e "" +echo -e "7.0 - Backup Tests" +echo -e "7.1 - backup" +echo -e "" +echo -e "8.0 - Development Tools Tests" +echo -e "8.1 - dev - detect glibc" +echo -e "8.2 - dev - detect ldd" +echo -e "8.3 - dev - detect deps" +echo -e "8.4 - dev - query-raw" +echo -e "" +echo -e "9.0 - Donate" +echo -e "9.1 - donate" + +echo -e "" +echo -e "0.0 - Pre-test Tasks" +echo -e "==================================================================" +echo -e "Description:" +echo -e "Create log dir's" +echo -e "" + +echo -e "" +echo -e "0.1 - Create log dir's" +echo -e "=================================" +echo -e "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + install_logs.sh +) +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "0.2 - Enable dev-debug" +echo -e "=================================" +echo -e "Description:" +echo -e "Enable dev-debug" +echo -e "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_debug.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "1.0 - Pre-install tests" +echo -e "==================================================================" +echo -e "" + +echo -e "1.1 - start - no files" +echo -e "=================================" +echo -e "Description:" +echo -e "test script reaction to missing server files." +echo -e "Command: ./${gameservername} start" +echo -e "" +# Allows for testing not on Travis CI +if [ -z "${TRAVIS}" ]; then +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) +fn_test_result_fail +else + echo -e "Test bypassed" +fi + +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "1.2 - getopt" +echo -e "=================================" +echo -e "Description:" +echo -e "displaying options messages." +echo -e "Command: ./${gameservername}" +echo -e "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + core_getopt.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "1.3 - getopt with incorrect args" +echo -e "=================================" +echo -e "Description:" +echo -e "displaying options messages." +echo -e "Command: ./${gameservername} abc123" +echo -e "" +getopt="abc123" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + core_getopt.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "2.0 - Installation" +echo -e "==================================================================" + +echo -e "" +echo -e "2.1 - install" +echo -e "=================================" +echo -e "Description:" +echo -e "install ${gamename} server." +echo -e "Command: ./${gameservername} auto-install" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + fn_autoinstall +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.0 - Start/Stop/Restart Tests" +echo -e "==================================================================" + +echo -e "" +echo -e "3.1 - start" +echo -e "=================================" +echo -e "Description:" +echo -e "start ${gamename} server." +echo -e "Command: ./${gameservername} start" +requiredstatus="OFFLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.2 - start - online" +echo -e "=================================" +echo -e "Description:" +echo -e "start ${gamename} server while already running." +echo -e "Command: ./${gameservername} start" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) +fn_test_result_fail +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.3 - start - updateonstart" +echo -e "=================================" +echo -e "Description:" +echo -e "will update server on start." +echo -e "Command: ./${gameservername} start" +requiredstatus="OFFLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + updateonstart="on";command_start.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +echo -e "" +echo -e "30s Pause" +echo -e "=================================" +echo -e "Description:" +echo -e "give time for server to fully start." +echo -e "Command: sleep 30" +requiredstatus="ONLINE" +fn_setstatus +sleep 30 + +echo -e "" +echo -e "3.4 - stop" +echo -e "=================================" +echo -e "Description:" +echo -e "stop ${gamename} server." +echo -e "Command: ./${gameservername} stop" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_stop.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.5 - stop - offline" +echo -e "=================================" +echo -e "Description:" +echo -e "stop ${gamename} server while already stopped." +echo -e "Command: ./${gameservername} stop" +requiredstatus="OFFLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_stop.sh +) +fn_test_result_fail +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.6 - restart" +echo -e "=================================" +echo -e "Description:" +echo -e "restart ${gamename}." +echo -e "Command: ./${gameservername} restart" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_restart.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.7 - restart - offline" +echo -e "=================================" +echo -e "Description:" +echo -e "restart ${gamename} while already stopped." +echo -e "Command: ./${gameservername} restart" +requiredstatus="OFFLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_restart.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "4.0 - Update Tests" +echo -e "==================================================================" + +echo -e "" +echo -e "4.1 - update" +echo -e "=================================" +echo -e "Description:" +echo -e "check for updates." +echo -e "Command: ./${gameservername} update" +requiredstatus="OFFLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_update.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "4.2 - update-lgsm" +echo -e "=================================" +echo -e "Description:" +echo -e "update LinuxGSM." +echo -e "" +echo -e "Command: ./jc2server update-lgam" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_update_linuxgsm.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "Inserting IP address" +echo -e "=================================" +echo -e "Description:" +echo -e "Inserting Travis IP in to config." +echo -e "Allows monitor to work" +if [ "$(ip -o -4 addr|grep eth0)" ]; then + travisip=$(ip -o -4 addr | grep eth0 | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | grep -v 127.0.0) +else + travisip=$(ip -o -4 addr | grep ens | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -v 127.0.0) +fi +sed -i "/server-ip=/c\server-ip=${travisip}" "${serverfiles}/server.properties" +echo -e "IP: ${travisip}" + +echo -e "" +echo -e "5.0 - Monitor Tests" +echo -e "==================================================================" +echo -e "" +info_config.sh +echo -e "Server IP - Port: ${ip}:${port}" +echo -e "Server IP - Query Port: ${ip}:${queryport}" + +echo -e "" +echo -e "30s Pause" +echo -e "=================================" +echo -e "Description:" +echo -e "give time for server to fully start." +echo -e "Command: sleep 30" +requiredstatus="ONLINE" +fn_setstatus +sleep 30 + +echo -e "" +echo -e "5.1 - monitor - online" +echo -e "=================================" +echo -e "Description:" +echo -e "run monitor server while already running." +echo -e "Command: ./${gameservername} monitor" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_monitor.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "5.2 - monitor - offline - with lockfile" +echo -e "=================================" +echo -e "Description:" +echo -e "run monitor while server is offline with lockfile." +echo -e "Command: ./${gameservername} monitor" +requiredstatus="OFFLINE" +fn_setstatus +fn_print_info_nl "creating lockfile." +date '+%s' > "${lockdir}/${selfname}.lock" +echo "${version}" >> "${lockdir}/${selfname}.lock" +echo "${port}" >> "${lockdir}/${selfname}.lock" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_monitor.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "5.3 - monitor - offline - no lockfile" +echo -e "=================================" +echo -e "Description:" +echo -e "run monitor while server is offline with no lockfile." +echo -e "Command: ./${gameservername} monitor" +requiredstatus="OFFLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_monitor.sh +) +fn_test_result_fail +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "5.4 - test-alert" +echo -e "=================================" +echo -e "Description:" +echo -e "run monitor while server is offline with no lockfile." +echo -e "Command: ./${gameservername} test-alert" +requiredstatus="OFFLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_test_alert.sh +) +fn_test_result_fail +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "6.0 - Details Tests" +echo -e "==================================================================" + +echo -e "" +echo -e "6.1 - details" +echo -e "=================================" +echo -e "Description:" +echo -e "display details." +echo -e "Command: ./${gameservername} details" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_details.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "6.2 - postdetails" +echo -e "=================================" +echo -e "Description:" +echo -e "post details." +echo -e "Command: ./${gameservername} postdetails" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_postdetails.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "7.0 - Backup Tests" +echo -e "==================================================================" + +echo -e "" +echo -e "7.1 - backup" +echo -e "=================================" +echo -e "Description:" +echo -e "run a backup." +echo -e "Command: ./${gameservername} backup" +requiredstatus="ONLINE" +fn_setstatus +echo -e "test de-activated until issue #1839 fixed" +#(command_backup.sh) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "8.0 - Development Tools Tests" +echo -e "==================================================================" + +echo -e "" +echo -e "8.1 - dev - detect glibc" +echo -e "=================================" +echo -e "Description:" +echo -e "detect glibc." +echo -e "Command: ./${gameservername} detect-glibc" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_detect_glibc.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "8.2 - dev - detect ldd" +echo -e "=================================" +echo -e "Description:" +echo -e "detect ldd." +echo -e "Command: ./${gameservername} detect-ldd" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_detect_ldd.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "8.3 - dev - detect deps" +echo -e "=================================" +echo -e "Description:" +echo -e "detect dependencies." +echo -e "Command: ./${gameservername} detect-deps" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_detect_deps.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "Inserting IP address" +echo -e "=================================" +echo -e "Description:" +echo -e "Inserting Travis IP in to config." +echo -e "Allows monitor to work" +if [ "$(ip -o -4 addr|grep eth0)" ]; then + travisip=$(ip -o -4 addr | grep eth0 | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | grep -v 127.0.0) +else + travisip=$(ip -o -4 addr | grep ens | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -v 127.0.0) +fi +sed -i "/server-ip=/c\server-ip=${travisip}" "${serverfiles}/server.properties" +echo -e "IP: ${travisip}" + +echo -e "" +echo -e "8.4 - dev - query-raw" +echo -e "=================================" +echo -e "Description:" +echo -e "raw query output." +echo -e "Command: ./${gameservername} query-raw" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_query_raw.sh +) +fn_test_result_na +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "9.0 - Donate" +echo -e "==================================================================" + +echo -e "" +echo -e "9.1 - donate" +echo -e "=================================" +echo -e "Description:" +echo -e "donate." +echo -e "Command: ./${gameservername} donate" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_donate.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "=================================" +echo -e "Server Tests - Complete!" +echo -e "Using: ${gamename}" +echo -e "=================================" +requiredstatus="OFFLINE" +fn_setstatus + +core_exit.sh diff --git a/tests/tests_shellcheck.sh b/tests/tests_shellcheck.sh new file mode 100644 index 000000000..f4bbf4868 --- /dev/null +++ b/tests/tests_shellcheck.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Project: Game Server Managers - LinuxGSM +# Author: Daniel Gibbs +# License: MIT License, Copyright (c) 2020 Daniel Gibbs +# Purpose: Travis CI Tests: Shellcheck | Linux Game Server Management Script +# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors +# Documentation: https://docs.linuxgsm.com/ +# Website: https://linuxgsm.com + +echo -e "=================================" +echo -e "Travis CI Tests" +echo -e "Linux Game Server Manager" +echo -e "by Daniel Gibbs" +echo -e "Contributors: http://goo.gl/qLmitD" +echo -e "https://linuxgsm.com" +echo -e "=================================" +echo -e "" +echo -e "=================================" +echo -e "Bash Analysis Tests" +echo -e "Using: Shellcheck" +echo -e "Testing Branch: $TRAVIS_BRANCH" +echo -e "=================================" +echo -e "" +scissues=$(find . -type f \( -name "*.sh" -o -name "*.cfg" \) -not -path "./shunit2-2.1.6/*" -exec shellcheck --shell=bash --exclude=SC2154,SC2034 {} \; | grep -F "^--" | wc -l) +echo -e "Found issues: ${scissues}" +echo -e "=================================" +find . -type f \( -name "*.sh" -o -name "*.cfg" \) -not -path "./shunit2-2.1.6/*" -exec shellcheck --shell=bash --exclude=SC2154,SC2034 {} \; +echo -e "" +echo -e "=================================" +echo -e "Bash Analysis Tests - Complete!" +echo -e "Using: Shellcheck" +echo -e "=================================" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 783f544bb..3883d8dc2 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -1,358 +1,1181 @@ #!/bin/bash -# TravisCI Tests -# Server Management Script +# Project: Game Server Managers - LinuxGSM # Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="071115" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="on" -email="me@danielgibbs.co.uk" - -# Start Variables -updateonstart="off" - -# Server Details -gamename="Teamspeak 3" -servername="Teamspeak 3 Server" -servicename="ts3-server" - -# Directories -rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" -selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./ts3server_startscript.sh" -servercfg="${servicename}.ini" -servercfgdir="${filesdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${filesdir}/logs" -scriptlogdir="${rootdir}/log/script" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" - -##### Script ##### -# Do not edit - -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions - fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" +# License: MIT License, Copyright (c) 2020 Daniel Gibbs +# Purpose: Travis CI Tests: Teamspeak 3 | Linux Game Server Management Script +# Contributors: https://linuxgsm.com/contrib +# Documentation: https://docs.linuxgsm.com +# Website: https://linuxgsm.com + +# DO NOT EDIT THIS FILE +# LinuxGSM configuration is no longer edited here +# To update your LinuxGSM config go to: +# lgsm/config-lgsm +# https://docs.linuxgsm.com/configuration/linuxgsm-config + +# Debugging +if [ -f ".dev-debug" ]; then + exec 5>dev-debug.log + BASH_XTRACEFD="5" + set -x fi -source "${rootdir}/functions/${functionfile}" + +version="v20.6.2" +shortname="ts3" +gameservername="ts3server" +commandname="CORE" +rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") +selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +sessionname=$(echo "${selfname}" | cut -f1 -d".") +lgsmdir="${rootdir}/lgsm" +logdir="${rootdir}/log" +lgsmlogdir="${logdir}/lgsm" +steamcmddir="${HOME}/.steam/steamcmd" +serverfiles="${rootdir}/serverfiles" +functionsdir="${lgsmdir}/functions" +tmpdir="${lgsmdir}/tmp" +datadir="${lgsmdir}/data" +lockdir="${lgsmdir}/lock" +serverlist="${datadir}/serverlist.csv" +serverlistmenu="${datadir}/serverlistmenu.csv" +configdir="${lgsmdir}/config-lgsm" +configdirserver="${configdir}/${gameservername}" +configdirdefault="${lgsmdir}/config-default" +userinput="${1}" + +# Allows for testing not on Travis CI. +# if using travis for tests +if [ -z "${TRAVIS}" ]; then + TRAVIS_BRANCH="develop" + TRAVIS_BUILD_DIR="${rootdir}" +fi +travistest="1" + +## GitHub Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="GameServerManagers" +githubrepo="LinuxGSM" +githubbranch="${TRAVIS_BRANCH}" + +# Core function that is required first. +core_functions.sh(){ + functionfile="${FUNCNAME[0]}" + fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" } -fn_functions(){ -# Functions are defined in fn_functions. -functionfile="${FUNCNAME}" -fn_runfunction +# Bootstrap +# Fetches the core functions required before passed off to core_dl.sh. +fn_bootstrap_fetch_file(){ + remote_fileurl="${1}" + remote_fileurl_backup="${2}" + remote_fileurl_name="${3}" + remote_fileurl_backup_name="${4}" + local_filedir="${5}" + local_filename="${6}" + chmodx="${7:-0}" + run="${8:-0}" + forcedl="${9:-0}" + md5="${10:-0}" + # Download file if missing or download forced. + if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then + # If backup fileurl exists include it. + if [ -n "${remote_fileurl_backup}" ]; then + # counter set to 0 to allow second try + counter=0 + remote_fileurls_array=( remote_fileurl remote_fileurl_backup ) + else + # counter set to 1 to not allow second try + counter=1 + remote_fileurls_array=( remote_fileurl ) + fi + + for remote_fileurl_array in "${remote_fileurls_array[@]}"; do + if [ "${remote_fileurl_array}" == "remote_fileurl" ]; then + fileurl="${remote_fileurl}" + fileurl_name="${remote_fileurl_name}" + elif [ "${remote_fileurl_array}" == "remote_fileurl_backup" ]; then + fileurl="${remote_fileurl_backup}" + fileurl_name="${remote_fileurl_backup_name}" + fi + counter=$((counter+1)) + if [ ! -d "${local_filedir}" ]; then + mkdir -p "${local_filedir}" + fi + # Trap will remove part downloaded files if canceled. + trap fn_fetch_trap INT + # Larger files show a progress bar. + + echo -en "fetching ${fileurl_name} ${local_filename}...\c" + curlcmd=$(curl -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) + + local exitcode=$? + # Download will fail if downloads a html file. + if [ -f "${local_filedir}/${local_filename}" ]; then + if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE" )" ]; then + rm "${local_filedir:?}/${local_filename:?}" + local exitcode=2 + fi + fi + + # On first try will error. On second try will fail. + if [ "${exitcode}" != 0 ]; then + if [ ${counter} -ge 2 ]; then + echo -e "FAIL" + if [ -f "${lgsmlog}" ]; then + fn_script_log_fatal "Downloading ${local_filename}" + fn_script_log_fatal "${fileurl}" + fi + core_exit.sh + else + echo -e "ERROR" + if [ -f "${lgsmlog}" ]; then + fn_script_log_error "Downloading ${local_filename}" + fn_script_log_error "${fileurl}" + fi + fi + + else + echo -en "OK" + sleep 0.3 + echo -en "\033[2K\\r" + if [ -f "${lgsmlog}" ]; then + fn_script_log_pass "Downloading ${local_filename}" + fi + + # Make file executable if chmodx is set. + if [ "${chmodx}" == "chmodx" ]; then + chmod +x "${local_filedir}/${local_filename}" + fi + + # Remove trap. + trap - INT + + break + fi + done + fi + + if [ -f "${local_filedir}/${local_filename}" ]; then + # Execute file if run is set. + if [ "${run}" == "run" ]; then + # shellcheck source=/dev/null + source "${local_filedir}/${local_filename}" + fi + fi } -fn_functions +fn_bootstrap_fetch_file_github(){ + github_file_url_dir="${1}" + github_file_url_name="${2}" + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" + else + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + fi + remote_fileurl_name="GitHub" + remote_fileurl_backup_name="Bitbucket" + local_filedir="${3}" + local_filename="${github_file_url_name}" + chmodx="${4:-0}" + run="${5:-0}" + forcedl="${6:-0}" + md5="${7:-0}" + # Passes vars to the file download function. + fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" +} -fn_currentstatus_tmux(){ -pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:") -if [ "${pid}" != "0" ]; then - currentstatus="ONLINE" -else - currentstatus="OFFLINE" -fi +# Installer menu. + +fn_print_center() { + columns=$(tput cols) + line="$*" + printf "%*s\n" $(( (${#line} + columns) / 2)) "${line}" +} + +fn_print_horizontal(){ + printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "=" +} + +# Bash menu. +fn_install_menu_bash() { + local resultvar=$1 + title=$2 + caption=$3 + options=$4 + fn_print_horizontal + fn_print_center "${title}" + fn_print_center "${caption}" + fn_print_horizontal + menu_options=() + while read -r line || [[ -n "${line}" ]]; do + var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') + menu_options+=( "${var}" ) + done < "${options}" + menu_options+=( "Cancel" ) + select option in "${menu_options[@]}"; do + if [ "${option}" ]&&[ "${option}" != "Cancel" ]; then + eval "$resultvar=\"${option/%\ */}\"" + fi + break + done +} + +# Whiptail/Dialog menu. +fn_install_menu_whiptail() { + local menucmd=$1 + local resultvar=$2 + title=$3 + caption=$4 + options=$5 + height=${6:-40} + width=${7:-80} + menuheight=${8:-30} + IFS="," + menu_options=() + while read -r line; do + key=$(echo -e "${line}" | awk -F "," '{print $3}') + val=$(echo -e "${line}" | awk -F "," '{print $2}') + menu_options+=( "${val//\"}" "${key//\"}" ) + done < "${options}" + OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3) + if [ $? == 0 ]; then + eval "$resultvar=\"${OPTION}\"" + else + eval "$resultvar=" + fi +} + +# Menu selector. +fn_install_menu() { + local resultvar=$1 + local selection="" + title=$2 + caption=$3 + options=$4 + # Get menu command. + for menucmd in whiptail dialog bash; do + if [ "$(command -v "${menucmd}")" ]; then + menucmd=$(command -v "${menucmd}") + break + fi + done + case "$(basename "${menucmd}")" in + whiptail|dialog) + fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; + *) + fn_install_menu_bash selection "${title}" "${caption}" "${options}";; + esac + eval "$resultvar=\"${selection}\"" +} + +# Gets server info from serverlist.csv and puts in to array. +fn_server_info(){ + IFS="," + server_info_array=($(grep -aw "${userinput}" "${serverlist}")) + shortname="${server_info_array[0]}" # csgo + gameservername="${server_info_array[1]}" # csgoserver + gamename="${server_info_array[2]}" # Counter Strike: Global Offensive +} + +fn_install_getopt(){ + userinput="empty" + echo -e "Usage: $0 [option]" + echo -e "" + echo -e "Installer - Linux Game Server Managers - Version ${version}" + echo -e "https://linuxgsm.com" + echo -e "" + echo -e "Commands" + echo -e "install\t\t| Select server to install." + echo -e "servername\t| Enter name of game server to install. e.g $0 csgoserver." + echo -e "list\t\t| List all servers available for install." + exit } -fn_currentstatus_ts3(){ -ts3status=$(${executable} status servercfgfullpathfile=${servercfgfullpath}) +fn_install_file(){ + local_filename="${gameservername}" + if [ -e "${local_filename}" ]; then + i=2 + while [ -e "${local_filename}-${i}" ] ; do + (( i++ )) + done + local_filename="${local_filename}-${i}" + fi + cp -R "${selfname}" "${local_filename}" + sed -i -e "s/shortname=\"core\"/shortname=\"${shortname}\"/g" "${local_filename}" + sed -i -e "s/gameservername=\"core\"/gameservername=\"${gameservername}\"/g" "${local_filename}" + echo -e "Installed ${gamename} server as ${local_filename}" + echo -e "" + if [ ! -d "${serverfiles}" ]; then + echo -e "./${local_filename} install" + else + echo -e "Remember to check server ports" + echo -e "./${local_filename} details" + fi + echo -e "" + exit +} + +# Prevent LinuxGSM from running as root. Except if doing a dependency install. +if [ "$(whoami)" == "root" ]; then + if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then + if [ "${shortname}" == "core" ]; then + echo -e "[ FAIL ] Do NOT run this script as root!" + exit 1 + fi + elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then + echo -e "[ FAIL ] Do NOT run this script as root!" + exit 1 + else + core_functions.sh + check_root.sh + fi +fi + +# LinuxGSM installer mode. +if [ "${shortname}" == "core" ]; then + # Download the latest serverlist. This is the complete list of all supported servers. + fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5" + if [ ! -f "${serverlist}" ]; then + echo -e "[ FAIL ] serverlist.csv could not be loaded." + exit 1 + fi -if [ "${ts3status}" == "Server is running" ]; then - currentstatus="ONLINE" + if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then + { + tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' + } | column -s $'\t' -t | more + exit + elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then + tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" + fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" + userinput="${result}" + fn_server_info + if [ "${result}" == "${gameservername}" ]; then + fn_install_file + elif [ "${result}" == "" ]; then + echo -e "Install canceled" + else + echo -e "[ FAIL ] menu result does not match gameservername" + echo -e "result: ${result}" + echo -e "gameservername: ${gameservername}" + fi + elif [ "${userinput}" ]; then + fn_server_info + if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then + fn_install_file + else + echo -e "[ FAIL ] unknown game server" + fi + else + fn_install_getopt + fi + +# LinuxGSM server mode. else - currentstatus="OFFLINE" + core_functions.sh + if [ "${shortname}" != "core-dep" ]; then + # Load LinuxGSM configs. + # These are required to get all the default variables for the specific server. + # Load the default config. If missing download it. If changed reload it. + if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then + mkdir -p "${configdirdefault}/config-lgsm/${gameservername}" + fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + fi + if [ ! -f "${configdirserver}/_default.cfg" ]; then + mkdir -p "${configdirserver}" + echo -en "copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + else + function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${function_file_diff}" != "" ]; then + fn_print_warn_nl "_default.cfg has been altered. reloading config." + echo -en "copying _default.cfg...\c" + cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + echo -e "FAIL" + exit 1 + else + echo -e "OK" + fi + fi + fi + # shellcheck source=/dev/null + source "${configdirserver}/_default.cfg" + # Load the common.cfg config. If missing download it. + if [ ! -f "${configdirserver}/common.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/common.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/common.cfg" + fi + # Load the secrets-common.cfg config. If missing download it. + if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/secrets-common.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/secrets-common.cfg" + fi + # Load the instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/${selfname}.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/${selfname}.cfg" + fi + # Load the secrets-instance.cfg config. If missing download it. + if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then + fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null + source "${configdirserver}/secrets-${selfname}.cfg" + else + # shellcheck source=/dev/null + source "${configdirserver}/secrets-${selfname}.cfg" + fi + + # Load the linuxgsm.sh in to tmpdir. If missing download it. + if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then + fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5" + fi + fi + # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. + fn_ansi_loader + # Prevents running of core_exit.sh for Travis-CI. + if [ "${travistest}" != "1" ]; then + getopt=$1 + core_getopt.sh + fi fi + +fn_currentstatus_tmux(){ + check_status.sh + if [ "${status}" != "0" ]; then + currentstatus="ONLINE" + else + currentstatus="OFFLINE" + fi } - + fn_setstatus(){ - fn_currentstatus_ts3 + fn_currentstatus_tmux echo"" - echo "Required status: ${requiredstatus}" + echo -e "Required status: ${requiredstatus}" counter=0 - echo "Current status: ${currentstatus}" - while [ "${requiredstatus}" != "${currentstatus}" ]; do - counter=$((counter+1)) - fn_currentstatus_ts3 - echo -ne "New status: ${currentstatus}\\r" - + echo -e "Current status: ${currentstatus}" + while [ "${requiredstatus}" != "${currentstatus}" ]; do + counter=$((counter+1)) + fn_currentstatus_tmux + echo -en "New status: ${currentstatus}\\r" + if [ "${requiredstatus}" == "ONLINE" ]; then - (fn_start) + (command_start.sh > /dev/null 2>&1) else - (fn_stop) + (command_stop.sh > /dev/null 2>&1) + fi + if [ "${counter}" -gt "5" ]; then + currentstatus="FAIL" + echo -e "Current status: ${currentstatus}" + echo -e "" + echo -e "Unable to start or stop server." + exit 1 fi - if [ "${counter}" -gt "5" ]; then - currentstatus="FAIL" - echo "Current status: ${currentstatus}" - echo "" - echo "Unable to start or stop server." - exit 1 - fi - done - echo -ne "New status: ${currentstatus}\\r" - echo -e "\n" - echo "Test starting:" - echo "" - sleep 0.5 + done + echo -en "New status: ${currentstatus}\\r" + echo -e "\n" + echo -e "Test starting:" + echo -e "" +} + +# End of every test will expect the result to either pass or fail +# If the script does not do as intended the whole test will fail +# if expecting a pass +fn_test_result_pass(){ + if [ $? != 0 ]; then + echo -e "=================================" + echo -e "Expected result: PASS" + echo -e "Actual result: FAIL" + fn_print_fail_nl "TEST FAILED" + exitcode=1 + core_exit.sh + else + echo -e "=================================" + echo -e "Expected result: PASS" + echo -e "Actual result: PASS" + fn_print_ok_nl "TEST PASSED" + echo -e "" + fi +} + +# if expecting a fail +fn_test_result_fail(){ + if [ $? == 0 ]; then + echo -e "=================================" + echo -e "Expected result: FAIL" + echo -e "Actual result: PASS" + fn_print_fail_nl "TEST FAILED" + exitcode=1 + core_exit.sh + else + echo -e "=================================" + echo -e "Expected result: FAIL" + echo -e "Actual result: FAIL" + fn_print_ok_nl "TEST PASSED" + echo -e "" + fi +} + +# test result n/a +fn_test_result_na(){ + echo -e "=================================" + echo -e "Expected result: N/A" + echo -e "Actual result: N/A" + fn_print_fail_nl "TEST N/A" } -echo "=================================" -echo "TravisCI Tests" -echo "Linux Game Server Manager" -echo "by Daniel Gibbs" -echo "http://gameservermanagers.com" -echo "=================================" -echo "" -sleep 1 -echo "=================================" -echo "Server Tests" -echo "Using: ${gamename}" -echo "=================================" -echo "" -sleep 1 - - - -echo "1.0 - start - no files" -echo "=================================" -echo "Description:" -echo "test script reaction to missing server files." -echo "" -(fn_start) -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "1.1 - getopt" -echo "=================================" -echo "Description:" -echo "displaying options messages." -echo "" -(fn_getopt) -echo "" -echo "Test complete!" -sleep 1 -echo "" - - - -echo "2.0 - install" -echo "=================================" -echo "Description:" -echo "install ${gamename} server." -fn_autoinstall -echo "" -echo "Test complete!" -sleep 1 -echo "" - - - -echo "3.1 - start" -echo "=================================" -echo "Description:" -echo "start ${gamename} server." +sleeptime="0" + +echo -e "=================================" +echo -e "Travis CI Tests" +echo -e "Linux Game Server Manager" +echo -e "by Daniel Gibbs" +echo -e "Contributors: http://goo.gl/qLmitD" +echo -e "https://linuxgsm.com" +echo -e "=================================" +echo -e "" +echo -e "=================================" +echo -e "Server Tests" +echo -e "Using: ${gamename}" +echo -e "Testing Branch: ${TRAVIS_BRANCH}" +echo -e "=================================" + +echo -e "" +echo -e "Tests Summary" +echo -e "=================================" +echo -e "0.0 - Pre-test Tasks" +echo -e "0.1 - Create log dir's" +echo -e "0.2 - Enable dev-debug" +echo -e "" +echo -e "1.0 - Pre-install tests" +echo -e "1.1 - start - no files" +echo -e "1.2 - getopt" +echo -e "1.3 - getopt with incorrect args" +echo -e "" +echo -e "2.0 - Installation" +echo -e "2.1 - install" +echo -e "" +echo -e "3.0 - Start/Stop/Restart Tests" +echo -e "3.1 - start" +echo -e "3.2 - start - online" +echo -e "3.3 - start - updateonstart" +echo -e "3.4 - stop" +echo -e "3.5 - stop - offline" +echo -e "3.6 - restart" +echo -e "3.7 - restart - offline" +echo -e "" +echo -e "4.0 - Update Tests" +echo -e "4.1 - update" +echo -e "4.2 - update-lgsm" +echo -e "" +echo -e "5.0 - Monitor Tests" +echo -e "5.1 - monitor - online" +echo -e "5.2 - monitor - offline - with lockfile" +echo -e "5.3 - monitor - offline - no lockfile" +echo -e "5.4 - test-alert" +echo -e "" +echo -e "6.0 - Details Tests" +echo -e "6.1 - details" +echo -e "6.2 - postdetails" +echo -e "" +echo -e "7.0 - Backup Tests" +echo -e "7.1 - backup" +echo -e "" +echo -e "8.0 - Development Tools Tests" +echo -e "8.1 - dev - detect glibc" +echo -e "8.2 - dev - detect ldd" +echo -e "8.3 - dev - detect deps" +echo -e "8.4 - dev - query-raw" +echo -e "" +echo -e "9.0 - Donate" +echo -e "9.1 - donate" +echo -e "" +echo -e "0.0 - Pre-test Tasks" +echo -e "==================================================================" +echo -e "Description:" +echo -e "Create log dir's" +echo -e "" + +echo -e "" +echo -e "0.1 - Create log dir's" +echo -e "=================================" +echo -e "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + install_logs.sh +) +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "0.2 - Enable dev-debug" +echo -e "=================================" +echo -e "Description:" +echo -e "Enable dev-debug" +echo -e "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_debug.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "1.0 - Pre-install tests" +echo -e "==================================================================" +echo -e "" + +echo -e "1.1 - start - no files" +echo -e "=================================" +echo -e "Description:" +echo -e "test script reaction to missing server files." +echo -e "Command: ./${gameservername} start" +echo -e "" +# Allows for testing not on Travis CI +if [ -z "${TRAVIS}" ]; then +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) +fn_test_result_fail +else + echo -e "Test bypassed" +fi + +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "1.2 - getopt" +echo -e "=================================" +echo -e "Description:" +echo -e "displaying options messages." +echo -e "Command: ./${gameservername}" +echo -e "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + core_getopt.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "1.3 - getopt with incorrect args" +echo -e "=================================" +echo -e "Description:" +echo -e "displaying options messages." +echo -e "Command: ./${gameservername} abc123" +echo -e "" +getopt="abc123" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + core_getopt.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "2.0 - Installation" +echo -e "==================================================================" + +echo -e "" +echo -e "2.1 - install" +echo -e "=================================" +echo -e "Description:" +echo -e "install ${gamename} server." +echo -e "Command: ./${gameservername} auto-install" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + fn_autoinstall +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.0 - Start/Stop/Restart Tests" +echo -e "==================================================================" + +echo -e "" +echo -e "3.1 - start" +echo -e "=================================" +echo -e "Description:" +echo -e "start ${gamename} server." +echo -e "Command: ./${gameservername} start" requiredstatus="OFFLINE" fn_setstatus -fn_start -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "3.2 - start - online" -echo "=================================" -echo "Description:" -echo "start ${gamename} server while already running." +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.2 - start - online" +echo -e "=================================" +echo -e "Description:" +echo -e "start ${gamename} server while already running." +echo -e "Command: ./${gameservername} start" requiredstatus="ONLINE" fn_setstatus -(fn_start) -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "3.3 - start - updateonstart" -echo "=================================" -echo "Description:" -echo "will update server on start." +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh +) +fn_test_result_fail +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.3 - start - updateonstart" +echo -e "=================================" +echo -e "Description:" +echo -e "will update server on start." +echo -e "Command: ./${gameservername} start" requiredstatus="OFFLINE" fn_setstatus ( - updateonstart="on" - fn_start + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + updateonstart="on";command_start.sh ) -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "3.4 - stop" -echo "=================================" -echo "Description:" -echo "stop ${gamename} server." +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.4 - stop" +echo -e "=================================" +echo -e "Description:" +echo -e "stop ${gamename} server." +echo -e "Command: ./${gameservername} stop" requiredstatus="ONLINE" fn_setstatus -fn_stop -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "3.5 - stop - offline" -echo "=================================" -echo "Description:" -echo "stop ${gamename} server while already stopped." +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_stop.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.5 - stop - offline" +echo -e "=================================" +echo -e "Description:" +echo -e "stop ${gamename} server while already stopped." +echo -e "Command: ./${gameservername} stop" requiredstatus="OFFLINE" fn_setstatus -(fn_stop) -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "3.6 - restart" -echo "=================================" -echo "Description:" -echo "restart ${gamename}." +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_stop.sh +) +fn_test_result_fail +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.6 - restart" +echo -e "=================================" +echo -e "Description:" +echo -e "restart ${gamename}." +echo -e "Command: ./${gameservername} restart" requiredstatus="ONLINE" fn_setstatus -fn_restart -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "3.7 - restart - offline" -echo "=================================" -echo "Description:" -echo "restart ${gamename} while already stopped." +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_restart.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "3.7 - restart - offline" +echo -e "=================================" +echo -e "Description:" +echo -e "restart ${gamename} while already stopped." +echo -e "Command: ./${gameservername} restart" requiredstatus="OFFLINE" fn_setstatus -fn_restart -echo "" -echo "Test complete!" -sleep 1 -echo "" - +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_restart.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +echo -e "" +echo -e "4.0 - Update Tests" +echo -e "==================================================================" -echo "4.1 - update" -echo "=================================" -echo "Description:" -echo "check for updates." +echo -e "" +echo -e "4.1 - update" +echo -e "=================================" +echo -e "Description:" +echo -e "check for updates." +echo -e "Command: ./${gameservername} update" requiredstatus="OFFLINE" fn_setstatus -fn_update_check -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "4.1 - update - old version" -echo "=================================" -echo "Description:" -echo "change the version number tricking LGSM to update." -requiredstatus="OFFLINE" -sed -i 's/[0-9]\+/0/g' ${gamelogdir}/ts3server*_0.log +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_update.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "4.2 - update-lgsm" +echo -e "=================================" +echo -e "Description:" +echo -e "update LinuxGSM." +echo -e "" +echo -e "Command: ./jc2server update-lgam" +requiredstatus="ONLINE" fn_setstatus -fn_update_check -echo "" -echo "Test complete!" -sleep 1 -echo "" - -echo "5.1 - monitor - online" -echo "=================================" -echo "Description:" -echo "run monitor server while already running." +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_update_linuxgsm.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "5.0 - Monitor Tests" +echo -e "==================================================================" +echo -e "" +info_config.sh +echo -e "Server IP - Port: ${ip}:${port}" +echo -e "Server IP - Query Port: ${ip}:${queryport}" + +echo -e "" +echo -e "5.1 - monitor - online" +echo -e "=================================" +echo -e "Description:" +echo -e "run monitor server while already running." +echo -e "Command: ./${gameservername} monitor" requiredstatus="ONLINE" fn_setstatus -(fn_monitor) -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "5.2 - monitor - offline - no lockfile" -echo "=================================" -echo "Description:" -echo "run monitor while server is offline with no lockfile." +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_monitor.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "5.2 - monitor - offline - with lockfile" +echo -e "=================================" +echo -e "Description:" +echo -e "run monitor while server is offline with lockfile." +echo -e "Command: ./${gameservername} monitor" requiredstatus="OFFLINE" fn_setstatus -(fn_monitor) -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "5.3 - monitor - offline - with lockfile" -echo "=================================" -echo "Description:" -echo "run monitor while server is offline with no lockfile." +fn_print_info_nl "creating lockfile." +date '+%s' > "${lockdir}/${selfname}.lock" +echo "${version}" >> "${lockdir}/${selfname}.lock" +echo "${port}" >> "${lockdir}/${selfname}.lock" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_monitor.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "5.3 - monitor - offline - no lockfile" +echo -e "=================================" +echo -e "Description:" +echo -e "run monitor while server is offline with no lockfile." +echo -e "Command: ./${gameservername} monitor" +requiredstatus="OFFLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_monitor.sh +) +fn_test_result_fail +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "5.4 - test-alert" +echo -e "=================================" +echo -e "Description:" +echo -e "run monitor while server is offline with no lockfile." +echo -e "Command: ./${gameservername} test-alert" requiredstatus="OFFLINE" fn_setstatus -fn_printinfonl "creating lockfile." -date > "${rootdir}/${lockselfname}" -(fn_monitor) -echo "" -echo "Test complete!" -sleep 1 -echo "" -echo "5.4 - monitor - gsquery.py failure" -echo "=================================" -echo "Description:" -echo "gsquery.py will fail to query port." +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_test_alert.sh +) +fn_test_result_fail +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "6.0 - Details Tests" +echo -e "==================================================================" + +echo -e "" +echo -e "6.1 - details" +echo -e "=================================" +echo -e "Description:" +echo -e "display details." +echo -e "Command: ./${gameservername} details" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_details.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "6.2 - postdetails" +echo -e "=================================" +echo -e "Description:" +echo -e "post details." +echo -e "Command: ./${gameservername} postdetails" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_postdetails.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "7.0 - Backup Tests" +echo -e "==================================================================" + +echo -e "" +echo -e "7.1 - backup" +echo -e "=================================" +echo -e "Description:" +echo -e "run a backup." +echo -e "Command: ./${gameservername} backup" +requiredstatus="ONLINE" +fn_setstatus +echo -e "test de-activated until issue #1839 fixed" +#(command_backup.sh) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "8.0 - Development Tools Tests" +echo -e "==================================================================" + +echo -e "" +echo -e "8.1 - dev - detect glibc" +echo -e "=================================" +echo -e "Description:" +echo -e "detect glibc." +echo -e "Command: ./${gameservername} detect-glibc" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_detect_glibc.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "8.2 - dev - detect ldd" +echo -e "=================================" +echo -e "Description:" +echo -e "detect ldd." +echo -e "Command: ./${gameservername} detect-ldd" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_detect_ldd.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "8.3 - dev - detect deps" +echo -e "=================================" +echo -e "Description:" +echo -e "detect dependencies." +echo -e "Command: ./${gameservername} detect-deps" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_detect_deps.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "8.4 - dev - query-raw" +echo -e "=================================" +echo -e "Description:" +echo -e "raw query output." +echo -e "Command: ./${gameservername} query-raw" requiredstatus="ONLINE" fn_setstatus -sed -i 's/[0-9]\+/0/' "${servercfgfullpath}" -(fn_monitor) -echo "" -fn_printinfonl "Reseting ${servercfg}." -fn_install_config -echo "" -echo "Test complete!" -sleep 1 -echo "" - - - -echo "6.0 - details" -echo "=================================" -echo "Description:" -echo "display details." +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_dev_query_raw.sh +) +fn_test_result_na +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "9.0 - Donate" +echo -e "==================================================================" + +echo -e "" +echo -e "9.1 - donate" +echo -e "=================================" +echo -e "Description:" +echo -e "donate." +echo -e "Command: ./${gameservername} donate" requiredstatus="ONLINE" fn_setstatus -fn_details -echo "" -echo "Test complete!" -sleep 1 -echo "" - -echo "=================================" -echo "Server Tests - Complete!" -echo "Using: ${gamename}" -echo "=================================" -echo "" +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_donate.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + +echo -e "" +echo -e "=================================" +echo -e "Server Tests - Complete!" +echo -e "Using: ${gamename}" +echo -e "=================================" requiredstatus="OFFLINE" fn_setstatus -sleep 1 -fn_printinfo "Tidying up directories." -sleep 1 -rm -rfv ${serverfiles} -echo "END" \ No newline at end of file + +core_exit.sh